diff mbox

Input: atmel_mxt_ts - add missing compatible strings to OF device table

Message ID 20180410095340.24074-1-javierm@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Javier Martinez Canillas April 10, 2018, 9:53 a.m. UTC
Commit af503716ac14 ("i2c: core: report OF style module alias for devices
registered via OF") fixed how the I2C core reports the module alias when
devices are registered via OF.

But the atmel_mxt_ts driver only has an "atmel,maxtouch" compatible in its
OF device ID table, so if a Device Tree is using a different one, autoload
won't be working for the module (the matching works because the I2C device
ID table is used as a fallback).

So add compatible strings for each of the entries in the I2C device table.

Fixes: af503716ac14 ("i2c: core: report OF style module alias for devices registered via OF")
Reported-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---

 Documentation/devicetree/bindings/input/atmel,maxtouch.txt | 6 +++++-
 drivers/input/touchscreen/atmel_mxt_ts.c                   | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)

Comments

Enric Balletbo Serra April 10, 2018, 10:20 a.m. UTC | #1
Thanks Javier!

2018-04-10 11:53 GMT+02:00 Javier Martinez Canillas <javierm@redhat.com>:
> Commit af503716ac14 ("i2c: core: report OF style module alias for devices
> registered via OF") fixed how the I2C core reports the module alias when
> devices are registered via OF.
>
> But the atmel_mxt_ts driver only has an "atmel,maxtouch" compatible in its
> OF device ID table, so if a Device Tree is using a different one, autoload
> won't be working for the module (the matching works because the I2C device
> ID table is used as a fallback).
>
> So add compatible strings for each of the entries in the I2C device table.
>
> Fixes: af503716ac14 ("i2c: core: report OF style module alias for devices registered via OF")
> Reported-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> ---
>
>  Documentation/devicetree/bindings/input/atmel,maxtouch.txt | 6 +++++-
>  drivers/input/touchscreen/atmel_mxt_ts.c                   | 4 ++++
>  2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
> index 23e3abc3fdef..cd43fb8bc2ce 100644
> --- a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
> +++ b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
> @@ -1,8 +1,12 @@
>  Atmel maXTouch touchscreen/touchpad
>
>  Required properties:
> -- compatible:
> +- compatible: Must be one of the following
> +    atmel,qt602240_ts
> +    atmel,atmel_mxt_ts
> +    atmel,atmel_mxt_tp
>      atmel,maxtouch
> +    atmel,mXT224
>
>  - reg: The I2C address of the device
>
> diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
> index 7659bc48f1db..e8ef83f168d6 100644
> --- a/drivers/input/touchscreen/atmel_mxt_ts.c
> +++ b/drivers/input/touchscreen/atmel_mxt_ts.c
> @@ -3238,7 +3238,11 @@ static int __maybe_unused mxt_resume(struct device *dev)
>  static SIMPLE_DEV_PM_OPS(mxt_pm_ops, mxt_suspend, mxt_resume);
>
>  static const struct of_device_id mxt_of_match[] = {
> +       { .compatible = "atmel,qt602240_ts", },
> +       { .compatible = "atmel,atmel_mxt_ts", },
> +       { .compatible = "atmel,atmel_mxt_tp", },
>         { .compatible = "atmel,maxtouch", },
> +       { .compatible = "atmel,mXT224", },
>         {},
>  };
>  MODULE_DEVICE_TABLE(of, mxt_of_match);
> --
> 2.14.3
>

The Samsung Chromebook Plus is one of the affected devices, with
current mainline the module is not autoloaded, this patch fixes the
issue.

Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Rob Herring (Arm) April 13, 2018, 9:11 p.m. UTC | #2
On Tue, Apr 10, 2018 at 11:53:40AM +0200, Javier Martinez Canillas wrote:
> Commit af503716ac14 ("i2c: core: report OF style module alias for devices
> registered via OF") fixed how the I2C core reports the module alias when
> devices are registered via OF.
> 
> But the atmel_mxt_ts driver only has an "atmel,maxtouch" compatible in its
> OF device ID table, so if a Device Tree is using a different one, autoload
> won't be working for the module (the matching works because the I2C device
> ID table is used as a fallback).
> 
> So add compatible strings for each of the entries in the I2C device table.
> 
> Fixes: af503716ac14 ("i2c: core: report OF style module alias for devices registered via OF")
> Reported-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> ---
> 
>  Documentation/devicetree/bindings/input/atmel,maxtouch.txt | 6 +++++-
>  drivers/input/touchscreen/atmel_mxt_ts.c                   | 4 ++++
>  2 files changed, 9 insertions(+), 1 deletion(-)

Reviewed-by: Rob Herring <robh@kernel.org>
Dmitry Torokhov May 1, 2018, 6:48 p.m. UTC | #3
On Tue, Apr 10, 2018 at 11:53:40AM +0200, Javier Martinez Canillas wrote:
> Commit af503716ac14 ("i2c: core: report OF style module alias for devices
> registered via OF") fixed how the I2C core reports the module alias when
> devices are registered via OF.
> 
> But the atmel_mxt_ts driver only has an "atmel,maxtouch" compatible in its
> OF device ID table, so if a Device Tree is using a different one, autoload
> won't be working for the module (the matching works because the I2C device
> ID table is used as a fallback).
> 
> So add compatible strings for each of the entries in the I2C device table.
> 
> Fixes: af503716ac14 ("i2c: core: report OF style module alias for devices registered via OF")
> Reported-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> ---
> 
>  Documentation/devicetree/bindings/input/atmel,maxtouch.txt | 6 +++++-
>  drivers/input/touchscreen/atmel_mxt_ts.c                   | 4 ++++
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
> index 23e3abc3fdef..cd43fb8bc2ce 100644
> --- a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
> +++ b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
> @@ -1,8 +1,12 @@
>  Atmel maXTouch touchscreen/touchpad
>  
>  Required properties:
> -- compatible:
> +- compatible: Must be one of the following
> +    atmel,qt602240_ts
> +    atmel,atmel_mxt_ts
> +    atmel,atmel_mxt_tp
>      atmel,maxtouch
> +    atmel,mXT224

