2012-08-03 12:38:12

by Sourav Poddar

[permalink] [raw]
Subject: [PATCH 0/4] Add device tree data for omap5

The following patch series add i2c support for omap5.
As well as enable I2C based devices like pressure and temperature
through device tree. Also add onchip keypad dts data.

Cc: Benoit Cousson <[email protected]>
Cc: Felipe Balbi <[email protected]>
Cc: Santosh Shilimkar <[email protected]>

Sourav Poddar (4):
arm/dts: omap5-evm: Add I2C support
arm/dts: omap5-evm: Add tmp102 sensor support
arm/dts: omap5-evm: Add keypad data
arm/dts: omap5-evm: Add bmp085 sensor support

arch/arm/boot/dts/omap5-evm.dts | 30 +++++++++++++++++++++++++++++
arch/arm/boot/dts/omap5.dtsi | 40 +++++++++++++++++++++++++++++++++++++++
2 files changed, 70 insertions(+), 0 deletions(-)


2012-08-03 12:38:16

by Sourav Poddar

[permalink] [raw]
Subject: [PATCH 1/4] arm/dts: omap5-evm: Add I2C support

Add I2C data node in omap5 device tree file.

Tested on omap5430 sdp.

Cc: Benoit Cousson <[email protected]>
Cc: Felipe Balbi <[email protected]>
Cc: Santosh Shilimkar <[email protected]>
Acked-by: Felipe Balbi <[email protected]>
Signed-off-by: Sourav Poddar <[email protected]>
---
arch/arm/boot/dts/omap5.dtsi | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 57e5270..6b68dfe 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -145,6 +145,41 @@
#interrupt-cells = <1>;
};

+ i2c1: i2c@48070000 {
+ compatible = "ti,omap4-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ ti,hwmods = "i2c1";
+ };
+
+ i2c2: i2c@48072000 {
+ compatible = "ti,omap4-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ ti,hwmods = "i2c2";
+ };
+
+ i2c3: i2c@48060000 {
+ compatible = "ti,omap4-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ ti,hwmods = "i2c3";
+ };
+
+ i2c4: i2c@4807A000 {
+ compatible = "ti,omap4-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ ti,hwmods = "i2c4";
+ };
+
+ i2c5: i2c@4807C000 {
+ compatible = "ti,omap4-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ ti,hwmods = "i2c5";
+ };
+
uart1: serial@4806a000 {
compatible = "ti,omap4-uart";
ti,hwmods = "uart1";
--
1.7.1

2012-08-03 12:38:22

by Sourav Poddar

[permalink] [raw]
Subject: [PATCH 4/4] arm/dts: omap5-evm: Add bmp085 sensor support

Add bmp085 pressure sensor data in omap5 evm dts file.

Tested on omap5430 sdp with 3.5 custom kernel.

Cc: Benoit Cousson <[email protected]>
Cc: Felipe Balbi <[email protected]>
Cc: Santosh Shilimkar <[email protected]>
Acked-by: Felipe Balbi <[email protected]>
Signed-off-by: Sourav Poddar <[email protected]>
---
arch/arm/boot/dts/omap5-evm.dts | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap5-evm.dts b/arch/arm/boot/dts/omap5-evm.dts
index 09fe941..956eba0 100644
--- a/arch/arm/boot/dts/omap5-evm.dts
+++ b/arch/arm/boot/dts/omap5-evm.dts
@@ -39,3 +39,12 @@
reg = <0x48>;
};
};
+
+&i2c2 {
+ clock-frequency = <400000>;
+
+ bmp085@77 {
+ compatible = "bosch,bmp085";
+ reg = <0x77>;
+ };
+};
--
1.7.1

2012-08-03 12:38:25

by Sourav Poddar

[permalink] [raw]
Subject: [PATCH 3/4] arm/dts: omap5-evm: Add keypad data

Add keypad data node in omap5 device tree file.
Also fill the device tree binding parameters
with the required value in "omap5-evm" dts file.

Tested on omap5430 evm with 3.5 custom kernel.

Cc: Benoit Cousson <[email protected]>
Cc: Felipe Balbi <[email protected]>
Cc: Santosh Shilimkar <[email protected]>
Acked-by: Felipe Balbi <[email protected]>
Signed-off-by: Sourav Poddar <[email protected]>
---
arch/arm/boot/dts/omap5-evm.dts | 12 ++++++++++++
arch/arm/boot/dts/omap5.dtsi | 5 +++++
2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap5-evm.dts b/arch/arm/boot/dts/omap5-evm.dts
index 45a8aeb..09fe941 100644
--- a/arch/arm/boot/dts/omap5-evm.dts
+++ b/arch/arm/boot/dts/omap5-evm.dts
@@ -17,6 +17,18 @@
device_type = "memory";
reg = <0x80000000 0x40000000>; /* 1 GB */
};
+
+ keypad {
+ keypad,num-rows = <8>;
+ keypad,num-columns = <8>;
+ linux,keymap = < 0x02020073
+ 0x02030072
+ 0x020400e7
+ 0x02050066
+ 0x0206006b
+ 0x020700d9 >;
+ linux,input-no-autorepeat;
+ };
};

