Device Tree configuration for I2C-Multiplexer and its Clients

Herzig, Christian Christian.Herzig at keymile.com
Tue Aug 18 18:31:38 EST 2009


Hi listmembers!

I'm working on a MPC8360 (powerpc) based target. I'd like to implement
the facility loading drivers for clients behind a I2C multiplexer. 
A driver for the I2C multiplexer family PCA954x is already written by
Rodolfo Giometti.

Let's assume, my hardware looks like that:

                                   ------  ------
                                   |LM75|  |AT24|
                                   |    |  |    |
                       PCA9542     |0x48|  |0x50|
     MPC8360          ---------    ------  -----
    ---------         | MUX   |   2   |      |
    |       |     2   |      0|--/------------
    | I2C-0 |----/----|       |   2
    |       |         |      1|--/------------
    ---------         | 0x70  |              |
                      ---------            ------
                                           |AT24|
                                           |    |
                                           |0x50|
                                           ------

Describing hardware in the traditional style isn't possible any more:


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:

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, pca9547";
                reg = <0x70>;
		
		/* and now the clients behind the multiplexer: */

                /* channel 0 */
                0-dtt at 48 {
                        mux-channel = <0>;
                        compatible = "national, lm75";
                        reg = <0x48>;
                }	
		0-at24 at 50 {
                        mux-channel = <0>;
                        compatible = "atmel, at24c08";
		        reg = <0x50>;
                }

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

maybe that's absolute nonsense. I'd like to obtain other opinions and
suggestions.

Christian


More information about the devicetree-discuss mailing list