linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Add device tree support for Goodix GT9xx series touchscreen controller
@ 2015-01-17 14:34 Aleksei Mamlin
       [not found] ` <1421505253-7474-1-git-send-email-mamlinav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Aleksei Mamlin @ 2015-01-17 14:34 UTC (permalink / raw)
  To: linux-input; +Cc: devicetree, Aleksei Mamlin

Provide device tree support and binding information.

Aleksei Mamlin (3):
  input: goodix: Add device tree support
  dt-bindings: Add vendor-prefix for Goodix
  input: goodix: Add bindings documentation

 .../bindings/input/touchscreen/gt9xx.txt           | 23 ++++++++++++++++++++++
 .../devicetree/bindings/vendor-prefixes.txt        |  1 +
 drivers/input/touchscreen/goodix.c                 | 10 ++++++++++
 3 files changed, 34 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/gt9xx.txt

-- 
2.0.5


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

* [PATCH 1/3] input: goodix: Add device tree support
       [not found] ` <1421505253-7474-1-git-send-email-mamlinav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-01-17 14:36   ` Aleksei Mamlin
       [not found]     ` <1421505361-8871-1-git-send-email-mamlinav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Aleksei Mamlin @ 2015-01-17 14:36 UTC (permalink / raw)
  To: linux-input-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Aleksei Mamlin

