linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] input: touchscreen: ar1021_i2c: add support for AR1020
@ 2017-04-11 10:27 Martin Kepplinger
  2017-04-11 10:27 ` [PATCH 2/3] Documentation: devicetree: bindings: add bindings doc for ar1021 driver Martin Kepplinger
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Martin Kepplinger @ 2017-04-11 10:27 UTC (permalink / raw)
  To: dmitry.torokhov, christian.gmeiner
  Cc: linux, linux-input, linux-kernel, devicetree, Martin Kepplinger

ar1021_i2c simply also supports the ar1020 device we use. This is tested.
They also share the same datasheet:

   http://ww1.microchip.com/downloads/en/DeviceDoc/40001393C.pdf

We differentiate not only to make it obvious that we support both devices,
but also to be able to implement the few model specific things in the
future.

Signed-off-by: Martin Kepplinger <martin.kepplinger@ginzinger.com>
---
 drivers/input/touchscreen/Kconfig      |  4 ++--
 drivers/input/touchscreen/ar1021_i2c.c | 13 ++++++++++---
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 33c62e5..535b91a 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -96,8 +96,8 @@ config TOUCHSCREEN_AR1021_I2C
 	tristate "Microchip AR1021 i2c touchscreen"
 	depends on I2C && OF
 	help
-	  Say Y here if you have the Microchip AR1021 touchscreen controller
-	  chip in your system.
+	  Say Y here if you have the Microchip AR1020 or AR1021 touchscreen
+	  controller chip in your system.
 
 	  If unsure, say N.
 
diff --git a/drivers/input/touchscreen/ar1021_i2c.c b/drivers/input/touchscreen/ar1021_i2c.c
index 6562b17..1767257 100644
--- a/drivers/input/touchscreen/ar1021_i2c.c
+++ b/drivers/input/touchscreen/ar1021_i2c.c
@@ -1,5 +1,5 @@
 /*
- * Microchip AR1021 driver for I2C
+ * Microchip AR1020 and AR1021 driver for I2C
  *
  * Author: Christian Gmeiner <christian.gmeiner@gmail.com>
  *
@@ -24,6 +24,11 @@ struct ar1021_i2c {
 	u8 data[AR1021_TOCUH_PKG_SIZE];
 };
 
+enum {
+	ar1021,
+	ar1020,
+};
+
 static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id)
 {
 	struct ar1021_i2c *ar1021 = dev_id;
@@ -151,13 +156,15 @@ static int __maybe_unused ar1021_i2c_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(ar1021_i2c_pm, ar1021_i2c_suspend, ar1021_i2c_resume);
 
 static const struct i2c_device_id ar1021_i2c_id[] = {
-	{ "MICROCHIP_AR1021_I2C", 0 },
+	{ "MICROCHIP_AR1021_I2C", ar1021 },
+	{ "MICROCHIP_AR1020_I2C", ar1020 },
 	{ },
 };
 MODULE_DEVICE_TABLE(i2c, ar1021_i2c_id);
 
 static const struct of_device_id ar1021_i2c_of_match[] = {
 	{ .compatible = "microchip,ar1021-i2c", },
+	{ .compatible = "microchip,ar1020-i2c", },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, ar1021_i2c_of_match);
@@ -175,5 +182,5 @@ static struct i2c_driver ar1021_i2c_driver = {
 module_i2c_driver(ar1021_i2c_driver);
 
 MODULE_AUTHOR("Christian Gmeiner <christian.gmeiner@gmail.com>");
-MODULE_DESCRIPTION("Microchip AR1021 I2C Driver");
+MODULE_DESCRIPTION("Microchip AR1020 and AR1021 I2C Driver");
 MODULE_LICENSE("GPL");
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-04-20 17:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-11 10:27 [PATCH 1/3] input: touchscreen: ar1021_i2c: add support for AR1020 Martin Kepplinger
2017-04-11 10:27 ` [PATCH 2/3] Documentation: devicetree: bindings: add bindings doc for ar1021 driver Martin Kepplinger
2017-04-13 20:40   ` Rob Herring
2017-04-14  6:11     ` [PATCH v2] dt-bindings: input: add bindings document for ar1021_i2c driver Martin Kepplinger
2017-04-20 13:40       ` Rob Herring
2017-04-20 17:42         ` Dmitry Torokhov
2017-04-11 10:27 ` [PATCH 3/3] input: touchscreen: ar1021_i2c: coding style fixes Martin Kepplinger
2017-04-12 15:41   ` Dmitry Torokhov
2017-04-12 15:40 ` [PATCH 1/3] input: touchscreen: ar1021_i2c: add support for AR1020 Dmitry Torokhov
2017-04-13  6:38   ` Martin Kepplinger
2017-04-13 20:35     ` Rob Herring
2017-04-14  6:02       ` [PATCH v2] input: touchscreen: ar1021_i2c: highlight " Martin Kepplinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).