diff mbox

[RFC,9/9] dts: tegra: WIP: hack dts to test new dt flags for i2c

Message ID 1437142109-31975-10-git-send-email-wsa@the-dreams.de
State Not Applicable, archived
Headers show

Commit Message

Wolfram Sang July 17, 2015, 2:08 p.m. UTC
Not-Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
 arch/arm/boot/dts/tegra124-jetson-tk1.dts | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Wolfram Sang July 17, 2015, 2:11 p.m. UTC | #1
> +			//FIXME: Should be I2C_OWN_SLAVE_ADDRESS | 0x42
> +			reg = <0xc0000042>;

That should have been 0x40000042, sorry!
Andrey Danin July 20, 2015, 7:28 a.m. UTC | #2
On 17.07.2015 17:08, Wolfram Sang wrote:
> +
> +		eeprom@42 {
> +			compatible = "linux,slave-24c02";
> +			//FIXME: Should be I2C_OWN_SLAVE_ADDRESS | 0x42
> +			reg = <0xc0000042>;

I used it in this way:
reg = <(I2C_OWN_SLAVE_ADDRESS | 0x42)>;

> +		};
>   	};
>
>   	/* Expansion GEN2_I2C_* */
>

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Laurent Pinchart July 20, 2015, 7:53 a.m. UTC | #3
Hi Wolfram,

Thank you for the patch.

On Friday 17 July 2015 16:08:29 Wolfram Sang wrote:
> Not-Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> ---
>  arch/arm/boot/dts/tegra124-jetson-tk1.dts | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/tegra124-jetson-tk1.dts
> b/arch/arm/boot/dts/tegra124-jetson-tk1.dts index
> bd43ed6d6ec7c0..4d5f2a4c4da1ce 100644
> --- a/arch/arm/boot/dts/tegra124-jetson-tk1.dts
> +++ b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
> @@ -1,5 +1,6 @@
>  /dts-v1/;
> 
> +#include <dt-bindings/i2c/i2c.h>
>  #include <dt-bindings/input/input.h>
>  #include "tegra124.dtsi"
> 
> @@ -1390,6 +1391,12 @@
>  			reg = <0x56>;
>  			pagesize = <8>;
>  		};
> +
> +		eeprom@42 {
> +			compatible = "linux,slave-24c02";
> +			//FIXME: Should be I2C_OWN_SLAVE_ADDRESS | 0x42
> +			reg = <0xc0000042>;

The node name doesn't match the reg property anymore. Isn't that considered as 
a problem ?

> +		};
>  	};
> 
>  	/* Expansion GEN2_I2C_* */
Wolfram Sang July 20, 2015, 8:45 a.m. UTC | #4
> > +
> > +		eeprom@42 {
> > +			compatible = "linux,slave-24c02";
> > +			//FIXME: Should be I2C_OWN_SLAVE_ADDRESS | 0x42
> > +			reg = <0xc0000042>;
> 
> The node name doesn't match the reg property anymore. Isn't that considered as 
> a problem ?

Hmm, true. So far, Rob (CCed) was fine with this approach:
http://www.spinics.net/lists/linux-tegra/msg22760.html

@Rob: If we introduce flag bits in the MSBs of an I2C address, the reg
property is different from the node name. Is this a problem?

Thanks,

   Wolfram
Wolfram Sang July 20, 2015, 9:03 a.m. UTC | #5
> >+			//FIXME: Should be I2C_OWN_SLAVE_ADDRESS | 0x42
> >+			reg = <0xc0000042>;
> 
> I used it in this way:
> reg = <(I2C_OWN_SLAVE_ADDRESS | 0x42)>;

Ah, nice, it was that easy :) Thanks!
Rob Herring July 20, 2015, 4:10 p.m. UTC | #6
On Mon, Jul 20, 2015 at 3:45 AM, Wolfram Sang <wsa@the-dreams.de> wrote:
>
>> > +
>> > +           eeprom@42 {
>> > +                   compatible = "linux,slave-24c02";
>> > +                   //FIXME: Should be I2C_OWN_SLAVE_ADDRESS | 0x42
>> > +                   reg = <0xc0000042>;
>>
>> The node name doesn't match the reg property anymore. Isn't that considered as
>> a problem ?
>
> Hmm, true. So far, Rob (CCed) was fine with this approach:
> http://www.spinics.net/lists/linux-tegra/msg22760.html
>
> @Rob: If we introduce flag bits in the MSBs of an I2C address, the reg
> property is different from the node name. Is this a problem?

No, I don't it is a problem.

Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stephen Warren July 20, 2015, 10:09 p.m. UTC | #7
On 07/20/2015 10:10 AM, Rob Herring wrote:
> On Mon, Jul 20, 2015 at 3:45 AM, Wolfram Sang <wsa@the-dreams.de> wrote:
>>
>>>> +
>>>> +           eeprom@42 {
>>>> +                   compatible = "linux,slave-24c02";
>>>> +                   //FIXME: Should be I2C_OWN_SLAVE_ADDRESS | 0x42
>>>> +                   reg = <0xc0000042>;
>>>
>>> The node name doesn't match the reg property anymore. Isn't that considered as
>>> a problem ?
>>
>> Hmm, true. So far, Rob (CCed) was fine with this approach:
>> http://www.spinics.net/lists/linux-tegra/msg22760.html
>>
>> @Rob: If we introduce flag bits in the MSBs of an I2C address, the reg
>> property is different from the node name. Is this a problem?
>
> No, I don't it is a problem.

The rule so far has been that the unit address (the value in the node 
name) must match the first value in the reg property. I don't see why 
this rule should change. To solve this, just name the node 
eeprom@c0000042 (or eeprom@40000042 with the correction pointed out 
earlier in the thread).
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Wolfram Sang July 21, 2015, 6:55 a.m. UTC | #8
> >>@Rob: If we introduce flag bits in the MSBs of an I2C address, the reg
> >>property is different from the node name. Is this a problem?
> >
> >No, I don't it is a problem.
> 
> The rule so far has been that the unit address (the value in the node name)
> must match the first value in the reg property. I don't see why this rule
> should change. To solve this, just name the node eeprom@c0000042 (or
> eeprom@40000042 with the correction pointed out earlier in the thread).

We can do that; that would mean that people need to find out the values
of the #define which will be used in the reg property. It works, but
will be cumbersome IMO.
diff mbox

Patch

diff --git a/arch/arm/boot/dts/tegra124-jetson-tk1.dts b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
index bd43ed6d6ec7c0..4d5f2a4c4da1ce 100644
--- a/arch/arm/boot/dts/tegra124-jetson-tk1.dts
+++ b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
@@ -1,5 +1,6 @@ 
 /dts-v1/;
 
+#include <dt-bindings/i2c/i2c.h>
 #include <dt-bindings/input/input.h>
 #include "tegra124.dtsi"
 
@@ -1390,6 +1391,12 @@ 
 			reg = <0x56>;
 			pagesize = <8>;
 		};
+
+		eeprom@42 {
+			compatible = "linux,slave-24c02";
+			//FIXME: Should be I2C_OWN_SLAVE_ADDRESS | 0x42
+			reg = <0xc0000042>;
+		};
 	};
 
 	/* Expansion GEN2_I2C_* */