Re: [RFC] [PATCH] Device Tree on ARM platform

From: Grant Likely
Date: Thu May 28 2009 - 10:14:14 EST


On Thu, May 28, 2009 at 6:17 AM, Dmitry Eremin-Solenikov
<dbaryshkov@xxxxxxxxx> wrote:
> David Miller wrote:
>
>> From: Russell King - ARM Linux
>> <linux@xxxxxxxxxxxxxxxx> 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):

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

i2c@[anotheraddress] {
#size-cells = <0>;
#address-cells = <1>;
compatible = "name-of-i2c-bus-device";
reg = <[anotheraddress] [size]>;
backlight@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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/