diff mbox

[v3] input: qt1070: Add device tree support

Message ID 1347358459-11598-1-git-send-email-voice.shen@atmel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bo Shen Sept. 11, 2012, 10:14 a.m. UTC
Add qt1070 device tree support
Using device node to parse irq

Test this on at91sam9x5ek board

Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
change since v2
  Using device node to parse irq,
  Remove gpio relative stuff

change since v1
  Add gpio relative stuff, gpio_is_valid, gpio_request
---
 .../devicetree/bindings/input/atmel-qt1070.txt     |   16 ++++++++++++++++
 drivers/input/keyboard/qt1070.c                    |    9 +++++++++
 2 files changed, 25 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/atmel-qt1070.txt

Comments

Bo Shen Sept. 17, 2012, 3:34 a.m. UTC | #1
Hi Dmitry,

On 9/11/2012 18:14, Bo Shen wrote:
> Add qt1070 device tree support
> Using device node to parse irq
>
> Test this on at91sam9x5ek board
>
> Signed-off-by: Bo Shen <voice.shen@atmel.com>
> ---
> change since v2
>    Using device node to parse irq,
>    Remove gpio relative stuff
>
> change since v1
>    Add gpio relative stuff, gpio_is_valid, gpio_request
> ---
>   .../devicetree/bindings/input/atmel-qt1070.txt     |   16 ++++++++++++++++
>   drivers/input/keyboard/qt1070.c                    |    9 +++++++++
>   2 files changed, 25 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/input/atmel-qt1070.txt
>

Ping?

> diff --git a/Documentation/devicetree/bindings/input/atmel-qt1070.txt b/Documentation/devicetree/bindings/input/atmel-qt1070.txt
> new file mode 100644
> index 0000000..e1fc09e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/atmel-qt1070.txt
> @@ -0,0 +1,16 @@
> +Atmel qt1070 keyboard interface
> +
> +Required Properties:
> +- compatible: Should be "atmel,qt1070"
> +- reg: I2C slave address
> +- interrupt-parent: Depends on SoC
> +- interrupts: The interrupt pin number to the cpu, and trigger mode.
> +
> +Example:
> +
> +	qt1070@1b {
> +		compatible = "atmel,qt1070";
> +		reg = <0x1b>;
> +		interrupt-parent = <&pioA>;
> +		interrupts = <7 0x0>;
> +	};
> diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c
> index ca68f29..60457dc 100644
> --- a/drivers/input/keyboard/qt1070.c
> +++ b/drivers/input/keyboard/qt1070.c
> @@ -249,10 +249,19 @@ static const struct i2c_device_id qt1070_id[] = {
>   };
>   MODULE_DEVICE_TABLE(i2c, qt1070_id);
>
> +#ifdef CONFIG_OF
> +static struct of_device_id atmel_qt1070_of_match[] = {
> +	{ .compatible = "atmel,qt1070" },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, atmel_qt1070_of_match);
> +#endif
> +
>   static struct i2c_driver qt1070_driver = {
>   	.driver	= {
>   		.name	= "qt1070",
>   		.owner	= THIS_MODULE,
> +		.of_match_table = of_match_ptr(atmel_qt1070_of_match),
>   	},
>   	.id_table	= qt1070_id,
>   	.probe		= qt1070_probe,
>
Nicolas Ferre Sept. 17, 2012, 9:20 a.m. UTC | #2
On 09/11/2012 12:14 PM, Bo Shen :
> Add qt1070 device tree support
> Using device node to parse irq
> 
> Test this on at91sam9x5ek board
> 
> Signed-off-by: Bo Shen <voice.shen@atmel.com>
> ---
> change since v2
>   Using device node to parse irq,
>   Remove gpio relative stuff
> 
> change since v1
>   Add gpio relative stuff, gpio_is_valid, gpio_request
> ---
>  .../devicetree/bindings/input/atmel-qt1070.txt     |   16 ++++++++++++++++
>  drivers/input/keyboard/qt1070.c                    |    9 +++++++++
>  2 files changed, 25 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/input/atmel-qt1070.txt
> 
> diff --git a/Documentation/devicetree/bindings/input/atmel-qt1070.txt b/Documentation/devicetree/bindings/input/atmel-qt1070.txt
> new file mode 100644
> index 0000000..e1fc09e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/atmel-qt1070.txt
> @@ -0,0 +1,16 @@
> +Atmel qt1070 keyboard interface

Nitpicking: there is usually a "*" at the beginning to give it a
title-ish look ;-)

Please tell that

