We use 3 adps9960 chips in our design (see schematic bellow) that are connected to an i2c muxer (PCA9544A).
I am struggling passing the APDS9960 interrupts to the CPU.
Could someone share a device tree example for this. Bellow is the device tree I am using right now.
The Interrupts are correctly seen in PCA9544A i2c Muxer driver but they are not forwarded to APDS-9960 driver.
Current Device Tree:
&i2c4 {
pinctrl-names = "default","gpio";
pinctrl-0 = <&pinctrl_i2c4>;
pinctrl-1 = <&pinctrl_i2c4_gpio>;
sda-gpios = <&gpio5 21 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
scl-gpios = <&gpio5 20 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
clock-frequency = <400000>;
status = "okay";
i2c4_mux_apds: i2c4-mux-pca9544@70 {
compatible = "nxp,pca9544";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x70>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pca9544a_70>;
interrupt-parent = <&gpio2>;
interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
interrupt-controller;
#interrupt-cells = <2>;
i2c@0 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
proximity@39 {
compatible = "avago,apds9960";
reg = <0x39>;
interrupt-parent = <&i2c4_mux_apds>; //unsure about this ???
interrupts = <0 2>;//unsure about this ???
};
};
i2c@1 {
#address-cells = <1>;
#size-cells = <0>;
reg = <1>;
proximity@39 {
compatible = "avago,apds9960";
reg = <0x39>;
interrupt-parent = <&i2c4_mux_apds>;
interrupts = <1 2>;
};
};
i2c@2 {
#address-cells = <1>;
#size-cells = <0>;
reg = <2>;
proximity@39 {
compatible = "avago,apds9960";
reg = <0x39>;
interrupt-parent = <&i2c4_mux_apds>;
interrupts = <2 2>;
};
};
i2c@3 {
#address-cells = <1>;
#size-cells = <0>;
reg = <3>;
/* NC */
};
};
…..
&iomuxc {
…
pinctrl_pca9544a_70: pinctrl-pca9544-70 {
fsl,pins = <
MX8MP_IOMUXC_SD1_DATA4__GPIO2_IO06 0x52
>;
};
Thank you
Thank you Aldo,
I have tried this implementation but for some strange reasons, the interrupt does not get dispatched to the lower level driver.
Hello,
You may refer to the device tree bindings documentation here:
https://github.com/nxp-imx/linux-imx/blob/lf-5.15.y/Documentation/devicetree/bindings/i2c/i2c-mux.ya...
Best regards,
Aldo.