I want to add tca9538 in jetson AGX XAVIER,How to change device tree

I want to add tca9538 in jetson AGX XAVIER,How to change device tree. Could you give me some references. Thanks.

Hi liusu,

Are you using the devkit or custom board for AGX Xavier?
What’s your Jetpack version in use?

It seems a I2C I/O expander.
You may ask for the porting guide or sample code from your vendor.
You could also connect the module and use standard I2C command (i2cdump) to read basic information of the module from Jetson device.

yes I am using devkit for AGX Xavier, I want to use I2C connecting tca9538

Jetpack version is 35.2.1

Okay, you could connect the module from I2C pins on 40-Pin Expansion Header.

I would just using the latest JP5.1.2(R35.4.1) for further debug.

i plan to use tca9539 in place of tca9538. How to edit dts and drive code? Could you give me some references?

You may need to add some configuration under i2c@ node.
Which I2C interface would you like to use?

Is there any sample code or porting guide from your vendor?

TCA9539 is supported in linux kernel and enabled in our jetson defconfig by default

Connect tca9539 to the i2c pin of 40-pin header

make sure to enable i2c pinmux using jetson-io py script

Add the respective i2c section to hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000.dts and you need to add entry similar to https://www.kernel.org/doc/Documentation/devicetree/bindings/gpio/gpio-pca953x.txt

Do you want to use TCA9538 or TCA9539…?

Have you ported your module on Jetson already?

Is there any issue now?

I want to use 9538. But I have not 9538 device tree.dtsi and drive code. where could I get a demo for 9538 device tree.dtsi and drive code

You should confirm this with your vendor, they may know more details for this module(TCA9538).
It seems they may use the same driver (gpio-pca953x.c).

You could refer to the details in gpio-pca953x.txt.

Thank so much. My vendor did not give any support,but we bought many xaviers several years ago

gpio-pca953x.txt is not in jetson_r35.2.1.

Which version does contain the gpio-pca953x.txt? Thank you

It seems not in kernel source.
You could just search it from google.

I would suggest using the latest JP5.1.2(R35.4.1) to verify and debug.

Thank you

Please check Linux_for_Tegra/sources/kernel/kernel-5.10/Documentation/devicetree/bindings/gpio/gpio-pca95xx.yaml for device tree reference

You can go through Linux_for_Tegra/sources/kernel/kernel-5.10/drivers/gpio/gpio-pca953x.c
You can select which ever device is similar to TCA9538

1 Like

Thank you so much

If you are satisfied with my above answer, please mark it as Solution.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.