> +
> +Required Properties:
> +- compatible: Should be "atmel,qt1070"
> +- reg: I2C slave address
> +- interrupt-parent: Depends on SoC
> +- interrupts: The interrupt pin number to the cpu, and trigger mode.
> +
> +Example:
> +
> +	qt1070@1b {

I think that you need to replace by a generic name for the node name:

qt1070: keyboard@1b {
	compatible = "atmel,qt1070";
	[..]
};

I found "keyboard" to be the most appropriate in the ePAPR.


> +		compatible = "atmel,qt1070";
> +		reg = <0x1b>;
> +		interrupt-parent = <&pioA>;
> +		interrupts = <7 0x0>;
> +	};
> diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c
> index ca68f29..60457dc 100644
> --- a/drivers/input/keyboard/qt1070.c
> +++ b/drivers/input/keyboard/qt1070.c
> @@ -249,10 +249,19 @@ static const struct i2c_device_id qt1070_id[] = {
>  };
>  MODULE_DEVICE_TABLE(i2c, qt1070_id);
>  
> +#ifdef CONFIG_OF
> +static struct of_device_id atmel_qt1070_of_match[] = {
> +	{ .compatible = "atmel,qt1070" },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, atmel_qt1070_of_match);
> +#endif
> +
>  static struct i2c_driver qt1070_driver = {
>  	.driver	= {
>  		.name	= "qt1070",
>  		.owner	= THIS_MODULE,
> +		.of_match_table = of_match_ptr(atmel_qt1070_of_match),
>  	},
>  	.id_table	= qt1070_id,
>  	.probe		= qt1070_probe,
> 

Otherwise, looks good. So, if you agree on my comments and for next
revision, you can add my:

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Bye,
Bo Shen Sept. 18, 2012, 2:21 a.m. UTC | #3
Hi Nicolas,

On 9/17/2012 17:20, Nicolas Ferre wrote:
> On 09/11/2012 12:14 PM, Bo Shen :
>> Add qt1070 device tree support
>> Using device node to parse irq
>>
>> Test this on at91sam9x5ek board
>>
>> Signed-off-by: Bo Shen <voice.shen@atmel.com>
>> ---
>> change since v2
>>    Using device node to parse irq,
>>    Remove gpio relative stuff
>>
>> change since v1
>>    Add gpio relative stuff, gpio_is_valid, gpio_request
>> ---
>>   .../devicetree/bindings/input/atmel-qt1070.txt     |   16 ++++++++++++++++
>>   drivers/input/keyboard/qt1070.c                    |    9 +++++++++
>>   2 files changed, 25 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/input/atmel-qt1070.txt
>>
>> diff --git a/Documentation/devicetree/bindings/input/atmel-qt1070.txt b/Documentation/devicetree/bindings/input/atmel-qt1070.txt
>> new file mode 100644
>> index 0000000..e1fc09e
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/input/atmel-qt1070.txt
>> @@ -0,0 +1,16 @@
>> +Atmel qt1070 keyboard interface
>
> Nitpicking: there is usually a "*" at the beginning to give it a
> title-ish look ;-)
>
> Please tell that

OK, I will add it. Thanks.

>
>> +
>> +Required Properties:
>> +- compatible: Should be "atmel,qt1070"
>> +- reg: I2C slave address
>> +- interrupt-parent: Depends on SoC
>> +- interrupts: The interrupt pin number to the cpu, and trigger mode.
>> +
>> +Example:
>> +
>> +	qt1070@1b {
>
> I think that you need to replace by a generic name for the node name:
>
> qt1070: keyboard@1b {
> 	compatible = "atmel,qt1070";
> 	[..]
> };
>
> I found "keyboard" to be the most appropriate in the ePAPR.

OK. I will modify it like this. Thanks.

>
>> +		compatible = "atmel,qt1070";
>> +		reg = <0x1b>;
>> +		interrupt-parent = <&pioA>;
>> +		interrupts = <7 0x0>;
>> +	};
>> diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c
>> index ca68f29..60457dc 100644
>> --- a/drivers/input/keyboard/qt1070.c
>> +++ b/drivers/input/keyboard/qt1070.c
>> @@ -249,10 +249,19 @@ static const struct i2c_device_id qt1070_id[] = {
>>   };
>>   MODULE_DEVICE_TABLE(i2c, qt1070_id);
>>
>> +#ifdef CONFIG_OF
>> +static struct of_device_id atmel_qt1070_of_match[] = {
>> +	{ .compatible = "atmel,qt1070" },
>> +	{ },
>> +};
>> +MODULE_DEVICE_TABLE(of, atmel_qt1070_of_match);
>> +#endif
>> +
>>   static struct i2c_driver qt1070_driver = {
>>   	.driver	= {
>>   		.name	= "qt1070",
>>   		.owner	= THIS_MODULE,
>> +		.of_match_table = of_match_ptr(atmel_qt1070_of_match),
>>   	},
>>   	.id_table	= qt1070_id,
>>   	.probe		= qt1070_probe,
>>
>
> Otherwise, looks good. So, if you agree on my comments and for next
> revision, you can add my:
>
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>
> Bye,
>
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/input/atmel-qt1070.txt b/Documentation/devicetree/bindings/input/atmel-qt1070.txt
new file mode 100644
index 0000000..e1fc09e
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/atmel-qt1070.txt
@@ -0,0 +1,16 @@ 
+Atmel qt1070 keyboard interface
+
+Required Properties:
+- compatible: Should be "atmel,qt1070"
+- reg: I2C slave address
+- interrupt-parent: Depends on SoC
+- interrupts: The interrupt pin number to the cpu, and trigger mode.
+
+Example:
+
+	qt1070@1b {
+		compatible = "atmel,qt1070";
+		reg = <0x1b>;
+		interrupt-parent = <&pioA>;
+		interrupts = <7 0x0>;
+	};
diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c
index ca68f29..60457dc 100644
--- a/drivers/input/keyboard/qt1070.c
+++ b/drivers/input/keyboard/qt1070.c
@@ -249,10 +249,19 @@  static const struct i2c_device_id qt1070_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, qt1070_id);
 
+#ifdef CONFIG_OF
+static struct of_device_id atmel_qt1070_of_match[] = {
+	{ .compatible = "atmel,qt1070" },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, atmel_qt1070_of_match);
+#endif
+
 static struct i2c_driver qt1070_driver = {
 	.driver	= {
 		.name	= "qt1070",
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(atmel_qt1070_of_match),
 	},
 	.id_table	= qt1070_id,
 	.probe		= qt1070_probe,