2019-05-19 20:07:45 +08:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2005-04-17 06:20:36 +08:00
|
|
|
#
|
|
|
|
# Input core configuration
|
|
|
|
#
|
|
|
|
menuconfig INPUT_KEYBOARD
|
2013-10-31 15:38:30 +08:00
|
|
|
bool "Keyboards"
|
2005-04-17 06:20:36 +08:00
|
|
|
default y
|
|
|
|
help
|
|
|
|
Say Y here, and a list of supported keyboards will be displayed.
|
|
|
|
This option doesn't affect the kernel.
|
|
|
|
|
|
|
|
If unsure, say Y.
|
|
|
|
|
|
|
|
if INPUT_KEYBOARD
|
|
|
|
|
2016-08-30 10:57:06 +08:00
|
|
|
config KEYBOARD_ADC
|
|
|
|
tristate "ADC Ladder Buttons"
|
|
|
|
depends on IIO
|
|
|
|
help
|
|
|
|
This driver implements support for buttons connected
|
|
|
|
to an ADC using a resistor ladder.
|
|
|
|
|
|
|
|
Say Y here if your device has such buttons connected to an ADC. Your
|
|
|
|
board-specific setup logic must also provide a configuration data
|
|
|
|
for mapping voltages to buttons.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called adc_keys.
|
|
|
|
|
2009-10-11 01:54:02 +08:00
|
|
|
config KEYBOARD_ADP5520
|
|
|
|
tristate "Keypad Support for ADP5520 PMIC"
|
|
|
|
depends on PMIC_ADP5520
|
|
|
|
help
|
|
|
|
This option enables support for the keypad scan matrix
|
|
|
|
on Analog Devices ADP5520 PMICs.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the module will
|
|
|
|
be called adp5520-keys.
|
|
|
|
|
2009-09-18 13:39:38 +08:00
|
|
|
config KEYBOARD_ADP5588
|
2010-01-19 16:28:44 +08:00
|
|
|
tristate "ADP5588/87 I2C QWERTY Keypad and IO Expander"
|
2009-09-18 13:39:38 +08:00
|
|
|
depends on I2C
|
|
|
|
help
|
2010-01-19 16:28:44 +08:00
|
|
|
Say Y here if you want to use a ADP5588/87 attached to your
|
2009-09-18 13:39:38 +08:00
|
|
|
system I2C bus.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called adp5588-keys.
|
|
|
|
|
2011-05-19 15:59:32 +08:00
|
|
|
config KEYBOARD_ADP5589
|
2011-10-19 12:12:39 +08:00
|
|
|
tristate "ADP5585/ADP5589 I2C QWERTY Keypad and IO Expander"
|
2011-05-19 15:59:32 +08:00
|
|
|
depends on I2C
|
|
|
|
help
|
2011-10-19 12:12:39 +08:00
|
|
|
Say Y here if you want to use a ADP5585/ADP5589 attached to your
|
2011-05-19 15:59:32 +08:00
|
|
|
system I2C bus.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called adp5589-keys.
|
|
|
|
|
2009-06-29 15:00:52 +08:00
|
|
|
config KEYBOARD_AMIGA
|
|
|
|
tristate "Amiga keyboard"
|
|
|
|
depends on AMIGA
|
|
|
|
help
|
|
|
|
Say Y here if you are running Linux on any AMIGA and have a keyboard
|
|
|
|
attached.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called amikbd.
|
|
|
|
|
|
|
|
config ATARI_KBD_CORE
|
|
|
|
bool
|
|
|
|
|
2019-07-16 01:30:11 +08:00
|
|
|
config KEYBOARD_APPLESPI
|
|
|
|
tristate "Apple SPI keyboard and trackpad"
|
|
|
|
depends on ACPI && EFI
|
|
|
|
depends on SPI
|
|
|
|
depends on X86 || COMPILE_TEST
|
2019-07-31 21:48:09 +08:00
|
|
|
depends on LEDS_CLASS
|
2019-07-23 21:41:35 +08:00
|
|
|
select CRC16
|
2019-07-16 01:30:11 +08:00
|
|
|
help
|
|
|
|
Say Y here if you are running Linux on any Apple MacBook8,1 or later,
|
|
|
|
or any MacBookPro13,* or MacBookPro14,*.
|
|
|
|
|
|
|
|
You will also need to enable appropriate SPI master controllers:
|
|
|
|
spi_pxa2xx_platform and spi_pxa2xx_pci for MacBook8,1, and
|
|
|
|
spi_pxa2xx_platform and intel_lpss_pci for the rest.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called applespi.
|
|
|
|
|
2009-06-29 15:00:52 +08:00
|
|
|
config KEYBOARD_ATARI
|
|
|
|
tristate "Atari keyboard"
|
|
|
|
depends on ATARI
|
|
|
|
select ATARI_KBD_CORE
|
|
|
|
help
|
|
|
|
Say Y here if you are running Linux on any Atari and have a keyboard
|
|
|
|
attached.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called atakbd.
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
config KEYBOARD_ATKBD
|
2013-10-31 15:38:30 +08:00
|
|
|
tristate "AT keyboard"
|
2005-04-17 06:20:36 +08:00
|
|
|
default y
|
|
|
|
select SERIO
|
|
|
|
select SERIO_LIBPS2
|
2014-05-13 02:00:15 +08:00
|
|
|
select SERIO_I8042 if ARCH_MIGHT_HAVE_PC_SERIO
|
2005-04-17 06:20:36 +08:00
|
|
|
select SERIO_GSCPS2 if GSC
|
|
|
|
help
|
|
|
|
Say Y here if you want to use a standard AT or PS/2 keyboard. Usually
|
|
|
|
you'll need this, unless you have a different type keyboard (USB, ADB
|
|
|
|
or other). This also works for AT and PS/2 keyboards connected over a
|
|
|
|
PS/2 to serial converter.
|
|
|
|
|
|
|
|
If unsure, say Y.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called atkbd.
|
|
|
|
|
|
|
|
config KEYBOARD_ATKBD_HP_KEYCODES
|
|
|
|
bool "Use HP keyboard scancodes"
|
|
|
|
depends on PARISC && KEYBOARD_ATKBD
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Say Y here if you have a PA-RISC machine and want to use an AT or
|
|
|
|
PS/2 keyboard, and your keyboard uses keycodes that are specific to
|
|
|
|
PA-RISC keyboards.
|
|
|
|
|
|
|
|
Say N if you use a standard keyboard.
|
|
|
|
|
|
|
|
config KEYBOARD_ATKBD_RDI_KEYCODES
|
|
|
|
bool "Use PrecisionBook keyboard scancodes"
|
|
|
|
depends on KEYBOARD_ATKBD_HP_KEYCODES
|
|
|
|
default n
|
|
|
|
help
|
|
|
|
If you have an RDI PrecisionBook, say Y here if you want to use its
|
|
|
|
built-in keyboard (as opposed to an external keyboard).
|
|
|
|
|
|
|
|
The PrecisionBook has five keys that conflict with those used by most
|
|
|
|
AT and PS/2 keyboards. These are as follows:
|
|
|
|
|
|
|
|
PrecisionBook Standard AT or PS/2
|
|
|
|
|
|
|
|
F1 F12
|
|
|
|
Left Ctrl Left Alt
|
|
|
|
Caps Lock Left Ctrl
|
|
|
|
Right Ctrl Caps Lock
|
|
|
|
Left 102nd key (the key to the right of Left Shift)
|
|
|
|
|
|
|
|
If you say N here, and use the PrecisionBook keyboard, then each key
|
|
|
|
in the left-hand column will be interpreted as the corresponding key
|
|
|
|
in the right-hand column.
|
|
|
|
|
|
|
|
If you say Y here, and use an external keyboard, then each key in the
|
|
|
|
right-hand column will be interpreted as the key shown in the
|
|
|
|
left-hand column.
|
|
|
|
|
2019-05-05 00:49:23 +08:00
|
|
|
config KEYBOARD_QT1050
|
|
|
|
tristate "Microchip AT42QT1050 Touch Sensor Chip"
|
|
|
|
depends on I2C
|
|
|
|
select REGMAP_I2C
|
|
|
|
help
|
|
|
|
Say Y here if you want to use Microchip AT42QT1050 QTouch
|
|
|
|
Sensor chip as input device.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here:
|
|
|
|
the module will be called qt1050
|
|
|
|
|
2011-03-14 14:34:59 +08:00
|
|
|
config KEYBOARD_QT1070
|
2019-11-23 06:49:30 +08:00
|
|
|
tristate "Atmel AT42QT1070 Touch Sensor Chip"
|
|
|
|
depends on I2C
|
|
|
|
help
|
|
|
|
Say Y here if you want to use Atmel AT42QT1070 QTouch
|
|
|
|
Sensor chip as input device.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here:
|
|
|
|
the module will be called qt1070
|
2011-03-14 14:34:59 +08:00
|
|
|
|
2010-07-18 05:29:06 +08:00
|
|
|
config KEYBOARD_QT2160
|
2009-09-22 13:24:06 +08:00
|
|
|
tristate "Atmel AT42QT2160 Touch Sensor Chip"
|
2012-10-25 14:53:02 +08:00
|
|
|
depends on I2C
|
2009-09-22 13:24:06 +08:00
|
|
|
help
|
|
|
|
If you say yes here you get support for Atmel AT42QT2160 Touch
|
|
|
|
Sensor chip as a keyboard input.
|
|
|
|
|
|
|
|
This driver can also be built as a module. If so, the module
|
|
|
|
will be called qt2160.
|
|
|
|
|
2014-03-29 00:37:14 +08:00
|
|
|
config KEYBOARD_CLPS711X
|
|
|
|
tristate "CLPS711X Keypad support"
|
|
|
|
depends on OF_GPIO && (ARCH_CLPS711X || COMPILE_TEST)
|
|
|
|
select INPUT_MATRIXKMAP
|
|
|
|
help
|
|
|
|
Say Y here to enable the matrix keypad on the Cirrus Logic
|
|
|
|
CLPS711X CPUs.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called clps711x-keypad.
|
|
|
|
|
2017-06-06 05:48:44 +08:00
|
|
|
config KEYBOARD_DLINK_DIR685
|
|
|
|
tristate "D-Link DIR-685 touchkeys support"
|
|
|
|
depends on I2C
|
|
|
|
default ARCH_GEMINI
|
|
|
|
help
|
|
|
|
If you say yes here you get support for the D-Link DIR-685
|
|
|
|
touchkeys.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called dlink-dir685-touchkeys.
|
|
|
|
|
2009-06-29 15:00:52 +08:00
|
|
|
config KEYBOARD_LKKBD
|
|
|
|
tristate "DECstation/VAXstation LK201/LK401 keyboard"
|
|
|
|
select SERIO
|
2005-09-13 16:25:35 +08:00
|
|
|
help
|
2009-06-29 15:00:52 +08:00
|
|
|
Say Y here if you want to use a LK201 or LK401 style serial
|
|
|
|
keyboard. This keyboard is also useable on PCs if you attach
|
|
|
|
it with the inputattach program. The connector pinout is
|
|
|
|
described within lkkbd.c.
|
2005-09-13 16:25:35 +08:00
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
2009-06-29 15:00:52 +08:00
|
|
|
module will be called lkkbd.
|
2005-09-13 16:25:35 +08:00
|
|
|
|
2009-06-29 15:00:52 +08:00
|
|
|
config KEYBOARD_EP93XX
|
|
|
|
tristate "EP93xx Matrix Keypad support"
|
2019-04-16 04:17:10 +08:00
|
|
|
depends on ARCH_EP93XX || COMPILE_TEST
|
2012-05-11 13:37:08 +08:00
|
|
|
select INPUT_MATRIXKMAP
|
2008-01-21 14:04:20 +08:00
|
|
|
help
|
2009-06-29 15:00:52 +08:00
|
|
|
Say Y here to enable the matrix keypad on the Cirrus EP93XX.
|
2008-01-21 14:04:20 +08:00
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
2009-06-29 15:00:52 +08:00
|
|
|
module will be called ep93xx_keypad.
|
2008-01-21 14:04:20 +08:00
|
|
|
|
2009-06-29 15:00:52 +08:00
|
|
|
config KEYBOARD_GPIO
|
|
|
|
tristate "GPIO Buttons"
|
2015-08-05 02:43:40 +08:00
|
|
|
depends on GPIOLIB || COMPILE_TEST
|
2005-04-17 06:20:36 +08:00
|
|
|
help
|
2009-06-29 15:00:52 +08:00
|
|
|
This driver implements support for buttons connected
|
|
|
|
to GPIO pins of various CPUs (and some other chips).
|
2007-06-20 18:23:33 +08:00
|
|
|
|
2009-06-29 15:00:52 +08:00
|
|
|
Say Y here if your device has buttons connected
|
|
|
|
directly to such GPIO pins. Your board-specific
|
|
|
|
setup logic must also provide a platform device,
|
|
|
|
with configuration data saying which GPIOs are used.
|
2007-05-02 04:32:38 +08:00
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
Input: add support for generic GPIO-based matrix keypad
Original patch by Marek Vasut, modified by Eric in:
1. use delayed work to simplify the debouncing
2. combine col_polarity/row_polarity into a single active_low field
3. use a generic bit array based XOR algorithm to detect key
press/release, which should make the column assertion time
shorter and code a bit cleaner
4. remove the ALT_FN handling, which is no way generic, the ALT_FN
key should be treated as no different from other keys, and
translation will be done by user space by commands like 'loadkeys'.
5. explicitly disable row IRQs and flush potential pending work,
and schedule an immediate scan after resuming as suggested
by Uli Luckas
6. incorporate review comments from many others
Patch tested on Littleton/PXA310 (though PXA310 has a dedicate keypad
controller, I have to configure those pins as generic GPIO to use this
driver, works quite well, though), and Sharp Zaurus model SL-C7x0
and SL-C1000.
[dtor@mail.ru: fix error unwinding path, support changing keymap
from userspace]
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Reviewed-by: Trilok Soni <soni.trilok@gmail.com>
Reviewed-by: Uli Luckas <u.luckas@road.de>
Reviewed-by: Russell King <linux@arm.linux.org.uk>
Reviewed-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-06-29 15:20:52 +08:00
|
|
|
module will be called gpio_keys.
|
|
|
|
|
2010-12-07 09:14:47 +08:00
|
|
|
config KEYBOARD_GPIO_POLLED
|
|
|
|
tristate "Polled GPIO buttons"
|
2013-03-28 19:34:56 +08:00
|
|
|
depends on GPIOLIB
|
2010-12-07 09:14:47 +08:00
|
|
|
help
|
|
|
|
This driver implements support for buttons connected
|
|
|
|
to GPIO pins that are not capable of generating interrupts.
|
|
|
|
|
|
|
|
Say Y here if your device has buttons connected
|
|
|
|
directly to such GPIO pins. Your board-specific
|
|
|
|
setup logic must also provide a platform device,
|
|
|
|
with configuration data saying which GPIOs are used.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called gpio_keys_polled.
|
|
|
|
|
2010-05-04 14:47:12 +08:00
|
|
|
config KEYBOARD_TCA6416
|
2010-12-07 18:54:00 +08:00
|
|
|
tristate "TCA6416/TCA6408A Keypad Support"
|
2010-05-04 14:47:12 +08:00
|
|
|
depends on I2C
|
|
|
|
help
|
|
|
|
This driver implements basic keypad functionality
|
2010-12-07 18:54:00 +08:00
|
|
|
for keys connected through TCA6416/TCA6408A IO expanders.
|
2010-05-04 14:47:12 +08:00
|
|
|
|
|
|
|
Say Y here if your device has keys connected to
|
2010-12-07 18:54:00 +08:00
|
|
|
TCA6416/TCA6408A IO expander. Your board-specific setup logic
|
2010-05-04 14:47:12 +08:00
|
|
|
must also provide pin-mask details(of which TCA6416 pins
|
|
|
|
are used for keypad).
|
|
|
|
|
2010-12-07 18:54:00 +08:00
|
|
|
If enabled the entire TCA6416 device will be managed through
|
2010-05-04 14:47:12 +08:00
|
|
|
this driver.
|
|
|
|
|
2010-12-07 18:54:00 +08:00
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called tca6416_keypad.
|
2010-05-04 14:47:12 +08:00
|
|
|
|
2011-10-30 03:31:35 +08:00
|
|
|
config KEYBOARD_TCA8418
|
|
|
|
tristate "TCA8418 Keypad Support"
|
2013-08-30 15:39:53 +08:00
|
|
|
depends on I2C
|
2012-05-11 13:37:08 +08:00
|
|
|
select INPUT_MATRIXKMAP
|
2011-10-30 03:31:35 +08:00
|
|
|
help
|
|
|
|
This driver implements basic keypad functionality
|
|
|
|
for keys connected through TCA8418 keypad decoder.
|
|
|
|
|
|
|
|
Say Y here if your device has keys connected to
|
|
|
|
TCA8418 keypad decoder.
|
|
|
|
|
|
|
|
If enabled the complete TCA8418 device will be managed through
|
|
|
|
this driver.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called tca8418_keypad.
|
|
|
|
|
Input: add support for generic GPIO-based matrix keypad
Original patch by Marek Vasut, modified by Eric in:
1. use delayed work to simplify the debouncing
2. combine col_polarity/row_polarity into a single active_low field
3. use a generic bit array based XOR algorithm to detect key
press/release, which should make the column assertion time
shorter and code a bit cleaner
4. remove the ALT_FN handling, which is no way generic, the ALT_FN
key should be treated as no different from other keys, and
translation will be done by user space by commands like 'loadkeys'.
5. explicitly disable row IRQs and flush potential pending work,
and schedule an immediate scan after resuming as suggested
by Uli Luckas
6. incorporate review comments from many others
Patch tested on Littleton/PXA310 (though PXA310 has a dedicate keypad
controller, I have to configure those pins as generic GPIO to use this
driver, works quite well, though), and Sharp Zaurus model SL-C7x0
and SL-C1000.
[dtor@mail.ru: fix error unwinding path, support changing keymap
from userspace]
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Reviewed-by: Trilok Soni <soni.trilok@gmail.com>
Reviewed-by: Uli Luckas <u.luckas@road.de>
Reviewed-by: Russell King <linux@arm.linux.org.uk>
Reviewed-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-06-29 15:20:52 +08:00
|
|
|
config KEYBOARD_MATRIX
|
|
|
|
tristate "GPIO driven matrix keypad support"
|
2015-08-05 02:43:40 +08:00
|
|
|
depends on GPIOLIB || COMPILE_TEST
|
2012-05-11 13:37:08 +08:00
|
|
|
select INPUT_MATRIXKMAP
|
Input: add support for generic GPIO-based matrix keypad
Original patch by Marek Vasut, modified by Eric in:
1. use delayed work to simplify the debouncing
2. combine col_polarity/row_polarity into a single active_low field
3. use a generic bit array based XOR algorithm to detect key
press/release, which should make the column assertion time
shorter and code a bit cleaner
4. remove the ALT_FN handling, which is no way generic, the ALT_FN
key should be treated as no different from other keys, and
translation will be done by user space by commands like 'loadkeys'.
5. explicitly disable row IRQs and flush potential pending work,
and schedule an immediate scan after resuming as suggested
by Uli Luckas
6. incorporate review comments from many others
Patch tested on Littleton/PXA310 (though PXA310 has a dedicate keypad
controller, I have to configure those pins as generic GPIO to use this
driver, works quite well, though), and Sharp Zaurus model SL-C7x0
and SL-C1000.
[dtor@mail.ru: fix error unwinding path, support changing keymap
from userspace]
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Reviewed-by: Trilok Soni <soni.trilok@gmail.com>
Reviewed-by: Uli Luckas <u.luckas@road.de>
Reviewed-by: Russell King <linux@arm.linux.org.uk>
Reviewed-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-06-29 15:20:52 +08:00
|
|
|
help
|
|
|
|
Enable support for GPIO driven matrix keypad.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called matrix_keypad.
|
2007-05-02 04:32:38 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
config KEYBOARD_HIL_OLD
|
|
|
|
tristate "HP HIL keyboard support (simple driver)"
|
2006-10-10 04:22:37 +08:00
|
|
|
depends on GSC || HP300
|
2005-04-17 06:20:36 +08:00
|
|
|
default y
|
|
|
|
help
|
|
|
|
The "Human Interface Loop" is a older, 8-channel USB-like
|
|
|
|
controller used in several Hewlett Packard models. This driver
|
|
|
|
was adapted from the one written for m68k/hp300, and implements
|
|
|
|
support for a keyboard attached to the HIL port, but not for
|
|
|
|
any other types of HIL input devices like mice or tablets.
|
|
|
|
However, it has been thoroughly tested and is stable.
|
|
|
|
|
|
|
|
If you want full HIL support including support for multiple
|
2006-10-04 04:31:37 +08:00
|
|
|
keyboards, mice, and tablets, you have to enable the
|
2005-04-17 06:20:36 +08:00
|
|
|
"HP System Device Controller i8042 Support" in the input/serio
|
|
|
|
submenu.
|
|
|
|
|
|
|
|
config KEYBOARD_HIL
|
2009-08-08 14:17:47 +08:00
|
|
|
tristate "HP HIL keyboard/pointer support"
|
2006-10-10 04:22:37 +08:00
|
|
|
depends on GSC || HP300
|
2005-04-17 06:20:36 +08:00
|
|
|
default y
|
|
|
|
select HP_SDC
|
|
|
|
select HIL_MLC
|
|
|
|
select SERIO
|
|
|
|
help
|
|
|
|
The "Human Interface Loop" is a older, 8-channel USB-like
|
|
|
|
controller used in several Hewlett Packard models.
|
2009-08-08 14:17:47 +08:00
|
|
|
This driver implements support for HIL-keyboards and pointing
|
|
|
|
devices (mice, tablets, touchscreens) attached
|
2005-04-17 06:20:36 +08:00
|
|
|
to your machine, so normally you should say Y here.
|
|
|
|
|
2007-09-26 12:02:35 +08:00
|
|
|
config KEYBOARD_HP6XX
|
2008-01-14 13:54:23 +08:00
|
|
|
tristate "HP Jornada 6xx keyboard"
|
2007-09-26 12:02:35 +08:00
|
|
|
depends on SH_HP6XX
|
|
|
|
help
|
2008-01-14 13:54:23 +08:00
|
|
|
Say Y here if you have a HP Jornada 620/660/680/690 and want to
|
|
|
|
support the built-in keyboard.
|
2007-09-26 12:02:35 +08:00
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called jornada680_kbd.
|
|
|
|
|
2007-09-26 12:02:49 +08:00
|
|
|
config KEYBOARD_HP7XX
|
2008-01-14 13:54:23 +08:00
|
|
|
tristate "HP Jornada 7xx keyboard"
|
2007-09-26 12:02:49 +08:00
|
|
|
depends on SA1100_JORNADA720_SSP && SA1100_SSP
|
|
|
|
help
|
2008-01-14 13:54:23 +08:00
|
|
|
Say Y here if you have a HP Jornada 710/720/728 and want to
|
|
|
|
support the built-in keyboard.
|
2007-09-26 12:02:49 +08:00
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called jornada720_kbd.
|
|
|
|
|
2009-05-16 11:12:47 +08:00
|
|
|
config KEYBOARD_LM8323
|
|
|
|
tristate "LM8323 keypad chip"
|
2013-08-30 15:39:53 +08:00
|
|
|
depends on I2C
|
2009-05-16 11:12:47 +08:00
|
|
|
depends on LEDS_CLASS
|
|
|
|
help
|
|
|
|
If you say yes here you get support for the National Semiconductor
|
|
|
|
LM8323 keypad controller.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called lm8323.
|
|
|
|
|
2012-04-04 04:39:44 +08:00
|
|
|
config KEYBOARD_LM8333
|
|
|
|
tristate "LM8333 keypad chip"
|
|
|
|
depends on I2C
|
2012-05-11 13:37:08 +08:00
|
|
|
select INPUT_MATRIXKMAP
|
2012-04-04 04:39:44 +08:00
|
|
|
help
|
|
|
|
If you say yes here you get support for the National Semiconductor
|
|
|
|
LM8333 keypad controller.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called lm8333.
|
|
|
|
|
2009-06-29 15:00:52 +08:00
|
|
|
config KEYBOARD_LOCOMO
|
|
|
|
tristate "LoCoMo Keyboard Support"
|
|
|
|
depends on SHARP_LOCOMO
|
2006-09-29 16:59:19 +08:00
|
|
|
help
|
2009-06-29 15:00:52 +08:00
|
|
|
Say Y here if you are running Linux on a Sharp Zaurus Collie or Poodle based PDA
|
2006-09-29 16:59:19 +08:00
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
2009-06-29 15:00:52 +08:00
|
|
|
module will be called locomokbd.
|
|
|
|
|
2012-07-13 15:08:34 +08:00
|
|
|
config KEYBOARD_LPC32XX
|
|
|
|
tristate "LPC32XX matrix key scanner support"
|
|
|
|
depends on ARCH_LPC32XX && OF
|
2012-10-30 13:30:56 +08:00
|
|
|
select INPUT_MATRIXKMAP
|
2012-07-13 15:08:34 +08:00
|
|
|
help
|
|
|
|
Say Y here if you want to use NXP LPC32XX SoC key scanner interface,
|
|
|
|
connected to a key matrix.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called lpc32xx-keys.
|
|
|
|
|
2009-06-29 15:00:52 +08:00
|
|
|
config KEYBOARD_MAPLE
|
|
|
|
tristate "Maple bus keyboard"
|
|
|
|
depends on SH_DREAMCAST && MAPLE
|
|
|
|
help
|
|
|
|
Say Y here if you have a Dreamcast console running Linux and have
|
|
|
|
a keyboard attached to its Maple bus.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called maple_keyb.
|
|
|
|
|
2009-09-22 13:17:04 +08:00
|
|
|
config KEYBOARD_MAX7359
|
|
|
|
tristate "Maxim MAX7359 Key Switch Controller"
|
2015-05-16 04:49:00 +08:00
|
|
|
select INPUT_MATRIXKMAP
|
2009-09-22 13:17:04 +08:00
|
|
|
depends on I2C
|
|
|
|
help
|
|
|
|
If you say yes here you get support for the Maxim MAX7359 Key
|
|
|
|
Switch Controller chip. This providers microprocessors with
|
|
|
|
management of up to 64 key switches
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called max7359_keypad.
|
|
|
|
|
2010-07-04 16:21:25 +08:00
|
|
|
config KEYBOARD_MCS
|
|
|
|
tristate "MELFAS MCS Touchkey"
|
|
|
|
depends on I2C
|
|
|
|
help
|
|
|
|
Say Y here if you have the MELFAS MCS5000/5080 touchkey controller
|
|
|
|
chip in your system.
|
|
|
|
|
|
|
|
If unsure, say N.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called mcs_touchkey.
|
|
|
|
|
2011-05-12 05:32:01 +08:00
|
|
|
config KEYBOARD_MPR121
|
|
|
|
tristate "Freescale MPR121 Touchkey"
|
|
|
|
depends on I2C
|
|
|
|
help
|
|
|
|
Say Y here if you have Freescale MPR121 touchkey controller
|
|
|
|
chip in your system.
|
|
|
|
|
|
|
|
If unsure, say N.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called mpr121_touchkey.
|
|
|
|
|
2015-05-27 00:26:00 +08:00
|
|
|
config KEYBOARD_SNVS_PWRKEY
|
|
|
|
tristate "IMX SNVS Power Key Driver"
|
2019-04-06 01:31:09 +08:00
|
|
|
depends on ARCH_MXC || COMPILE_TEST
|
2015-05-27 00:26:00 +08:00
|
|
|
depends on OF
|
|
|
|
help
|
|
|
|
This is the snvs powerkey driver for the Freescale i.MX application
|
2019-11-26 04:40:47 +08:00
|
|
|
processors.
|
2015-05-27 00:26:00 +08:00
|
|
|
|
|
|
|
To compile this driver as a module, choose M here; the
|
|
|
|
module will be called snvs_pwrkey.
|
|
|
|
|
2010-02-01 09:52:07 +08:00
|
|
|
config KEYBOARD_IMX
|
|
|
|
tristate "IMX keypad support"
|
|
|
|
depends on ARCH_MXC
|
2012-05-11 13:37:08 +08:00
|
|
|
select INPUT_MATRIXKMAP
|
2010-02-01 09:52:07 +08:00
|
|
|
help
|
|
|
|
Enable support for IMX keypad port.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called imx_keypad.
|
|
|
|
|
2019-10-16 08:27:21 +08:00
|
|
|
config KEYBOARD_IMX_SC_KEY
|
|
|
|
tristate "IMX SCU Key Driver"
|
|
|
|
depends on IMX_SCU
|
|
|
|
help
|
|
|
|
This is the system controller key driver for NXP i.MX SoCs with
|
|
|
|
system controller inside.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called imx_sc_key.
|
|
|
|
|
2009-06-29 15:00:52 +08:00
|
|
|
config KEYBOARD_NEWTON
|
|
|
|
tristate "Newton keyboard"
|
|
|
|
select SERIO
|
|
|
|
help
|
|
|
|
Say Y here if you have a Newton keyboard on a serial port.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called newtonkbd.
|
2006-09-29 16:59:19 +08:00
|
|
|
|
2010-09-30 10:42:14 +08:00
|
|
|
config KEYBOARD_NOMADIK
|
|
|
|
tristate "ST-Ericsson Nomadik SKE keyboard"
|
2012-10-18 20:01:25 +08:00
|
|
|
depends on (ARCH_NOMADIK || ARCH_U8500)
|
2012-05-11 13:37:08 +08:00
|
|
|
select INPUT_MATRIXKMAP
|
2010-09-30 10:42:14 +08:00
|
|
|
help
|
|
|
|
Say Y here if you want to use a keypad provided on the SKE controller
|
|
|
|
used on the Ux500 and Nomadik platforms
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called nmk-ske-keypad.
|
|
|
|
|
2013-05-31 04:16:10 +08:00
|
|
|
config KEYBOARD_NSPIRE
|
|
|
|
tristate "TI-NSPIRE built-in keyboard"
|
|
|
|
depends on ARCH_NSPIRE && OF
|
|
|
|
select INPUT_MATRIXKMAP
|
|
|
|
help
|
|
|
|
Say Y here if you want to use the built-in keypad on TI-NSPIRE.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called nspire-keypad.
|
|
|
|
|
2011-01-20 15:38:47 +08:00
|
|
|
config KEYBOARD_TEGRA
|
|
|
|
tristate "NVIDIA Tegra internal matrix keyboard controller support"
|
2013-02-16 09:04:12 +08:00
|
|
|
depends on ARCH_TEGRA && OF
|
2012-05-11 13:37:08 +08:00
|
|
|
select INPUT_MATRIXKMAP
|
2011-01-20 15:38:47 +08:00
|
|
|
help
|
|
|
|
Say Y here if you want to use a matrix keyboard connected directly
|
|
|
|
to the internal keyboard controller on Tegra SoCs.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called tegra-kbc.
|
|
|
|
|
2009-09-16 16:06:42 +08:00
|
|
|
config KEYBOARD_OPENCORES
|
|
|
|
tristate "OpenCores Keyboard Controller"
|
2013-06-11 02:05:40 +08:00
|
|
|
depends on HAS_IOMEM
|
2009-09-16 16:06:42 +08:00
|
|
|
help
|
|
|
|
Say Y here if you want to use the OpenCores Keyboard Controller
|
|
|
|
http://www.opencores.org/project,keyboardcontroller
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here; the
|
|
|
|
module will be called opencores-kbd.
|
|
|
|
|
2007-03-16 12:58:52 +08:00
|
|
|
config KEYBOARD_PXA27x
|
2008-01-31 13:59:31 +08:00
|
|
|
tristate "PXA27x/PXA3xx keypad support"
|
2010-09-04 06:28:07 +08:00
|
|
|
depends on PXA27x || PXA3xx || ARCH_MMP
|
2013-05-06 11:24:58 +08:00
|
|
|
select INPUT_MATRIXKMAP
|
2007-03-16 12:58:52 +08:00
|
|
|
help
|
Input: add support for generic GPIO-based matrix keypad
Original patch by Marek Vasut, modified by Eric in:
1. use delayed work to simplify the debouncing
2. combine col_polarity/row_polarity into a single active_low field
3. use a generic bit array based XOR algorithm to detect key
press/release, which should make the column assertion time
shorter and code a bit cleaner
4. remove the ALT_FN handling, which is no way generic, the ALT_FN
key should be treated as no different from other keys, and
translation will be done by user space by commands like 'loadkeys'.
5. explicitly disable row IRQs and flush potential pending work,
and schedule an immediate scan after resuming as suggested
by Uli Luckas
6. incorporate review comments from many others
Patch tested on Littleton/PXA310 (though PXA310 has a dedicate keypad
controller, I have to configure those pins as generic GPIO to use this
driver, works quite well, though), and Sharp Zaurus model SL-C7x0
and SL-C1000.
[dtor@mail.ru: fix error unwinding path, support changing keymap
from userspace]
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Reviewed-by: Trilok Soni <soni.trilok@gmail.com>
Reviewed-by: Uli Luckas <u.luckas@road.de>
Reviewed-by: Russell King <linux@arm.linux.org.uk>
Reviewed-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-06-29 15:20:52 +08:00
|
|
|
Enable support for PXA27x/PXA3xx keypad controller.
|
2007-03-16 12:58:52 +08:00
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
2008-01-31 13:56:46 +08:00
|
|
|
module will be called pxa27x_keypad.
|
2007-03-16 12:58:52 +08:00
|
|
|
|
2008-12-29 20:00:02 +08:00
|
|
|
config KEYBOARD_PXA930_ROTARY
|
|
|
|
tristate "PXA930/PXA935 Enhanced Rotary Controller Support"
|
|
|
|
depends on CPU_PXA930 || CPU_PXA935
|
|
|
|
help
|
|
|
|
Enable support for PXA930/PXA935 Enhanced Rotary Controller.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called pxa930_rotary.
|
|
|
|
|
2011-05-19 13:24:04 +08:00
|
|
|
config KEYBOARD_PMIC8XXX
|
|
|
|
tristate "Qualcomm PMIC8XXX keypad support"
|
|
|
|
depends on MFD_PM8XXX
|
2012-05-11 13:37:08 +08:00
|
|
|
select INPUT_MATRIXKMAP
|
2011-05-19 13:24:04 +08:00
|
|
|
help
|
|
|
|
Say Y here if you want to enable the driver for the PMIC8XXX
|
|
|
|
keypad provided as a reference design from Qualcomm. This is intended
|
|
|
|
to support upto 18x8 matrix based keypad design.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the module will
|
|
|
|
be called pmic8xxx-keypad.
|
|
|
|
|
2010-07-21 15:45:10 +08:00
|
|
|
config KEYBOARD_SAMSUNG
|
|
|
|
tristate "Samsung keypad support"
|
2011-11-08 15:59:41 +08:00
|
|
|
depends on HAVE_CLK
|
2012-05-11 13:37:08 +08:00
|
|
|
select INPUT_MATRIXKMAP
|
2010-07-21 15:45:10 +08:00
|
|
|
help
|
2011-11-08 15:59:41 +08:00
|
|
|
Say Y here if you want to use the keypad on your Samsung mobile
|
|
|
|
device.
|
2010-07-21 15:45:10 +08:00
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called samsung-keypad.
|
|
|
|
|
2013-01-24 11:45:00 +08:00
|
|
|
config KEYBOARD_GOLDFISH_EVENTS
|
2015-10-03 01:49:48 +08:00
|
|
|
depends on GOLDFISH || COMPILE_TEST
|
2013-01-24 11:45:00 +08:00
|
|
|
tristate "Generic Input Event device for Goldfish"
|
|
|
|
help
|
|
|
|
Say Y here to get an input event device for the Goldfish virtual
|
|
|
|
device emulator.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called goldfish-events.
|
|
|
|
|
2009-06-29 15:00:52 +08:00
|
|
|
config KEYBOARD_STOWAWAY
|
|
|
|
tristate "Stowaway keyboard"
|
|
|
|
select SERIO
|
2007-10-13 08:36:13 +08:00
|
|
|
help
|
2009-06-29 15:00:52 +08:00
|
|
|
Say Y here if you have a Stowaway keyboard on a serial port.
|
|
|
|
Stowaway compatible keyboards like Dicota Input-PDA keyboard
|
|
|
|
are also supported by this driver.
|
2007-10-13 08:36:13 +08:00
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
2009-06-29 15:00:52 +08:00
|
|
|
module will be called stowaway.
|
2007-10-13 08:36:13 +08:00
|
|
|
|
2014-04-13 04:45:50 +08:00
|
|
|
config KEYBOARD_ST_KEYSCAN
|
|
|
|
tristate "STMicroelectronics keyscan support"
|
|
|
|
depends on ARCH_STI || COMPILE_TEST
|
|
|
|
select INPUT_MATRIXKMAP
|
|
|
|
help
|
|
|
|
Say Y here if you want to use a keypad attached to the keyscan block
|
|
|
|
on some STMicroelectronics SoC devices.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called st-keyscan.
|
|
|
|
|
2009-06-29 15:00:52 +08:00
|
|
|
config KEYBOARD_SUNKBD
|
|
|
|
tristate "Sun Type 4 and Type 5 keyboard"
|
|
|
|
select SERIO
|
2007-10-13 12:36:46 +08:00
|
|
|
help
|
2009-06-29 15:00:52 +08:00
|
|
|
Say Y here if you want to use a Sun Type 4 or Type 5 keyboard,
|
|
|
|
connected either to the Sun keyboard connector or to an serial
|
|
|
|
(RS-232) port via a simple adapter.
|
2007-10-13 12:36:46 +08:00
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
2009-06-29 15:00:52 +08:00
|
|
|
module will be called sunkbd.
|
2007-10-13 12:36:46 +08:00
|
|
|
|
2008-03-05 07:23:45 +08:00
|
|
|
config KEYBOARD_SH_KEYSC
|
|
|
|
tristate "SuperH KEYSC keypad support"
|
2016-03-05 03:21:18 +08:00
|
|
|
depends on ARCH_SHMOBILE || COMPILE_TEST
|
2008-03-05 07:23:45 +08:00
|
|
|
help
|
|
|
|
Say Y here if you want to use a keypad attached to the KEYSC block
|
|
|
|
on SuperH processors such as sh7722 and sh7343.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called sh_keysc.
|
2009-05-16 11:12:47 +08:00
|
|
|
|
2010-07-02 19:22:10 +08:00
|
|
|
config KEYBOARD_STMPE
|
|
|
|
tristate "STMPE keypad support"
|
|
|
|
depends on MFD_STMPE
|
2014-11-04 08:51:26 +08:00
|
|
|
depends on OF
|
2012-05-11 13:37:08 +08:00
|
|
|
select INPUT_MATRIXKMAP
|
2010-07-02 19:22:10 +08:00
|
|
|
help
|
|
|
|
Say Y here if you want to use the keypad controller on STMPE I/O
|
|
|
|
expanders.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the module will be
|
|
|
|
called stmpe-keypad.
|
|
|
|
|
2014-12-19 01:24:50 +08:00
|
|
|
config KEYBOARD_SUN4I_LRADC
|
|
|
|
tristate "Allwinner sun4i low res adc attached tablet keys support"
|
|
|
|
depends on ARCH_SUNXI
|
|
|
|
help
|
|
|
|
This selects support for the Allwinner low res adc attached tablet
|
|
|
|
keys found on Allwinner sunxi SoCs.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called sun4i-lradc-keys.
|
|
|
|
|
2009-10-14 14:37:32 +08:00
|
|
|
config KEYBOARD_DAVINCI
|
|
|
|
tristate "TI DaVinci Key Scan"
|
|
|
|
depends on ARCH_DAVINCI_DM365
|
|
|
|
help
|
|
|
|
Say Y to enable keypad module support for the TI DaVinci
|
|
|
|
platforms (DM365).
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called davinci_keyscan.
|
|
|
|
|
2015-03-05 06:47:58 +08:00
|
|
|
config KEYBOARD_IPAQ_MICRO
|
|
|
|
tristate "Buttons on Micro SoC (iPaq h3100,h3600,h3700)"
|
|
|
|
depends on MFD_IPAQ_MICRO
|
|
|
|
help
|
|
|
|
Say Y to enable support for the buttons attached to
|
|
|
|
Micro peripheral controller on iPAQ h3100/h3600/h3700
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called ipaq-micro-keys.
|
|
|
|
|
2020-02-17 07:32:07 +08:00
|
|
|
config KEYBOARD_IQS62X
|
|
|
|
tristate "Azoteq IQS620A/621/622/624/625 keys and switches"
|
|
|
|
depends on MFD_IQS62X
|
|
|
|
help
|
|
|
|
Say Y here to enable key and switch support for the Azoteq IQS620A,
|
|
|
|
IQS621, IQS622, IQS624 and IQS625 multi-function sensors.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the module will
|
|
|
|
be called iqs62x-keys.
|
|
|
|
|
2009-06-29 15:00:52 +08:00
|
|
|
config KEYBOARD_OMAP
|
|
|
|
tristate "TI OMAP keypad support"
|
2012-09-08 04:27:58 +08:00
|
|
|
depends on ARCH_OMAP1
|
2012-05-11 13:37:08 +08:00
|
|
|
select INPUT_MATRIXKMAP
|
2009-04-19 14:43:57 +08:00
|
|
|
help
|
2009-06-29 15:00:52 +08:00
|
|
|
Say Y here if you want to use the OMAP keypad.
|
2009-04-19 14:43:57 +08:00
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
2009-06-29 15:00:52 +08:00
|
|
|
module will be called omap-keypad.
|
|
|
|
|
2010-09-01 08:05:27 +08:00
|
|
|
config KEYBOARD_OMAP4
|
Input: omap-keypad - dynamically handle register offsets
Hi Dmitry,
On Wed, May 9, 2012 at 3:14 PM, Poddar, Sourav <sourav.poddar@ti.com> wrote:
> Hi Dmitry,
>
> I did some minor fixes to the patch which you suggested above and
> the keypad is functional now.
>
> Changes:
> - Move "pm_runtime_enable" before using "pm_runtime_get_sync".
>
> Sending the patch inlined..(also attached).
>
> From: G, Manjunath Kondaiah <manjugk@ti.com>
> Date: Mon, 10 Oct 2011 20:52:05 +0530
> Subject: [PATCH] Input: omap-keypad: dynamically handle register offsets
>
> Keypad controller register offsets are different for omap4
> and omap5. Handle these offsets through static mapping and
> assign these mappings during run time.
>
> Tested on omap4430 sdp with 3.4-rc3.
> Tested on omap5430evm with 3.1-custom kernel.
>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
> Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
> ---
> drivers/input/keyboard/Kconfig | 4 +-
> drivers/input/keyboard/omap4-keypad.c | 120 +++++++++++++++++++++++++-------
> 2 files changed, 95 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
> index f354813..33bbdee 100644
> --- a/drivers/input/keyboard/Kconfig
> +++ b/drivers/input/keyboard/Kconfig
> @@ -512,9 +512,9 @@ config KEYBOARD_OMAP
> module will be called omap-keypad.
>
> config KEYBOARD_OMAP4
> - tristate "TI OMAP4 keypad support"
> + tristate "TI OMAP4+ keypad support"
> help
> - Say Y here if you want to use the OMAP4 keypad.
> + Say Y here if you want to use the OMAP4+ keypad.
>
> To compile this driver as a module, choose M here: the
> module will be called omap4-keypad.
> diff --git a/drivers/input/keyboard/omap4-keypad.c
> b/drivers/input/keyboard/omap4-keypad.c
> index e809ac0..d7102e8 100644
> --- a/drivers/input/keyboard/omap4-keypad.c
> +++ b/drivers/input/keyboard/omap4-keypad.c
> @@ -68,19 +68,52 @@
>
> #define OMAP4_MASK_IRQSTATUSDISABLE 0xFFFF
>
> +enum {
> + KBD_REVISION_OMAP4 = 0,
> + KBD_REVISION_OMAP5,
> +};
> +
> struct omap4_keypad {
> struct input_dev *input;
>
> void __iomem *base;
> - int irq;
> + unsigned int irq;
>
> unsigned int rows;
> unsigned int cols;
> + u32 reg_offset;
> + u32 irqreg_offset;
> unsigned int row_shift;
> unsigned char key_state[8];
> unsigned short keymap[];
> };
>
> +static int kbd_readl(struct omap4_keypad *keypad_data, u32 offset)
> +{
> + return __raw_readl(keypad_data->base +
> + keypad_data->reg_offset + offset);
> +}
> +
> +static void kbd_writel(struct omap4_keypad *keypad_data, u32 offset, u32 value)
> +{
> + __raw_writel(value,
> + keypad_data->base + keypad_data->reg_offset + offset);
> +}
> +
> +static int kbd_read_irqreg(struct omap4_keypad *keypad_data, u32 offset)
> +{
> + return __raw_readl(keypad_data->base +
> + keypad_data->irqreg_offset + offset);
> +}
> +
> +static void kbd_write_irqreg(struct omap4_keypad *keypad_data,
> + u32 offset, u32 value)
> +{
> + __raw_writel(value,
> + keypad_data->base + keypad_data->irqreg_offset + offset);
> +}
> +
> +
> /* Interrupt handler */
> static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id)
> {
> @@ -91,12 +124,11 @@ static irqreturn_t omap4_keypad_interrupt(int
> irq, void *dev_id)
> u32 *new_state = (u32 *) key_state;
>
> /* Disable interrupts */
> - __raw_writel(OMAP4_VAL_IRQDISABLE,
> - keypad_data->base + OMAP4_KBD_IRQENABLE);
> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
> + OMAP4_VAL_IRQDISABLE);
>
> - *new_state = __raw_readl(keypad_data->base + OMAP4_KBD_FULLCODE31_0);
> - *(new_state + 1) = __raw_readl(keypad_data->base
> - + OMAP4_KBD_FULLCODE63_32);
> + *new_state = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE31_0);
> + *(new_state + 1) = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE63_32);
>
> for (row = 0; row < keypad_data->rows; row++) {
> changed = key_state[row] ^ keypad_data->key_state[row];
> @@ -121,12 +153,13 @@ static irqreturn_t omap4_keypad_interrupt(int
> irq, void *dev_id)
> sizeof(keypad_data->key_state));
>
> /* clear pending interrupts */
> - __raw_writel(__raw_readl(keypad_data->base + OMAP4_KBD_IRQSTATUS),
> - keypad_data->base + OMAP4_KBD_IRQSTATUS);
> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
> + kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
>
> /* enable interrupts */
> - __raw_writel(OMAP4_DEF_IRQENABLE_EVENTEN | OMAP4_DEF_IRQENABLE_LONGKEY,
> - keypad_data->base + OMAP4_KBD_IRQENABLE);
> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
> + OMAP4_DEF_IRQENABLE_EVENTEN |
> + OMAP4_DEF_IRQENABLE_LONGKEY);
>
> return IRQ_HANDLED;
> }
> @@ -139,16 +172,17 @@ static int omap4_keypad_open(struct input_dev *input)
>
> disable_irq(keypad_data->irq);
>
> - __raw_writel(OMAP4_VAL_FUNCTIONALCFG,
> - keypad_data->base + OMAP4_KBD_CTRL);
> - __raw_writel(OMAP4_VAL_DEBOUNCINGTIME,
> - keypad_data->base + OMAP4_KBD_DEBOUNCINGTIME);
> - __raw_writel(OMAP4_VAL_IRQDISABLE,
> - keypad_data->base + OMAP4_KBD_IRQSTATUS);
> - __raw_writel(OMAP4_DEF_IRQENABLE_EVENTEN | OMAP4_DEF_IRQENABLE_LONGKEY,
> - keypad_data->base + OMAP4_KBD_IRQENABLE);
> - __raw_writel(OMAP4_DEF_WUP_EVENT_ENA | OMAP4_DEF_WUP_LONG_KEY_ENA,
> - keypad_data->base + OMAP4_KBD_WAKEUPENABLE);
> + kbd_writel(keypad_data, OMAP4_KBD_CTRL,
> + OMAP4_VAL_FUNCTIONALCFG);
> + kbd_writel(keypad_data, OMAP4_KBD_DEBOUNCINGTIME,
> + OMAP4_VAL_DEBOUNCINGTIME);
> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
> + OMAP4_VAL_IRQDISABLE);
> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
> + OMAP4_DEF_IRQENABLE_EVENTEN |
> + OMAP4_DEF_IRQENABLE_LONGKEY);
> + kbd_writel(keypad_data, OMAP4_KBD_WAKEUPENABLE,
> + OMAP4_DEF_WUP_EVENT_ENA | OMAP4_DEF_WUP_LONG_KEY_ENA);
>
> enable_irq(keypad_data->irq);
>
> @@ -162,12 +196,12 @@ static void omap4_keypad_close(struct input_dev *input)
> disable_irq(keypad_data->irq);
>
> /* Disable interrupts */
> - __raw_writel(OMAP4_VAL_IRQDISABLE,
> - keypad_data->base + OMAP4_KBD_IRQENABLE);
> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
> + OMAP4_VAL_IRQDISABLE);
>
> /* clear pending interrupts */
> - __raw_writel(__raw_readl(keypad_data->base + OMAP4_KBD_IRQSTATUS),
> - keypad_data->base + OMAP4_KBD_IRQSTATUS);
> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
> + kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
>
> enable_irq(keypad_data->irq);
>
> @@ -182,6 +216,7 @@ static int __devinit omap4_keypad_probe(struct
> platform_device *pdev)
> struct resource *res;
> resource_size_t size;
> unsigned int row_shift, max_keys;
> + int rev;
> int irq;
> int error;
>
> @@ -241,11 +276,40 @@ static int __devinit omap4_keypad_probe(struct
> platform_device *pdev)
> keypad_data->rows = pdata->rows;
> keypad_data->cols = pdata->cols;
>
> + /*
> + * Enable clocks for the keypad module so that we can read
> + * revision register.
> + */
> + pm_runtime_enable(&pdev->dev);
> + error = pm_runtime_get_sync(&pdev->dev);
> + if (error) {
> + dev_err(&pdev->dev, "pm_runtime_get_sync() failed\n");
> + goto err_unmap;
> + }
> + rev = __raw_readl(keypad_data->base + OMAP4_KBD_REVISION);
> + rev &= 0x03 << 30;
> + rev >>= 30;
> + switch (rev) {
> + case KBD_REVISION_OMAP4:
> + keypad_data->reg_offset = 0x00;
> + keypad_data->irqreg_offset = 0x00;
> + break;
> + case KBD_REVISION_OMAP5:
> + keypad_data->reg_offset = 0x10;
> + keypad_data->irqreg_offset = 0x0c;
> + break;
> + default:
> + dev_err(&pdev->dev,
> + "Keypad reports unsupported revision %d", rev);
> + error = -EINVAL;
> + goto err_pm_put_sync;
> + }
> +
> /* input device allocation */
> keypad_data->input = input_dev = input_allocate_device();
> if (!input_dev) {
> error = -ENOMEM;
> - goto err_unmap;
> + goto err_pm_put_sync;
> }
>
> input_dev->name = pdev->name;
> @@ -273,14 +337,14 @@ static int __devinit omap4_keypad_probe(struct
> platform_device *pdev)
> input_dev->keycode, input_dev->keybit);
>
> error = request_irq(keypad_data->irq, omap4_keypad_interrupt,
> - IRQF_TRIGGER_RISING,
> + IRQF_DISABLED | IRQF_TRIGGER_RISING,
Sorry, " IRQF_DISABLED" got included by mistake.
Removing this stray change and sending it again.
> "omap4-keypad", keypad_data);
> if (error) {
> dev_err(&pdev->dev, "failed to register interrupt\n");
> goto err_free_input;
> }
>
> - pm_runtime_enable(&pdev->dev);
> + pm_runtime_put_sync(&pdev->dev);
>
> error = input_register_device(keypad_data->input);
> if (error < 0) {
> @@ -296,6 +360,8 @@ err_pm_disable:
> free_irq(keypad_data->irq, keypad_data);
> err_free_input:
> input_free_device(input_dev);
> +err_pm_put_sync:
> + pm_runtime_put_sync(&pdev->dev);
> err_unmap:
> iounmap(keypad_data->base);
> err_release_mem:
>
>
> ~Sourav
>
> On Wed, May 9, 2012 at 1:15 PM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
>>> Hi Dmitry ,
>>>
>>>
>>> On Wed, May 9, 2012 at 10:48 AM, Dmitry Torokhov
>>> <dmitry.torokhov@gmail.com> wrote:
>>> > Ho Sourav,
>>> >
>>> > On Thu, Apr 26, 2012 at 11:24:37AM +0530, Sourav Poddar wrote:
>>> >>
>>> >> -config KEYBOARD_OMAP4
>>> >> - tristate "TI OMAP4 keypad support"
>>> >> +config KEYBOARD_OMAP4+
>>> >
>>> > I think this works purely by accident - '+' sign getting dropped by
>>> > parser...
>>> >
>>> >> @@ -139,16 +192,33 @@ static int omap4_keypad_open(struct input_dev *input)
>>> >>
>>> >> disable_irq(keypad_data->irq);
>>> >>
>>> >> - __raw_writel(OMAP4_VAL_FUNCTIONALCFG,
>>> >> - keypad_data->base + OMAP4_KBD_CTRL);
>>> >> - __raw_writel(OMAP4_VAL_DEBOUNCINGTIME,
>>> >> - keypad_data->base + OMAP4_KBD_DEBOUNCINGTIME);
>>> >> - __raw_writel(OMAP4_VAL_IRQDISABLE,
>>> >> - keypad_data->base + OMAP4_KBD_IRQSTATUS);
>>> >> - __raw_writel(OMAP4_DEF_IRQENABLE_EVENTEN | OMAP4_DEF_IRQENABLE_LONGKEY,
>>> >> - keypad_data->base + OMAP4_KBD_IRQENABLE);
>>> >> - __raw_writel(OMAP4_DEF_WUP_EVENT_ENA | OMAP4_DEF_WUP_LONG_KEY_ENA,
>>> >> - keypad_data->base + OMAP4_KBD_WAKEUPENABLE);
>>> >> + keypad_data->revision = kbd_read_revision(keypad_data,
>>> >> + OMAP4_KBD_REVISION);
>>> >> + switch (keypad_data->revision) {
>>> >> + case 1:
>>> >> + keypad_data->irqstatus = OMAP4_KBD_IRQSTATUS + 0x0c;
>>> >> + keypad_data->irqenable = OMAP4_KBD_IRQENABLE + 0x0c;
>>> >> + keypad_data->reg_offset = 0x10;
>>> >> + break;
>>> >
>>> > This should be done in probe().
>>> >
>>> Dont we then require "pm_runtime_put_sync" in probe, since we are trying
>>> to read the keypad revision register.?
>>
>> Ah, indeed, but I think not pm_runtime_get_sync() but
>> pm_runtime_set_active().
>>
>> Not sure if this will fix the crash...
>>
>> --
>> Dmitry
>>
>>
>> Input: omap-keypad - dynamically handle register offsets
>>
>> From: G, Manjunath Kondaiah <manjugk@ti.com>
>>
>> Keypad controller register offsets are different for omap4
>> and omap5. Handle these offsets through static mapping and
>> assign these mappings during run time.
>>
>> Tested on omap4430 sdp with 3.4-rc3.
>> Tested on omap5430evm with 3.1-custom kernel.
>>
>> Signed-off-by: Felipe Balbi <balbi@ti.com>
>> Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
>> Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
>> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
>> ---
>>
>> drivers/input/keyboard/Kconfig | 4 +
>> drivers/input/keyboard/omap4-keypad.c | 117 ++++++++++++++++++++++++++-------
>> 2 files changed, 94 insertions(+), 27 deletions(-)
>>
>>
>> diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
>> index 20a3753..84ee155 100644
>> --- a/drivers/input/keyboard/Kconfig
>> +++ b/drivers/input/keyboard/Kconfig
>> @@ -531,9 +531,9 @@ config KEYBOARD_OMAP
>> module will be called omap-keypad.
>>
>> config KEYBOARD_OMAP4
>> - tristate "TI OMAP4 keypad support"
>> + tristate "TI OMAP4+ keypad support"
>> help
>> - Say Y here if you want to use the OMAP4 keypad.
>> + Say Y here if you want to use the OMAP4+ keypad.
>>
>> To compile this driver as a module, choose M here: the
>> module will be called omap4-keypad.
>> diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
>> index e809ac0..c9fd0df 100644
>> --- a/drivers/input/keyboard/omap4-keypad.c
>> +++ b/drivers/input/keyboard/omap4-keypad.c
>> @@ -68,19 +68,52 @@
>>
>> #define OMAP4_MASK_IRQSTATUSDISABLE 0xFFFF
>>
>> +enum {
>> + KBD_REVISION_OMAP4 = 0,
>> + KBD_REVISION_OMAP5,
>> +};
>> +
>> struct omap4_keypad {
>> struct input_dev *input;
>>
>> void __iomem *base;
>> - int irq;
>> + unsigned int irq;
>>
>> unsigned int rows;
>> unsigned int cols;
>> + u32 reg_offset;
>> + u32 irqreg_offset;
>> unsigned int row_shift;
>> unsigned char key_state[8];
>> unsigned short keymap[];
>> };
>>
>> +static int kbd_readl(struct omap4_keypad *keypad_data, u32 offset)
>> +{
>> + return __raw_readl(keypad_data->base +
>> + keypad_data->reg_offset + offset);
>> +}
>> +
>> +static void kbd_writel(struct omap4_keypad *keypad_data, u32 offset, u32 value)
>> +{
>> + __raw_writel(value,
>> + keypad_data->base + keypad_data->reg_offset + offset);
>> +}
>> +
>> +static int kbd_read_irqreg(struct omap4_keypad *keypad_data, u32 offset)
>> +{
>> + return __raw_readl(keypad_data->base +
>> + keypad_data->irqreg_offset + offset);
>> +}
>> +
>> +static void kbd_write_irqreg(struct omap4_keypad *keypad_data,
>> + u32 offset, u32 value)
>> +{
>> + __raw_writel(value,
>> + keypad_data->base + keypad_data->irqreg_offset + offset);
>> +}
>> +
>> +
>> /* Interrupt handler */
>> static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id)
>> {
>> @@ -91,12 +124,11 @@ static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id)
>> u32 *new_state = (u32 *) key_state;
>>
>> /* Disable interrupts */
>> - __raw_writel(OMAP4_VAL_IRQDISABLE,
>> - keypad_data->base + OMAP4_KBD_IRQENABLE);
>> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
>> + OMAP4_VAL_IRQDISABLE);
>>
>> - *new_state = __raw_readl(keypad_data->base + OMAP4_KBD_FULLCODE31_0);
>> - *(new_state + 1) = __raw_readl(keypad_data->base
>> - + OMAP4_KBD_FULLCODE63_32);
>> + *new_state = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE31_0);
>> + *(new_state + 1) = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE63_32);
>>
>> for (row = 0; row < keypad_data->rows; row++) {
>> changed = key_state[row] ^ keypad_data->key_state[row];
>> @@ -121,12 +153,13 @@ static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id)
>> sizeof(keypad_data->key_state));
>>
>> /* clear pending interrupts */
>> - __raw_writel(__raw_readl(keypad_data->base + OMAP4_KBD_IRQSTATUS),
>> - keypad_data->base + OMAP4_KBD_IRQSTATUS);
>> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
>> + kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
>>
>> /* enable interrupts */
>> - __raw_writel(OMAP4_DEF_IRQENABLE_EVENTEN | OMAP4_DEF_IRQENABLE_LONGKEY,
>> - keypad_data->base + OMAP4_KBD_IRQENABLE);
>> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
>> + OMAP4_DEF_IRQENABLE_EVENTEN |
>> + OMAP4_DEF_IRQENABLE_LONGKEY);
>>
>> return IRQ_HANDLED;
>> }
>> @@ -139,16 +172,17 @@ static int omap4_keypad_open(struct input_dev *input)
>>
>> disable_irq(keypad_data->irq);
>>
>> - __raw_writel(OMAP4_VAL_FUNCTIONALCFG,
>> - keypad_data->base + OMAP4_KBD_CTRL);
>> - __raw_writel(OMAP4_VAL_DEBOUNCINGTIME,
>> - keypad_data->base + OMAP4_KBD_DEBOUNCINGTIME);
>> - __raw_writel(OMAP4_VAL_IRQDISABLE,
>> - keypad_data->base + OMAP4_KBD_IRQSTATUS);
>> - __raw_writel(OMAP4_DEF_IRQENABLE_EVENTEN | OMAP4_DEF_IRQENABLE_LONGKEY,
>> - keypad_data->base + OMAP4_KBD_IRQENABLE);
>> - __raw_writel(OMAP4_DEF_WUP_EVENT_ENA | OMAP4_DEF_WUP_LONG_KEY_ENA,
>> - keypad_data->base + OMAP4_KBD_WAKEUPENABLE);
>> + kbd_writel(keypad_data, OMAP4_KBD_CTRL,
>> + OMAP4_VAL_FUNCTIONALCFG);
>> + kbd_writel(keypad_data, OMAP4_KBD_DEBOUNCINGTIME,
>> + OMAP4_VAL_DEBOUNCINGTIME);
>> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
>> + OMAP4_VAL_IRQDISABLE);
>> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
>> + OMAP4_DEF_IRQENABLE_EVENTEN |
>> + OMAP4_DEF_IRQENABLE_LONGKEY);
>> + kbd_writel(keypad_data, OMAP4_KBD_WAKEUPENABLE,
>> + OMAP4_DEF_WUP_EVENT_ENA | OMAP4_DEF_WUP_LONG_KEY_ENA);
>>
>> enable_irq(keypad_data->irq);
>>
>> @@ -162,12 +196,12 @@ static void omap4_keypad_close(struct input_dev *input)
>> disable_irq(keypad_data->irq);
>>
>> /* Disable interrupts */
>> - __raw_writel(OMAP4_VAL_IRQDISABLE,
>> - keypad_data->base + OMAP4_KBD_IRQENABLE);
>> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
>> + OMAP4_VAL_IRQDISABLE);
>>
>> /* clear pending interrupts */
>> - __raw_writel(__raw_readl(keypad_data->base + OMAP4_KBD_IRQSTATUS),
>> - keypad_data->base + OMAP4_KBD_IRQSTATUS);
>> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
>> + kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
>>
>> enable_irq(keypad_data->irq);
>>
>> @@ -182,6 +216,7 @@ static int __devinit omap4_keypad_probe(struct platform_device *pdev)
>> struct resource *res;
>> resource_size_t size;
>> unsigned int row_shift, max_keys;
>> + int rev;
>> int irq;
>> int error;
>>
>> @@ -241,11 +276,40 @@ static int __devinit omap4_keypad_probe(struct platform_device *pdev)
>> keypad_data->rows = pdata->rows;
>> keypad_data->cols = pdata->cols;
>>
>> + /*
>> + * Mark device as active (and wake up its parent) so we can read
>> + * revision register.
>> + */
>> + error = pm_runtime_set_active(&pdev->dev);
>> + if (error) {
>> + dev_err(&pdev->dev, "pm_runtime_set_active() failed\n");
>> + goto err_unmap;
>> + }
>> +
>> + rev = __raw_readl(keypad_data->base + OMAP4_KBD_REVISION);
>> + rev &= 0x03 << 30;
>> + rev >>= 30;
>> + switch (rev) {
>> + case KBD_REVISION_OMAP4:
>> + keypad_data->reg_offset = 0x00;
>> + keypad_data->irqreg_offset = 0x00;
>> + break;
>> + case KBD_REVISION_OMAP5:
>> + keypad_data->reg_offset = 0x10;
>> + keypad_data->irqreg_offset = 0x0c;
>> + break;
>> + default:
>> + dev_err(&pdev->dev,
>> + "Keypad reports unsupported revision %d", rev);
>> + error = -EINVAL;
>> + goto err_pm_suspended;
>> + }
>> +
>> /* input device allocation */
>> keypad_data->input = input_dev = input_allocate_device();
>> if (!input_dev) {
>> error = -ENOMEM;
>> - goto err_unmap;
>> + goto err_pm_suspended;
>> }
>>
>> input_dev->name = pdev->name;
>> @@ -281,6 +345,7 @@ static int __devinit omap4_keypad_probe(struct platform_device *pdev)
>> }
>>
>> pm_runtime_enable(&pdev->dev);
>> + pm_runtime_put_sync(&pdev->dev);
>>
>> error = input_register_device(keypad_data->input);
>> if (error < 0) {
>> @@ -296,6 +361,8 @@ err_pm_disable:
>> free_irq(keypad_data->irq, keypad_data);
>> err_free_input:
>> input_free_device(input_dev);
>> +err_pm_suspended:
>> + pm_runtime_set_suspended(&pdev->dev);
>> err_unmap:
>> iounmap(keypad_data->base);
>> err_release_mem:
From: G, Manjunath Kondaiah <manjugk@ti.com>
Date: Mon, 10 Oct 2011 20:52:05 +0530
Subject: [PATCH] Input: omap-keypad: dynamically handle register offsets
Keypad controller register offsets are different for omap4
and omap5. Handle these offsets through static mapping and
assign these mappings during run time.
Tested on omap4430 sdp with 3.4-rc3.
Tested on omap5430evm with 3.1-custom kernel.
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-05-11 13:32:00 +08:00
|
|
|
tristate "TI OMAP4+ keypad support"
|
2014-05-29 15:30:02 +08:00
|
|
|
depends on OF || ARCH_OMAP2PLUS
|
2012-05-11 13:37:08 +08:00
|
|
|
select INPUT_MATRIXKMAP
|
2010-09-01 08:05:27 +08:00
|
|
|
help
|
Input: omap-keypad - dynamically handle register offsets
Hi Dmitry,
On Wed, May 9, 2012 at 3:14 PM, Poddar, Sourav <sourav.poddar@ti.com> wrote:
> Hi Dmitry,
>
> I did some minor fixes to the patch which you suggested above and
> the keypad is functional now.
>
> Changes:
> - Move "pm_runtime_enable" before using "pm_runtime_get_sync".
>
> Sending the patch inlined..(also attached).
>
> From: G, Manjunath Kondaiah <manjugk@ti.com>
> Date: Mon, 10 Oct 2011 20:52:05 +0530
> Subject: [PATCH] Input: omap-keypad: dynamically handle register offsets
>
> Keypad controller register offsets are different for omap4
> and omap5. Handle these offsets through static mapping and
> assign these mappings during run time.
>
> Tested on omap4430 sdp with 3.4-rc3.
> Tested on omap5430evm with 3.1-custom kernel.
>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
> Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
> ---
> drivers/input/keyboard/Kconfig | 4 +-
> drivers/input/keyboard/omap4-keypad.c | 120 +++++++++++++++++++++++++-------
> 2 files changed, 95 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
> index f354813..33bbdee 100644
> --- a/drivers/input/keyboard/Kconfig
> +++ b/drivers/input/keyboard/Kconfig
> @@ -512,9 +512,9 @@ config KEYBOARD_OMAP
> module will be called omap-keypad.
>
> config KEYBOARD_OMAP4
> - tristate "TI OMAP4 keypad support"
> + tristate "TI OMAP4+ keypad support"
> help
> - Say Y here if you want to use the OMAP4 keypad.
> + Say Y here if you want to use the OMAP4+ keypad.
>
> To compile this driver as a module, choose M here: the
> module will be called omap4-keypad.
> diff --git a/drivers/input/keyboard/omap4-keypad.c
> b/drivers/input/keyboard/omap4-keypad.c
> index e809ac0..d7102e8 100644
> --- a/drivers/input/keyboard/omap4-keypad.c
> +++ b/drivers/input/keyboard/omap4-keypad.c
> @@ -68,19 +68,52 @@
>
> #define OMAP4_MASK_IRQSTATUSDISABLE 0xFFFF
>
> +enum {
> + KBD_REVISION_OMAP4 = 0,
> + KBD_REVISION_OMAP5,
> +};
> +
> struct omap4_keypad {
> struct input_dev *input;
>
> void __iomem *base;
> - int irq;
> + unsigned int irq;
>
> unsigned int rows;
> unsigned int cols;
> + u32 reg_offset;
> + u32 irqreg_offset;
> unsigned int row_shift;
> unsigned char key_state[8];
> unsigned short keymap[];
> };
>
> +static int kbd_readl(struct omap4_keypad *keypad_data, u32 offset)
> +{
> + return __raw_readl(keypad_data->base +
> + keypad_data->reg_offset + offset);
> +}
> +
> +static void kbd_writel(struct omap4_keypad *keypad_data, u32 offset, u32 value)
> +{
> + __raw_writel(value,
> + keypad_data->base + keypad_data->reg_offset + offset);
> +}
> +
> +static int kbd_read_irqreg(struct omap4_keypad *keypad_data, u32 offset)
> +{
> + return __raw_readl(keypad_data->base +
> + keypad_data->irqreg_offset + offset);
> +}
> +
> +static void kbd_write_irqreg(struct omap4_keypad *keypad_data,
> + u32 offset, u32 value)
> +{
> + __raw_writel(value,
> + keypad_data->base + keypad_data->irqreg_offset + offset);
> +}
> +
> +
> /* Interrupt handler */
> static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id)
> {
> @@ -91,12 +124,11 @@ static irqreturn_t omap4_keypad_interrupt(int
> irq, void *dev_id)
> u32 *new_state = (u32 *) key_state;
>
> /* Disable interrupts */
> - __raw_writel(OMAP4_VAL_IRQDISABLE,
> - keypad_data->base + OMAP4_KBD_IRQENABLE);
> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
> + OMAP4_VAL_IRQDISABLE);
>
> - *new_state = __raw_readl(keypad_data->base + OMAP4_KBD_FULLCODE31_0);
> - *(new_state + 1) = __raw_readl(keypad_data->base
> - + OMAP4_KBD_FULLCODE63_32);
> + *new_state = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE31_0);
> + *(new_state + 1) = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE63_32);
>
> for (row = 0; row < keypad_data->rows; row++) {
> changed = key_state[row] ^ keypad_data->key_state[row];
> @@ -121,12 +153,13 @@ static irqreturn_t omap4_keypad_interrupt(int
> irq, void *dev_id)
> sizeof(keypad_data->key_state));
>
> /* clear pending interrupts */
> - __raw_writel(__raw_readl(keypad_data->base + OMAP4_KBD_IRQSTATUS),
> - keypad_data->base + OMAP4_KBD_IRQSTATUS);
> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
> + kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
>
> /* enable interrupts */
> - __raw_writel(OMAP4_DEF_IRQENABLE_EVENTEN | OMAP4_DEF_IRQENABLE_LONGKEY,
> - keypad_data->base + OMAP4_KBD_IRQENABLE);
> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
> + OMAP4_DEF_IRQENABLE_EVENTEN |
> + OMAP4_DEF_IRQENABLE_LONGKEY);
>
> return IRQ_HANDLED;
> }
> @@ -139,16 +172,17 @@ static int omap4_keypad_open(struct input_dev *input)
>
> disable_irq(keypad_data->irq);
>
> - __raw_writel(OMAP4_VAL_FUNCTIONALCFG,
> - keypad_data->base + OMAP4_KBD_CTRL);
> - __raw_writel(OMAP4_VAL_DEBOUNCINGTIME,
> - keypad_data->base + OMAP4_KBD_DEBOUNCINGTIME);
> - __raw_writel(OMAP4_VAL_IRQDISABLE,
> - keypad_data->base + OMAP4_KBD_IRQSTATUS);
> - __raw_writel(OMAP4_DEF_IRQENABLE_EVENTEN | OMAP4_DEF_IRQENABLE_LONGKEY,
> - keypad_data->base + OMAP4_KBD_IRQENABLE);
> - __raw_writel(OMAP4_DEF_WUP_EVENT_ENA | OMAP4_DEF_WUP_LONG_KEY_ENA,
> - keypad_data->base + OMAP4_KBD_WAKEUPENABLE);
> + kbd_writel(keypad_data, OMAP4_KBD_CTRL,
> + OMAP4_VAL_FUNCTIONALCFG);
> + kbd_writel(keypad_data, OMAP4_KBD_DEBOUNCINGTIME,
> + OMAP4_VAL_DEBOUNCINGTIME);
> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
> + OMAP4_VAL_IRQDISABLE);
> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
> + OMAP4_DEF_IRQENABLE_EVENTEN |
> + OMAP4_DEF_IRQENABLE_LONGKEY);
> + kbd_writel(keypad_data, OMAP4_KBD_WAKEUPENABLE,
> + OMAP4_DEF_WUP_EVENT_ENA | OMAP4_DEF_WUP_LONG_KEY_ENA);
>
> enable_irq(keypad_data->irq);
>
> @@ -162,12 +196,12 @@ static void omap4_keypad_close(struct input_dev *input)
> disable_irq(keypad_data->irq);
>
> /* Disable interrupts */
> - __raw_writel(OMAP4_VAL_IRQDISABLE,
> - keypad_data->base + OMAP4_KBD_IRQENABLE);
> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
> + OMAP4_VAL_IRQDISABLE);
>
> /* clear pending interrupts */
> - __raw_writel(__raw_readl(keypad_data->base + OMAP4_KBD_IRQSTATUS),
> - keypad_data->base + OMAP4_KBD_IRQSTATUS);
> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
> + kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
>
> enable_irq(keypad_data->irq);
>
> @@ -182,6 +216,7 @@ static int __devinit omap4_keypad_probe(struct
> platform_device *pdev)
> struct resource *res;
> resource_size_t size;
> unsigned int row_shift, max_keys;
> + int rev;
> int irq;
> int error;
>
> @@ -241,11 +276,40 @@ static int __devinit omap4_keypad_probe(struct
> platform_device *pdev)
> keypad_data->rows = pdata->rows;
> keypad_data->cols = pdata->cols;
>
> + /*
> + * Enable clocks for the keypad module so that we can read
> + * revision register.
> + */
> + pm_runtime_enable(&pdev->dev);
> + error = pm_runtime_get_sync(&pdev->dev);
> + if (error) {
> + dev_err(&pdev->dev, "pm_runtime_get_sync() failed\n");
> + goto err_unmap;
> + }
> + rev = __raw_readl(keypad_data->base + OMAP4_KBD_REVISION);
> + rev &= 0x03 << 30;
> + rev >>= 30;
> + switch (rev) {
> + case KBD_REVISION_OMAP4:
> + keypad_data->reg_offset = 0x00;
> + keypad_data->irqreg_offset = 0x00;
> + break;
> + case KBD_REVISION_OMAP5:
> + keypad_data->reg_offset = 0x10;
> + keypad_data->irqreg_offset = 0x0c;
> + break;
> + default:
> + dev_err(&pdev->dev,
> + "Keypad reports unsupported revision %d", rev);
> + error = -EINVAL;
> + goto err_pm_put_sync;
> + }
> +
> /* input device allocation */
> keypad_data->input = input_dev = input_allocate_device();
> if (!input_dev) {
> error = -ENOMEM;
> - goto err_unmap;
> + goto err_pm_put_sync;
> }
>
> input_dev->name = pdev->name;
> @@ -273,14 +337,14 @@ static int __devinit omap4_keypad_probe(struct
> platform_device *pdev)
> input_dev->keycode, input_dev->keybit);
>
> error = request_irq(keypad_data->irq, omap4_keypad_interrupt,
> - IRQF_TRIGGER_RISING,
> + IRQF_DISABLED | IRQF_TRIGGER_RISING,
Sorry, " IRQF_DISABLED" got included by mistake.
Removing this stray change and sending it again.
> "omap4-keypad", keypad_data);
> if (error) {
> dev_err(&pdev->dev, "failed to register interrupt\n");
> goto err_free_input;
> }
>
> - pm_runtime_enable(&pdev->dev);
> + pm_runtime_put_sync(&pdev->dev);
>
> error = input_register_device(keypad_data->input);
> if (error < 0) {
> @@ -296,6 +360,8 @@ err_pm_disable:
> free_irq(keypad_data->irq, keypad_data);
> err_free_input:
> input_free_device(input_dev);
> +err_pm_put_sync:
> + pm_runtime_put_sync(&pdev->dev);
> err_unmap:
> iounmap(keypad_data->base);
> err_release_mem:
>
>
> ~Sourav
>
> On Wed, May 9, 2012 at 1:15 PM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
>>> Hi Dmitry ,
>>>
>>>
>>> On Wed, May 9, 2012 at 10:48 AM, Dmitry Torokhov
>>> <dmitry.torokhov@gmail.com> wrote:
>>> > Ho Sourav,
>>> >
>>> > On Thu, Apr 26, 2012 at 11:24:37AM +0530, Sourav Poddar wrote:
>>> >>
>>> >> -config KEYBOARD_OMAP4
>>> >> - tristate "TI OMAP4 keypad support"
>>> >> +config KEYBOARD_OMAP4+
>>> >
>>> > I think this works purely by accident - '+' sign getting dropped by
>>> > parser...
>>> >
>>> >> @@ -139,16 +192,33 @@ static int omap4_keypad_open(struct input_dev *input)
>>> >>
>>> >> disable_irq(keypad_data->irq);
>>> >>
>>> >> - __raw_writel(OMAP4_VAL_FUNCTIONALCFG,
>>> >> - keypad_data->base + OMAP4_KBD_CTRL);
>>> >> - __raw_writel(OMAP4_VAL_DEBOUNCINGTIME,
>>> >> - keypad_data->base + OMAP4_KBD_DEBOUNCINGTIME);
>>> >> - __raw_writel(OMAP4_VAL_IRQDISABLE,
>>> >> - keypad_data->base + OMAP4_KBD_IRQSTATUS);
>>> >> - __raw_writel(OMAP4_DEF_IRQENABLE_EVENTEN | OMAP4_DEF_IRQENABLE_LONGKEY,
>>> >> - keypad_data->base + OMAP4_KBD_IRQENABLE);
>>> >> - __raw_writel(OMAP4_DEF_WUP_EVENT_ENA | OMAP4_DEF_WUP_LONG_KEY_ENA,
>>> >> - keypad_data->base + OMAP4_KBD_WAKEUPENABLE);
>>> >> + keypad_data->revision = kbd_read_revision(keypad_data,
>>> >> + OMAP4_KBD_REVISION);
>>> >> + switch (keypad_data->revision) {
>>> >> + case 1:
>>> >> + keypad_data->irqstatus = OMAP4_KBD_IRQSTATUS + 0x0c;
>>> >> + keypad_data->irqenable = OMAP4_KBD_IRQENABLE + 0x0c;
>>> >> + keypad_data->reg_offset = 0x10;
>>> >> + break;
>>> >
>>> > This should be done in probe().
>>> >
>>> Dont we then require "pm_runtime_put_sync" in probe, since we are trying
>>> to read the keypad revision register.?
>>
>> Ah, indeed, but I think not pm_runtime_get_sync() but
>> pm_runtime_set_active().
>>
>> Not sure if this will fix the crash...
>>
>> --
>> Dmitry
>>
>>
>> Input: omap-keypad - dynamically handle register offsets
>>
>> From: G, Manjunath Kondaiah <manjugk@ti.com>
>>
>> Keypad controller register offsets are different for omap4
>> and omap5. Handle these offsets through static mapping and
>> assign these mappings during run time.
>>
>> Tested on omap4430 sdp with 3.4-rc3.
>> Tested on omap5430evm with 3.1-custom kernel.
>>
>> Signed-off-by: Felipe Balbi <balbi@ti.com>
>> Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
>> Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
>> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
>> ---
>>
>> drivers/input/keyboard/Kconfig | 4 +
>> drivers/input/keyboard/omap4-keypad.c | 117 ++++++++++++++++++++++++++-------
>> 2 files changed, 94 insertions(+), 27 deletions(-)
>>
>>
>> diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
>> index 20a3753..84ee155 100644
>> --- a/drivers/input/keyboard/Kconfig
>> +++ b/drivers/input/keyboard/Kconfig
>> @@ -531,9 +531,9 @@ config KEYBOARD_OMAP
>> module will be called omap-keypad.
>>
>> config KEYBOARD_OMAP4
>> - tristate "TI OMAP4 keypad support"
>> + tristate "TI OMAP4+ keypad support"
>> help
>> - Say Y here if you want to use the OMAP4 keypad.
>> + Say Y here if you want to use the OMAP4+ keypad.
>>
>> To compile this driver as a module, choose M here: the
>> module will be called omap4-keypad.
>> diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
>> index e809ac0..c9fd0df 100644
>> --- a/drivers/input/keyboard/omap4-keypad.c
>> +++ b/drivers/input/keyboard/omap4-keypad.c
>> @@ -68,19 +68,52 @@
>>
>> #define OMAP4_MASK_IRQSTATUSDISABLE 0xFFFF
>>
>> +enum {
>> + KBD_REVISION_OMAP4 = 0,
>> + KBD_REVISION_OMAP5,
>> +};
>> +
>> struct omap4_keypad {
>> struct input_dev *input;
>>
>> void __iomem *base;
>> - int irq;
>> + unsigned int irq;
>>
>> unsigned int rows;
>> unsigned int cols;
>> + u32 reg_offset;
>> + u32 irqreg_offset;
>> unsigned int row_shift;
>> unsigned char key_state[8];
>> unsigned short keymap[];
>> };
>>
>> +static int kbd_readl(struct omap4_keypad *keypad_data, u32 offset)
>> +{
>> + return __raw_readl(keypad_data->base +
>> + keypad_data->reg_offset + offset);
>> +}
>> +
>> +static void kbd_writel(struct omap4_keypad *keypad_data, u32 offset, u32 value)
>> +{
>> + __raw_writel(value,
>> + keypad_data->base + keypad_data->reg_offset + offset);
>> +}
>> +
>> +static int kbd_read_irqreg(struct omap4_keypad *keypad_data, u32 offset)
>> +{
>> + return __raw_readl(keypad_data->base +
>> + keypad_data->irqreg_offset + offset);
>> +}
>> +
>> +static void kbd_write_irqreg(struct omap4_keypad *keypad_data,
>> + u32 offset, u32 value)
>> +{
>> + __raw_writel(value,
>> + keypad_data->base + keypad_data->irqreg_offset + offset);
>> +}
>> +
>> +
>> /* Interrupt handler */
>> static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id)
>> {
>> @@ -91,12 +124,11 @@ static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id)
>> u32 *new_state = (u32 *) key_state;
>>
>> /* Disable interrupts */
>> - __raw_writel(OMAP4_VAL_IRQDISABLE,
>> - keypad_data->base + OMAP4_KBD_IRQENABLE);
>> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
>> + OMAP4_VAL_IRQDISABLE);
>>
>> - *new_state = __raw_readl(keypad_data->base + OMAP4_KBD_FULLCODE31_0);
>> - *(new_state + 1) = __raw_readl(keypad_data->base
>> - + OMAP4_KBD_FULLCODE63_32);
>> + *new_state = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE31_0);
>> + *(new_state + 1) = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE63_32);
>>
>> for (row = 0; row < keypad_data->rows; row++) {
>> changed = key_state[row] ^ keypad_data->key_state[row];
>> @@ -121,12 +153,13 @@ static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id)
>> sizeof(keypad_data->key_state));
>>
>> /* clear pending interrupts */
>> - __raw_writel(__raw_readl(keypad_data->base + OMAP4_KBD_IRQSTATUS),
>> - keypad_data->base + OMAP4_KBD_IRQSTATUS);
>> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
>> + kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
>>
>> /* enable interrupts */
>> - __raw_writel(OMAP4_DEF_IRQENABLE_EVENTEN | OMAP4_DEF_IRQENABLE_LONGKEY,
>> - keypad_data->base + OMAP4_KBD_IRQENABLE);
>> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
>> + OMAP4_DEF_IRQENABLE_EVENTEN |
>> + OMAP4_DEF_IRQENABLE_LONGKEY);
>>
>> return IRQ_HANDLED;
>> }
>> @@ -139,16 +172,17 @@ static int omap4_keypad_open(struct input_dev *input)
>>
>> disable_irq(keypad_data->irq);
>>
>> - __raw_writel(OMAP4_VAL_FUNCTIONALCFG,
>> - keypad_data->base + OMAP4_KBD_CTRL);
>> - __raw_writel(OMAP4_VAL_DEBOUNCINGTIME,
>> - keypad_data->base + OMAP4_KBD_DEBOUNCINGTIME);
>> - __raw_writel(OMAP4_VAL_IRQDISABLE,
>> - keypad_data->base + OMAP4_KBD_IRQSTATUS);
>> - __raw_writel(OMAP4_DEF_IRQENABLE_EVENTEN | OMAP4_DEF_IRQENABLE_LONGKEY,
>> - keypad_data->base + OMAP4_KBD_IRQENABLE);
>> - __raw_writel(OMAP4_DEF_WUP_EVENT_ENA | OMAP4_DEF_WUP_LONG_KEY_ENA,
>> - keypad_data->base + OMAP4_KBD_WAKEUPENABLE);
>> + kbd_writel(keypad_data, OMAP4_KBD_CTRL,
>> + OMAP4_VAL_FUNCTIONALCFG);
>> + kbd_writel(keypad_data, OMAP4_KBD_DEBOUNCINGTIME,
>> + OMAP4_VAL_DEBOUNCINGTIME);
>> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
>> + OMAP4_VAL_IRQDISABLE);
>> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
>> + OMAP4_DEF_IRQENABLE_EVENTEN |
>> + OMAP4_DEF_IRQENABLE_LONGKEY);
>> + kbd_writel(keypad_data, OMAP4_KBD_WAKEUPENABLE,
>> + OMAP4_DEF_WUP_EVENT_ENA | OMAP4_DEF_WUP_LONG_KEY_ENA);
>>
>> enable_irq(keypad_data->irq);
>>
>> @@ -162,12 +196,12 @@ static void omap4_keypad_close(struct input_dev *input)
>> disable_irq(keypad_data->irq);
>>
>> /* Disable interrupts */
>> - __raw_writel(OMAP4_VAL_IRQDISABLE,
>> - keypad_data->base + OMAP4_KBD_IRQENABLE);
>> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
>> + OMAP4_VAL_IRQDISABLE);
>>
>> /* clear pending interrupts */
>> - __raw_writel(__raw_readl(keypad_data->base + OMAP4_KBD_IRQSTATUS),
>> - keypad_data->base + OMAP4_KBD_IRQSTATUS);
>> + kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
>> + kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
>>
>> enable_irq(keypad_data->irq);
>>
>> @@ -182,6 +216,7 @@ static int __devinit omap4_keypad_probe(struct platform_device *pdev)
>> struct resource *res;
>> resource_size_t size;
>> unsigned int row_shift, max_keys;
>> + int rev;
>> int irq;
>> int error;
>>
>> @@ -241,11 +276,40 @@ static int __devinit omap4_keypad_probe(struct platform_device *pdev)
>> keypad_data->rows = pdata->rows;
>> keypad_data->cols = pdata->cols;
>>
>> + /*
>> + * Mark device as active (and wake up its parent) so we can read
>> + * revision register.
>> + */
>> + error = pm_runtime_set_active(&pdev->dev);
>> + if (error) {
>> + dev_err(&pdev->dev, "pm_runtime_set_active() failed\n");
>> + goto err_unmap;
>> + }
>> +
>> + rev = __raw_readl(keypad_data->base + OMAP4_KBD_REVISION);
>> + rev &= 0x03 << 30;
>> + rev >>= 30;
>> + switch (rev) {
>> + case KBD_REVISION_OMAP4:
>> + keypad_data->reg_offset = 0x00;
>> + keypad_data->irqreg_offset = 0x00;
>> + break;
>> + case KBD_REVISION_OMAP5:
>> + keypad_data->reg_offset = 0x10;
>> + keypad_data->irqreg_offset = 0x0c;
>> + break;
>> + default:
>> + dev_err(&pdev->dev,
>> + "Keypad reports unsupported revision %d", rev);
>> + error = -EINVAL;
>> + goto err_pm_suspended;
>> + }
>> +
>> /* input device allocation */
>> keypad_data->input = input_dev = input_allocate_device();
>> if (!input_dev) {
>> error = -ENOMEM;
>> - goto err_unmap;
>> + goto err_pm_suspended;
>> }
>>
>> input_dev->name = pdev->name;
>> @@ -281,6 +345,7 @@ static int __devinit omap4_keypad_probe(struct platform_device *pdev)
>> }
>>
>> pm_runtime_enable(&pdev->dev);
>> + pm_runtime_put_sync(&pdev->dev);
>>
>> error = input_register_device(keypad_data->input);
>> if (error < 0) {
>> @@ -296,6 +361,8 @@ err_pm_disable:
>> free_irq(keypad_data->irq, keypad_data);
>> err_free_input:
>> input_free_device(input_dev);
>> +err_pm_suspended:
>> + pm_runtime_set_suspended(&pdev->dev);
>> err_unmap:
>> iounmap(keypad_data->base);
>> err_release_mem:
From: G, Manjunath Kondaiah <manjugk@ti.com>
Date: Mon, 10 Oct 2011 20:52:05 +0530
Subject: [PATCH] Input: omap-keypad: dynamically handle register offsets
Keypad controller register offsets are different for omap4
and omap5. Handle these offsets through static mapping and
assign these mappings during run time.
Tested on omap4430 sdp with 3.4-rc3.
Tested on omap5430evm with 3.1-custom kernel.
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-05-11 13:32:00 +08:00
|
|
|
Say Y here if you want to use the OMAP4+ keypad.
|
2010-09-01 08:05:27 +08:00
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called omap4-keypad.
|
|
|
|
|
2010-11-20 04:41:19 +08:00
|
|
|
config KEYBOARD_SPEAR
|
|
|
|
tristate "ST SPEAR keyboard support"
|
|
|
|
depends on PLAT_SPEAR
|
2012-05-11 13:37:08 +08:00
|
|
|
select INPUT_MATRIXKMAP
|
2010-11-20 04:41:19 +08:00
|
|
|
help
|
|
|
|
Say Y here if you want to use the SPEAR keyboard.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
2020-04-19 12:27:25 +08:00
|
|
|
module will be called spear-keyboard.
|
2010-11-20 04:41:19 +08:00
|
|
|
|
2010-12-21 18:23:31 +08:00
|
|
|
config KEYBOARD_TC3589X
|
|
|
|
tristate "TC3589X Keypad support"
|
|
|
|
depends on MFD_TC3589X
|
2012-05-11 13:37:08 +08:00
|
|
|
select INPUT_MATRIXKMAP
|
2010-12-21 18:23:31 +08:00
|
|
|
help
|
|
|
|
Say Y here if you want to use the keypad controller on
|
|
|
|
TC35892/3 I/O expander.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called tc3589x-keypad.
|
|
|
|
|
2017-01-19 06:35:42 +08:00
|
|
|
config KEYBOARD_TM2_TOUCHKEY
|
|
|
|
tristate "TM2 touchkey support"
|
|
|
|
depends on I2C
|
|
|
|
depends on LEDS_CLASS
|
|
|
|
help
|
|
|
|
Say Y here to enable device driver for tm2-touchkey with
|
|
|
|
LED control for the Exynos5433 TM2 board.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here.
|
|
|
|
module will be called tm2-touchkey.
|
|
|
|
|
2009-08-26 10:24:14 +08:00
|
|
|
config KEYBOARD_TWL4030
|
|
|
|
tristate "TI TWL4030/TWL5030/TPS659x0 keypad support"
|
|
|
|
depends on TWL4030_CORE
|
2012-05-11 13:37:08 +08:00
|
|
|
select INPUT_MATRIXKMAP
|
2009-08-26 10:24:14 +08:00
|
|
|
help
|
|
|
|
Say Y here if your board use the keypad controller on
|
|
|
|
TWL4030 family chips. It's safe to say enable this
|
|
|
|
even on boards that don't use the keypad controller.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called twl4030_keypad.
|
|
|
|
|
2009-06-29 15:00:52 +08:00
|
|
|
config KEYBOARD_XTKBD
|
|
|
|
tristate "XT keyboard"
|
|
|
|
select SERIO
|
|
|
|
help
|
|
|
|
Say Y here if you want to use the old IBM PC/XT keyboard (or
|
|
|
|
compatible) on your system. This is only possible with a
|
|
|
|
parallel port keyboard adapter, you cannot connect it to the
|
|
|
|
keyboard port on a PC that runs Linux.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called xtkbd.
|
2009-04-19 14:43:57 +08:00
|
|
|
|
2013-02-26 06:08:41 +08:00
|
|
|
config KEYBOARD_CROS_EC
|
|
|
|
tristate "ChromeOS EC keyboard"
|
|
|
|
select INPUT_MATRIXKMAP
|
2019-09-02 17:53:01 +08:00
|
|
|
depends on CROS_EC
|
2013-02-26 06:08:41 +08:00
|
|
|
help
|
|
|
|
Say Y here to enable the matrix keyboard used by ChromeOS devices
|
|
|
|
and implemented on the ChromeOS EC. You must enable one bus option
|
2018-07-02 18:22:01 +08:00
|
|
|
(CROS_EC_I2C or CROS_EC_SPI) to use this.
|
2013-02-26 06:08:41 +08:00
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called cros_ec_keyb.
|
|
|
|
|
2014-11-01 11:00:13 +08:00
|
|
|
config KEYBOARD_CAP11XX
|
|
|
|
tristate "Microchip CAP11XX based touch sensors"
|
2014-07-16 00:47:52 +08:00
|
|
|
depends on OF && I2C
|
|
|
|
select REGMAP_I2C
|
|
|
|
help
|
2014-11-01 11:00:13 +08:00
|
|
|
Say Y here to enable the CAP11XX touch sensor driver.
|
2014-07-16 00:47:52 +08:00
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
2014-11-01 11:00:13 +08:00
|
|
|
module will be called cap11xx.
|
2014-07-16 00:47:52 +08:00
|
|
|
|
2015-03-01 05:33:30 +08:00
|
|
|
config KEYBOARD_BCM
|
|
|
|
tristate "Broadcom keypad driver"
|
|
|
|
depends on OF && HAVE_CLK
|
|
|
|
select INPUT_MATRIXKMAP
|
|
|
|
default ARCH_BCM_CYGNUS
|
|
|
|
help
|
|
|
|
Say Y here if you want to use Broadcom keypad.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called bcm-keypad.
|
|
|
|
|
2017-10-25 21:16:03 +08:00
|
|
|
config KEYBOARD_MTK_PMIC
|
|
|
|
tristate "MediaTek PMIC keys support"
|
|
|
|
depends on MFD_MT6397
|
|
|
|
help
|
|
|
|
Say Y here if you want to use the pmic keys (powerkey/homekey).
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
|
|
module will be called pmic-keys.
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
endif
|