Device Tree configuration for I2C-Multiplexer and its Clients

Grant Likely grant.likely at secretlab.ca
Fri Aug 21 01:27:07 EST 2009


On Tue, Aug 18, 2009 at 2:31 AM, Herzig,
Christian<Christian.Herzig at keymile.com> wrote:
> i2c at 3000 {
>        #address-cells = <1>;
>        #size-cells = <0>;
>        cell-index = <0>;
>        compatible = "fsl-i2c";
>        reg = <0x3000 0x100>;
>        interrupts = <43 2>;
>        interrupt-parent = <&mpic>;
>        dfsrr;
>
>        mux at 70 {
>                #address-cells = <1>;
>                #size-cells = <0>;
>                compatible = "philips, pca9542";
>                reg = <0x70>;
>
>                /* and now the clients behind the multiplexer: */
>
>                /* channel 0 */
>                dtt at 48 {
>                        compatible = "national, lm75";
>                        reg = <0x48>;
>                };
>                at24 at 50 {
>                        compatible = "atmel, at24c08";
>                        reg = <0x50>;
>                };
>
>                /* channel 1 */
>                at24 at 50 {
>                        compatible = "atmel, at24c08";
>                        reg = <0x50>;
>                };
>        };
> };
>
> That can't work for reasons of naming and allocation. My proposal to
> describe the hardware:

It looks to me like you should be using this form:

    mux at 70 {
            #address-cells = <2>;   /* Note this change */
            #size-cells = <0>;
            compatible = "philips, pca9542";
            reg = <0x70>;

            /* and now the clients behind the multiplexer: */

            /* channel 0 */
            dtt at 0,48 {
                    compatible = "national,lm75";
                    reg = < 0 0x48 >; /* now reg is specified with 2 cells */
            };
            at24 at 0,50 {
                    compatible = "atmel,at24c08";
                    reg = < 0 0x50 >;
            };

            /* channel 1 */
            at24 at 1,50 {
                    compatible = "atmel,at24c08";
                    reg = < 1 0x50 >;
            };
    };


More information about the devicetree-discuss mailing list