openbmc / entity-manager

Run-time JSON driven system configuration manager
Other
26 stars 48 forks source link

pca9546 without fru #9

Closed feitiantutu closed 3 years ago

feitiantutu commented 3 years ago

I have a pca9546 with an address of 0x70 on my i2c2, and a tmp112 with an address of 0x49 is connected to each channel. How do I configure the json file?In dts, I configured it according to the doc document, but I don’t know how to configure the json file so that tmp112sensor corresponds to the channel aliases { i2c16 = &i2c_pe0; i2c17 = &i2c_pe1; i2c18 = &i2c_pe2; i2c19 = &i2c_pe3; }; &i2c2 { status = "okay"; i2c-switch@70 { compatible = "nxp,pca9546"; reg = <0x70>;

address-cells = <1>;

    #size-cells = <0>;
    i2c-mux-idle-disconnect;

    i2c_pe0: i2c@0 {
        #address-cells = <1>;
        #size-cells = <0>;
        reg = <0>;
    };
    i2c_pe1: i2c@1 {
        #address-cells = <1>;
        #size-cells = <0>;
        reg = <1>;
    };
    i2c_pe2: i2c@2 {
        #address-cells = <1>;
        #size-cells = <0>;
        reg = <2>;
    };
    i2c_pe3: i2c@3 {
        #address-cells = <1>;
        #size-cells = <0>;
        reg = <3>;
    };
};

};

please help me,thanks!

edtanous commented 3 years ago

I have a pca9546 with an address of 0x70 on my i2c2, and a tmp112 with an address of 0x49 is connected to each channel. How do I configure the json file?

There are plenty of examples of similar setups in entity-manager today that you can use as reference. Please use the openbmc mailing list or discord for questions of this nature.

In dts, I configured it according to the doc document, but I don’t know how to configure the json file so that tmp112sensor corresponds to the channel aliases { i2c16 = &i2c_pe0; i2c17 = &i2c_pe1; i2c18 = &i2c_pe2; i2c19 = &i2c_pe3; }; &i2c2 { status = "okay"; i2c-switch@70 { compatible = "nxp,pca9546"; reg = <0x70>;

address-cells = <1>;

size-cells = <0>;

i2c-mux-idle-disconnect;

    i2c_pe0: i2c@0 {
        #address-cells = <1>;
        #size-cells = <0>;
        reg = <0>;
    };
    i2c_pe1: i2c@1 {
        #address-cells = <1>;
        #size-cells = <0>;
        reg = <1>;
    };
    i2c_pe2: i2c@2 {
        #address-cells = <1>;
        #size-cells = <0>;
        reg = <2>;
    };
    i2c_pe3: i2c@3 {
        #address-cells = <1>;
        #size-cells = <0>;
        reg = <3>;
    };
};

};

please help me,thanks!

znning commented 1 year ago

@feitiantutu hi,I have the same doubt,Could you please provide your json file?thanks