R32.3.1 Need device tree changes to make bit 0 an interrupt on tca9539 device

Help, looked thru all the device tree source and it is missing info for a tca9539

May this document can help on you.

https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next/+/refs/heads/akpm-base/Documentation/devicetree/bindings/gpio/gpio-pca953x.txt

was looking for the nvidia information for interrupt-parent and the setup for the interrupt line on the tx2.

Need nvidia specific information please, I have looked thru all the source code and there are no examples of how to make it work on the tx2.

ShaneCCC

any tx2 configuration information available for the tca9539?

Any more info from nvidia?

There should be a nvidia specific document on this part, not just a general google doc.

tca9539 is an external gpio expander, it all depends on to which lines you are connecting tca9539 and its interrupt line.

When Its used in TX2 its mentioned like this in nvidia dts files
Example:
i2c@3160000 {
e3320_tca_gpio: tca9539@75 {
compatible = “ti,tca9539”;
status = “okay”;
reg = <0x75>;
gpio-controller;
#gpio-cells = <2>;
vcc-supply = <&battery_reg>;
interrupt-parent = <&tegra_main_gpio>;
interrupts = <TEGRA_MAIN_GPIO(B, 5) GPIO_ACTIVE_LOW>;
#interrupt-cells = <2>;
interrupt-controller;

you can see the interrupt handling in the driver
kernel-4.9/drivers/gpio/gpio-pca953x.c

Check the interrupt line (INT) from the expander and trace that it goes to any gpio pin of tegra.That GPIO you need to mention in the DT node “interrupts”

wrote a module to try to setup and process a interrupt from the tca9539, but request_irq fails with a -22, did some poking and it looks like it is related to nested interrupts, so am I missing some other device tree setup to tell tca9539 that it needs to support ints.

I checked and config does have the irq for the pca953x device. Think there is more device tree info that is missing, again I looked at all the sources and dts’s for 953x and no help.

Thanks,

Found solution replaced request_irq with request_any_context_irq

Also to get rid of warning/kernel messages change gpio_get_value() to gpio_get_value_cansleep()