I do not think we should document ad-hoc compatible strings that were
introduced by various vendors as the documented ones, so I'd rather
dropped this chunk and leave only "atmel,maxtouch" as compatible that
everyone should be using.

The changes to the driver to support the existing DTSes can of course be
applied.

Rob, any objections?

>  
>  - reg: The I2C address of the device
>  
> diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
> index 7659bc48f1db..e8ef83f168d6 100644
> --- a/drivers/input/touchscreen/atmel_mxt_ts.c
> +++ b/drivers/input/touchscreen/atmel_mxt_ts.c
> @@ -3238,7 +3238,11 @@ static int __maybe_unused mxt_resume(struct device *dev)
>  static SIMPLE_DEV_PM_OPS(mxt_pm_ops, mxt_suspend, mxt_resume);
>  
>  static const struct of_device_id mxt_of_match[] = {
> +	{ .compatible = "atmel,qt602240_ts", },
> +	{ .compatible = "atmel,atmel_mxt_ts", },
> +	{ .compatible = "atmel,atmel_mxt_tp", },
>  	{ .compatible = "atmel,maxtouch", },
> +	{ .compatible = "atmel,mXT224", },
>  	{},
>  };
>  MODULE_DEVICE_TABLE(of, mxt_of_match);
> -- 
> 2.14.3
> 

Thanks.
Rob Herring May 1, 2018, 7:42 p.m. UTC | #4
On Tue, May 1, 2018 at 1:48 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Tue, Apr 10, 2018 at 11:53:40AM +0200, Javier Martinez Canillas wrote:
>> Commit af503716ac14 ("i2c: core: report OF style module alias for devices
>> registered via OF") fixed how the I2C core reports the module alias when
>> devices are registered via OF.
>>
>> But the atmel_mxt_ts driver only has an "atmel,maxtouch" compatible in its
>> OF device ID table, so if a Device Tree is using a different one, autoload
>> won't be working for the module (the matching works because the I2C device
>> ID table is used as a fallback).
>>
>> So add compatible strings for each of the entries in the I2C device table.
>>
>> Fixes: af503716ac14 ("i2c: core: report OF style module alias for devices registered via OF")
>> Reported-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
>> ---
>>
>>  Documentation/devicetree/bindings/input/atmel,maxtouch.txt | 6 +++++-
>>  drivers/input/touchscreen/atmel_mxt_ts.c                   | 4 ++++
>>  2 files changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
>> index 23e3abc3fdef..cd43fb8bc2ce 100644
>> --- a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
>> +++ b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
>> @@ -1,8 +1,12 @@
>>  Atmel maXTouch touchscreen/touchpad
>>
>>  Required properties:
>> -- compatible:
>> +- compatible: Must be one of the following
>> +    atmel,qt602240_ts
>> +    atmel,atmel_mxt_ts
>> +    atmel,atmel_mxt_tp
>>      atmel,maxtouch
>> +    atmel,mXT224
>
> I do not think we should document ad-hoc compatible strings that were
> introduced by various vendors as the documented ones, so I'd rather
> dropped this chunk and leave only "atmel,maxtouch" as compatible that
> everyone should be using.
>
> The changes to the driver to support the existing DTSes can of course be
> applied.
>
> Rob, any objections?

I'd prefer we list them in the binding as deprecated. Then we document
somewhere besides this thread to not use them.

And there are 3 dts changes needed as well:

$ git grep atmel,mXT224
$ git grep atmel,qt6
$ git grep atmel,atmel_mxt
arch/arm/boot/dts/at91-sama5d4ek.dts:
 compatible = "atmel,atmel_mxt_ts";
arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts:
compatible = "atmel,atmel_mxt_tp";
arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts:
compatible = "atmel,atmel_mxt_ts";

Rob
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
index 23e3abc3fdef..cd43fb8bc2ce 100644
--- a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
+++ b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
@@ -1,8 +1,12 @@ 
 Atmel maXTouch touchscreen/touchpad
 
 Required properties:
-- compatible:
+- compatible: Must be one of the following
+    atmel,qt602240_ts
+    atmel,atmel_mxt_ts
+    atmel,atmel_mxt_tp
     atmel,maxtouch
+    atmel,mXT224
 
 - reg: The I2C address of the device
 
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 7659bc48f1db..e8ef83f168d6 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -3238,7 +3238,11 @@  static int __maybe_unused mxt_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(mxt_pm_ops, mxt_suspend, mxt_resume);
 
 static const struct of_device_id mxt_of_match[] = {
+	{ .compatible = "atmel,qt602240_ts", },
+	{ .compatible = "atmel,atmel_mxt_ts", },
+	{ .compatible = "atmel,atmel_mxt_tp", },
 	{ .compatible = "atmel,maxtouch", },
+	{ .compatible = "atmel,mXT224", },
 	{},
 };
 MODULE_DEVICE_TABLE(of, mxt_of_match);