&i2c4 {
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 6b68dfe..c38b823 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -216,4 +216,9 @@
clock-frequency = <48000000>;
};
};
+
+ keypad {
+ compatible = "ti,omap4-keypad";
+ ti,hwmods = "kbd";
+ };
};
--
1.7.1

2012-08-03 12:38:58

by Sourav Poddar

[permalink] [raw]
Subject: [PATCH 2/4] arm/dts: omap5-evm: Add tmp102 sensor support

Add tmp102 temperature sensor data in omap5 evm dts file.

Tested on omap5430 sdp with 3.5 custom kernel.

Cc: Benoit Cousson <[email protected]>
Cc: Felipe Balbi <[email protected]>
Cc: Santosh Shilimkar <[email protected]>
Acked-by: Felipe Balbi <[email protected]>
Signed-off-by: Sourav Poddar <[email protected]>
---
arch/arm/boot/dts/omap5-evm.dts | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap5-evm.dts b/arch/arm/boot/dts/omap5-evm.dts
index 200c39a..45a8aeb 100644
--- a/arch/arm/boot/dts/omap5-evm.dts
+++ b/arch/arm/boot/dts/omap5-evm.dts
@@ -18,3 +18,12 @@
reg = <0x80000000 0x40000000>; /* 1 GB */
};
};
+
+&i2c4 {
+ clock-frequency = <400000>;
+
+ tmp102@48{
+ compatible = "ti,tmp102";
+ reg = <0x48>;
+ };
+};
--
1.7.1

2012-08-03 12:50:19

by Koen Kooi

[permalink] [raw]
Subject: Re: [PATCH 3/4] arm/dts: omap5-evm: Add keypad data


Op 3 aug. 2012, om 14:38 heeft Sourav Poddar <[email protected]> het volgende geschreven:

> Add keypad data node in omap5 device tree file.
> Also fill the device tree binding parameters
> with the required value in "omap5-evm" dts file.
>
> Tested on omap5430 evm with 3.5 custom kernel.
>
> Cc: Benoit Cousson <[email protected]>
> Cc: Felipe Balbi <[email protected]>
> Cc: Santosh Shilimkar <[email protected]>
> Acked-by: Felipe Balbi <[email protected]>
> Signed-off-by: Sourav Poddar <[email protected]>
> ---
> arch/arm/boot/dts/omap5-evm.dts | 12 ++++++++++++
> arch/arm/boot/dts/omap5.dtsi | 5 +++++
> 2 files changed, 17 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/boot/dts/omap5-evm.dts b/arch/arm/boot/dts/omap5-evm.dts
> index 45a8aeb..09fe941 100644
> --- a/arch/arm/boot/dts/omap5-evm.dts
> +++ b/arch/arm/boot/dts/omap5-evm.dts
> @@ -17,6 +17,18 @@
> device_type = "memory";
> reg = <0x80000000 0x40000000>; /* 1 GB */
> };
> +
> + keypad {
> + keypad,num-rows = <8>;
> + keypad,num-columns = <8>;
> + linux,keymap = < 0x02020073
> + 0x02030072
> + 0x020400e7
> + 0x02050066
> + 0x0206006b
> + 0x020700d9 >;
> + linux,input-no-autorepeat;
> + };

This not a criticism on your patch, but a generic question about DT: Is there no way to have nice constants for keys like we have in the kernel, like KEY_POWER, KEY_UP, etc? If no, does DT allow comments so I can look at a dts and see which keycodes are mapped instead of having to dig up the sources?

regards,

Koen-

2012-08-03 13:06:08

by Sourav Poddar

[permalink] [raw]
Subject: Re: [PATCH 3/4] arm/dts: omap5-evm: Add keypad data

Hi,

