FDT/OFW GPIO bus

Luiz Otavio O Souza loos.br at gmail.com
Tue Feb 11 19:10:19 UTC 2014


On Feb 7, 2014, at 1:21 AM, Warner Losh wrote:
> 
> On Feb 6, 2014, at 11:53 AM, Luiz Otavio O Souza wrote:
[…]
>> 
>> gpioiic(4) devices can be described in DTS as follow:
>> 
>>               gpio {
>> 
>>                       gpioiic {
>>                               compatible = "gpioiic";
> 
> Linux uses 'i2c-gpio' here. Can we follow that standard rather than invent our own? Or at least support both?

Sure, no problem.

> 
>>                               gpios = <&gpio 17 2 0
>>                                        &gpio 21 2 0>;
>>                               scl = <0>;
>>                               sda = <1>;
> 
> Linux doesn't have these at all, it seems, since they are implicit in the gpios property. It would be ideal if the scl and sda properties were optional…

They are optional and only needed when you want to change the default setting (scl = 0 and sda = 1 - yes, in this example they are just a no op).

> 
> In addition, you'll often see things like:
> 
>  i2c-gpio,sda-open-drain;
>  i2c-gpio,scl-open-drain;
>  i2c-gpio,delay-us = <2>;
> 
> as well. These should be easy enough to add and shouldn't gate things.

Right, ATM gpioiic(4) is coded as an open collector/drain for both SCL and SDA as per standard. The delay option should be added.

> 
> There's also many DTS files that don't have this as a direct child of gpio... But that's not strictly required. I'll cope with adding support for that when I get the Atmel stuff working...
> 
>>                               lm750 {
>>                                       compatible = "lm75";
>>                                       i2c-address = <0x4b>;
>>                               };
>>                               lm751 {
>>                                       compatible = "lm75";
>>                                       i2c-address = <0x4f>;
>>                               };
>>                       };
>> 		};

I see. I found a DTS from Atmel and i’ll add support for that.

Thank you for point that out.

Luiz


More information about the freebsd-arm mailing list