Community Added Features on LO kernel

USB Keyboard and Mouse
The kernel currently has g_zero support. The devices keyboard and mouse have been added based on that. The config changes to enable these are.

Configuration changes
Modify the Zoom2 Defconfig (kernel_omap3/arch/arm/configs/omap_zoom2_defconfig) for the below.

# # Userland interfaces # # CONFIG_INPUT_MOUSEDEV is not set CONFIG_INPUT_MOUSEDEV=y CONFIG_INPUT_MOUSEDEV_PSAUX=y

# # Input Device Drivers # # CONFIG_INPUT_KEYBOARD is not set CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y CONFIG_KEYBOARD_TWL4030=y

# CONFIG_INPUT_MOUSE is not set CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y CONFIG_MOUSE_PS2_ALPS=y CONFIG_MOUSE_PS2_LOGIPS2PP=y CONFIG_MOUSE_PS2_SYNAPTICS=y CONFIG_MOUSE_PS2_LIFEBOOK=y CONFIG_MOUSE_PS2_TRACKPOINT=y

CONFIG_INPUT_UINPUT=y CONFIG_INPUT_GPIO=y CONFIG_INPUT_KEYCHORD=y

The changes will soon be pushed upstream.

How to install the devices
The devices work the USB OTG. To setup USB OTG, refer to Support Tools page

The devices (keyboard or mouse) have to be connected over a self powered USB 2.0 Hub.

Building the USB gadget
Once the kernel has been built with the above modified Zoom2 defconfig, build the modules which will generate the g_zero.ko file. To build the modules

# make CROSS_COMPILE=arm-none-linux-gnueabi- modules The g_zero.ko file will be at kernel/drivers/usb/gadget

Installing the devices
Copy g_zero.ko to the SD card or another accessible location.

Once the file system has loaded, install the gadget module. # insmod g_zero.ko

This will install the gadget module and the USB devices would be detected. The below logs show the detection of a powered USB Hub and a keyboard device connected to it.

omapzoom2 login: root root@omapzoom2:~# cd /media root@omapzoom2:/media# cd mmcblk0p1 root@omapzoom2:/media/mmcblk0p1# ls g_zero.ko   mlo         u-boot.bin  uImage root@omapzoom2:/media/mmcblk0p1# insmod g_zero.ko  <7>zero gadget: adding config #3 'source/sink'/bf00485c <7>zero gadget: adding 'source/sink'/cfffc2a0 to config 'source/sink'/bf00485c <7>zero gadget: dual speed source/sink: IN/ep1in, OUT/ep1out <7>zero gadget: cfg 3/bf00485c speeds: high full <7>zero gadget:  interface 0 = source/sink/cfffc2a0 <7>zero gadget: adding config #2 'loopback'/bf0047e8 <7>zero gadget: adding 'loopback'/cfffc660 to config 'loopback'/bf0047e8 <7>zero gadget: dual speed loopback: IN/ep1in, OUT/ep1out <7>zero gadget: cfg 2/bf0047e8 speeds: high full <7>zero gadget:  interface 0 = loopback/cfffc660 <6>zero gadget: Gadget Zero, version: Cinco de Mayo 2008 zero gadget: Gadget Zero, version: Cinco de Mayo 2008 <6>zero gadget: zero ready zero gadget: zero ready <6>musb_hdrc musb_hdrc: MUSB HDRC host driver musb_hdrc musb_hdrc: MUSB HDRC host driver <7>PM: Adding info for No Bus:usbmon1 <6>musb_hdrc musb_hdrc: new USB bus registered, assigned bus number 1 musb_hdrc musb_hdrc: new USB bus registered, assigned bus number 1 <7>usb usb1: default language 0x0409 <7>usb usb1: udev 1, busnum 1, minor = 0 <6>usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 <6>usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 <6>usb usb1: Product: MUSB HDRC host driver usb usb1: Product: MUSB HDRC host driver <6>usb usb1: Manufacturer: Linux 2.6.31-rc7-omap1-06714-gda06581-dirty musb-hcd usb usb1: Manufacturer: Linux 2.6.31-rc7-omap1-06714-gda06581-dirty musb-hcd <6>usb usb1: SerialNumber: musb_hdrc usb usb1: SerialNumber: musb_hdrc <7>PM: Adding info for usb:usb1 <7>usb usb1: uevent <7>usb usb1: usb_probe_device <6>usb usb1: configuration #1 chosen from 1 choice usb usb1: configuration #1 chosen from 1 choice <7>usb usb1: adding 1-0:1.0 (config #1, interface 0) <7>PM: Adding info for usb:1-0:1.0 <7>usb 1-0:1.0: uevent <7>hub 1-0:1.0: usb_probe_interface <7>hub 1-0:1.0: usb_probe_interface - got id <6>hub 1-0:1.0: USB hub found hub 1-0:1.0: USB hub found <6>hub 1-0:1.0: 1 port detected hub 1-0:1.0: 1 port detected <7>hub 1-0:1.0: standalone hub <7>hub 1-0:1.0: individual port power switching <7>hub 1-0:1.0: no over-current protection <7>hub 1-0:1.0: power on to power good time: 10ms <7>hub 1-0:1.0: 100mA bus power budget for each child <7>hub 1-0:1.0: local power source is good <7>hub 1-0:1.0: enabling power on all ports <7>PM: Adding info for No Bus:ep_81 <7>PM: Adding info for No Bus:usbdev1.1 <7>PM: Adding info for No Bus:ep_00 root@omapzoom2:/media/mmcblk0p1# <7>usb usb1: uevent <7>hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0000 <7>hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002 <7>hub 1-0:1.0: port 1, status 0101, change 0001, 12 Mb/s <7>hub 1-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x101 <6>usb 1-1: new high speed USB device using musb_hdrc and address 2 usb 1-1: new high speed USB device using musb_hdrc and address 2 <7>usb 1-1: udev 2, busnum 1, minor = 1 <6>usb 1-1: New USB device found, idVendor=050d, idProduct=0234 usb 1-1: New USB device found, idVendor=050d, idProduct=0234 <6>usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 <7>PM: Adding info for usb:1-1 <7>usb 1-1: uevent <7>usb 1-1: usb_probe_device <6>usb 1-1: configuration #1 chosen from 1 choice usb 1-1: configuration #1 chosen from 1 choice <7>usb 1-1: adding 1-1:1.0 (config #1, interface 0) <7>PM: Adding info for usb:1-1:1.0 <7>usb 1-1:1.0: uevent

