Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 10-11-2020, 06:03 PM   #1
katadelos
rm -rf /
katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.
 
Posts: 219
Karma: 3333683
Join Date: Nov 2019
Location: United Kingdom
Device: K5, KT, KT2, KT3, KT4, KV, PW2, PW3, PW4, PW5
Kindle USB OTG Control for iMX6

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:
Code:
rmmod otg_control
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/
Attached Files
File Type: zip otg_control.zip (2.0 KB, 382 views)
katadelos is offline   Reply With Quote
Old 03-04-2021, 10:46 AM   #2
morrolinux
Junior Member
morrolinux began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Mar 2021
Device: Kindle PW4
Hi, awesome work!
I've got a PW4 running 5.11.2 (kernel is 4.1.15-lab126).
I tried replicating your changes in the kernel tree and building the module but it looks like there's a big leap between 3.0.35 and 4.1.15 so needless to say it doesn't even compile.
All I wanted to do is to use a USB keyboard on the kindle and I think this might be the only missing part since usbhid, hid and stuff are already built into the kindle's kernel.

Could you by any chance update the procedure / code for it to work on 4.1.15?
morrolinux is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does Kindle Paperwhite 10th gen support USB OTG out of the box? n00bdude Amazon Kindle 21 11-06-2023 07:57 AM
USB Host (OTG) tinkerwinker Kobo Developer's Corner 9 02-04-2017 06:08 AM
CC and USB/OTG support GEB Calibre Companion 2 05-30-2015 12:24 PM
Experiments with USB-OTG HarryT Android Devices 13 07-03-2012 03:55 PM
USB OTG Mythic Bookeen 7 11-11-2007 12:39 PM


All times are GMT -4. The time now is 08:21 PM.


MobileRead.com is a privately owned, operated and funded community.