Skip to content

Commit

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

* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/dtor/input:
  Input: remove obsolete setup parameters from input drivers
  Input: HIL - fix improper call to release_region()
  Input: hid-lgff - treat devices as joysticks unless told otherwise
  Input: HID - add support for Logitech Formula Force EX
  Input: gpio-keys - switch to common GPIO API
  Input: do not lock device when showing name, phys and uniq
  Input: i8042 - let serio bus suspend ports
  Input: psmouse - properly reset mouse on shutdown/suspend
  • Loading branch information
Linus Torvalds committed Feb 19, 2007
2 parents cb4aaf4 + 62b529a commit d43a338
Show file tree
Hide file tree
Showing 21 changed files with 124 additions and 104 deletions.
17 changes: 2 additions & 15 deletions drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,18 +588,9 @@ static inline void input_proc_exit(void) { }
static ssize_t input_dev_show_##name(struct class_device *dev, char *buf) \
{ \
struct input_dev *input_dev = to_input_dev(dev); \
int retval; \
\
retval = mutex_lock_interruptible(&input_dev->mutex); \
if (retval) \
return retval; \
\
retval = scnprintf(buf, PAGE_SIZE, \
"%s\n", input_dev->name ? input_dev->name : ""); \
\
mutex_unlock(&input_dev->mutex); \
\
return retval; \
return scnprintf(buf, PAGE_SIZE, "%s\n", \
input_dev->name ? input_dev->name : ""); \
} \
static CLASS_DEVICE_ATTR(name, S_IRUGO, input_dev_show_##name, NULL);

Expand Down Expand Up @@ -1049,10 +1040,6 @@ void input_unregister_device(struct input_dev *dev)
sysfs_remove_group(&dev->cdev.kobj, &input_dev_id_attr_group);
sysfs_remove_group(&dev->cdev.kobj, &input_dev_attr_group);

mutex_lock(&dev->mutex);
dev->name = dev->phys = dev->uniq = NULL;
mutex_unlock(&dev->mutex);

class_device_unregister(&dev->cdev);

input_wakeup_procfs_readers();
Expand Down
2 changes: 0 additions & 2 deletions drivers/input/joystick/amijoy.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ static int amijoy[2] = { 0, 1 };
module_param_array_named(map, amijoy, uint, NULL, 0);
MODULE_PARM_DESC(map, "Map of attached joysticks in form of <a>,<b> (default is 0,1)");

__obsolete_setup("amijoy=");

static int amijoy_used;
static DEFINE_MUTEX(amijoy_mutex);
static struct input_dev *amijoy_dev[2];
Expand Down
2 changes: 0 additions & 2 deletions drivers/input/joystick/analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ static int analog_options[ANALOG_PORTS];
module_param_array_named(map, js, charp, &js_nargs, 0);
MODULE_PARM_DESC(map, "Describes analog joysticks type/capabilities");

__obsolete_setup("js=");

/*
* Times, feature definitions.
*/
Expand Down
4 changes: 0 additions & 4 deletions drivers/input/joystick/db9.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ MODULE_PARM_DESC(dev2, "Describes second attached device (<parport#>,<type>)");
module_param_array_named(dev3, db9[2].args, int, &db9[2].nargs, 0);
MODULE_PARM_DESC(dev3, "Describes third attached device (<parport#>,<type>)");

__obsolete_setup("db9=");
__obsolete_setup("db9_2=");
__obsolete_setup("db9_3=");

#define DB9_ARG_PARPORT 0
#define DB9_ARG_MODE 1

Expand Down
6 changes: 0 additions & 6 deletions drivers/input/joystick/gamecon.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ MODULE_PARM_DESC(map2, "Describes second set of devices");
module_param_array_named(map3, gc[2].args, int, &gc[2].nargs, 0);
MODULE_PARM_DESC(map3, "Describes third set of devices");

__obsolete_setup("gc=");
__obsolete_setup("gc_2=");
__obsolete_setup("gc_3=");

/* see also gs_psx_delay parameter in PSX support section */

#define GC_SNES 1
Expand Down Expand Up @@ -403,8 +399,6 @@ static int gc_psx_delay = GC_PSX_DELAY;
module_param_named(psx_delay, gc_psx_delay, uint, 0);
MODULE_PARM_DESC(psx_delay, "Delay when accessing Sony PSX controller (usecs)");

__obsolete_setup("gc_psx_delay=");

static short gc_psx_abs[] = { ABS_X, ABS_Y, ABS_RX, ABS_RY, ABS_HAT0X, ABS_HAT0Y };
static short gc_psx_btn[] = { BTN_TL, BTN_TR, BTN_TL2, BTN_TR2, BTN_A, BTN_B, BTN_X, BTN_Y,
BTN_START, BTN_SELECT, BTN_THUMBL, BTN_THUMBR };
Expand Down
4 changes: 0 additions & 4 deletions drivers/input/joystick/turbografx.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ MODULE_PARM_DESC(map2, "Describes second set of devices");
module_param_array_named(map3, tgfx[2].args, int, &tgfx[2].nargs, 0);
MODULE_PARM_DESC(map3, "Describes third set of devices");

__obsolete_setup("tgfx=");
__obsolete_setup("tgfx_2=");
__obsolete_setup("tgfx_3=");

#define TGFX_REFRESH_TIME HZ/100 /* 10 ms */

#define TGFX_TRIGGER 0x08
Expand Down
6 changes: 3 additions & 3 deletions drivers/input/keyboard/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,11 @@ config KEYBOARD_AAED2000
module will be called aaed2000_kbd.

config KEYBOARD_GPIO
tristate "Buttons on CPU GPIOs (PXA)"
depends on ARCH_PXA
tristate "Buttons on CPU GPIOs (PXA)"
depends on (ARCH_SA1100 || ARCH_PXA || ARCH_S3C2410)
help
This driver implements support for buttons connected
directly to GPIO pins of PXA CPUs.
directly to GPIO pins of SA1100, PXA or S3C24xx CPUs.

Say Y here if your device has buttons connected
directly to GPIO pins of the CPU.
Expand Down
4 changes: 0 additions & 4 deletions drivers/input/keyboard/atkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ static int atkbd_extra;
module_param_named(extra, atkbd_extra, bool, 0);
MODULE_PARM_DESC(extra, "Enable extra LEDs and keys on IBM RapidAcces, EzKey and similar keyboards");

__obsolete_setup("atkbd_set=");
__obsolete_setup("atkbd_reset");
__obsolete_setup("atkbd_softrepeat=");

/*
* Scancode to keycode tables. These are just the default setting, and
* are loadable via an userland utility.
Expand Down
15 changes: 8 additions & 7 deletions drivers/input/keyboard/gpio_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <linux/input.h>
#include <linux/irq.h>

#include <asm/arch/pxa-regs.h>
#include <asm/gpio.h>
#include <asm/arch/hardware.h>

#include <asm/hardware/gpio_keys.h>
Expand All @@ -38,8 +38,8 @@ static irqreturn_t gpio_keys_isr(int irq, void *dev_id)

for (i = 0; i < pdata->nbuttons; i++) {
int gpio = pdata->buttons[i].gpio;
if (irq == IRQ_GPIO(gpio)) {
int state = ((GPLR(gpio) & GPIO_bit(gpio)) ? 1 : 0) ^ (pdata->buttons[i].active_low);
if (irq == gpio_to_irq(gpio)) {
int state = (gpio_get_value(gpio) ? 1 : 0) ^ (pdata->buttons[i].active_low);

input_report_key(input, pdata->buttons[i].keycode, state);
input_sync(input);
Expand Down Expand Up @@ -75,14 +75,15 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)

for (i = 0; i < pdata->nbuttons; i++) {
int code = pdata->buttons[i].keycode;
int irq = IRQ_GPIO(pdata->buttons[i].gpio);
int irq = gpio_to_irq(pdata->buttons[i].gpio);

set_irq_type(irq, IRQ_TYPE_EDGE_BOTH);
error = request_irq(irq, gpio_keys_isr, IRQF_SAMPLE_RANDOM,
pdata->buttons[i].desc ? pdata->buttons[i].desc : "gpio_keys",
pdev);
if (error) {
printk(KERN_ERR "gpio-keys: unable to claim irq %d; error %d\n", irq, ret);
printk(KERN_ERR "gpio-keys: unable to claim irq %d; error %d\n",
irq, error);
goto fail;
}
set_bit(code, input->keybit);
Expand All @@ -98,7 +99,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)

fail:
for (i = i - 1; i >= 0; i--)
free_irq(IRQ_GPIO(pdata->buttons[i].gpio), pdev);
free_irq(gpio_to_irq(pdata->buttons[i].gpio), pdev);

input_free_device(input);

Expand All @@ -112,7 +113,7 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev)
int i;

for (i = 0; i < pdata->nbuttons; i++) {
int irq = IRQ_GPIO(pdata->buttons[i].gpio);
int irq = gpio_to_irq(pdata->buttons[i].gpio);
free_irq(irq, pdev);
}

Expand Down
2 changes: 2 additions & 0 deletions drivers/input/keyboard/hilkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,10 @@ hil_keyb_init(void)
disable_irq(HIL_IRQ);
free_irq(HIL_IRQ, hil_dev.dev_id);
err2:
#if defined(CONFIG_HP300)
release_region(HILBASE + HIL_DATA, 2);
err1:
#endif
input_free_device(hil_dev.dev);
hil_dev.dev = NULL;
return err;
Expand Down
2 changes: 0 additions & 2 deletions drivers/input/mouse/inport.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ static int inport_irq = INPORT_IRQ;
module_param_named(irq, inport_irq, uint, 0);
MODULE_PARM_DESC(irq, "IRQ number (5=default)");

__obsolete_setup("inport_irq=");

static struct input_dev *inport_dev;

static irqreturn_t inport_interrupt(int irq, void *dev_id)
Expand Down
2 changes: 0 additions & 2 deletions drivers/input/mouse/logibm.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ static int logibm_irq = LOGIBM_IRQ;
module_param_named(irq, logibm_irq, uint, 0);
MODULE_PARM_DESC(irq, "IRQ number (5=default)");

__obsolete_setup("logibm_irq=");

static struct input_dev *logibm_dev;

static irqreturn_t logibm_interrupt(int irq, void *dev_id)
Expand Down
34 changes: 28 additions & 6 deletions drivers/input/mouse/psmouse-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ static struct attribute_group psmouse_attribute_group = {
.attrs = psmouse_attributes,
};

__obsolete_setup("psmouse_noext");
__obsolete_setup("psmouse_resolution=");
__obsolete_setup("psmouse_smartscroll=");
__obsolete_setup("psmouse_resetafter=");
__obsolete_setup("psmouse_rate=");

/*
* psmouse_mutex protects all operations changing state of mouse
* (connecting, disconnecting, changing rate or resolution via
Expand Down Expand Up @@ -987,8 +981,36 @@ static void psmouse_resync(struct work_struct *work)
static void psmouse_cleanup(struct serio *serio)
{
struct psmouse *psmouse = serio_get_drvdata(serio);
struct psmouse *parent = NULL;

mutex_lock(&psmouse_mutex);

if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {
parent = serio_get_drvdata(serio->parent);
psmouse_deactivate(parent);
}

psmouse_deactivate(psmouse);

if (psmouse->cleanup)
psmouse->cleanup(psmouse);

psmouse_reset(psmouse);

/*
* Some boxes, such as HP nx7400, get terribly confused if mouse
* is not fully enabled before suspending/shutting down.
*/
ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_ENABLE);

if (parent) {
if (parent->pt_deactivate)
parent->pt_deactivate(parent);

psmouse_activate(parent);
}

mutex_unlock(&psmouse_mutex);
}

/*
Expand Down
1 change: 1 addition & 0 deletions drivers/input/mouse/psmouse.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ struct psmouse {

int (*reconnect)(struct psmouse *psmouse);
void (*disconnect)(struct psmouse *psmouse);
void (*cleanup)(struct psmouse *psmouse);
int (*poll)(struct psmouse *psmouse);

void (*pt_activate)(struct psmouse *psmouse);
Expand Down
1 change: 1 addition & 0 deletions drivers/input/mouse/synaptics.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ int synaptics_init(struct psmouse *psmouse)
psmouse->set_rate = synaptics_set_rate;
psmouse->disconnect = synaptics_disconnect;
psmouse->reconnect = synaptics_reconnect;
psmouse->cleanup = synaptics_reset;
psmouse->pktsize = 6;
/* Synaptics can usually stay in sync without extra help */
psmouse->resync_time = 0;
Expand Down
Loading

0 comments on commit d43a338

Please sign in to comment.