How can I use the GPIO 148 on the TX1 with L4T R28.1?
I'd like to control the GPIO 148 by sysfs on the TX1 with L4T R28.1 as below. But an error occurs. [code]$ sudo su $ echo 148 > /sys/class/gpio/export $ bash: echo: write error: Device or resource busy[/code] I can do it with L4T R24.1. How can I use it with L4T R28.1? Best Regards,
I'd like to control the GPIO 148 by sysfs on the TX1 with L4T R28.1 as below.
But an error occurs.

$ sudo su
$ echo 148 > /sys/class/gpio/export
$ bash: echo: write error: Device or resource busy


I can do it with L4T R24.1.
How can I use it with L4T R28.1?

Best Regards,

#1
Posted 01/13/2018 07:19 AM   
I don't know which GPIO that corresponds to, but the numbers differ between R24.1 and R28.1. It's unlikely you're using the same GPIO despite the number being the same. In the case of a GPIO which does exist the refusal to export tends to imply either the GPIO has already been assigned. There might be a similar error for controllers which are powered down for energy savings, but I am thinking of some of the non-GPIO controllers.
I don't know which GPIO that corresponds to, but the numbers differ between R24.1 and R28.1. It's unlikely you're using the same GPIO despite the number being the same.

In the case of a GPIO which does exist the refusal to export tends to imply either the GPIO has already been assigned. There might be a similar error for controllers which are powered down for energy savings, but I am thinking of some of the non-GPIO controllers.

#2
Posted 01/13/2018 06:16 PM   
hi linuxdev, Thanks for your generic comment. In more details, I'd like to control the GPIO2/CAM0_RST# and the GPIO3/CAM1_RST# from the TX1 flashed by JetPack310 (L4T R28.1). On the spreadsheet "Jetson_TX1_Generic_Customer_Pinmux_Customer_Release.xlsm", the GPIO2/CAM0_RST# is defined as GPIO3_PS_04 and the GPIO3/CAM1_RST# is defined as GPIO3_PS_05. I downloaded the source of L4T R28.1 and I refered to /hardware/nvidia/platform/t210/jetson/kernel-dts/jetson-platforms/tegra210-jetson-e-gpio-p2530-0930-e03.dtsi. This file includes following. [code]: TEGRA_GPIO(S, 4) 0 TEGRA_GPIO(S, 5) 0 :[/code] The macro TEGRA_GPIO() is defined in the /hardware/nvidia/soc/tegra/kernel-include/dt-bindings/gpio/tegra-gpio.h. [code]: #define TEGRA_GPIO_BANK_ID_S 18 : #define TEGRA_GPIO(bank, offset) \ ((TEGRA_GPIO_BANK_ID_##bank * 8) + offset) [/code] So, I think the GPIO number is correct... GPIO2/CAM0_RST# is (18*8 + 4) = 148 GPIO3/CAM1_RST# is (18*8 + 5) = 149 In act, the CAM1_RST# can be controlled by GPIO149. I hope NVIDIA give me something information. Best Regards,
hi linuxdev,
Thanks for your generic comment.

In more details, I'd like to control the GPIO2/CAM0_RST# and the GPIO3/CAM1_RST# from the TX1 flashed by JetPack310 (L4T R28.1).

On the spreadsheet "Jetson_TX1_Generic_Customer_Pinmux_Customer_Release.xlsm",
the GPIO2/CAM0_RST# is defined as GPIO3_PS_04 and
the GPIO3/CAM1_RST# is defined as GPIO3_PS_05.

I downloaded the source of L4T R28.1 and I refered to /hardware/nvidia/platform/t210/jetson/kernel-dts/jetson-platforms/tegra210-jetson-e-gpio-p2530-0930-e03.dtsi.
This file includes following.
:
TEGRA_GPIO(S, 4) 0
TEGRA_GPIO(S, 5) 0
:



