Skip to contentSkip to conversation

input: egalax_ts: remove bogus OF dependency

PATCH In review Andy Shevchenko 2 participants 2 messages Apr 25, 2013 – Apr 26, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 input: egalax_ts: remove bogus OF dependency

From: Artem Bityutskiy <[email protected]>

There are platforms using this driver which do not have OF. However, commit ae495e84 ("Input: egalax_ts - get gpio from devicetree") added a Kconfig dependency on OF and broke OF-less setups.

The mentioned commit does actually two things. It makes device tree mandatory which is quite wrong approach, and it appends check for wake up function, which is correct. The wake up function uses dedicated gpio lines to prepare touchscreen device. However this is not the case when touchscreen is connected via USB, there is no gpio lines for that.

This patch allows to use the device in non-DT environment properly.

---
 drivers/input/touchscreen/Kconfig     | 2 +-
 drivers/input/touchscreen/egalax_ts.c | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
drivers/input/touchscreen/Kconfig +1 -1
index f9a5fd8..006111b 100644
@@ -227,7 +227,7 @@ config TOUCHSCREEN_EETI
 
 config TOUCHSCREEN_EGALAX
 	tristate "EETI eGalax multi-touch panel support"
-	depends on I2C && OF
+	depends on I2C
 	help
 	  Say Y here to enable support for I2C connected EETI
 	  eGalax multi-touch panels.
drivers/input/touchscreen/egalax_ts.c +7 -1
index 17c9097..f85c074 100644
@@ -128,7 +128,11 @@ static int egalax_wake_up_device(struct i2c_client *client)
 	int ret;
 
 	if (!np)
-		return -ENODEV;
+		/*
+		 * Do not try to wake up device on non-DT compatible platforms.
+		 * For example this is the case for USB connected touchscreen.
+		 */
+		return 0;
 
 	gpio = of_get_named_gpio(np, "wakeup-gpios", 0);
 	if (!gpio_is_valid(gpio))
@@ -287,10 +291,12 @@ static int egalax_ts_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(egalax_ts_pm_ops, egalax_ts_suspend, egalax_ts_resume);
 
+#ifdef CONFIG_OF
 static struct of_device_id egalax_ts_dt_ids[] = {
 	{ .compatible = "eeti,egalax_ts" },
 	{ /* sentinel */ }
 };
+#endif
 
 static struct i2c_driver egalax_ts_driver = {
 	.driver = {
Signature · 1 line
1.8.2.rc0.22.gb3600c3
#1 lore raw
Quoted 5 lines · Andy Shevchenko

From: Artem Bityutskiy <[email protected]>

There are platforms using this driver which do not have OF. However, commit ae495e84 ("Input: egalax_ts - get gpio from devicetree") added a Kconfig dependency on OF and broke OF-less setups.

Shame on me, I totally messed up with this!
Please, discard this patch.

Signature · 12 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.