How to configure pinmux setting by DTS for TX2 with R28.1

HI sir/Madam,

Since using spreadsheet is not working, I’m trying to configure pinmux in dts.
For example, I want to config B20 to GPIO/output/low.

I put the following codes in tegra186-quill-p3310-1000-c03-00-base.dts and it will be compiler to tegra186-quill-p3310-1000-c03-00-base.dtb but this pin is still input. Is there anything wrong?

pinmux@2430000 {
		common {
			gpio_wan4_pc0 {
				nvidia,pins = "gpio_wan4_pc0";
				nvidia,function = "gpio";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
			};
		};
	};

I also want to control “SDCARD_PWR_EN” (H16) GPIO#446. (The pin is set to GPIO in spreadsheet)
But I got “bash: echo: write error: Device or resource busy” after “echo 446 > /sys/class/gpio/export”

Thanks.

I can’t answer the question, but if attempts to change the device/pin causes device or resource busy, then it means the pin is in use and locked by some other process. Someone else got control of the pin and started using it before you did. It is possible that loading your dtb file or changes also did not make it in for the same reason. You should check “/proc/device-tree/” just to see if your change did actually make it in (this is a reflection in RAM of the running kernel and not a hard file…this directory tree will change as the device tree itself changes).

It might be a question of finding out what uses this pin and disabling that usage before your own usage works.

NOTE: Any device not powered will also fail to do what you want for cases where power rails can be turned off or on.