GPIO can work in Jetpack 5.0.2/L4T 35.1 but work fine in previous version

When I used Jetpack5.0.1/L4T 34.1.1 for our customized carrier board, the AGX’s gpiochip can work successfully.
After changed the BSP to L4T 35.1, the gpiochip wouldn’t work and got a error message " tegra186-gpio 2200000.gpio: Failed to set output direction: -517".

Seems it is caused from the changes of the “gpio-tegra186.c’” in L4T 35.1 version.
Because the L4T 34.1.1’s "gpio-tegra186.c’ file doesn’t call “pinctrl_gpio_direction_xxx” function in tegra186_gpio_direction_xxx function .
So I removed pinctrl_gpio_direction_xxx in it.
Then the gpiochip can successfully work.
Does NV has any ideal about this? Can you provide a correct way or any suggestion to fix this issue ?

static int tegra186_gpio_direction_input(struct gpio_chip *chip,
unsigned int offset)
{

//ret = pinctrl_gpio_direction_input(chip->base + offset);
//if (ret < 0)
//dev_err(chip->parent,
//“Failed to set input direction: %d\n”, ret);
return 0; //return ret;
}

static int tegra186_gpio_direction_output(struct gpio_chip *chip,
unsigned int offset, int level)
{

//ret = pinctrl_gpio_direction_output(chip->base + offset);

//if (ret < 0)
	//dev_err(chip->parent
		//"Failed to set output direction: %d\n", ret);
return 0; //return ret;

}

[ 6.697781] tegra_nvdisp_bandwidth_register_max_config: max config EMC floor = 1066500000 Hz
[ 6.697789] tegra_nvdisp_bandwidth_register_max_config: max config hubclk = 358400000 Hz
[ 6.698991] tegradc 15200000.display: vblank syncpt # 8 for dc 0
[ 6.704410] serial-tegra 3110000.serial: Adding to iommu group 2
[ 6.705857] tegradc 15200000.display: vpulse3 syncpt # 9 for dc 0
[ 6.713578] 3110000.serial: ttyTHS1 at MMIO 0x3110000 (irq = 36, base_baud = 0) is a TEGRA_UART
[ 6.718608] tegradc 15200000.display: dc_hdmi_hotplug_init: couldn’t get regulator vdd_hdmi_5v0, -517
[ 6.726614] serial-tegra 3140000.serial: Adding to iommu group 2
[ 6.732863] tegradc 15200000.display: dc_probe: failed hotplug init, -517
[ 6.822409] 3140000.serial: ttyTHS4 at MMIO 0x3140000 (irq = 37, base_baud = 0) is a TEGRA_UART
[ 6.867359] tegra-i2c 31e0000.i2c: Adding to iommu group 2
[ 6.884935] cpufreq: cpufreq_online: CPU0: Running at unlisted initial frequency: 2260000 KHz, changing to: 2265600 KHz
[ 6.886057] tegra194-cpufreq ccplex: probed with BWMGR
[ 6.887345] tegra186-gpio 2200000.gpio: Failed to set output direction: -517
[ 6.887426] sdhci-tegra 3460000.sdhci: BWMGR client registration for eMC Successful
[ 6.887713] reg-fixed-voltage fixed-regulators:regulator@106: nonexclusive access to GPIO for fixed-regulators:regulator@106
[ 6.888264] tegra186-gpio 2200000.gpio: Failed to set output direction: -517
[ 6.888312] tegra186-gpio 2200000.gpio: Failed to set input direction: -517
[ 6.888581] tegra186-gpio 2200000.gpio: Failed to set output direction: -517
[ 6.891577] sdhci-tegra 3400000.sdhci: Got CD GPIO
[ 6.891634] sdhci-tegra 3400000.sdhci: BWMGR client registration for eMC Successful
[ 6.898440] tegra186-gpio 2200000.gpio: Failed to set output direction: -517
[ 6.898833] mmc0: CQHCI version 5.10
[ 6.911961] irq: IRQ267: trimming hierarchy from :interrupt-controller@3881000
[ 6.918155] tegra186-gpio 2200000.gpio: Failed to set output direction: -517
[ 6.921645] sdhci-tegra 3400000.sdhci: wakeup init done, cdirq 267
[ 6.927573] mmc0: SDHCI controller on 3460000.sdhci [3460000.sdhci] using ADMA 64-bit
[ 6.929275] vdd-5v-sata: supplied by vdd-ac-bat
[ 6.955182] tegra186-gpio 2200000.gpio: Failed to set output direction: -517
[ 6.962203] tegra186-gpio 2200000.gpio: Failed to set output direction: -517
[ 6.970874] mmc1: SDHCI controller on 3400000.sdhci [3400000.sdhci] using ADMA 64-bit
[ 6.971136] tegra186-gpio 2200000.gpio: Failed to set input direction: -517

hello neil.lee1,

this looks incorrect driver is used, Xavier series should be tegra194.
could you please confirm which platform you’re using?
could you please also review your driver implementation.
thanks

Thanks @JerryChang

This problem is caused by losing dtsi files when I extracted NV’s BSP source package.
After I put it back, the issue is solved.

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