summaryrefslogtreecommitdiff
path: root/common/usb_kbd.c
AgeCommit message (Collapse)Author
2012-01-22usb: add special keys handling to the HID driverVincent Palatin
Generate ANSI 3.64 sequences to handle arrow keys, Fx and other special keyboard keys. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:7666 TEST=on Stumpy in recovery mode, press arrow keys and see the language of the message change. Change-Id: I4560ca0c68ea5a9da4cde8247ea5ecc74938f84a Reviewed-on: https://gerrit.chromium.org/gerrit/14596 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Terry Lambert <tlambert@chromium.org> Commit-Ready: Terry Lambert <tlambert@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@google.com> (cherry picked from commit 93954c89f388f3f36149504ebbcd6f6a70fd3a8f) Reviewed-on: https://gerrit.chromium.org/gerrit/14606 Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
2012-01-18usb: workaround non-working keyboards.Vincent Palatin
If the USB keyboard is not answering properly the first request on its interrupt endpoint, just skip it and try the next one. This workarounds an issue with a wireless mouse dongle which presents itself both as a keyboard and a mouse but has a non-functional keyboard interface. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:7559 TEST=Boot a stumpy with the wireless mouse and the keyboard plugged in such a way that the mouse enumerates first. Check we are booting properly and the key strokes are working in the firmware. Change-Id: I574f2a4bdb3bc7824b5bd747a237ef0b79dd83ac Reviewed-on: https://gerrit.chromium.org/gerrit/14362 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org> (cherry picked from commit 012bbf0ce0301be2482857e3f03b481dd15c2340) Reviewed-on: https://gerrit.chromium.org/gerrit/14379
2012-01-13usb: properly re-initialize the USB keyboard.Vincent Palatin
Allow to reconfigure properly the USB keyboard driver when we enumerate several times the USB devices and its position in the device tree has changes. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:7188 chrome-os-partner:7430 chrome-os-partner:7432 chrome-os-partner:7559 TEST=On lumpy with usb keyboard configured, run in recovery mode, insert a bad key, press tab, remove the key, press tab. The recovery info are displayed properly. Change-Id: I5a4c0f5a85e6946a51bc5d0f1ad0860979e84113 Reviewed-on: https://gerrit.chromium.org/gerrit/14189 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
2012-01-09usb: add numeric keypad support to HID driverVincent Palatin
When keys are pressed on the numeric keypad, emit key codes for the numbers, operators, dot and enter. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:7436 TEST=On lumpy with USB keyboard activated, boot in dev mode and press enter (on the numeric keypad) to boot. Change-Id: I4a50a26c8dca17c015743c16475833447769765b Reviewed-on: https://gerrit.chromium.org/gerrit/13890 Reviewed-by: Stefan Reinauer <reinauer@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
2012-01-04Use periodic list if no other method is selected polling keyboardsPatrick Georgi
BUG=chrome-os-partner:5752 TEST=Use USB keyboard in u-boot (recovery mode) with later commit that enables this code Change-Id: I60ee2ef94ef0aca9009b9fa6a370d7e4e0536753 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: https://gerrit.chromium.org/gerrit/13490 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
2011-12-19USB: fix USB keyboard polling parameterVincent Palatin
When doing a "GET_REPORT" request on the keyboard control endpoint, the report ID should 0 (ie report ID not used) rather than 1 as reports are not used in boot mode. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:5752 TEST=use various USB keyboard and check their behavior with the USB analyzer. Change-Id: I8706a91473534e251f5bc97d8d97ab92d2b6e65d Reviewed-on: https://gerrit.chromium.org/gerrit/13149 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
2011-12-08USB: fix USB keyboard selection with iomuxVincent Palatin
When U-Boot is configured with CONFIG_IOMUX, even if the usbkbd is the highest priority input device (e.g. stdin=="usbkbd,serial"), the console input was not switched to the USB keyboard when enumerating usb devices using "usb start". Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:5752 TEST=on Lumpy, use USB keyboard to enter commands on U-Boot command line. Change-Id: I7d15a7bea9de97a1fad79cf269772878e5dd03c3 Reviewed-on: https://gerrit.chromium.org/gerrit/12603 Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2011-12-07UPSTREAM: USB: Drop dead code from usb_kbd.cMarek Vasut
Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Cc: Remy Bohmer <linux@bohmer.net> Cc: Wolfgang Denk <wd@denx.de> (cherry picked from u-boot-usb.git commit dbd4480edaee4b1c4c401d966b6686adf226aa96) BUG=chrome-os-partner:5752 TEST=on Lumpy, use USB keyboard to enter commands on U-Boot command line. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Change-Id: I36e8666e7d2433bed4e6ec31141fef4b347d4627 Reviewed-on: https://gerrit.chromium.org/gerrit/12514 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
2011-12-07UPSTREAM: USB: Rework usb_kbd.cMarek Vasut
* Support dynamic allocation of devices * Passing data via usb device privptr * Reorder functions to avoid forward declarations * Introduce generic polling mechanism to fix musb and ehci-hcd breakage due to using "extern new;" to access keyboard driver data! Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Cc: Remy Bohmer <linux@bohmer.net> Cc: Wolfgang Denk <wd@denx.de> (cherry picked from u-boot-usb.git commit e9831b4870b89097923d06bcd439c4f491fe3828) BUG=chrome-os-partner:5752 TEST=on Lumpy, use USB keyboard to enter commands on U-Boot command line. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Change-Id: I4836151684aeb30b36077ddf63a5326ded3e6944 Reviewed-on: https://gerrit.chromium.org/gerrit/12513 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
2011-12-06UPSTREAM: USB: Squash checkpatch warnings in usb_kbd.cMarek Vasut
Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Cc: Remy Bohmer <linux@bohmer.net> Cc: Wolfgang Denk <wd@denx.de> (cherry picked from u-boot-usb.git commit 0d648d1c78d22b0ab586d0c7deace3069041a09f) BUG=chrome-os-partner:5752 TEST=on Lumpy, use USB keyboard to enter commands on U-Boot command line. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Change-Id: I54f12a27ea6f6e21a54fb016a754785c6e8231d5 Reviewed-on: https://gerrit.chromium.org/gerrit/12512 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
2011-12-06UPSTREAM: USB: Add functionality to poll the USB keyboard via control EPMarek Vasut
This allows the keyboard to avoid requests via Interrupt Endpoint altogether and run all requests via Control Endpoint. This uses the Get_Report request. Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Remy Bohmer <linux@bohmer.net> (cherry picked from u-boot-usb.git commit 24e626cafd0793843c3e38439237c4031cef7ebf) BUG=chrome-os-partner:5752 TEST=on Lumpy, use USB keyboard to enter commands on U-Boot command line. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Change-Id: I55a47a6193ff3c7ce55510ebea922e5223cfc29c Reviewed-on: https://gerrit.chromium.org/gerrit/12511 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
2009-12-20USB Consolidate descriptor definitionsTom Rix
The header files usb.h and usbdescriptors.h have the same nameed structure definitions for usb_config_descriptor usb_interface_descriptor usb_endpoint_descriptor usb_device_descriptor usb_string_descriptor These are out right duplicates in usb.h usb_device_descriptor usb_string_descriptor This one has extra unused elements usb_endpoint_descriptor unsigned char bRefresh unsigned char bSynchAddress; These in usb.h have extra elements at the end of the usb 2.0 specified descriptor and are used. usb_config_descriptor usb_interface_descriptor The change is to consolidate the definition of the descriptors to usbdescriptors.h. The dublicates in usb.h are removed. The extra element structure will have their name shorted by removing the '_descriptor' suffix. So usb_config_descriptor -> usb_config usb_interface_descriptor -> usb_interface For these, the common descriptor elements are accessed now by an element 'desc'. As an example - if (iface->bInterfaceClass != USB_CLASS_HUB) + if (iface->desc.bInterfaceClass != USB_CLASS_HUB) This has been compile tested on MAKEALL arm, ppc and mips. Signed-off-by: Tom Rix <Tom.Rix@windriver.com>
2009-07-18stdio/device: rework function naming conventionJean-Christophe PLAGNIOL-VILLARD
So far the console API uses the following naming convention: ======Extract====== typedef struct device_t; int device_register (device_t * dev); int devices_init (void); int device_deregister(char *devname); struct list_head* device_get_list(void); device_t* device_get_by_name(char* name); device_t* device_clone(device_t *dev); ======= which is too generic and confusing. Instead of using device_XX and device_t we change this into stdio_XX and stdio_dev This will also allow to add later a generic device mechanism in order to have support for multiple devices and driver instances. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Edited commit message. Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-01-28usb : usb_kbd : Populating 'priv' member of USB keyboard device_t structureThomas Abraham
This patch populates the 'priv' field of the USB keyboard device_t structure. The 'priv' field is populated with the address of the 'struct usb_device' structure that represents the USB device. The 'priv' field can then be used in the 'usb_event_poll' function to determine the USB device that requires to be polled. An example of its usage in 'usb_event_poll' function is as below. device_t *dev; struct usb_device *usb_kbd_dev; <snip> dev = device_get_by_name("usbkbd"); usb_kbd_dev = (struct usb_device *)dev->priv; iface = &usb_kbd_dev->config.if_desc[0]; Signed-off-by: Thomas Abraham <t-abraham@ti.com> Signed-off-by: Remy Bohmer <linux@bohmer.net>
2008-12-20usb_kbd: fix usb_kbd_deregister when DEVICE_DEREGISTER not enableJean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Remy Böhmer <linux@bohmer.net>
2008-10-18rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-09-09Correct drv_usb_kbd_init functionRyan CHEN
The patch is that check if usb_get_dev_index() function return valid pointer. If valid, continue. Otherwise return -1. Signed-off-by: Ryan Chen <ryan.chen@st.com> Acked-by: Markus Klotzbuecher <mk@denx.de>
2008-08-31devices: merge to list_headJean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-08-13common: Move conditional compilation to MakefileJean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-07-14Code cleanup: fix old style assignment ambiguities like "=-" etc.Wolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-05-22USB: replace old swap_ with proper endianess conversion macrosChristian Eggers
Signed-off-by: Christian Eggers <ceggers@gmx.de> Signed-off-by: Markus Klotzbuecher <mk@denx.de>
2008-05-21Big white-space cleanup.Wolfgang Denk
This commit gets rid of a huge amount of silly white-space issues. Especially, all sequences of SPACEs followed by TAB characters get removed (unless they appear in print statements). Also remove all embedded "vim:" and "vi:" statements which hide indentation problems. Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-01-09Add Ctrl combo key support to usb keyboard driver.Zhang Wei
Ctrl combo key support is added, which is very useful to input Ctrl-C for interrupt current job. Also add usb_event_poll() calling to usb_kbd_testc(), which can get key input when tstc() is called. Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
2007-11-03Fix the issue of usb_kbd driver missing the scan code of key 'z'.Zhang Wei
The scan code of the key 'z' is 0x1d, which should be handled. The change has be tested on NOVATEK USB keyboard and ULI PCI OHCI controller. Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
2007-06-06USB event poll supportZhang Wei
This patch adds USB event poll support, which could be used in usbkbd and other usb devices driver when the asynchronous interrupt processing is supported. Signed-off-by: Zhang Wei <wei.zhang@freescale.com
2003-06-27* Code cleanup:LABEL_2003_06_27_2340wdenk
- remove trailing white space, trailing empty lines, C++ comments, etc. - split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c) * Patches by Kenneth Johansson, 25 Jun 2003: - major rework of command structure (work done mostly by Michal Cendrowski and Joakim Kristiansen)
2002-08-17Initial revisionwdenk