9
0
Fork 0
Commit Graph

56 Commits

Author SHA1 Message Date
Sascha Hauer d59330da2c Merge branch 'for-next/input' 2016-03-11 10:49:49 +01:00
Sascha Hauer 690ec1804c Merge branch 'for-next/driver' 2016-03-11 10:49:48 +01:00
Aleksey Kuleshov 504c511e4a usb_kbd: lock is useless since pollers are atomic
Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-10 10:00:01 +01:00
Aleksey Kuleshov b73e1479d6 usb_kbd: use async polling instead of regular polling
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>
2016-03-10 10:00:01 +01:00
Aleksey Kuleshov 9505b28a68 usb_kbd: style fixes
Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-10 10:00:01 +01:00
Aleksey Kuleshov c0d42b3d7b usb_kbd: check for registering error
Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-10 10:00:01 +01:00
Aleksey Kuleshov d0e367ba4d usb_kbd: remove unused fields
Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-10 10:00:01 +01:00
Sascha Hauer 3bd69ad077 driver: replace dev_request_mem_region with dev_request_mem_resource
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>
2016-03-07 08:57:56 +01:00
Peter Mamonov d7d0c7a0bb input: usb keyboard: fix CTRL+ combinations
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>
2016-02-26 07:52:17 +01:00
Peter Mamonov 051b39f683 input: usb keyboard: fix BACKSPACE
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-23 08:46:57 +01:00
Sascha Hauer 253fb33bb8 input: gpio-keys: convert to input framework
To allow asking for the button states.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-18 08:32:59 +01:00
Sascha Hauer 30b7c5ead3 input: gpio-keys: Use KEY_* keycodes
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>
2016-01-13 16:28:08 +01:00
Sascha Hauer dcaf3adb53 input: imx-keypad: Add device tree support
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>
2016-01-13 16:28:07 +01:00
Sascha Hauer 5ac4b013a3 input: Add device tree parsing support for matrix keymap
Add support for parsing the "linux,keymap" property.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-13 16:28:07 +01:00
Sascha Hauer b187e4784a input: imx-keypad: convert to input framework
To make it possible to ask for the button state.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-13 16:28:07 +01:00
Sascha Hauer 6639c98acc input: move matrix_keypad_build_keymap() to C file
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>
2016-01-13 16:28:06 +01:00
Sascha Hauer f3bf60efcb input: imx-keypad: Use dev_* functions
driver should use dev_* rather than pr_*

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-13 16:28:06 +01:00
Sascha Hauer 85e54605ed input: usb keyboard: convert to input framework
Conert the USB keyboard over to the new input core as a first user.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-13 16:28:05 +01:00
Sascha Hauer 224a08df5d input: Add input core
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>
2016-01-13 16:26:05 +01:00
Sascha Hauer cfe4e61df1 keymap: Add keymap for keys with shift pressed
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>
2016-01-13 16:23:22 +01:00
Sascha Hauer 2d43dd7697 keymap: Add apostrophe, backslash and home
Add some previously undefined keys.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-13 16:23:22 +01:00
Sascha Hauer 7e55652418 keymap: Add keypad keys
Allow to use the number keypad keys.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-13 16:23:22 +01:00
Sascha Hauer 59a464ca6c keymap: remove exotic and nonprintable keys
We do not need these keys and they do not produce a usable result
either.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-13 16:23:22 +01:00
Sascha Hauer c8fe211975 keymap: Fix braces
KEY_LEFTBRACE is the '[' key on an english keyboard and KEY_RIGHTBRACE
is the ']' key.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-13 16:23:22 +01:00
Sascha Hauer 9d15b92988 input: gpio-keys: implement debouncing
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>
2016-01-08 08:30:55 +01:00
Peter Mamonov 6b0cbf2059 input: usb_kbd: skip poll on -EAGAIN error
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>
2015-10-14 15:35:30 +02:00
Lucas Stach 36ef69578c input: usb-kbd: depend on CONSOLE_FULL
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>
2015-10-14 15:33:07 +02:00
Peter Mamonov b0ae09acda input: port usb keyboard driver from the u-boot
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-02 07:50:51 +02:00
Sascha Hauer 86ef8cb8fb input: Let input support depend on !CONSOLE_NONE
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>
2014-10-08 08:11:02 +02:00
Sascha Hauer fa93e4fb60 Merge branch 'for-next/resource-err-ptr' 2014-10-02 08:54:42 +02:00
Sascha Hauer ed6e965824 resource: Let dev_request_mem_region return an error pointer
For all users fix or add the error check.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-16 08:32:10 +02:00
Sascha Hauer 0efa92fdca input: imx_keypad: remove unused variable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-12 11:59:00 +02:00
Holger Schurig b3265685f7 sandbox: allow "make ARCH=sandbox allyesconfig"
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>
2014-07-22 21:29:57 +02:00
Alexander Shiyan 1fc66d1401 imx_keypad: Fix error handling
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>
2014-04-23 14:01:45 +02:00
Sascha Hauer 258772deab input: gpio-keys; dt probing needs CONFIG_OF_GPIO
Otherwise of_get_named_gpio_flags is not available.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-29 06:38:46 +01:00
Sascha Hauer 7a037a952d input: gpio-keys: Add devicetree probe support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-17 08:23:41 +01:00
Sascha Hauer 2c194e5822 input: Add keycode to barebox key translation table
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>
2014-02-17 08:23:41 +01:00
Sascha Hauer 59d6a0b7f1 input: gpio-keys: separate internal data from platform_data
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>
2014-02-17 08:23:41 +01:00
Sascha Hauer 7e66707c76 input: Add BB_ prefix to KEY_ defines
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>
2014-02-17 08:23:37 +01:00
Jean-Christophe PLAGNIOL-VILLARD e62d425517 console: drop f_caps and check the function pointer getc/putc instead
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>
2013-09-21 09:59:16 +02:00
Jean-Christophe PLAGNIOL-VILLARD 259591dd13 qt1070: drop non used buf
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-08 07:16:40 +02:00
Sascha Hauer 7c6c61fe8e treewide: Use dev_add_param_int_ro where possible
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-11 11:48:35 +02:00
Sascha Hauer eebe92e3ad Merge branch 'for-next/omap' 2013-04-04 14:20:33 +02:00
Vicente Bergas 5a1d6da675 gpio_keys: detect keys pressed before booting
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>
2013-03-25 10:21:21 +01:00
Vicente Bergas 4b6cd0ee4b twl6030: add power button as an input key
Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-25 10:21:20 +01:00
Alexander Shiyan 4f255f7318 I2C: Rename i2c_register_driver() for using with register_driver_macro()
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-14 07:15:44 +01:00
Alexander Shiyan 6a256321b8 Use new device_platform_driver() macro for drivers
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-13 09:23:28 +01:00
Jean-Christophe PLAGNIOL-VILLARD c559eb612f gpio_keys: fix loop on buttons for request and configuration
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-26 22:23:20 +01:00
Jean-Christophe PLAGNIOL-VILLARD 97d4ca970a qt1070: init default key code first
So the key code provided by platform_data are not overwrited

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2013-01-15 00:26:19 +08:00
Alexander Shiyan 4c20f9af97 Cleanup Kconfig files
This patch provides a global cleanup barebox Kconfig files. This includes
replacing spaces to tabs, formatting in accordance format, removing
extraneous lines and spaces. No functional changes.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-08 12:22:12 +01:00