Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1621125 > unrolled thread
| Started by | Martin Kepplinger <martin.kepplinger@ginzinger.com> |
|---|---|
| First post | 2017-04-11 12:40 +0200 |
| Last post | 2017-04-14 08:10 +0200 |
| Articles | 12 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH 1/3] input: touchscreen: ar1021_i2c: add support for AR1020 Martin Kepplinger <martin.kepplinger@ginzinger.com> - 2017-04-11 12:40 +0200
[PATCH 2/3] Documentation: devicetree: bindings: add bindings doc for ar1021 driver Martin Kepplinger <martin.kepplinger@ginzinger.com> - 2017-04-11 12:40 +0200
Re: [PATCH 2/3] Documentation: devicetree: bindings: add bindings doc for ar1021 driver Rob Herring <robh@kernel.org> - 2017-04-13 22:50 +0200
[PATCH v2] dt-bindings: input: add bindings document for ar1021_i2c driver Martin Kepplinger <martin.kepplinger@ginzinger.com> - 2017-04-14 08:20 +0200
Re: [PATCH v2] dt-bindings: input: add bindings document for ar1021_i2c driver Rob Herring <robh@kernel.org> - 2017-04-20 15:50 +0200
Re: [PATCH v2] dt-bindings: input: add bindings document for ar1021_i2c driver Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-04-20 19:50 +0200
[PATCH 3/3] input: touchscreen: ar1021_i2c: coding style fixes Martin Kepplinger <martin.kepplinger@ginzinger.com> - 2017-04-11 12:40 +0200
Re: [PATCH 3/3] input: touchscreen: ar1021_i2c: coding style fixes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-04-12 17:50 +0200
Re: [PATCH 1/3] input: touchscreen: ar1021_i2c: add support for AR1020 Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-04-12 17:50 +0200
Re: [PATCH 1/3] input: touchscreen: ar1021_i2c: add support for AR1020 Martin Kepplinger <martin.kepplinger@ginzinger.com> - 2017-04-13 08:40 +0200
Re: [PATCH 1/3] input: touchscreen: ar1021_i2c: add support for AR1020 Rob Herring <robh@kernel.org> - 2017-04-13 22:40 +0200
[PATCH v2] input: touchscreen: ar1021_i2c: highlight support for AR1020 Martin Kepplinger <martin.kepplinger@ginzinger.com> - 2017-04-14 08:10 +0200
| From | Martin Kepplinger <martin.kepplinger@ginzinger.com> |
|---|---|
| Date | 2017-04-11 12:40 +0200 |
| Subject | [PATCH 1/3] input: touchscreen: ar1021_i2c: add support for AR1020 |
| Message-ID | <tv1nj-5Mx-3@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | Martin Kepplinger <martin.kepplinger@ginzinger.com> |
|---|---|
| Date | 2017-04-11 12:40 +0200 |
| Subject | [PATCH 2/3] Documentation: devicetree: bindings: add bindings doc for ar1021 driver |
| Message-ID | <tv1nj-5Mx-1@gated-at.bofh.it> |
| In reply to | #1621125 |
Add a simple binding document highlighting the supported devices and
I2C bus address.
Signed-off-by: Martin Kepplinger <martin.kepplinger@ginzinger.com>
---
.../devicetree/bindings/input/touchscreen/ar1021.txt | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
create mode 100644 Documentation/devicetree/bindings/input/touchscreen/ar1021.txt
diff --git a/Documentation/devicetree/bindings/input/touchscreen/ar1021.txt b/Documentation/devicetree/bindings/input/touchscreen/ar1021.txt
new file mode 100644
index 0000000..87a8c72
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/ar1021.txt
@@ -0,0 +1,16 @@
+* Microchip AR1020 and AR1021 touchscreen interface (I2C)
+
+Required properties:
+- compatible : use "microchip,ar1020-i2c" or "microchip,ar1021-i2c"
+- reg : I2C slave address
+- interrupt-parent : the phandle for the interrupt controller
+- interrupts : touch controller interrupt
+
+Example:
+
+ ar1020: ar1020@4d {
+ compatible = "microchip,ar1020-i2c";
+ reg = <0x4d>;
+ interrupt-parent = <&gpio3>;
+ interrupts = <11 IRQ_TYPE_LEVEL_HIGH>;
+ };
--
2.1.4
[toc] | [prev] | [next] | [standalone]
| From | Rob Herring <robh@kernel.org> |
|---|---|
| Date | 2017-04-13 22:50 +0200 |
| Subject | Re: [PATCH 2/3] Documentation: devicetree: bindings: add bindings doc for ar1021 driver |
| Message-ID | <tvTQK-8fn-15@gated-at.bofh.it> |
| In reply to | #1621126 |
On Tue, Apr 11, 2017 at 12:27:58PM +0200, Martin Kepplinger wrote:
> Add a simple binding document highlighting the supported devices and
> I2C bus address.
"dt-bindings: input: ..." for the subject please.
>
> Signed-off-by: Martin Kepplinger <martin.kepplinger@ginzinger.com>
> ---
> .../devicetree/bindings/input/touchscreen/ar1021.txt | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/input/touchscreen/ar1021.txt
>
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/ar1021.txt b/Documentation/devicetree/bindings/input/touchscreen/ar1021.txt
> new file mode 100644
> index 0000000..87a8c72
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/touchscreen/ar1021.txt
> @@ -0,0 +1,16 @@
> +* Microchip AR1020 and AR1021 touchscreen interface (I2C)
> +
> +Required properties:
> +- compatible : use "microchip,ar1020-i2c" or "microchip,ar1021-i2c"
> +- reg : I2C slave address
> +- interrupt-parent : the phandle for the interrupt controller
> +- interrupts : touch controller interrupt
> +
> +Example:
> +
> + ar1020: ar1020@4d {
touchscreen@4d
> + compatible = "microchip,ar1020-i2c";
> + reg = <0x4d>;
> + interrupt-parent = <&gpio3>;
> + interrupts = <11 IRQ_TYPE_LEVEL_HIGH>;
> + };
> --
> 2.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[toc] | [prev] | [next] | [standalone]
| From | Martin Kepplinger <martin.kepplinger@ginzinger.com> |
|---|---|
| Date | 2017-04-14 08:20 +0200 |
| Subject | [PATCH v2] dt-bindings: input: add bindings document for ar1021_i2c driver |
| Message-ID | <tw2Km-64H-3@gated-at.bofh.it> |
| In reply to | #1623346 |
Add a simple binding document describing the supported devices and the
I2C bus address.
Signed-off-by: Martin Kepplinger <martin.kepplinger@ginzinger.com>
---
revision history
----------------
v2: fixed subject line and binding; thanks Rob Herring
v1: initial idea
.../devicetree/bindings/input/touchscreen/ar1021.txt | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
create mode 100644 Documentation/devicetree/bindings/input/touchscreen/ar1021.txt
diff --git a/Documentation/devicetree/bindings/input/touchscreen/ar1021.txt b/Documentation/devicetree/bindings/input/touchscreen/ar1021.txt
new file mode 100644
index 0000000..e459e85
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/ar1021.txt
@@ -0,0 +1,16 @@
+* Microchip AR1020 and AR1021 touchscreen interface (I2C)
+
+Required properties:
+- compatible : "microchip,ar1021-i2c"
+- reg : I2C slave address
+- interrupt-parent : the phandle for the interrupt controller
+- interrupts : touch controller interrupt
+
+Example:
+
+ touchscreen@4d {
+ compatible = "microchip,ar1021-i2c";
+ reg = <0x4d>;
+ interrupt-parent = <&gpio3>;
+ interrupts = <11 IRQ_TYPE_LEVEL_HIGH>;
+ };
--
2.1.4
[toc] | [prev] | [next] | [standalone]
| From | Rob Herring <robh@kernel.org> |
|---|---|
| Date | 2017-04-20 15:50 +0200 |
| Subject | Re: [PATCH v2] dt-bindings: input: add bindings document for ar1021_i2c driver |
| Message-ID | <tykD7-18r-1@gated-at.bofh.it> |
| In reply to | #1623537 |
On Fri, Apr 14, 2017 at 08:11:38AM +0200, Martin Kepplinger wrote: > Add a simple binding document describing the supported devices and the > I2C bus address. > > Signed-off-by: Martin Kepplinger <martin.kepplinger@ginzinger.com> > --- > > revision history > ---------------- > v2: fixed subject line and binding; thanks Rob Herring > v1: initial idea > > > .../devicetree/bindings/input/touchscreen/ar1021.txt | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > create mode 100644 Documentation/devicetree/bindings/input/touchscreen/ar1021.txt Acked-by: Rob Herring <robh@kernel.org>
[toc] | [prev] | [next] | [standalone]
| From | Dmitry Torokhov <dmitry.torokhov@gmail.com> |
|---|---|
| Date | 2017-04-20 19:50 +0200 |
| Subject | Re: [PATCH v2] dt-bindings: input: add bindings document for ar1021_i2c driver |
| Message-ID | <tyonn-3sm-3@gated-at.bofh.it> |
| In reply to | #1627462 |
On Thu, Apr 20, 2017 at 08:40:42AM -0500, Rob Herring wrote: > On Fri, Apr 14, 2017 at 08:11:38AM +0200, Martin Kepplinger wrote: > > Add a simple binding document describing the supported devices and the > > I2C bus address. > > > > Signed-off-by: Martin Kepplinger <martin.kepplinger@ginzinger.com> > > --- > > > > revision history > > ---------------- > > v2: fixed subject line and binding; thanks Rob Herring > > v1: initial idea > > > > > > .../devicetree/bindings/input/touchscreen/ar1021.txt | 16 ++++++++++++++++ > > 1 file changed, 16 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/input/touchscreen/ar1021.txt > > Acked-by: Rob Herring <robh@kernel.org> Applied, thank you. -- Dmitry
[toc] | [prev] | [next] | [standalone]
| From | Martin Kepplinger <martin.kepplinger@ginzinger.com> |
|---|---|
| Date | 2017-04-11 12:40 +0200 |
| Subject | [PATCH 3/3] input: touchscreen: ar1021_i2c: coding style fixes |
| Message-ID | <tv1nk-5Mx-11@gated-at.bofh.it> |
| In reply to | #1621125 |
Use the common kernel coding style and corrently align parameters with
open parenthesis.
Signed-off-by: Martin Kepplinger <martin.kepplinger@ginzinger.com>
---
drivers/input/touchscreen/ar1021_i2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/input/touchscreen/ar1021_i2c.c b/drivers/input/touchscreen/ar1021_i2c.c
index 1767257..cac7eeb 100644
--- a/drivers/input/touchscreen/ar1021_i2c.c
+++ b/drivers/input/touchscreen/ar1021_i2c.c
@@ -38,7 +38,7 @@ static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id)
int retval;
retval = i2c_master_recv(ar1021->client,
- ar1021->data, sizeof(ar1021->data));
+ ar1021->data, sizeof(ar1021->data));
if (retval != sizeof(ar1021->data))
goto out;
@@ -78,7 +78,7 @@ static void ar1021_i2c_close(struct input_dev *dev)
}
static int ar1021_i2c_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
+ const struct i2c_device_id *id)
{
struct ar1021_i2c *ar1021;
struct input_dev *input;
--
2.1.4
[toc] | [prev] | [next] | [standalone]
| From | Dmitry Torokhov <dmitry.torokhov@gmail.com> |
|---|---|
| Date | 2017-04-12 17:50 +0200 |
| Subject | Re: [PATCH 3/3] input: touchscreen: ar1021_i2c: coding style fixes |
| Message-ID | <tvsGT-6f3-37@gated-at.bofh.it> |
| In reply to | #1621130 |
On Tue, Apr 11, 2017 at 12:27:59PM +0200, Martin Kepplinger wrote:
> Use the common kernel coding style and corrently align parameters with
> open parenthesis.
>
> Signed-off-by: Martin Kepplinger <martin.kepplinger@ginzinger.com>
Applied, thank you.
> ---
> drivers/input/touchscreen/ar1021_i2c.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/touchscreen/ar1021_i2c.c b/drivers/input/touchscreen/ar1021_i2c.c
> index 1767257..cac7eeb 100644
> --- a/drivers/input/touchscreen/ar1021_i2c.c
> +++ b/drivers/input/touchscreen/ar1021_i2c.c
> @@ -38,7 +38,7 @@ static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id)
> int retval;
>
> retval = i2c_master_recv(ar1021->client,
> - ar1021->data, sizeof(ar1021->data));
> + ar1021->data, sizeof(ar1021->data));
> if (retval != sizeof(ar1021->data))
> goto out;
>
> @@ -78,7 +78,7 @@ static void ar1021_i2c_close(struct input_dev *dev)
> }
>
> static int ar1021_i2c_probe(struct i2c_client *client,
> - const struct i2c_device_id *id)
> + const struct i2c_device_id *id)
> {
> struct ar1021_i2c *ar1021;
> struct input_dev *input;
> --
> 2.1.4
>
--
Dmitry
[toc] | [prev] | [next] | [standalone]
| From | Dmitry Torokhov <dmitry.torokhov@gmail.com> |
|---|---|
| Date | 2017-04-12 17:50 +0200 |
| Subject | Re: [PATCH 1/3] input: touchscreen: ar1021_i2c: add support for AR1020 |
| Message-ID | <tvsGS-6f3-25@gated-at.bofh.it> |
| In reply to | #1621125 |
Hi Martin,
On Tue, Apr 11, 2017 at 12:27:57PM +0200, Martin Kepplinger wrote:
> 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
>
I do not see where you handle ar1020 differently from ar1021. If devices
are compatible, you do not need to add a new compatible to the driver,
simply use it in the binding:
compatible = "microchip,ar1020-i2c", "microchip,ar1021-i2c";
Thanks.
--
Dmitry
[toc] | [prev] | [next] | [standalone]
| From | Martin Kepplinger <martin.kepplinger@ginzinger.com> |
|---|---|
| Date | 2017-04-13 08:40 +0200 |
| Subject | Re: [PATCH 1/3] input: touchscreen: ar1021_i2c: add support for AR1020 |
| Message-ID | <tvGA9-7ok-1@gated-at.bofh.it> |
| In reply to | #1622261 |
On 2017-04-12 17:40, Dmitry Torokhov wrote:
> Hi Martin,
>
> On Tue, Apr 11, 2017 at 12:27:57PM +0200, Martin Kepplinger wrote:
>> 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
>>
>
> I do not see where you handle ar1020 differently from ar1021. If devices
> are compatible, you do not need to add a new compatible to the driver,
> simply use it in the binding:
>
> compatible = "microchip,ar1020-i2c", "microchip,ar1021-i2c";
>
> Thanks.
>
Why would you use "microchip,ar1020-i2c" in the dts if it's not
available? people don't obviously see, by grepping or reading,
that they have a compatible driver. ... or did I get you wrong?
I don't handle anything differently now. Factory reset has to be done
differntly though, as one example. So it'd be nice to have the option
to add data.
thanks
martin
[toc] | [prev] | [next] | [standalone]
| From | Rob Herring <robh@kernel.org> |
|---|---|
| Date | 2017-04-13 22:40 +0200 |
| Subject | Re: [PATCH 1/3] input: touchscreen: ar1021_i2c: add support for AR1020 |
| Message-ID | <tvTH4-8b7-5@gated-at.bofh.it> |
| In reply to | #1622744 |
On Thu, Apr 13, 2017 at 08:38:39AM +0200, Martin Kepplinger wrote: > > > On 2017-04-12 17:40, Dmitry Torokhov wrote: > > Hi Martin, > > > > On Tue, Apr 11, 2017 at 12:27:57PM +0200, Martin Kepplinger wrote: > >> 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. [...] > > > > I do not see where you handle ar1020 differently from ar1021. If devices > > are compatible, you do not need to add a new compatible to the driver, > > simply use it in the binding: > > > > compatible = "microchip,ar1020-i2c", "microchip,ar1021-i2c"; > > > > Thanks. > > > > Why would you use "microchip,ar1020-i2c" in the dts if it's not > available? people don't obviously see, by grepping or reading, > that they have a compatible driver. ... or did I get you wrong? > > I don't handle anything differently now. Factory reset has to be done > differntly though, as one example. So it'd be nice to have the option > to add data. Having both lets you use the current driver now and you can match on the more specific compatible string when and if you need to. That's exactly why we have multiple compatibles. I could imagine the driver never supports factory reset. Add both to comments or kconfig help if you want to make it clear that both devices are supported. Rob
[toc] | [prev] | [next] | [standalone]
| From | Martin Kepplinger <martin.kepplinger@ginzinger.com> |
|---|---|
| Date | 2017-04-14 08:10 +0200 |
| Subject | [PATCH v2] input: touchscreen: ar1021_i2c: highlight support for AR1020 |
| Message-ID | <tw2AG-61v-15@gated-at.bofh.it> |
| In reply to | #1623339 |
ar1021_i2c simply also supports the ar1020 device I'm using. This is
tested. They also share the same datasheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/40001393C.pdf
So let users see that they have a compatible in front of them by adding
AR1020 to the driver's description.
Signed-off-by: Martin Kepplinger <martin.kepplinger@ginzinger.com>
---
revision history
----------------
v2: leave compatible string untouched. only add description.
v1: initial idea.
drivers/input/touchscreen/Kconfig | 4 ++--
drivers/input/touchscreen/ar1021_i2c.c | 4 ++--
2 files changed, 4 insertions(+), 4 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 2e7500e..03784d2 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>
*
@@ -175,5 +175,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
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web