GUF-Yocto-jethro-9.0-r7707-0
i.MX6
User Manual
6.9.3 USB OTG ID pin emulation
The USB OTG ID pin emulation disables the real OTG ID pin detection when enabled.
The activation/deactivation can be executed through a sysfs entry:
Activation:
root@santaro:~# echo 1 > /sys/class/udc/ci_hdrc.0/device/otg_id_pin_emulation
A new sysfs entry to control the ID value through software appears. The polarity is identical to the hardware state
of the pin. The hardware ID pin detection is deactivated.
Control:
The ID pin can now be controlled via this new sysfs entry:
OTG pin HIGH:
root@santaro:~# echo 1 > /sys/class/udc/ci_hdrc.0/device/otg_id_pin_value
OTG pin LOW:
root@santaro:~# echo 0 > /sys/class/udc/ci_hdrc.0/device/otg_id_pin_value
Deactivation:
root@santaro:~# echo 0 > /sys/class/udc/ci_hdrc.0/device/otg_id_pin_emulation
Th new sysfs entry disappears. The hardware ID pin detection is activated again.
Note:
The sysfs path may vary between different platforms. On some boards the USB device num-
ber in
ci_hdrc.0
has to be changed, e.g. to
ci_hdrc.1
or
ci_hdrc.2
. Linux is able to use wild-
cards, so the path
/sys/class/udc/ci_hdrc.?/device
should work across all platforms, since the file
otg_id_pin_emulation
exists in only one of these paths.
Note:
We are not liable for system instability or hardware damages, if the software emulation does not
correspond to the intended hardware plugging use case, e.g. when the system is switched to device
mode though a USB mass storage is plugged. Similarly, we are not liable for hardware damages, if
cables are used that do not conform to the official USB specification.
6.10
Display power
The display can be powered on or off by software. The value is exported as a virtual file in the sysfs under
/sys/class/graphics/fb0/blank
. It can be accessed using the standard file operations open(), read(), write() and
close().
Example 1:
Turn display off:
root@santaro:~# echo 4 > /sys/class/graphics/fb0/blank
Example 2:
Turn display on:
root@santaro:~# echo 0 > /sys/class/graphics/fb0/blank
Please note that this value is not persistent, i.e. it gets lost when the device is rebooted.
6.11
Display backlight
The brightness of the display backlight can be adjusted in a range from 0 to 255. The value is exported as a
virtual file in the sysfs under
/sys/class/backlight/pwm-backlight.0/brightness
. It can be accessed using the
standard file operations open(), read(), write() and close().
Example 1:
Reading and adjusting the current backlight brightness on the console:
42