2013-07-10 09:54:30

by Bo Shen

[permalink] [raw]
Subject: [PATCH 0/3] arm: atmel: at91sam9n12: add i2c pinctrl and qt1070 support

this patch is based on linux master branch, implementation as following:
- add the i2c pinctrl which needed for using at91sam9n12 TWI
- enable qt1070
- trivial fix for the gpio-key pin number


Bo Shen (3):
arm: atmel: at91sam9n12: add pinctrl of TWI
arm: atmel: at91sam9n12: add qt1070 support
arm: atmel: at91sam9n12: correct pin number of gpio-key

arch/arm/boot/dts/at91sam9n12.dtsi | 20 ++++++++++++++++++++
arch/arm/boot/dts/at91sam9n12ek.dts | 18 +++++++++++++++++-
2 files changed, 37 insertions(+), 1 deletion(-)

--
1.7.9.5


2013-07-10 09:54:35

by Bo Shen

[permalink] [raw]
Subject: [PATCH 2/3] arm: atmel: at91sam9n12: add qt1070 support

add qt1070 support on at91sam9n12ek board

Signed-off-by: Bo Shen <[email protected]>
---
arch/arm/boot/dts/at91sam9n12ek.dts | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts b/arch/arm/boot/dts/at91sam9n12ek.dts
index d59b70c..3acac62 100644
--- a/arch/arm/boot/dts/at91sam9n12ek.dts
+++ b/arch/arm/boot/dts/at91sam9n12ek.dts
@@ -40,6 +40,15 @@

i2c0: i2c@f8010000 {
status = "okay";
+
+ qt1070: keyboard@1b {
+ compatible = "qt1070";
+ reg = <0x1b>;
+ interrupt-parent = <&pioA>;
+ interrupts = <2 0x0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_qt1070_irq>;
+ };
};

i2c1: i2c@f8014000 {
@@ -66,6 +75,13 @@
<AT91_PIOA 7 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>; /* PA7 gpio CD pin pull up and deglitch */
};
};
+
+ qt1070 {
+ pinctrl_qt1070_irq: qt1070_irq {
+ atmel,pins =
+ <AT91_PIOA 2 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>; /* PA2 GPIO with pull up deglith */
+ };
+ };
};

spi0: spi@f0000000 {
--
1.7.9.5

2013-07-10 09:54:40

by Bo Shen

[permalink] [raw]
Subject: [PATCH 3/3] arm: atmel: at91sam9n12: correct pin number of gpio-key

correct pin number of gpio-key for at91sam9n12ek board
the pioB4 is connect to LED, the pioB3 use as gpio-key

Signed-off-by: Bo Shen <[email protected]>

---
arch/arm/boot/dts/at91sam9n12ek.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts b/arch/arm/boot/dts/at91sam9n12ek.dts
index 3acac62..9f4c601 100644
--- a/arch/arm/boot/dts/at91sam9n12ek.dts
+++ b/arch/arm/boot/dts/at91sam9n12ek.dts
@@ -137,7 +137,7 @@

enter {
label = "Enter";
- gpios = <&pioB 4 GPIO_ACTIVE_LOW>;
+ gpios = <&pioB 3 GPIO_ACTIVE_LOW>;
linux,code = <28>;
gpio-key,wakeup;
};
--
1.7.9.5

2013-07-10 09:55:00

by Bo Shen

[permalink] [raw]
Subject: [PATCH 1/3] arm: atmel: at91sam9n12: add pinctrl of TWI

add pinctrl of TWI for at91sam9n12 SoC

Signed-off-by: Bo Shen <[email protected]>
---
arch/arm/boot/dts/at91sam9n12.dtsi | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
index bb7f564..3db62f6 100644
--- a/arch/arm/boot/dts/at91sam9n12.dtsi
+++ b/arch/arm/boot/dts/at91sam9n12.dtsi
@@ -291,6 +291,22 @@
};
};

