What is it?
This is a kernel module that allows you to enable and disable USB OTG functionality on Kindle devices using the iMX6 SOC. This functionality is disabled on most iMX6 devices by default; the only working devices are USB sound cards on the PW3 and later devices.
This module is capable of expanding that support to any USB device supported by the 3.0.35-lab126 kernel (as long as the additional kernel modules required by the device are compiled and loaded into the kernel too).
It has been tested on the KT2 and PW3, but will likely work on the KOA, PW2 and KV too.
How do I use it?
First, insert the module into the kernel:
Code:
insmod otg_control.ko
The module can be removed from the kernel like so:
The module exposes a procfs entry that allows you to:
- Enable USB OTG functionality
- Disable USB OTG functionality
- Set the audio_enumerated variable to 1
- Set the audio_enumerated variable to 0
To carry out any of these actions, you will need to write the following values to
/proc/usb_otg:
Code:
echo 0 > /proc/usb_otg # Disable USB OTG functionality
echo 1 > /proc/usb_otg # Enable USB OTG functionality
echo 2 > /proc/usb_otg # Set audio_enumerated to 1
echo 3 > /proc/usb_otg # Set audio_enumerated to 0
On devices that support the Kindle Audio Adapter accessory, you should use the
Set audio_enumerated to 1 option - this bypasses the check used by Lab126 to lock out other USB peripherals.
For older devices, use the
Enable USB OTG functionality option. This does the same thing as the option above, as well as a couple of additional setup tasks which need to be carried out before USB OTG can be used.
Building from source:
To build this module from source, you will need a cross-compiler toolchain.
Code:
git clone https://github.com/katadelos/linux-3.0.35-lab126.git
cd linux-3.0.35-lab126/
git checkout usb-otg-control
make ARCH=arm CROSS_COMPILE=arm-kindlepw2-linux-gnueabi- imx60_wario_defconfig
echo "CONFIG_USB_KINDLE_OTG_CONTROL=m" >> .config
make ARCH=arm CROSS_COMPILE=arm-kindlepw2-linux-gnueabi- modules_prepare
make ARCH=arm CROSS_COMPILE=arm-kindlepw2-linux-gnueabi- M=drivers/usb/otg/