On Thu, May 28, 2009 at 6:17 AM, Dmitry Eremin-Solenikov
<[email protected]> wrote:
> David Miller wrote:
>
>> From: Russell King - ARM Linux
>> <[email protected]> Date: Thu, 28 May 2009
>> 10:15:13 +0100
>>
>>> For example, how would an IrDA transceiver be expressed in OF?
>>
>> As a child device node of the IRDA device, with associated properties.
>>
>> You can express _ANYTHING_ using the OF device tree.  It is not even
>> something to discuss, it's flexible enough.
>
> Hmmm. How to express the following situation:
> On one of my platforms (sharp tosa) the backlight controller
> is separated into two parts: one sitting on SPI, one on the I2C.
> The tricky part is that the I2C part is only available when some
> of registers of SPI part are programmed in a specific way.

Perhaps something like this (in dts format):

s...@[someaddress] {
        #size-cells = <0>;
        #address-cells = <1>;
        compatible = "name-of-spi-bus-device";
        reg = <[someaddress] [size]>;
        backlight-spi: backli...@5 {
                compatible = "sharp,backlight-spi";
                reg = <5>;  /* CS line # 5 */
        }
}

i...@[anotheraddress] {
        #size-cells = <0>;
        #address-cells = <1>;
        compatible = "name-of-i2c-bus-device";
        reg = <[anotheraddress] [size]>;
        backli...@30 {
                compatible = "sharp,backlight-i2c";
                reg = <30>;
                spi-interface-phandle = < &backlight-spi >;
        }
}

Two nodes are used to describe the device and a "phandle" is used to
link them.  A device driver probe could be triggered (bind) against
the i2c half of the device and follow the phandle to get the rest of
the description.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
_______________________________________________
devicetree-discuss mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/devicetree-discuss

Reply via email to