+ i2c0 {
+ pinctrl_i2c0: i2c0-0 {
+ atmel,pins =
+ <AT91_PIOA 30 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA30 periph A I2C0 data */
+ AT91_PIOA 31 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PA31 periph A I2C0 clock */
+ };
+ };
+
+ i2c1 {
+ pinctrl_i2c1: i2c1-0 {
+ atmel,pins =
+ <AT91_PIOC 0 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC0 periph C I2C1 data */
+ AT91_PIOC 1 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PC1 periph C I2C1 clock */
+ };
+ };
+
tcb0 {
pinctrl_tcb0_tclk0: tcb0_tclk0-0 {
atmel,pins = <AT91_PIOA 24 AT91_PERIPH_A AT91_PINCTRL_NONE>;
@@ -471,6 +487,8 @@
dma-names = "tx", "rx";
#address-cells = <1>;
#size-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c0>;
status = "disabled";
};

@@ -483,6 +501,8 @@
dma-names = "tx", "rx";
#address-cells = <1>;
#size-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c1>;
status = "disabled";
};

--
1.7.9.5

Subject: Re: [PATCH 2/3] arm: atmel: at91sam9n12: add qt1070 support

On 17:51 Wed 10 Jul , Bo Shen wrote:
> add qt1070 support on at91sam9n12ek board
>
> Signed-off-by: Bo Shen <[email protected]>
> ---
> arch/arm/boot/dts/at91sam9n12ek.dts | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts b/arch/arm/boot/dts/at91sam9n12ek.dts
> index d59b70c..3acac62 100644
> --- a/arch/arm/boot/dts/at91sam9n12ek.dts
> +++ b/arch/arm/boot/dts/at91sam9n12ek.dts
> @@ -40,6 +40,15 @@
>
> i2c0: i2c@f8010000 {
> status = "okay";
> +
> + qt1070: keyboard@1b {
> + compatible = "qt1070";
> + reg = <0x1b>;
> + interrupt-parent = <&pioA>;
> + interrupts = <2 0x0>;
use the macro
> + pinctrl-names = "default";
> + pinctrl-0 = <&pinctrl_qt1070_irq>;
> + };
> };
>
> i2c1: i2c@f8014000 {
> @@ -66,6 +75,13 @@
> <AT91_PIOA 7 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>; /* PA7 gpio CD pin pull up and deglitch */
> };
> };
> +
> + qt1070 {
> + pinctrl_qt1070_irq: qt1070_irq {
> + atmel,pins =
> + <AT91_PIOA 2 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>; /* PA2 GPIO with pull up deglith */
drop the comment as we use macro
> + };
> + };
> };
>
> spi0: spi@f0000000 {
> --

Best Regards,
J.

Subject: Re: [PATCH 1/3] arm: atmel: at91sam9n12: add pinctrl of TWI

On 17:51 Wed 10 Jul , Bo Shen wrote:
> add pinctrl of TWI for at91sam9n12 SoC
>
> Signed-off-by: Bo Shen <[email protected]>
> ---
> arch/arm/boot/dts/at91sam9n12.dtsi | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
> index bb7f564..3db62f6 100644
> --- a/arch/arm/boot/dts/at91sam9n12.dtsi
> +++ b/arch/arm/boot/dts/at91sam9n12.dtsi
> @@ -291,6 +291,22 @@
> };
> };
>
> + i2c0 {
> + pinctrl_i2c0: i2c0-0 {
> + atmel,pins =
> + <AT91_PIOA 30 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA30 periph A I2C0 data */
> + AT91_PIOA 31 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PA31 periph A I2C0 clock */
> + };
> + };
> +
> + i2c1 {
> + pinctrl_i2c1: i2c1-0 {
> + atmel,pins =
> + <AT91_PIOC 0 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC0 periph C I2C1 data */
> + AT91_PIOC 1 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PC1 periph C I2C1 clock */
drop the comment as we use macro
> + };
> + };
> +
> tcb0 {
> pinctrl_tcb0_tclk0: tcb0_tclk0-0 {
> atmel,pins = <AT91_PIOA 24 AT91_PERIPH_A AT91_PINCTRL_NONE>;
> @@ -471,6 +487,8 @@
> dma-names = "tx", "rx";
> #address-cells = <1>;
> #size-cells = <0>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&pinctrl_i2c0>;
> status = "disabled";
> };
>
> @@ -483,6 +501,8 @@
> dma-names = "tx", "rx";
> #address-cells = <1>;
> #size-cells = <0>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&pinctrl_i2c1>;
> status = "disabled";
> };
>
> --
> 1.7.9.5
>

2013-07-11 01:23:27

by Bo Shen

[permalink] [raw]
Subject: Re: [PATCH 2/3] arm: atmel: at91sam9n12: add qt1070 support

