summaryrefslogtreecommitdiffstats
path: root/drivers/input
Commit message (Collapse)AuthorAgeFilesLines
* i2c: introduce device_i2c_driver() macroMarco Felsch2018-10-191-8/+1
| | | | | | | | | Add macro and dependency to avoid boilerplate code. Since now simple i2c drivers only have to include the i2c.h header and call the device_i2c_driver() macro to register a i2c device driver. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* param: make parameter functions more consistentSascha Hauer2017-04-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | This patch creates a consitent set of device parameter functions. With this we have: dev_add_param_<type><access> "type" is one of: int32, uint32, int64, uint64, string, mac, ipv4, enum, bitmask The improvement here is that we now can exactly specify the width of the int type parameters and also correctly distinguish between signed and unsigned variables which means that a variable no longer ends up with INT_MAX when it's assigned -1. "access" can be empty for regular read/write parameter, "_ro" for readonly parameters which get their value from a variable pointer in the background or "_fixed" for parameters which are set to a fixed value (without a pointer in the background). Some more exotic types are not (yet) implemented, like dev_add_param_ip_ro. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb_kbd: release all keys on error / disconnectPeter Mamonov2017-03-241-0/+11
| | | | | Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: Fix compiler warningSascha Hauer2017-01-101-2/+2
| | | | | | | | | | Fixes: drivers/input/input.c:46:17: warning: passing argument 2 of '__set_bit' from incompatible pointer type [-Wincompatible-pointer-types] idev->keys is an array, so we don't need to take the address of it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: Compile keymap only if necessaryAlexander Shiyan2016-07-051-2/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/input'Sascha Hauer2016-03-111-21/+20
|\
| * usb_kbd: lock is useless since pollers are atomicAleksey Kuleshov2016-03-101-8/+1
| | | | | | | | | | Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb_kbd: use async polling instead of regular pollingAleksey Kuleshov2016-03-101-7/+13
| | | | | | | | | | | | | | | | | | This fixes the overpolling of USB keyboard which causes slowdown of entier barebox by using periodic polling occuting once per some milliseconds. Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb_kbd: style fixesAleksey Kuleshov2016-03-101-2/+1
| | | | | | | | | | Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb_kbd: check for registering errorAleksey Kuleshov2016-03-101-1/+5
| | | | | | | | | | Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb_kbd: remove unused fieldsAleksey Kuleshov2016-03-101-3/+0
| | | | | | | | | | Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/driver'Sascha Hauer2016-03-111-3/+5
|\ \ | |/ |/|
| * driver: replace dev_request_mem_region with dev_request_mem_resourceSascha Hauer2016-03-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_request_mem_region doesn't work properly one some SoCs on which PTR_ERR() values clash with valid return values from dev_request_mem_region. Replace them with dev_request_mem_resource where possible. This patch has been generated with the following semantic patch: // <smpl> @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { ... - return PTR_ERR(io); -} + return PTR_ERR(iores); +} +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) - return PTR_ERR(io); -} + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { - ret = PTR_ERR(io); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { + ret = PTR_ERR(iores); ... } +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ identifier func; @@ func(...) { <+... struct resource *iores; -struct resource *iores; ...+> } // </smpl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | input: usb keyboard: fix CTRL+ combinationsPeter Mamonov2016-02-261-1/+5
| | | | | | | | | | | | | | Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | input: usb keyboard: fix BACKSPACEPeter Mamonov2016-02-231-2/+2
|/ | | | | Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: gpio-keys: convert to input frameworkSascha Hauer2016-01-182-47/+18
| | | | | | To allow asking for the button states. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: gpio-keys: Use KEY_* keycodesSascha Hauer2016-01-131-8/+1
| | | | | | | | The gpio-keys driver takes ascii key codes from platform_data and Linux keycodes from device tree. Convert the ascii keys over to Linux keycodes to get rid of the special cases in the driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: imx-keypad: Add device tree supportSascha Hauer2016-01-131-14/+20
| | | | | | | The preparations are done in previous patches, now we only have to add the device tree compatible and drio the check for platform_data. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: Add device tree parsing support for matrix keymapSascha Hauer2016-01-132-2/+51
| | | | | | Add support for parsing the "linux,keymap" property. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: imx-keypad: convert to input frameworkSascha Hauer2016-01-132-43/+13
| | | | | | To make it possible to ask for the button state. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: move matrix_keypad_build_keymap() to C fileSascha Hauer2016-01-134-1/+48
| | | | | | | | Future additions will make the function too big to live as a static inline function. Move to a C file and while at it, move matrix_keypad.h to include/input/ where it belongs to. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: imx-keypad: Use dev_* functionsSascha Hauer2016-01-131-5/+6
| | | | | | driver should use dev_* rather than pr_* Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: usb keyboard: convert to input frameworkSascha Hauer2016-01-132-242/+55
| | | | | | Conert the USB keyboard over to the new input core as a first user. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: Add input coreSascha Hauer2016-01-133-0/+206
| | | | | | | | | | | | | | | | | | | Currently all input driver register themselves as consoles. Consoles are fine for typing text, but they do not allow to ask for the current pressed state of buttons or keypads. They also do not support non printable keys like the function keys. This patch adds a simple input core. On the driver side it supports input_report_key_event() to report events (button presses and releases). On the consumer side it allows getting the current button status via input_key_get_status(). Also an event driven interface is available which calls a callback whenever an input event is received. The input core also registers a console for all registered input devices which handles passing events to the console and stuff like key repetition, so this can be removed from the drivers once they are converted to the input core. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* keymap: Add keymap for keys with shift pressedSascha Hauer2016-01-131-0/+82
| | | | | | | When converting keys to ascii for the console we also need the keymap with shift pressed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* keymap: Add apostrophe, backslash and homeSascha Hauer2016-01-131-3/+3
| | | | | | Add some previously undefined keys. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* keymap: Add keypad keysSascha Hauer2016-01-131-16/+16
| | | | | | Allow to use the number keypad keys. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* keymap: remove exotic and nonprintable keysSascha Hauer2016-01-131-49/+0
| | | | | | | We do not need these keys and they do not produce a usable result either. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* keymap: Fix bracesSascha Hauer2016-01-131-2/+2
| | | | | | | KEY_LEFTBRACE is the '[' key on an english keyboard and KEY_RIGHTBRACE is the ']' key. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: gpio-keys: implement debouncingSascha Hauer2016-01-081-4/+19
| | | | | | | | The gpio-keys driver often generates multiple events on a single buttong press. Implement debouncing. The default debouncing time is 20ms and can be configured with the "debounce-interval" device tree property. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: usb_kbd: skip poll on -EAGAIN errorPeter Mamonov2015-10-141-2/+5
| | | | | | | | Skip poll if either usb_submit_int_msg() or usb_get_report() returned -EAGAIN. Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: usb-kbd: depend on CONSOLE_FULLLucas Stach2015-10-141-0/+1
| | | | | | | | | Fixes: In function `usb_kbd_probe': (usb_kbd_probe): undefined reference to `console_set_active' Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: port usb keyboard driver from the u-bootPeter Mamonov2015-10-023-0/+428
| | | | | Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: Let input support depend on !CONSOLE_NONESascha Hauer2014-10-081-0/+1
| | | | | | | Without console support the input devices make no sense, so add a depends on !CONSOLE_NONE. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/resource-err-ptr'Sascha Hauer2014-10-021-0/+3
|\
| * resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-161-0/+3
| | | | | | | | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | input: imx_keypad: remove unused variableSascha Hauer2014-09-121-1/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: allow "make ARCH=sandbox allyesconfig"Holger Schurig2014-07-221-1/+1
| | | | | | | | | | | | | Compiling the tree with allyesconfig is helpful because different compilers (gcc, clang) or static checkers (e.g. clang's scan-build) can then process and check more code. This patch introduces two new configuration symbols that Kconfig files can depend on. That way, code that is only working where a cache or DMA implementation exists can be opted out. Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx_keypad: Fix error handlingAlexander Shiyan2014-04-231-9/+4
| | | | | | | Also remove the unnecessary check for xzalloc failure. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: gpio-keys; dt probing needs CONFIG_OF_GPIOSascha Hauer2014-03-291-1/+1
| | | | | | Otherwise of_get_named_gpio_flags is not available. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: gpio-keys: Add devicetree probe supportSascha Hauer2014-02-171-13/+77
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: Add keycode to barebox key translation tableSascha Hauer2014-02-172-0/+137
| | | | | | | | Devicetrees specify the keyboard codes for the gpio-keys driver, so add a table to translate them into something barebox can use. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: gpio-keys: separate internal data from platform_dataSascha Hauer2014-02-171-23/+57
| | | | | | | Do not abuse platform data for internal driver data, instead use a separate struct for that. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: Add BB_ prefix to KEY_ definesSascha Hauer2014-02-171-2/+2
| | | | | | | Our KEY_ defines conflict with the standard Linux KEY_ defines, so add a BB_ prefix to them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: drop f_caps and check the function pointer getc/putc insteadJean-Christophe PLAGNIOL-VILLARD2013-09-214-4/+0
| | | | | | | | | | None of the driver make the difference between STDOUT and STDERR. So we just need to check if putc or getc are filled in the console_device save 32 bytes on versatilepb Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* qt1070: drop non used bufJean-Christophe PLAGNIOL-VILLARD2013-05-081-1/+0
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Use dev_add_param_int_ro where possibleSascha Hauer2013-04-111-4/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/omap'Sascha Hauer2013-04-044-0/+118
|\
| * gpio_keys: detect keys pressed before bootingVicente Bergas2013-03-251-0/+2
| | | | | | | | | | | | | | | | | | If a key is pressed but not released before booting and the key is connected to an active low gpio it's not detected. This patch solves that. Signed-off-by: Vicente Bergas <vicencb@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * twl6030: add power button as an input keyVicente Bergas2013-03-253-0/+116
| | | | | | | | | | Signed-off-by: Vicente Bergas <vicencb@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>