Skip to contentSkip to conversation

input: qt1070: Add device tree support

PATCH Superseded Bo Shen 2 participants 4 messages Sep 11, 2012 – Sep 18, 2012

Subsystems (4)
lore
Share & tools
lore

Bo Shen

author
#0 lore raw

PATCH v3 1/1 input: qt1070: Add device tree support

Add qt1070 device tree support
Using device node to parse irq

Test this on at91sam9x5ek board

---
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
Documentation/devicetree/bindings/input/atmel-qt1070.txt new file +16 -0
new file mode 100644
index 0000000..e1fc09e
@@ -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 at 1b {
+		compatible = "atmel,qt1070";
+		reg = <0x1b>;
+		interrupt-parent = <&pioA>;
+		interrupts = <7 0x0>;
+	};
drivers/input/keyboard/qt1070.c +9 -0
index ca68f29..60457dc 100644
@@ -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,
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH v3 1/1 input: qt1070: Add device tree support

Hi Dmitry,

Quoted 11 lines · Bo Shen

Add qt1070 device tree support
Using device node to parse irq

Test this on at91sam9x5ek board

---
change since v2
Using device node to parse irq,
Remove gpio relative stuff

Quoted 8 lines

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?

Quoted 47 lines
Documentation/devicetree/bindings/input/atmel-qt1070.txt new file +16 -0
new file mode 100644
index 0000000..e1fc09e
@@ -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 at 1b {
+		compatible = "atmel,qt1070";
+		reg = <0x1b>;
+		interrupt-parent = <&pioA>;
+		interrupts = <7 0x0>;
+	};
drivers/input/keyboard/qt1070.c +9 -0
index ca68f29..60457dc 100644
@@ -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,
#2 lore raw

PATCH v3 1/1 input: qt1070: Add device tree support

In reply to Bo Shen

On 09/11/2012 12:14 PM, Bo Shen :

Quoted 25 lines

Add qt1070 device tree support
Using device node to parse irq

Test this on at91sam9x5ek board

---
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
Documentation/devicetree/bindings/input/atmel-qt1070.txt new file +0 -0
new file mode 100644
index 0000000..e1fc09e

Documentation/devicetree/bindings/input/atmel-qt1070.txt line 1

Quoted 1 line
Documentation/devicetree/bindings/input/atmel-qt1070.txt new file +1 -0
@@ -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

Documentation/devicetree/bindings/input/atmel-qt1070.txt line 11

Quoted 10 lines
Documentation/devicetree/bindings/input/atmel-qt1070.txt new file +10 -0
+
+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 at 1b {

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

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

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

Quoted 20 lines
Documentation/devicetree/bindings/input/atmel-qt1070.txt new file +5 -0
+		compatible = "atmel,qt1070";
+		reg = <0x1b>;
+		interrupt-parent = <&pioA>;
+		interrupts = <7 0x0>;
+	};
drivers/input/keyboard/qt1070.c +6 -0
index ca68f29..60457dc 100644
@@ -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);

drivers/input/keyboard/qt1070.c static const struct i2c_device_id qt1070_id[] = { · line 267

Quoted 10 lines
drivers/input/keyboard/qt1070.c +3 -0
+#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:

Bye,

Signature · 1 line
Nicolas Ferre
author
#3 lore raw

PATCH v3 1/1 input: qt1070: Add device tree support

Hi Nicolas,

Quoted 31 lines · Nicolas Ferre

On 09/11/2012 12:14 PM, Bo Shen :

Quoted 25 lines

Add qt1070 device tree support
Using device node to parse irq

Test this on at91sam9x5ek board

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

Documentation/devicetree/bindings/input/atmel-qt1070.txt new file +0 -0
new file mode 100644
index 0000000..e1fc09e

Documentation/devicetree/bindings/input/atmel-qt1070.txt line 1

Quoted 1 line
Documentation/devicetree/bindings/input/atmel-qt1070.txt new file +1 -0
@@ -0,0 +1,16 @@
+Atmel qt1070 keyboard interface

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

Quoted 1 line

Please tell that

OK, I will add it. Thanks.

Quoted 14 lines

Documentation/devicetree/bindings/input/atmel-qt1070.txt line 11

Quoted 11 lines
Documentation/devicetree/bindings/input/atmel-qt1070.txt new file +10 -0
+
+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 at 1b {

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

Quoted 6 lines
qt1070: keyboard at 1b {
	compatible = "atmel,qt1070";
	[..]
};

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

OK. I will modify it like this. Thanks.

Quoted 39 lines
Quoted 21 lines
Documentation/devicetree/bindings/input/atmel-qt1070.txt new file +5 -0
+		compatible = "atmel,qt1070";
+		reg = <0x1b>;
+		interrupt-parent = <&pioA>;
+		interrupts = <7 0x0>;
+	};
drivers/input/keyboard/qt1070.c +6 -0
index ca68f29..60457dc 100644
@@ -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);

drivers/input/keyboard/qt1070.c static const struct i2c_device_id qt1070_id[] = { · line 267

Quoted 10 lines
drivers/input/keyboard/qt1070.c +3 -0
+#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:

Bye,