Hi J,

On 7/10/2013 22:38, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 17:51 Wed 10 Jul , Bo Shen wrote:
>> add qt1070 support on at91sam9n12ek board
>>
>> Signed-off-by: Bo Shen <[email protected]>
>> ---
>> arch/arm/boot/dts/at91sam9n12ek.dts | 16 ++++++++++++++++
>> 1 file changed, 16 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts b/arch/arm/boot/dts/at91sam9n12ek.dts
>> index d59b70c..3acac62 100644
>> --- a/arch/arm/boot/dts/at91sam9n12ek.dts
>> +++ b/arch/arm/boot/dts/at91sam9n12ek.dts
>> @@ -40,6 +40,15 @@
>>
>> i2c0: i2c@f8010000 {
>> status = "okay";
>> +
>> + qt1070: keyboard@1b {
>> + compatible = "qt1070";
>> + reg = <0x1b>;
>> + interrupt-parent = <&pioA>;
>> + interrupts = <2 0x0>;
> use the macro

Thanks, I will use macro here.

>> + pinctrl-names = "default";
>> + pinctrl-0 = <&pinctrl_qt1070_irq>;
>> + };
>> };
>>
>> i2c1: i2c@f8014000 {
>> @@ -66,6 +75,13 @@
>> <AT91_PIOA 7 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>; /* PA7 gpio CD pin pull up and deglitch */
>> };
>> };
>> +
>> + qt1070 {
>> + pinctrl_qt1070_irq: qt1070_irq {
>> + atmel,pins =
>> + <AT91_PIOA 2 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>; /* PA2 GPIO with pull up deglith */
> drop the comment as we use macro

OK, I will drop the comment

>> + };
>> + };
>> };
>>
>> spi0: spi@f0000000 {
>> --
>
> Best Regards,
> J.
>

Best Regards,
Bo Shen

2013-07-11 01:23:36

by Bo Shen

[permalink] [raw]
Subject: Re: [PATCH 1/3] arm: atmel: at91sam9n12: add pinctrl of TWI

Hi J,

On 7/10/2013 22:39, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 17:51 Wed 10 Jul , Bo Shen wrote:
>> add pinctrl of TWI for at91sam9n12 SoC
>>
>> Signed-off-by: Bo Shen <[email protected]>
>> ---
>> arch/arm/boot/dts/at91sam9n12.dtsi | 20 ++++++++++++++++++++
>> 1 file changed, 20 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
>> index bb7f564..3db62f6 100644
>> --- a/arch/arm/boot/dts/at91sam9n12.dtsi
>> +++ b/arch/arm/boot/dts/at91sam9n12.dtsi
>> @@ -291,6 +291,22 @@
>> };
>> };
>>
>> + i2c0 {
>> + pinctrl_i2c0: i2c0-0 {
>> + atmel,pins =
>> + <AT91_PIOA 30 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA30 periph A I2C0 data */
>> + AT91_PIOA 31 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PA31 periph A I2C0 clock */
>> + };
>> + };
>> +
>> + i2c1 {
>> + pinctrl_i2c1: i2c1-0 {
>> + atmel,pins =
>> + <AT91_PIOC 0 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC0 periph C I2C1 data */
>> + AT91_PIOC 1 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PC1 periph C I2C1 clock */
> drop the comment as we use macro

Thanks, I will drop the comment.

>> + };
>> + };
>> +
>> tcb0 {
>> pinctrl_tcb0_tclk0: tcb0_tclk0-0 {
>> atmel,pins = <AT91_PIOA 24 AT91_PERIPH_A AT91_PINCTRL_NONE>;
>> @@ -471,6 +487,8 @@
>> dma-names = "tx", "rx";
>> #address-cells = <1>;
>> #size-cells = <0>;
>> + pinctrl-names = "default";
>> + pinctrl-0 = <&pinctrl_i2c0>;
>> status = "disabled";
>> };
>>
>> @@ -483,6 +501,8 @@
>> dma-names = "tx", "rx";
>> #address-cells = <1>;
>> #size-cells = <0>;
>> + pinctrl-names = "default";
>> + pinctrl-0 = <&pinctrl_i2c1>;
>> status = "disabled";
>> };
>>
>> --
>> 1.7.9.5
>>

Best Regards,
Bo Shen