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.

TCA6424A: Operating two TCA6424ARGJR connected to same I2C bus

Part Number: TCA6424A
Other Parts Discussed in Thread: AM625-Q1, TPIC2810

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

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#
# 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
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

DTS Settings

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
&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",
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I2C Address

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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:~#
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Linux GPIO Info

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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 

  • Any messages regarding pca953x or gpio/pinctrl in the kernel log?

  • Greetings Clemens,

    Yes, in the kernel log we do get messages regarding pca953x and gpio/pinctrl.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    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:~#
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Apparently, you are using main_gpio1_ioexp_intr_pins_default for both devices.

  • 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