Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: add driver for Atmel AT42QT2160 Sensor Chip
  Input: max7359 - use threaded IRQs
  Input: add driver for Maxim MAX7359 key switch controller
  Input: add driver for ADP5588 QWERTY I2C Keypad
  Input: add touchscreen driver for MELFAS MCS-5000 controller
  Input: add driver for OpenCores Keyboard Controller
  Input: dm355evm_keys - remove dm355evm_keys_hardirq
  Input: synaptics_i2c - switch to using __cancel_delayed_work()
  Input: ad7879 - add support for AD7889
  Input: atkbd - rely on input core to restore state on resume
  Input: add generic suspend and resume for input devices
  Input: libps2 - additional locking for i8042 ports
  • Loading branch information
Linus Torvalds committed Sep 23, 2009
2 parents c37efa9 + fde1132 commit 0dd52d0
Show file tree
Hide file tree
Showing 24 changed files with 1,987 additions and 80 deletions.
64 changes: 63 additions & 1 deletion drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/

#include <linux/init.h>
#include <linux/types.h>
#include <linux/input.h>
#include <linux/module.h>
#include <linux/random.h>
Expand Down Expand Up @@ -514,7 +515,7 @@ static void input_disconnect_device(struct input_dev *dev)
* that there are no threads in the middle of input_open_device()
*/
mutex_lock(&dev->mutex);
dev->going_away = 1;
dev->going_away = true;
mutex_unlock(&dev->mutex);

spin_lock_irq(&dev->event_lock);
Expand Down Expand Up @@ -1259,10 +1260,71 @@ static int input_dev_uevent(struct device *device, struct kobj_uevent_env *env)
return 0;
}

#define INPUT_DO_TOGGLE(dev, type, bits, on) \
do { \
int i; \
if (!test_bit(EV_##type, dev->evbit)) \
break; \
for (i = 0; i < type##_MAX; i++) { \
if (!test_bit(i, dev->bits##bit) || \
!test_bit(i, dev->bits)) \
continue; \
dev->event(dev, EV_##type, i, on); \
} \
} while (0)

static void input_dev_reset(struct input_dev *dev, bool activate)
{
if (!dev->event)
return;

INPUT_DO_TOGGLE(dev, LED, led, activate);
INPUT_DO_TOGGLE(dev, SND, snd, activate);

if (activate && test_bit(EV_REP, dev->evbit)) {
dev->event(dev, EV_REP, REP_PERIOD, dev->rep[REP_PERIOD]);
dev->event(dev, EV_REP, REP_DELAY, dev->rep[REP_DELAY]);
}
}

#ifdef CONFIG_PM
static int input_dev_suspend(struct device *dev)
{
struct input_dev *input_dev = to_input_dev(dev);

mutex_lock(&input_dev->mutex);
input_dev_reset(input_dev, false);
mutex_unlock(&input_dev->mutex);

return 0;
}

static int input_dev_resume(struct device *dev)
{
struct input_dev *input_dev = to_input_dev(dev);

mutex_lock(&input_dev->mutex);
input_dev_reset(input_dev, true);
mutex_unlock(&input_dev->mutex);

return 0;
}

static const struct dev_pm_ops input_dev_pm_ops = {
.suspend = input_dev_suspend,
.resume = input_dev_resume,
.poweroff = input_dev_suspend,
.restore = input_dev_resume,
};
#endif /* CONFIG_PM */

static struct device_type input_dev_type = {
.groups = input_dev_attr_groups,
.release = input_dev_release,
.uevent = input_dev_uevent,
#ifdef CONFIG_PM
.pm = &input_dev_pm_ops,
#endif
};

static char *input_devnode(struct device *dev, mode_t *mode)
Expand Down
40 changes: 40 additions & 0 deletions drivers/input/keyboard/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ config KEYBOARD_AAED2000
To compile this driver as a module, choose M here: the
module will be called aaed2000_kbd.

config KEYBOARD_ADP5588
tristate "ADP5588 I2C QWERTY Keypad and IO Expander"
depends on I2C
help
Say Y here if you want to use a ADP5588 attached to your
system I2C bus.

To compile this driver as a module, choose M here: the
module will be called adp5588-keys.

config KEYBOARD_AMIGA
tristate "Amiga keyboard"
depends on AMIGA
Expand Down Expand Up @@ -104,6 +114,16 @@ config KEYBOARD_ATKBD_RDI_KEYCODES
right-hand column will be interpreted as the key shown in the
left-hand column.

config QT2160
tristate "Atmel AT42QT2160 Touch Sensor Chip"
depends on I2C && EXPERIMENTAL
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.

config KEYBOARD_BFIN
tristate "Blackfin BF54x keypad support"
depends on (BF54x && !BF544)
Expand Down Expand Up @@ -251,6 +271,17 @@ config KEYBOARD_MAPLE
To compile this driver as a module, choose M here: the
module will be called maple_keyb.

config KEYBOARD_MAX7359
tristate "Maxim MAX7359 Key Switch Controller"
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.

config KEYBOARD_NEWTON
tristate "Newton keyboard"
select SERIO
Expand All @@ -260,6 +291,15 @@ config KEYBOARD_NEWTON
To compile this driver as a module, choose M here: the
module will be called newtonkbd.

config KEYBOARD_OPENCORES
tristate "OpenCores Keyboard Controller"
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.

config KEYBOARD_PXA27x
tristate "PXA27x/PXA3xx keypad support"
depends on PXA27x || PXA3xx
Expand Down
4 changes: 4 additions & 0 deletions drivers/input/keyboard/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Each configuration option enables a list of files.

obj-$(CONFIG_KEYBOARD_AAED2000) += aaed2000_kbd.o
obj-$(CONFIG_KEYBOARD_ADP5588) += adp5588-keys.o
obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o
obj-$(CONFIG_KEYBOARD_ATARI) += atakbd.o
obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o
Expand All @@ -21,10 +22,13 @@ obj-$(CONFIG_KEYBOARD_LM8323) += lm8323.o
obj-$(CONFIG_KEYBOARD_LOCOMO) += locomokbd.o
obj-$(CONFIG_KEYBOARD_MAPLE) += maple_keyb.o
obj-$(CONFIG_KEYBOARD_MATRIX) += matrix_keypad.o
obj-$(CONFIG_KEYBOARD_MAX7359) += max7359_keypad.o
obj-$(CONFIG_KEYBOARD_NEWTON) += newtonkbd.o
obj-$(CONFIG_KEYBOARD_OMAP) += omap-keypad.o
obj-$(CONFIG_KEYBOARD_OPENCORES) += opencores-kbd.o
obj-$(CONFIG_KEYBOARD_PXA27x) += pxa27x_keypad.o
obj-$(CONFIG_KEYBOARD_PXA930_ROTARY) += pxa930_rotary.o
obj-$(CONFIG_KEYBOARD_QT2160) += qt2160.o
obj-$(CONFIG_KEYBOARD_SH_KEYSC) += sh_keysc.o
obj-$(CONFIG_KEYBOARD_SPITZ) += spitzkbd.o
obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o
Expand Down
Loading

0 comments on commit 0dd52d0

Please sign in to comment.