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.
Tool/software:
Greetings TI Community,
In our custom AM625-Q1 based board design we have connected two TCA6424ARGJR I/O Expanders onto the same I2C bus. As the SoC is operating on a Linux based environment we have also enabled the required device tree and kernel configurations for both the I/O expanders. However, we are only able to only able to utilize one I/O expander while the other is non-operational.
Kernel Configuration Settings
# # I2C GPIO expanders # # CONFIG_GPIO_ADNP is not set # CONFIG_GPIO_GW_PLD is not set # CONFIG_GPIO_MAX7300 is not set CONFIG_GPIO_MAX732X=y # CONFIG_GPIO_MAX732X_IRQ is not set CONFIG_GPIO_PCA953X=y CONFIG_GPIO_PCA953X_IRQ=y # CONFIG_GPIO_PCA9570 is not set # CONFIG_GPIO_PCF857X is not set # CONFIG_GPIO_TPIC2810 is not set # end of I2C GPIO expanders
DTS Settings
&main_i2c3 { status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&main_i2c3_pins_default>; clock-frequency = <100000>; exp1: gpio@23 { compatible = "ti,tca6424"; reg = <0x23>; gpio-controller; #gpio-cells = <2>; gpio-line-names = "12V_GPI1_OUT", "12V_GPI2_OUT", "12V_GPI3_OUT", "12V_GPI4_OUT", "12V_GPI5_OUT", "12V_GPI6_OUT", "12V_GPI7_OUT", "12V_GPI8_OUT", "12V_GPI9_OUT", "12V_GPI10_OUT", "12V_GPI11_OUT", "12V_GPI12_OUT", "12V_GPO1_IN", "12V_GPO2_IN", "12V_GPO3_IN", "12V_GPO4_IN", "12V_GPO5678_FAULT2", "12V_GPO5678_FAULT1", "12V_GPO1234_FAULT2", "12V_GPO1234_FAULT1", "12V_GPO8_IN", "12V_GPO7_IN", "12V_GPO6_IN", "12V_GPO5_IN"; pinctrl-names = "default"; pinctrl-0 = <&main_gpio1_ioexp_intr_pins_default>; interrupt-parent = <&main_gpio1>; interrupts = <3 IRQ_TYPE_EDGE_FALLING>; interrupt-controller; #interrupt-cells = <2>; }; exp2: gpio@22 { compatible = "ti,tca6424"; reg = <0x22>; gpio-controller; #gpio-cells = <2>; gpio-line-names = "MCU_12V_GPI1_OUT", "MCU_12V_GPI2_OUT", "MCU_12V_GPI3_OUT", "MCU_12V_GPI4_OUT", "MCU_12V_GPI5_OUT", "MCU_12V_GPI6_OUT", "MCU_12V_GPI7_OUT", "MCU_12V_GPI8_OUT", "MCU_12V_GPI9_OUT", "MCU_12V_GPI10_OUT", "MCU_12V_GPI11_OUT", "MCU_12V_GPI12_OUT", "MCU_12V_GPO1_IN", "MCU_12V_GPO2_IN", "MCU_12V_GPO3_IN", "MCU_12V_GPO4_IN", "MCU_12V_GPO5678_FAULT2", "MCU_12V_GPO5678_FAULT1", "MCU_12V_GPO1234_FAULT2", "MCU_12V_GPO1234_FAULT1", "MCU_12V_GPO8_IN", "MCU_12V_GPO7_IN", "MCU_12V_GPO6_IN", "MCU_12V_GPO5_IN"; pinctrl-names = "default"; pinctrl-0 = <&main_gpio1_ioexp_intr_pins_default>; interrupt-parent = <&main_gpio1>; interrupts = <3 IRQ_TYPE_EDGE_FALLING>; interrupt-controller; #interrupt-cells = <2>; }; };
I2C Address
root@am62xx-evm:~# i2cdetect -r 3 WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-3 using receive byte commands. I will probe address range 0x08-0x77. Continue? [Y/n] y 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- 22 UU -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- root@am62xx-evm:~#
Linux GPIO Info
root@am62xx-evm:~# gpioinfo gpiochip0 - 92 lines: line 0: unnamed input line 1: unnamed input line 2: unnamed input line 3: unnamed input line 4: unnamed input line 5: unnamed input line 6: unnamed input line 7: unnamed input line 8: unnamed input line 9: unnamed input line 10: unnamed input line 11: unnamed input line 12: unnamed input line 13: unnamed input line 14: unnamed input line 15: unnamed input line 16: unnamed input line 17: unnamed input line 18: unnamed input line 19: unnamed input line 20: unnamed input line 21: unnamed input line 22: unnamed input line 23: unnamed input line 24: unnamed input line 25: unnamed input line 26: unnamed input line 27: unnamed input line 28: unnamed input line 29: unnamed input line 30: unnamed input line 31: unnamed output consumer=regulator-6 line 32: unnamed input line 33: unnamed input line 34: unnamed input line 35: unnamed input line 36: unnamed output consumer=regulator-7 line 37: unnamed input line 38: unnamed input line 39: unnamed input line 40: unnamed output consumer=tlv71033 line 41: unnamed input line 42: unnamed input line 43: unnamed input line 44: unnamed input line 45: unnamed input line 46: unnamed input line 47: unnamed input line 48: unnamed input line 49: unnamed input line 50: unnamed input line 51: unnamed input line 52: unnamed input line 53: unnamed input line 54: unnamed input line 55: unnamed input line 56: unnamed input line 57: unnamed input line 58: unnamed input line 59: unnamed input line 60: unnamed input line 61: unnamed input line 62: unnamed input line 63: unnamed input line 64: unnamed input line 65: unnamed input line 66: unnamed input line 67: unnamed input line 68: unnamed input line 69: unnamed input line 70: unnamed input line 71: unnamed input line 72: unnamed input line 73: unnamed output active-low consumer=reset line 74: unnamed input line 75: unnamed input line 76: unnamed output consumer=regulator-3 line 77: unnamed input line 78: unnamed input line 79: unnamed input line 80: unnamed input line 81: unnamed input line 82: unnamed input line 83: unnamed input line 84: unnamed input line 85: unnamed input line 86: unnamed input line 87: unnamed input line 88: unnamed input line 89: unnamed input line 90: unnamed output line 91: unnamed input gpiochip1 - 52 lines: line 0: unnamed input line 1: unnamed input line 2: unnamed input line 3: unnamed input line 4: unnamed output line 5: unnamed input line 6: unnamed input line 7: unnamed input line 8: unnamed input line 9: unnamed input line 10: unnamed input line 11: unnamed input line 12: unnamed input line 13: unnamed input line 14: unnamed input line 15: unnamed input line 16: unnamed input line 17: unnamed input line 18: unnamed input line 19: unnamed input line 20: unnamed input line 21: unnamed input line 22: unnamed input line 23: unnamed input line 24: unnamed input line 25: unnamed input line 26: unnamed input line 27: unnamed input line 28: unnamed input line 29: unnamed input line 30: unnamed input line 31: unnamed input line 32: unnamed input line 33: unnamed input line 34: unnamed input line 35: unnamed input line 36: unnamed input line 37: unnamed input line 38: unnamed input line 39: unnamed input line 40: unnamed input line 41: unnamed input line 42: unnamed input line 43: unnamed input line 44: unnamed input line 45: unnamed input line 46: unnamed input line 47: unnamed input line 48: unnamed input line 49: unnamed input line 50: unnamed input line 51: unnamed input gpiochip2 - 24 lines: line 0: "12V_GPI1_OUT" input line 1: "12V_GPI2_OUT" input line 2: "12V_GPI3_OUT" input line 3: "12V_GPI4_OUT" input line 4: "12V_GPI5_OUT" input line 5: "12V_GPI6_OUT" input line 6: "12V_GPI7_OUT" input line 7: "12V_GPI8_OUT" input line 8: "12V_GPI9_OUT" input line 9: "12V_GPI10_OUT" input line 10: "12V_GPI11_OUT" input line 11: "12V_GPI12_OUT" input line 12: "12V_GPO1_IN" input line 13: "12V_GPO2_IN" input line 14: "12V_GPO3_IN" input line 15: "12V_GPO4_IN" input line 16: "12V_GPO5678_FAULT2" input line 17: "12V_GPO5678_FAULT1" input line 18: "12V_GPO1234_FAULT2" input line 19: "12V_GPO1234_FAULT1" input line 20: "12V_GPO8_IN" input line 21: "12V_GPO7_IN" input line 22: "12V_GPO6_IN" input line 23: "12V_GPO5_IN" input root@am62xx-evm:~#
We are able to detect the I2C address of both the I/O expanders but only one is utilized or can be operated even though the kernel and dts configurations for both have been defined. We therefore need assistance to make both the I/O expanders operational.
Regards,
Visweshwar Selvaraj
Greetings Clemens,
Yes, in the kernel log we do get messages regarding pca953x and gpio/pinctrl.
root@am62xx-evm:~# dmesg | grep pca953 [ 1.339365] pca953x 3-0023: supply vcc not found, using dummy regulator [ 1.346211] pca953x 3-0023: using AI [ 1.409957] pca953x 3-0022: Error applying setting, reverse things back root@am62xx-evm:~# dmesg | grep gpio [ 1.396798] pinctrl-single f4000.pinctrl: could not request pin 97 (PIN97) from group main-gpio1-ioexp-intr-pins-default on device pinctrl-single root@am62xx-evm:~# dmesg | grep pinctrl [ 0.213068] pinctrl core: initialized pinctrl subsystem [ 0.756962] pinctrl-single 4084000.pinctrl: 34 pins, size 136 [ 0.763644] pinctrl-single f4000.pinctrl: 171 pins, size 684 [ 1.373652] pinctrl-single f4000.pinctrl: pin PIN97 already requested by 3-0023; cannot claim for 3-0022 [ 1.390306] pinctrl-single f4000.pinctrl: pin-97 (3-0022) status -22 [ 1.396798] pinctrl-single f4000.pinctrl: could not request pin 97 (PIN97) from group main-gpio1-ioexp-intr-pins-default on device pinctrl-single root@am62xx-evm:~#
Visweshwar,
Did the latest reply from Clemens fix the issue?
Have you confirmed this setup on a hardware level? Were you able to verify that both devices are ACK'ing to your commands?
Regards,
Tyler
Hi Clemens,
Yes, we are using the main_gpio1_ioexp_intr_pins_default for both devices. We removed the DTS definition of main_gpio1_ioexp_intr_pins_default for the second device and the I/O expander was detected in the gpio info.
Greetings Tyler,
The reply from Clemens helped us fix the issue. We have confirmed the results of the setup on the hardware level. Yes, both the devices are acknowledging our commands
Regards,
Visweshwar Selvaraj
Hi Visweshwar,
Please let me know if you have any more questions.
Regards,
Tyler