The devices are plug and play and you can add or remove devices. The below logs show the events when a mouse is connected to the USB Hub

root@omapzoom2:/media/mmcblk0p1# <7>hub 1-1:1.0: state 7 ports 4 chg 0000 evt 0010 <7>hub 1-1:1.0: port 4, status 0301, change 0001, 1.5 Mb/s <7>hub 1-1:1.0: debounce: port 4: total 100ms stable 100ms status 0x301 <7>hub 1-1:1.0: port 4 not reset yet, waiting 10ms <6>usb 1-1.4: new low speed USB device using musb_hdrc and address 5 usb 1-1.4: new low speed USB device using musb_hdrc and address 5 <7>hub 1-1:1.0: port 4 not reset yet, waiting 10ms <7>usb 1-1.4: skipped 1 descriptor after interface <7>usb 1-1.4: default language 0x0409 <3>usb 1-1.4: device v046d pc016 is not supported usb 1-1.4: device v046d pc016 is not supported <7>usb 1-1.4: udev 5, busnum 1, minor = 4 <6>usb 1-1.4: New USB device found, idVendor=046d, idProduct=c016 usb 1-1.4: New USB device found, idVendor=046d, idProduct=c016 <6>usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0 usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0 <6>usb 1-1.4: Product: Optical USB Mouse usb 1-1.4: Product: Optical USB Mouse <6>usb 1-1.4: Manufacturer: Logitech usb 1-1.4: Manufacturer: Logitech <7>PM: Adding info for usb:1-1.4 <7>usb 1-1.4: uevent <7>usb 1-1.4: usb_probe_device <6>usb 1-1.4: configuration #1 chosen from 1 choice usb 1-1.4: configuration #1 chosen from 1 choice <7>usb 1-1.4: adding 1-1.4:1.0 (config #1, interface 0) <7>PM: Adding info for usb:1-1.4:1.0 <7>usb 1-1.4:1.0: uevent <7>usbhid 1-1.4:1.0: usb_probe_interface <7>usbhid 1-1.4:1.0: usb_probe_interface - got id <7>PM: Adding info for hid:0003:046D:C016.0003 <7>PM: Adding info for No Bus:input4 <6>input: Logitech Optical USB Mouse as /devices/platform/musb_hdrc/usb1/1-1/1-1.4/1-1.4:1.0/input/input4 input: Logitech Optical USB Mouse as /devices/platform/musb_hdrc/usb1/1-1/1-1.4/1-1.4:1.0/input/input4 <7>PM: Adding info for No Bus:mouse1 <7>PM: Adding info for No Bus:event4 <6>generic-usb 0003:046D:C016.0003: input: USB HID v1.10 Mouse [Logitech Optical USB Mouse] on usb-musb_hdrc-1.4/input0 generic-usb 0003:046D:C016.0003: input: USB HID v1.10 Mouse [Logitech Optical USB Mouse] on usb-musb_hdrc-1.4/input0 <7>PM: Adding info for No Bus:ep_81 <7>PM: Adding info for No Bus:usbdev1.5 <7>PM: Adding info for No Bus:ep_00

To list the devices, # lsusb

root@omapzoom2:/media/mmcblk0p1# lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID 050d:0234 Belkin Components F5U234 USB 2.0 4-Port Hub Bus 001 Device 003: ID 413c:1002 Dell Computer Corp. Keyboard Hub Bus 001 Device 004: ID 413c:2002 Dell Computer Corp. SK-8125 Keyboard Bus 001 Device 005: ID 046d:c016 Logitech, Inc. M-UV69a/HP M-UV96 Optical Wheel Mouse

HDMI
HDMI has been enabled on the LO kernel using the patches from Android kernel. The instructions are provided here for anyone to take the changes to enable HDMI on another kernel.

Code to enable HDMI
Below are the patches and pull them in order 10965, 10760, 10761, 10762

https://review.source.android.com/#change,10762 https://review.source.android.com/#change,10761 https://review.source.android.com/#change,10760 https://review.source.android.com/#change,10965

With the above changes, HDMI is enabled on the kernel.

How to test HDMI
Check the devices (HDMI may be on display1 or 2 depending on whether you have DVI and which one it was assigned to)

lcd=/sys/devices/platform/omapdss/display0 hdmi=/sys/devices/platform/omapdss/display1

To enable HDMI echo "0" > $lcd/enabled echo "1" > $hdmi/enabled

To switch back to LCD from HDMI echo "1" > $lcd/enabled echo "0" > $hdmi/enabled

Known Limitations

 * The HDMI works with certain TVs while others don't detect the input because of some clock issues
 * HDMI has been tested on Angstrom. A video clip that has audio can be played on TV. But the image is not full screen. This probably has to be enabled at user space from Angstrom.