Skip to content

Commit 40949a3

Browse files
dtorij-intel
authored andcommitted
platform/x86: x86-android-tablets: convert HiDeep devices to GPIO references
Now that gpiolib supports software nodes to describe GPIOs, switch the driver away from using GPIO lookup tables for HiDeep touchscreens to using PROPERTY_ENTRY_GPIO() to keep all touchscreen properties together. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Tested-by: Hans de Goede <hansg@kernel.org> Reviewed-by: Hans de Goede <hansg@kernel.org> Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hansg@kernel.org> Link: https://patch.msgid.link/20250920200713.20193-4-hansg@kernel.org Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
1 parent c5f7d46 commit 40949a3

1 file changed

Lines changed: 3 additions & 23 deletions

File tree

  • drivers/platform/x86/x86-android-tablets

drivers/platform/x86/x86-android-tablets/lenovo.c

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ static const struct property_entry lenovo_yb1_x90_hideep_ts_props[] = {
9797
PROPERTY_ENTRY_U32("touchscreen-size-y", 1920),
9898
PROPERTY_ENTRY_U32("touchscreen-max-pressure", 16384),
9999
PROPERTY_ENTRY_BOOL("hideep,force-native-protocol"),
100+
PROPERTY_ENTRY_GPIO("reset-gpios", &cherryview_gpiochip_nodes[0], 7, GPIO_ACTIVE_LOW),
100101
{ }
101102
};
102103

@@ -211,19 +212,6 @@ static const struct x86_gpio_button lenovo_yb1_x90_lid __initconst = {
211212
.pin = 19,
212213
};
213214

214-
static struct gpiod_lookup_table lenovo_yb1_x90_hideep_gpios = {
215-
.dev_id = "i2c-hideep_ts",
216-
.table = {
217-
GPIO_LOOKUP("INT33FF:00", 7, "reset", GPIO_ACTIVE_LOW),
218-
{ }
219-
},
220-
};
221-
222-
static struct gpiod_lookup_table * const lenovo_yb1_x90_gpios[] = {
223-
&lenovo_yb1_x90_hideep_gpios,
224-
NULL
225-
};
226-
227215
static int __init lenovo_yb1_x90_init(struct device *dev)
228216
{
229217
/* Enable the regulators used by the touchscreens */
@@ -252,7 +240,6 @@ const struct x86_dev_info lenovo_yogabook_x90_info __initconst = {
252240
.serdev_count = ARRAY_SIZE(lenovo_yb1_x90_serdevs),
253241
.gpio_button = &lenovo_yb1_x90_lid,
254242
.gpio_button_count = 1,
255-
.gpiod_lookup_tables = lenovo_yb1_x90_gpios,
256243
.gpiochip_type = X86_GPIOCHIP_CHERRYVIEW,
257244
.init = lenovo_yb1_x90_init,
258245
};
@@ -819,6 +806,7 @@ static const struct property_entry lenovo_yt3_hideep_ts_props[] = {
819806
PROPERTY_ENTRY_U32("touchscreen-size-x", 1600),
820807
PROPERTY_ENTRY_U32("touchscreen-size-y", 2560),
821808
PROPERTY_ENTRY_U32("touchscreen-max-pressure", 255),
809+
PROPERTY_ENTRY_GPIO("reset-gpios", &cherryview_gpiochip_nodes[0], 7, GPIO_ACTIVE_LOW),
822810
{ }
823811
};
824812

@@ -1008,14 +996,6 @@ static int __init lenovo_yt3_init(struct device *dev)
1008996
return 0;
1009997
}
1010998

1011-
static struct gpiod_lookup_table lenovo_yt3_hideep_gpios = {
1012-
.dev_id = "i2c-hideep_ts",
1013-
.table = {
1014-
GPIO_LOOKUP("INT33FF:00", 7, "reset", GPIO_ACTIVE_LOW),
1015-
{ }
1016-
},
1017-
};
1018-
1019999
static struct gpiod_lookup_table lenovo_yt3_wm5102_gpios = {
10201000
.dev_id = "spi1.0",
10211001
.table = {
@@ -1028,7 +1008,6 @@ static struct gpiod_lookup_table lenovo_yt3_wm5102_gpios = {
10281008
};
10291009

10301010
static struct gpiod_lookup_table * const lenovo_yt3_gpios[] = {
1031-
&lenovo_yt3_hideep_gpios,
10321011
&lenovo_yt3_wm5102_gpios,
10331012
NULL
10341013
};
@@ -1039,5 +1018,6 @@ const struct x86_dev_info lenovo_yt3_info __initconst = {
10391018
.spi_dev_info = lenovo_yt3_spi_devs,
10401019
.spi_dev_count = ARRAY_SIZE(lenovo_yt3_spi_devs),
10411020
.gpiod_lookup_tables = lenovo_yt3_gpios,
1021+
.gpiochip_type = X86_GPIOCHIP_CHERRYVIEW,
10421022
.init = lenovo_yt3_init,
10431023
};

0 commit comments

Comments
 (0)