FDT bindings for I2C devices

Grant Likely grant.likely at secretlab.ca
Sat Oct 20 00:38:09 EST 2007


On 10/19/07, Wolfgang Grandegger <wg at grandegger.com> wrote:
> Hello,
>
> is it forseen to define and configure devices like RTC, temperature
> sensors or EEPROM on the I2C bus with the Flat Device Tree? If yes, how
> would the DTS entries look like?

booting-without-of.txt has some information about describing the controller.

Scott Wood made an attempt at defining a device binding for I2C
devices, but it has not been merged into booting-without-of.txt yet.
I've copied what he wrote below.  I would add to his definition the
following:
- If compatible is missing, driver should *not* fall back to the device name.
- 'compatible' list should include the exact device in the form "<mfg>,<part>"

Cheers,
g.

Here's the thread and an excerpt from Scott's original post:

http://patchwork.ozlabs.org/linuxppc/patch?id=11223

+   e2) I2C Devices
+
+   Required properties :
+
+    - reg : Unshifted 7-bit I2C address for the device
+
+   Recommended properties :
+
+    - compatible : The name of the Linux device driver that
+      handles this device.  If unspecified, the name of the
+      node will be used.
+    - interrupts : <a b> where a is the interrupt number and b is a
+      field that represents an encoding of the sense and level
+      information for the interrupt.  This should be encoded based on
+      the information in section 2) depending on the type of interrupt
+      controller you have.
+    - interrupt-parent : the phandle for the interrupt controller that
+      services interrupts for this device.
+
+   Example :
+
+       rtc at 68 {
+               device_type = "rtc";
+               compatible = "ds1374";
+               reg = <68>;
+               interrupts = <13 8>;
+               interrupt-parent = <700>;
+       };

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195


More information about the Linuxppc-embedded mailing list