On Fri, Aug 3, 2012 at 6:20 PM, Koen Kooi <[email protected]> wrote:
>
> Op 3 aug. 2012, om 14:38 heeft Sourav Poddar <[email protected]> het volgende geschreven:
>
>> Add keypad data node in omap5 device tree file.
>> Also fill the device tree binding parameters
>> with the required value in "omap5-evm" dts file.
>>
>> Tested on omap5430 evm with 3.5 custom kernel.
>>
>> Cc: Benoit Cousson <[email protected]>
>> Cc: Felipe Balbi <[email protected]>
>> Cc: Santosh Shilimkar <[email protected]>
>> Acked-by: Felipe Balbi <[email protected]>
>> Signed-off-by: Sourav Poddar <[email protected]>
>> ---
>> arch/arm/boot/dts/omap5-evm.dts | 12 ++++++++++++
>> arch/arm/boot/dts/omap5.dtsi | 5 +++++
>> 2 files changed, 17 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/omap5-evm.dts b/arch/arm/boot/dts/omap5-evm.dts
>> index 45a8aeb..09fe941 100644
>> --- a/arch/arm/boot/dts/omap5-evm.dts
>> +++ b/arch/arm/boot/dts/omap5-evm.dts
>> @@ -17,6 +17,18 @@
>> device_type = "memory";
>> reg = <0x80000000 0x40000000>; /* 1 GB */
>> };
>> +
>> + keypad {
>> + keypad,num-rows = <8>;
>> + keypad,num-columns = <8>;
>> + linux,keymap = < 0x02020073
>> + 0x02030072
>> + 0x020400e7
>> + 0x02050066
>> + 0x0206006b
>> + 0x020700d9 >;
>> + linux,input-no-autorepeat;
>> + };
>
> This not a criticism on your patch, but a generic question about DT: Is there no way to have nice constants for keys like we have in the kernel, like KEY_POWER, KEY_UP, etc?
There is way, something like this ..
key_C {
keypad,row = <2>;
keypad,column = <1>;
linux,code = <46>;
};
But its not the preferred approach mainly because of the fact that
it is too big. So suppose, if we have 100 key codes, we will have
400 -500 lines of code in our dts file for the mapping only.
If no, does DT allow comments so I can look at a dts and see which
keycodes are mapped instead of having to dig up the sources?
Yes, comments are allowed and seems to be better option to do.

~Sourav
>
> regards,
>
> Koen

2012-08-03 17:23:58

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH 1/4] arm/dts: omap5-evm: Add I2C support

Hello.

On 08/03/2012 04:38 PM, Sourav Poddar wrote:

> Add I2C data node in omap5 device tree file.

> Tested on omap5430 sdp.

> Cc: Benoit Cousson <[email protected]>
> Cc: Felipe Balbi <[email protected]>
> Cc: Santosh Shilimkar <[email protected]>
> Acked-by: Felipe Balbi <[email protected]>
> Signed-off-by: Sourav Poddar <[email protected]>
> ---
> arch/arm/boot/dts/omap5.dtsi | 35 +++++++++++++++++++++++++++++++++++
> 1 files changed, 35 insertions(+), 0 deletions(-)

> diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
> index 57e5270..6b68dfe 100644
> --- a/arch/arm/boot/dts/omap5.dtsi
> +++ b/arch/arm/boot/dts/omap5.dtsi
> @@ -145,6 +145,41 @@
> #interrupt-cells = <1>;
> };
>
> + i2c1: i2c@48070000 {
> + compatible = "ti,omap4-i2c";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + ti,hwmods = "i2c1";

Address postfix in the node name and no "reg" property?

WBR, Sergei

2012-08-06 08:42:21

by Felipe Balbi

[permalink] [raw]
Subject: Re: [PATCH 1/4] arm/dts: omap5-evm: Add I2C support

Hi,

On Fri, Aug 03, 2012 at 09:22:19PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 08/03/2012 04:38 PM, Sourav Poddar wrote:
>
> > Add I2C data node in omap5 device tree file.
>
> > Tested on omap5430 sdp.
>
> > Cc: Benoit Cousson <[email protected]>
> > Cc: Felipe Balbi <[email protected]>
> > Cc: Santosh Shilimkar <[email protected]>
> > Acked-by: Felipe Balbi <[email protected]>
> > Signed-off-by: Sourav Poddar <[email protected]>
> > ---
> > arch/arm/boot/dts/omap5.dtsi | 35 +++++++++++++++++++++++++++++++++++
> > 1 files changed, 35 insertions(+), 0 deletions(-)
>
> > diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
> > index 57e5270..6b68dfe 100644
> > --- a/arch/arm/boot/dts/omap5.dtsi
> > +++ b/arch/arm/boot/dts/omap5.dtsi
> > @@ -145,6 +145,41 @@
> > #interrupt-cells = <1>;
> > };
> >
> > + i2c1: i2c@48070000 {
> > + compatible = "ti,omap4-i2c";
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > + ti,hwmods = "i2c1";
>
> Address postfix in the node name and no "reg" property?

that's because of the ti,hwmods attribute. OMAP is still not entirely
converted to DT and there's this weird ti,hwmods attribute. OMAP's hwmod
framework will fill up register addresses, irqs, etc when the device is
created. Oh well...

--
balbi


Attachments:
(No filename) (1.28 kB)
signature.asc (836.00 B)
Digital signature
Download all attachments

2012-08-07 12:54:08

by Koen Kooi

[permalink] [raw]
Subject: Re: [PATCH 3/4] arm/dts: omap5-evm: Add keypad data


Op 3 aug. 2012, om 14:38 heeft Sourav Poddar <[email protected]> het volgende geschreven:

> Add keypad data node in omap5 device tree file.
> Also fill the device tree binding parameters
> with the required value in "omap5-evm" dts file.
>
> Tested on omap5430 evm with 3.5 custom kernel.
>
> Cc: Benoit Cousson <[email protected]>
> Cc: Felipe Balbi <[email protected]>
> Cc: Santosh Shilimkar <[email protected]>
> Acked-by: Felipe Balbi <[email protected]>
> Signed-off-by: Sourav Poddar <[email protected]>
> ---
> arch/arm/boot/dts/omap5-evm.dts | 12 ++++++++++++
> arch/arm/boot/dts/omap5.dtsi | 5 +++++
> 2 files changed, 17 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/boot/dts/omap5-evm.dts b/arch/arm/boot/dts/omap5-evm.dts
> index 45a8aeb..09fe941 100644
> --- a/arch/arm/boot/dts/omap5-evm.dts
> +++ b/arch/arm/boot/dts/omap5-evm.dts
> @@ -17,6 +17,18 @@
> device_type = "memory";
> reg = <0x80000000 0x40000000>; /* 1 GB */
> };
> +
> + keypad {
> + keypad,num-rows = <8>;
> + keypad,num-columns = <8>;
> + linux,keymap = < 0x02020073
> + 0x02030072
> + 0x020400e7
> + 0x02050066
> + 0x0206006b
> + 0x020700d9 >;
> + linux,input-no-autorepeat;
> + };

Again not a coment on your patch, but on DT:

If DT bindings must be OS independent, what then, is that linux keycode doing there?

regards,

Koen

2012-08-07 15:49:24

by Sourav Poddar

[permalink] [raw]
Subject: Re: [PATCH 3/4] arm/dts: omap5-evm: Add keypad data

Hi Koen,

On Tue, Aug 7, 2012 at 6:24 PM, Koen Kooi <[email protected]> wrote:
>
> Op 3 aug. 2012, om 14:38 heeft Sourav Poddar <[email protected]> het volgende geschreven:
>
>> Add keypad data node in omap5 device tree file.
>> Also fill the device tree binding parameters
>> with the required value in "omap5-evm" dts file.
>>
>> Tested on omap5430 evm with 3.5 custom kernel.
>>
>> Cc: Benoit Cousson <[email protected]>
>> Cc: Felipe Balbi <[email protected]>
>> Cc: Santosh Shilimkar <[email protected]>
>> Acked-by: Felipe Balbi <[email protected]>
>> Signed-off-by: Sourav Poddar <[email protected]>
>> ---
>> arch/arm/boot/dts/omap5-evm.dts | 12 ++++++++++++
>> arch/arm/boot/dts/omap5.dtsi | 5 +++++
>> 2 files changed, 17 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/omap5-evm.dts b/arch/arm/boot/dts/omap5-evm.dts
>> index 45a8aeb..09fe941 100644
>> --- a/arch/arm/boot/dts/omap5-evm.dts
>> +++ b/arch/arm/boot/dts/omap5-evm.dts
>> @@ -17,6 +17,18 @@
>> device_type = "memory";
>> reg = <0x80000000 0x40000000>; /* 1 GB */
>> };
>> +
>> + keypad {
>> + keypad,num-rows = <8>;
>> + keypad,num-columns = <8>;
>> + linux,keymap = < 0x02020073
>> + 0x02030072
>> + 0x020400e7
>> + 0x02050066
>> + 0x0206006b
>> + 0x020700d9 >;
>> + linux,input-no-autorepeat;
>> + };
>
> Again not a coment on your patch, but on DT:
>
> If DT bindings must be OS independent, what then, is that linux keycode doing there?
>
Currently, for all matrix connected keyboards the keymap are defined
in the scope of the
linux key code since that is a stable and standardized interface at this time.

For the above reason , computation of the keymap uses linux keycode

row << 24 | column << 16 | linux-key-code
I think this is the primary reason for keeping "linux" prefix with this
property.
> regards,
>
> Koen
>