Signed-off-by: Aleksei Mamlin <mamlinav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/input/touchscreen/goodix.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index ca19668..603d2ae 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -23,6 +23,7 @@
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 #include <asm/unaligned.h>
 
 struct goodix_ts_data {
@@ -378,6 +379,14 @@ static const struct acpi_device_id goodix_acpi_match[] = {
 };
 MODULE_DEVICE_TABLE(acpi, goodix_acpi_match);
 
+#ifdef CONFIG_OF
+static struct of_device_id goodix_of_match[] = {
+	{ .compatible = "goodix,gt9xx" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, goodix_of_match);
+#endif
+
 static struct i2c_driver goodix_ts_driver = {
 	.probe = goodix_ts_probe,
 	.id_table = goodix_ts_id,
@@ -385,6 +394,7 @@ static struct i2c_driver goodix_ts_driver = {
 		.name = "Goodix-TS",
 		.owner = THIS_MODULE,
 		.acpi_match_table = goodix_acpi_match,
+		.of_match_table = of_match_ptr(goodix_of_match),
 	},
 };
 module_i2c_driver(goodix_ts_driver);
-- 
2.0.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 2/3] dt-bindings: Add vendor-prefix for Goodix
  2015-01-17 14:34 [PATCH 0/3] Add device tree support for Goodix GT9xx series touchscreen controller Aleksei Mamlin
       [not found] ` <1421505253-7474-1-git-send-email-mamlinav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-01-17 14:36 ` Aleksei Mamlin
  2015-01-17 14:36 ` [PATCH 3/3] input: goodix: Add bindings documentation Aleksei Mamlin
  2015-01-17 20:37 ` [PATCH 0/3] Add device tree support for Goodix GT9xx series touchscreen controller Bastien Nocera
  3 siblings, 0 replies; 10+ messages in thread
From: Aleksei Mamlin @ 2015-01-17 14:36 UTC (permalink / raw)
  To: linux-input; +Cc: devicetree, Aleksei Mamlin

Signed-off-by: Aleksei Mamlin <mamlinav@gmail.com>
---
 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index b1df0ad..72136f1 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -64,6 +64,7 @@ gef	GE Fanuc Intelligent Platforms Embedded Systems, Inc.
 geniatech	Geniatech, Inc.
 globalscale	Globalscale Technologies, Inc.
 gmt	Global Mixed-mode Technology, Inc.
+goodix	Shenzhen Huiding Technology Co. Ltd.
 google	Google, Inc.
 gumstix	Gumstix, Inc.
 gw	Gateworks Corporation
-- 
2.0.5


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

* [PATCH 3/3] input: goodix: Add bindings documentation
  2015-01-17 14:34 [PATCH 0/3] Add device tree support for Goodix GT9xx series touchscreen controller Aleksei Mamlin
       [not found] ` <1421505253-7474-1-git-send-email-mamlinav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2015-01-17 14:36 ` [PATCH 2/3] dt-bindings: Add vendor-prefix for Goodix Aleksei Mamlin
@ 2015-01-17 14:36 ` Aleksei Mamlin
  2015-01-19 12:13   ` Arnd Bergmann
  2015-01-17 20:37 ` [PATCH 0/3] Add device tree support for Goodix GT9xx series touchscreen controller Bastien Nocera
  3 siblings, 1 reply; 10+ messages in thread
From: Aleksei Mamlin @ 2015-01-17 14:36 UTC (permalink / raw)
  To: linux-input; +Cc: devicetree, Aleksei Mamlin

Signed-off-by: Aleksei Mamlin <mamlinav@gmail.com>
---
 .../bindings/input/touchscreen/gt9xx.txt           | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/gt9xx.txt

diff --git a/Documentation/devicetree/bindings/input/touchscreen/gt9xx.txt b/Documentation/devicetree/bindings/input/touchscreen/gt9xx.txt
new file mode 100644
index 0000000..96c17f0
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/gt9xx.txt
@@ -0,0 +1,23 @@
+Device tree bindings for Goodix GT9xx series touchscreen controller
+
+Required properties:
+
+ - compatible		: Should be "goodix,gt9xx"
+ - reg			: I2C address of the chip
+ - interrupt-parent 	: Interrupt controller to which the chip is connected
+ - interrupts		: Interrupt to which the chip is connected
+
+Example:
+
+	i2c@00000000 {
+		/* ... */
+
+		gt9xx@5d {
+			compatible = "goodix,gt9xx";
+			reg = <0x5d>;
+			interrupt-parent = <&gpio>;
+			interrupts = <0 2>;
+		};
+
+		/* ... */
+	};
-- 
2.0.5


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

* Re: [PATCH 0/3] Add device tree support for Goodix GT9xx series touchscreen controller
  2015-01-17 14:34 [PATCH 0/3] Add device tree support for Goodix GT9xx series touchscreen controller Aleksei Mamlin
                   ` (2 preceding siblings ...)
  2015-01-17 14:36 ` [PATCH 3/3] input: goodix: Add bindings documentation Aleksei Mamlin
@ 2015-01-17 20:37 ` Bastien Nocera
  3 siblings, 0 replies; 10+ messages in thread
From: Bastien Nocera @ 2015-01-17 20:37 UTC (permalink / raw)
  To: Aleksei Mamlin; +Cc: linux-input, devicetree

On Sat, 2015-01-17 at 17:34 +0300, Aleksei Mamlin wrote:
> Provide device tree support and binding information.

What hardware is this enabling support for? The commit messages lack
that information.

> Aleksei Mamlin (3):
>   input: goodix: Add device tree support
>   dt-bindings: Add vendor-prefix for Goodix
>   input: goodix: Add bindings documentation
> 
>  .../bindings/input/touchscreen/gt9xx.txt           | 23 ++++++++++++++++++++++
>  .../devicetree/bindings/vendor-prefixes.txt        |  1 +
>  drivers/input/touchscreen/goodix.c                 | 10 ++++++++++
>  3 files changed, 34 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/input/touchscreen/gt9xx.txt
> 



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

* Re: [PATCH 1/3] input: goodix: Add device tree support
       [not found]     ` <1421505361-8871-1-git-send-email-mamlinav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-01-17 20:38       ` Bastien Nocera
       [not found]         ` <1421527085.2075.12.camel-0MeiytkfxGOsTnJN9+BGXg@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Bastien Nocera @ 2015-01-17 20:38 UTC (permalink / raw)
  To: Aleksei Mamlin
  Cc: linux-input-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

On Sat, 2015-01-17 at 17:36 +0300, Aleksei Mamlin wrote:
> Signed-off-by: Aleksei Mamlin <mamlinav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/input/touchscreen/goodix.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
> index ca19668..603d2ae 100644
> --- a/drivers/input/touchscreen/goodix.c
> +++ b/drivers/input/touchscreen/goodix.c
> @@ -23,6 +23,7 @@
>  #include <linux/irq.h>
>  #include <linux/interrupt.h>
>  #include <linux/slab.h>
> +#include <linux/of.h>
>  #include <asm/unaligned.h>
>  
>  struct goodix_ts_data {
> @@ -378,6 +379,14 @@ static const struct acpi_device_id goodix_acpi_match[] = {
>  };
>  MODULE_DEVICE_TABLE(acpi, goodix_acpi_match);
>  
> +#ifdef CONFIG_OF
> +static struct of_device_id goodix_of_match[] = {
> +	{ .compatible = "goodix,gt9xx" },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(of, goodix_of_match);
> +#endif
> +
>  static struct i2c_driver goodix_ts_driver = {
>  	.probe = goodix_ts_probe,
>  	.id_table = goodix_ts_id,
> @@ -385,6 +394,7 @@ static struct i2c_driver goodix_ts_driver = {
>  		.name = "Goodix-TS",
>  		.owner = THIS_MODULE,
>  		.acpi_match_table = goodix_acpi_match,
> +		.of_match_table = of_match_ptr(goodix_of_match),

Pretty sure that wouldn't compile if CONFIG_OF is disabled.

>  	},
>  };
>  module_i2c_driver(goodix_ts_driver);


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 1/3] input: goodix: Add device tree support
       [not found]         ` <1421527085.2075.12.camel-0MeiytkfxGOsTnJN9+BGXg@public.gmane.org>
@ 2015-01-18 12:25           ` Алексей Мамлин
  2015-01-18 14:22             ` Antonio Ospite
  0 siblings, 1 reply; 10+ messages in thread
From: Алексей Мамлин @ 2015-01-18 12:25 UTC (permalink / raw)
  To: linux-input-u79uwXL29TY76Z2rM5mHXA; +Cc: devicetree-u79uwXL29TY76Z2rM5mHXA

Look at include/linux/of.h

#ifdef CONFIG_OF
 ...
#define of_match_ptr(_ptr)	(_ptr)
 ...
#else /* CONFIG_OF */
 ...
#define of_match_ptr(_ptr)	NULL
 ...
#endif /* CONFIG_OF */

So it would be compiled. Similarly in other touchscreen drivers.
But Kconfig should be fixed to enable CONFIG_OF. Will be fixed in v2.

2015-01-17 23:38 GMT+03:00, Bastien Nocera <hadess-0MeiytkfxGOsTnJN9+BGXg@public.gmane.org>:
> On Sat, 2015-01-17 at 17:36 +0300, Aleksei Mamlin wrote:
>> Signed-off-by: Aleksei Mamlin <mamlinav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> ---
>>  drivers/input/touchscreen/goodix.c | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/input/touchscreen/goodix.c
>> b/drivers/input/touchscreen/goodix.c
>> index ca19668..603d2ae 100644
>> --- a/drivers/input/touchscreen/goodix.c
>> +++ b/drivers/input/touchscreen/goodix.c
>> @@ -23,6 +23,7 @@
>>  #include <linux/irq.h>
>>  #include <linux/interrupt.h>
>>  #include <linux/slab.h>
>> +#include <linux/of.h>
>>  #include <asm/unaligned.h>
>>
>>  struct goodix_ts_data {
>> @@ -378,6 +379,14 @@ static const struct acpi_device_id
>> goodix_acpi_match[] = {
>>  };
>>  MODULE_DEVICE_TABLE(acpi, goodix_acpi_match);
>>
>> +#ifdef CONFIG_OF
>> +static struct of_device_id goodix_of_match[] = {
>> +	{ .compatible = "goodix,gt9xx" },
>> +	{ }
>> +};
>> +MODULE_DEVICE_TABLE(of, goodix_of_match);
>> +#endif
>> +
>>  static struct i2c_driver goodix_ts_driver = {
>>  	.probe = goodix_ts_probe,
>>  	.id_table = goodix_ts_id,
>> @@ -385,6 +394,7 @@ static struct i2c_driver goodix_ts_driver = {
>>  		.name = "Goodix-TS",
>>  		.owner = THIS_MODULE,
>>  		.acpi_match_table = goodix_acpi_match,
>> +		.of_match_table = of_match_ptr(goodix_of_match),
>
> Pretty sure that wouldn't compile if CONFIG_OF is disabled.
>
>>  	},
>>  };
>>  module_i2c_driver(goodix_ts_driver);
>
>
>


-- 
Thanks and regards,
Aleksei Mamlin
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 1/3] input: goodix: Add device tree support
  2015-01-18 12:25           ` Алексей Мамлин
@ 2015-01-18 14:22             ` Antonio Ospite
  2015-01-18 15:12               ` Aleksei Mamlin
  0 siblings, 1 reply; 10+ messages in thread
From: Antonio Ospite @ 2015-01-18 14:22 UTC (permalink / raw)
  To: Алексей Мамлин
  Cc: linux-input, devicetree

On Sun, 18 Jan 2015 16:25:35 +0400
Алексей Мамлин <mamlinav@gmail.com> wrote:

> Look at include/linux/of.h
> 
> #ifdef CONFIG_OF
>  ...
> #define of_match_ptr(_ptr)	(_ptr)
>  ...
> #else /* CONFIG_OF */
>  ...
> #define of_match_ptr(_ptr)	NULL
>  ...
> #endif /* CONFIG_OF */
> 
> So it would be compiled. Similarly in other touchscreen drivers.
> But Kconfig should be fixed to enable CONFIG_OF. Will be fixed in v2.
> 

I was thinking, instead of depending on (ACPI || OF), can we make ACPI
optional as well and remove the dependency on it?
Does it make sense to allow selecting a driver even with no
enabled mechanism to pass platform data to it?

Thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 1/3] input: goodix: Add device tree support
  2015-01-18 14:22             ` Antonio Ospite
@ 2015-01-18 15:12               ` Aleksei Mamlin
  0 siblings, 0 replies; 10+ messages in thread
From: Aleksei Mamlin @ 2015-01-18 15:12 UTC (permalink / raw)
  To: Antonio Ospite; +Cc: linux-input, devicetree

Do you mean that I should use #ifdef CONFIG_ACPI and ACPI_PTR?

#ifdef CONFIG_ACPI
static const struct acpi_device_id goodix_acpi_match[] = {
	{ "GDIX1001", 0 },
	{ }
};
MODULE_DEVICE_TABLE(acpi, goodix_acpi_match);
#endif

#ifdef CONFIG_OF
static struct of_device_id goodix_of_match[] = {
	{ .compatible = "goodix,gt9xx" },
	{ }
};
MODULE_DEVICE_TABLE(of, goodix_of_match);
#endif

static struct i2c_driver goodix_ts_driver = {
	...
		.acpi_match_table = ACPI_PTR(goodix_acpi_match),
		.of_match_table = of_match_ptr(goodix_of_match),
}

2015-01-18 17:22 GMT+03:00, Antonio Ospite <ao2@ao2.it>:
> On Sun, 18 Jan 2015 16:25:35 +0400
> Алексей Мамлин <mamlinav@gmail.com> wrote:
>
>> Look at include/linux/of.h
>>
>> #ifdef CONFIG_OF
>>  ...
>> #define of_match_ptr(_ptr)	(_ptr)
>>  ...
>> #else /* CONFIG_OF */
>>  ...
>> #define of_match_ptr(_ptr)	NULL
>>  ...
>> #endif /* CONFIG_OF */
>>
>> So it would be compiled. Similarly in other touchscreen drivers.
>> But Kconfig should be fixed to enable CONFIG_OF. Will be fixed in v2.
>>
>
> I was thinking, instead of depending on (ACPI || OF), can we make ACPI
> optional as well and remove the dependency on it?
> Does it make sense to allow selecting a driver even with no
> enabled mechanism to pass platform data to it?
>
> Thanks,
>    Antonio
>
> --
> Antonio Ospite
> http://ao2.it
>
> A: Because it messes up the order in which people normally read text.
>    See http://en.wikipedia.org/wiki/Posting_style
> Q: Why is top-posting such a bad thing?
>


-- 
Thanks and regards,
Aleksei Mamlin
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 3/3] input: goodix: Add bindings documentation
  2015-01-17 14:36 ` [PATCH 3/3] input: goodix: Add bindings documentation Aleksei Mamlin
@ 2015-01-19 12:13   ` Arnd Bergmann
  0 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2015-01-19 12:13 UTC (permalink / raw)
  To: Aleksei Mamlin; +Cc: linux-input, devicetree

On Saturday 17 January 2015 17:36:50 Aleksei Mamlin wrote:
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/touchscreen/gt9xx.txt
> @@ -0,0 +1,23 @@
> +Device tree bindings for Goodix GT9xx series touchscreen controller
> +
> +Required properties:
> +
> + - compatible          : Should be "goodix,gt9xx"
> + - reg                 : I2C address of the chip
> + - interrupt-parent    : Interrupt controller to which the chip is connected
> + - interrupts          : Interrupt to which the chip is connected
> +
> 

You should avoid the use of wildcards in compatible strings. Better list
all the known part numbers, or (if they are 100% compatible with one another)
pick the oldest one we support and use that as the compatible string.

	Arnd

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

end of thread, other threads:[~2015-01-19 12:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-17 14:34 [PATCH 0/3] Add device tree support for Goodix GT9xx series touchscreen controller Aleksei Mamlin
     [not found] ` <1421505253-7474-1-git-send-email-mamlinav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-01-17 14:36   ` [PATCH 1/3] input: goodix: Add device tree support Aleksei Mamlin
     [not found]     ` <1421505361-8871-1-git-send-email-mamlinav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-01-17 20:38       ` Bastien Nocera
     [not found]         ` <1421527085.2075.12.camel-0MeiytkfxGOsTnJN9+BGXg@public.gmane.org>
2015-01-18 12:25           ` Алексей Мамлин
2015-01-18 14:22             ` Antonio Ospite
2015-01-18 15:12               ` Aleksei Mamlin
2015-01-17 14:36 ` [PATCH 2/3] dt-bindings: Add vendor-prefix for Goodix Aleksei Mamlin
2015-01-17 14:36 ` [PATCH 3/3] input: goodix: Add bindings documentation Aleksei Mamlin
2015-01-19 12:13   ` Arnd Bergmann
2015-01-17 20:37 ` [PATCH 0/3] Add device tree support for Goodix GT9xx series touchscreen controller Bastien Nocera

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).