The macro TEGRA_GPIO() is defined in the /hardware/nvidia/soc/tegra/kernel-include/dt-bindings/gpio/tegra-gpio.h.
:
#define TEGRA_GPIO_BANK_ID_S 18
:
#define TEGRA_GPIO(bank, offset) \
((TEGRA_GPIO_BANK_ID_##bank * 8) + offset)



So, I think the GPIO number is correct...
GPIO2/CAM0_RST# is (18*8 + 4) = 148
GPIO3/CAM1_RST# is (18*8 + 5) = 149

In act, the CAM1_RST# can be controlled by GPIO149.

I hope NVIDIA give me something information.

Best Regards,

#3
Posted 01/15/2018 01:17 AM   
hello nanoto, had you connect any camera sensor board to the Jetson platform? your kernel message shown CAM0_RST pin is occupied.
hello nanoto,

had you connect any camera sensor board to the Jetson platform?
your kernel message shown CAM0_RST pin is occupied.

#4
Posted 01/15/2018 03:07 AM   
hi JerryChang Thanks for your reply. No. I don't connect any camera sensor board now. Best Regards,
hi JerryChang

Thanks for your reply.
No. I don't connect any camera sensor board now.

Best Regards,

#5
Posted 01/15/2018 03:15 AM   
hi JerryChang The file "Jetson_TX1_Generic_Customer_Pinmux_Customer_Release.xlsm" which I have was released on 2015-11-10. If it is the old information, please give me the updated information corresponding to L4T R28.1. Or ..., if there is another way to control GPIO2/CAM0_RST# on the TX1 with the L4T R28.1, please tell me it. Best Regards,
hi JerryChang

The file "Jetson_TX1_Generic_Customer_Pinmux_Customer_Release.xlsm" which I have was released on 2015-11-10.
If it is the old information, please give me the updated information corresponding to L4T R28.1.

Or ..., if there is another way to control GPIO2/CAM0_RST# on the TX1 with the L4T R28.1, please tell me it.

Best Regards,

#6
Posted 01/15/2018 07:29 AM   
hello nanoto, CAM0_RST pin is used for all camera reset. you could also check camera device tree for reference. r28.1/hardware/nvidia/platform/t210/jetson/kernel-dts/jetson-platforms/ looking for TEGRA_GPIO(S, 4) for more details. thanks
hello nanoto,

CAM0_RST pin is used for all camera reset.
you could also check camera device tree for reference.
r28.1/hardware/nvidia/platform/t210/jetson/kernel-dts/jetson-platforms/

looking for TEGRA_GPIO(S, 4) for more details.
thanks

#7
Posted 01/16/2018 07:27 AM   
hi JerryChang, Thanks for your reply. But, I already checked it. please see third posted message in this thread. Is there any method to control the gpio 148 by us on TX1 with L4T R28.1? Best Regards,
hi JerryChang,

Thanks for your reply.
But, I already checked it. please see third posted message in this thread.

Is there any method to control the gpio 148 by us on TX1 with L4T R28.1?

Best Regards,

#8
Posted 01/17/2018 01:20 AM   
hello nanoto, you can use the kernel APIs to control the gpio pins, please check the reference camera driver for example. [code] if (pw->reset_gpio) { gpio_set_value(pw->reset_gpio, 0); usleep_range(30, 50); gpio_set_value(pw->reset_gpio, 1); usleep_range(30, 50); }[/code]
Answer Accepted by Original Poster
hello nanoto,

you can use the kernel APIs to control the gpio pins, please check the reference camera driver for example.
if (pw->reset_gpio) {
gpio_set_value(pw->reset_gpio, 0);
usleep_range(30, 50);
gpio_set_value(pw->reset_gpio, 1);
usleep_range(30, 50);
}

#9
Posted 01/17/2018 02:07 AM   
hi JerryChang Thanks for your comment. I will try the APIs from a kernel module. Best Regards,
hi JerryChang

Thanks for your comment.
I will try the APIs from a kernel module.

Best Regards,

#10
Posted 01/17/2018 03:17 AM   
hi JerryChang Thank you very much. I can change gpio 148 from kernel module. Best Regards,
hi JerryChang

Thank you very much.
I can change gpio 148 from kernel module.

Best Regards,

#11
Posted 01/17/2018 04:23 AM   
I think the gpio 148 can't be used since are being used by other drivers/device (see en-vdd-vcm-2v8) nvidia@tegra-ubuntu:~$ sudo cat /sys/kernel/debug/gpio GPIOs 0-255, platform/6000d000.gpio, tegra-gpio: gpio-2 ( |pcie_wake ) in hi gpio-56 ( |wlan-default-output-) out hi gpio-57 ( |rtl-5v0 ) out hi gpio-58 ( |wlan-default-input-h) in lo IRQ gpio-64 ( |wlan-default-output-) out hi gpio-65 ( |wlan-default-input-i) in hi gpio-67 ( |vdd-disp-3v0 ) out lo gpio-148 ( |en-vdd-vcm-2v8 ) out lo gpio-169 ( |lcd-bl-en ) out lo gpio-188 ( |temp_alert ) in hi IRQ gpio-189 ( |Power ) in hi IRQ gpio-190 ( |Volume Up ) in hi IRQ gpio-192 ( |Volume Down ) in hi IRQ gpio-200 ( |extcon:extcon@1 ) in hi IRQ gpio-201 ( |cd ) in hi IRQ gpio-203 ( |en-vdd-sd ) out lo gpio-204 ( |wp ) in lo gpio-225 ( |hdmi2.0_hpd ) in lo IRQ gpio-228 ( |usb-vbus1 ) in hi gpio-229 ( |en-usb-vbus2 ) in hi GPIOs 504-511, platform/max77620-gpio, max77620-gpio, can sleep: gpio-504 ( |extcon:extcon@1 ) in lo gpio-505 ( |vdd-sys-boost ) out hi gpio-506 ( |spmic-default-output) out hi gpio-507 ( |vdd-3v3 ) out hi gpio-510 ( |enable ) out lo gpio-511 ( |max77620-gpio7 ) out lo
I think the gpio 148 can't be used since are being used by other drivers/device (see en-vdd-vcm-2v8)

nvidia@tegra-ubuntu:~$ sudo cat /sys/kernel/debug/gpio
GPIOs 0-255, platform/6000d000.gpio, tegra-gpio:
gpio-2 ( |pcie_wake ) in hi
gpio-56 ( |wlan-default-output-) out hi
gpio-57 ( |rtl-5v0 ) out hi
gpio-58 ( |wlan-default-input-h) in lo IRQ
gpio-64 ( |wlan-default-output-) out hi
gpio-65 ( |wlan-default-input-i) in hi
gpio-67 ( |vdd-disp-3v0 ) out lo
gpio-148 ( |en-vdd-vcm-2v8 ) out lo
gpio-169 ( |lcd-bl-en ) out lo
gpio-188 ( |temp_alert ) in hi IRQ
gpio-189 ( |Power ) in hi IRQ
gpio-190 ( |Volume Up ) in hi IRQ
gpio-192 ( |Volume Down ) in hi IRQ
gpio-200 ( |extcon:extcon@1 ) in hi IRQ
gpio-201 ( |cd ) in hi IRQ
gpio-203 ( |en-vdd-sd ) out lo
gpio-204 ( |wp ) in lo
gpio-225 ( |hdmi2.0_hpd ) in lo IRQ
gpio-228 ( |usb-vbus1 ) in hi
gpio-229 ( |en-usb-vbus2 ) in hi

GPIOs 504-511, platform/max77620-gpio, max77620-gpio, can sleep:
gpio-504 ( |extcon:extcon@1 ) in lo
gpio-505 ( |vdd-sys-boost ) out hi
gpio-506 ( |spmic-default-output) out hi
gpio-507 ( |vdd-3v3 ) out hi
gpio-510 ( |enable ) out lo
gpio-511 ( |max77620-gpio7 ) out lo

#12
Posted 01/25/2018 09:19 PM   
Scroll To Top

Add Reply