This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/PCA9534A: How to include PCA9534A and its connections in Device Tree

Part Number: PCA9534A
Other Parts Discussed in Thread: AM3352, , PCA9534

Tool/software: Linux

Hello everyone,

I'm working on creating a device tree for a device centered around an AM3352 SoC. I'm using the am335x-evm.dts as my starting point and reference tree.

The schematics for my board show a PCA9534A connected to I2C2, and I'm trying to figure how to show this in the DT.

I've searched the Linux source documentation only to find gpio-pca953x.txt, which I did not find very helpful.

I also found the pca9534a page, but also found no helpful information when it came to the device tree. So I have some questions:

Question 1 - How should I include this device in the device tree? Something like what I have below?

&i2c2{
gpio@20 { compatible = "nxp,pca9534"; reg = <0x20>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pca934>; interrupt-parent = <&gpio3>; interrupts = <23 IRQ_TYPE_LEVEL_LOW>; };
}

Question 2 - If I do have to include it in the i2c2 node, do I have to include any of the properties outlined in i2c-gpio.txt?

Question 3 - How do I include the I/O from the PCA9534 in my DT?

Thank you for the help!

-Jon

  • Hi Jon,

    Sorry for the delayed reply.

    Question 1 -> Maybe you'll need to add status="okay";. And also the node should be completed with the i2c specific settings:
    &i2c2{
    pinctrl-names = "default";
    pinctrl-0 = <&i2c2_pins>;

    status = "okay";
    clock-frequency = <400000>;
    gpio@20 {
    compatible = "nxp,pca9534";
    reg = <0x20>;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_pca934>;
    interrupt-parent = <&gpio3>;
    interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
    };
    }

    Question 2 -> no, you should be fine with the I2C functioning as i2c, not as gpio.

    Question 3 -> This should be taken care of in the pca953x driver.

    Best Regards,
    Yordan