From ccd3474569a101914444dc37cc108eec22578999 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Tue, 6 May 2008 12:11:39 -0400 Subject: Input: libps2 - remove delayed command execution Delayed command execution is not used by anyone so let's remove it. Reported-by: Adrian Bunk Signed-off-by: Dmitry Torokhov --- drivers/input/serio/libps2.c | 52 -------------------------------------------- 1 file changed, 52 deletions(-) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c index b819239d74d..2b304c22c20 100644 --- a/drivers/input/serio/libps2.c +++ b/drivers/input/serio/libps2.c @@ -26,15 +26,6 @@ MODULE_AUTHOR("Dmitry Torokhov "); MODULE_DESCRIPTION("PS/2 driver library"); MODULE_LICENSE("GPL"); -/* Work structure to schedule execution of a command */ -struct ps2work { - struct work_struct work; - struct ps2dev *ps2dev; - int command; - unsigned char param[0]; -}; - - /* * ps2_sendbyte() sends a byte to the device and waits for acknowledge. * It doesn't handle retransmission, though it could - because if there @@ -245,49 +236,6 @@ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command) } EXPORT_SYMBOL(ps2_command); -/* - * ps2_execute_scheduled_command() sends a command, previously scheduled by - * ps2_schedule_command(), to a PS/2 device (keyboard, mouse, etc.) - */ - -static void ps2_execute_scheduled_command(struct work_struct *work) -{ - struct ps2work *ps2work = container_of(work, struct ps2work, work); - - ps2_command(ps2work->ps2dev, ps2work->param, ps2work->command); - kfree(ps2work); -} - -/* - * ps2_schedule_command() allows to schedule delayed execution of a PS/2 - * command and can be used to issue a command from an interrupt or softirq - * context. - */ - -int ps2_schedule_command(struct ps2dev *ps2dev, unsigned char *param, int command) -{ - struct ps2work *ps2work; - int send = (command >> 12) & 0xf; - int receive = (command >> 8) & 0xf; - - if (!(ps2work = kmalloc(sizeof(struct ps2work) + max(send, receive), GFP_ATOMIC))) - return -1; - - memset(ps2work, 0, sizeof(struct ps2work)); - ps2work->ps2dev = ps2dev; - ps2work->command = command; - memcpy(ps2work->param, param, send); - INIT_WORK(&ps2work->work, ps2_execute_scheduled_command); - - if (!schedule_work(&ps2work->work)) { - kfree(ps2work); - return -1; - } - - return 0; -} -EXPORT_SYMBOL(ps2_schedule_command); - /* * ps2_init() initializes ps2dev structure */ -- cgit v1.2.3 From d1659fcc59b21ec442564fedb67a5ad371f82380 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Tue, 20 May 2008 12:17:39 -0400 Subject: Input: remove CVS keywords This patch removes CVS keywords that weren't updated for a long time from comments. Signed-off-by: Adrian Bunk Signed-off-by: Dmitry Torokhov --- drivers/input/serio/ct82c710.c | 2 -- drivers/input/serio/q40kbd.c | 2 -- drivers/input/serio/rpckbd.c | 2 -- 3 files changed, 6 deletions(-) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/ct82c710.c b/drivers/input/serio/ct82c710.c index 0d35018c23a..d1380fc72cc 100644 --- a/drivers/input/serio/ct82c710.c +++ b/drivers/input/serio/ct82c710.c @@ -1,6 +1,4 @@ /* - * $Id: ct82c710.c,v 1.11 2001/09/25 10:12:07 vojtech Exp $ - * * Copyright (c) 1999-2001 Vojtech Pavlik */ diff --git a/drivers/input/serio/q40kbd.c b/drivers/input/serio/q40kbd.c index cb89aff2e16..eca125c8d53 100644 --- a/drivers/input/serio/q40kbd.c +++ b/drivers/input/serio/q40kbd.c @@ -1,6 +1,4 @@ /* - * $Id: q40kbd.c,v 1.12 2002/02/02 22:26:44 vojtech Exp $ - * * Copyright (c) 2000-2001 Vojtech Pavlik * * Based on the work of: diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c index 34c59d9c620..1567b778247 100644 --- a/drivers/input/serio/rpckbd.c +++ b/drivers/input/serio/rpckbd.c @@ -1,6 +1,4 @@ /* - * $Id: rpckbd.c,v 1.7 2001/09/25 10:12:07 vojtech Exp $ - * * Copyright (c) 2000-2001 Vojtech Pavlik * Copyright (c) 2002 Russell King */ -- cgit v1.2.3 From c3a34f4390396a4bede3f8b7bcc5153f50b974bb Mon Sep 17 00:00:00 2001 From: Jiri Kosina Date: Wed, 28 May 2008 01:10:52 -0400 Subject: Input: i8042 - add Intel D845PESV to nopnp list This patch introduces i8042_dmi_nopnp_table to make it possible to perform DMI matches for systems that need 'i8042.nopnp' to work correctly, and introduces such an entry for Intel D845PESV -- this system doesn't detect PS2 mouse reliably without this option, as reported by Robert Lewis. [dtor@mail.ru - make it compile if CONFIG_PNP is off - reported by Randy Dunlap] Signed-off-by: Jiri Kosina Signed-off-by: Dmitry Torokhov --- drivers/input/serio/i8042-x86ia64io.h | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 5ece9f56bab..2289e3a8f25 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h @@ -63,7 +63,7 @@ static inline void i8042_write_command(int val) outb(val, I8042_COMMAND_REG); } -#if defined(__i386__) || defined(__x86_64__) +#ifdef CONFIG_X86 #include @@ -287,14 +287,19 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = { { } }; - - +#ifdef CONFIG_PNP +static struct dmi_system_id __initdata i8042_dmi_nopnp_table[] = { + { + .ident = "Intel MBO Desktop D845PESV", + .matches = { + DMI_MATCH(DMI_BOARD_NAME, "D845PESV"), + DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"), + }, + }, + { } +}; #endif -#ifdef CONFIG_X86 - -#include - /* * Some Wistron based laptops need us to explicitly enable the 'Dritek * keyboard extension' to make their extra keys start generating scancodes. @@ -342,7 +347,6 @@ static struct dmi_system_id __initdata i8042_dmi_dritek_table[] = { #endif /* CONFIG_X86 */ - #ifdef CONFIG_PNP #include @@ -452,6 +456,11 @@ static int __init i8042_pnp_init(void) int pnp_data_busted = 0; int err; +#ifdef CONFIG_X86 + if (dmi_check_system(i8042_dmi_nopnp_table)) + i8042_nopnp = 1; +#endif + if (i8042_nopnp) { printk(KERN_INFO "i8042: PNP detection disabled\n"); return 0; @@ -577,15 +586,13 @@ static int __init i8042_platform_init(void) i8042_reset = 1; #endif -#if defined(__i386__) || defined(__x86_64__) +#ifdef CONFIG_X86 if (dmi_check_system(i8042_dmi_noloop_table)) i8042_noloop = 1; if (dmi_check_system(i8042_dmi_nomux_table)) i8042_nomux = 1; -#endif -#ifdef CONFIG_X86 if (dmi_check_system(i8042_dmi_dritek_table)) i8042_dritek = 1; #endif /* CONFIG_X86 */ -- cgit v1.2.3 From e8ef4347099584b49ecf74144ad2089b724292cf Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Mon, 2 Jun 2008 00:41:57 -0400 Subject: Input: serio - remove pending events when unregistering driver That fixes an opps when driver is repeatedly loaded and unloaded in a tight loop. Tested-by: Roland Kletzing Signed-off-by: Dmitry Torokhov --- drivers/input/serio/serio.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index 7f5293828fb..78f2abb5c11 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c @@ -331,9 +331,10 @@ static void serio_handle_event(void) } /* - * Remove all events that have been submitted for a given serio port. + * Remove all events that have been submitted for a given + * object, be it serio port or driver. */ -static void serio_remove_pending_events(struct serio *serio) +static void serio_remove_pending_events(void *object) { struct list_head *node, *next; struct serio_event *event; @@ -343,7 +344,7 @@ static void serio_remove_pending_events(struct serio *serio) list_for_each_safe(node, next, &serio_event_list) { event = list_entry(node, struct serio_event, node); - if (event->object == serio) { + if (event->object == object) { list_del_init(node); serio_free_event(event); } @@ -837,7 +838,9 @@ void serio_unregister_driver(struct serio_driver *drv) struct serio *serio; mutex_lock(&serio_mutex); + drv->manual_bind = 1; /* so serio_find_driver ignores it */ + serio_remove_pending_events(drv); start_over: list_for_each_entry(serio, &serio_list, node) { -- cgit v1.2.3 From 0486dc1e9295f46130305817940384458e3f47d1 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Thu, 26 Jun 2008 10:46:38 -0400 Subject: Input: hil_mlc.c - make code static Signed-off-by: Adrian Bunk Signed-off-by: Dmitry Torokhov --- drivers/input/serio/hil_mlc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/hil_mlc.c b/drivers/input/serio/hil_mlc.c index 93a1a6ba216..37586a68d34 100644 --- a/drivers/input/serio/hil_mlc.c +++ b/drivers/input/serio/hil_mlc.c @@ -76,7 +76,7 @@ static struct timer_list hil_mlcs_kicker; static int hil_mlcs_probe; static void hil_mlcs_process(unsigned long unused); -DECLARE_TASKLET_DISABLED(hil_mlcs_tasklet, hil_mlcs_process, 0); +static DECLARE_TASKLET_DISABLED(hil_mlcs_tasklet, hil_mlcs_process, 0); /* #define HIL_MLC_DEBUG */ @@ -459,7 +459,7 @@ static int hilse_operate(hil_mlc *mlc, int repoll) #define OUT_LAST(pack) \ { HILSE_OUT_LAST, { .packet = pack }, 0, 0, 0, 0 }, -const struct hilse_node hil_mlc_se[HILSEN_END] = { +static const struct hilse_node hil_mlc_se[HILSEN_END] = { /* 0 HILSEN_START */ FUNC(hilse_init_lcv, 0, HILSEN_NEXT, HILSEN_SLEEP, 0) @@ -784,7 +784,7 @@ static void hil_mlcs_process(unsigned long unused) /************************* Keepalive timer task *********************/ -void hil_mlcs_timer(unsigned long data) +static void hil_mlcs_timer(unsigned long data) { hil_mlcs_probe = 1; tasklet_schedule(&hil_mlcs_tasklet); -- cgit v1.2.3 From fa14f7e8df9ee8afea23dab21adb0b7a521f1cd6 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Thu, 26 Jun 2008 10:46:39 -0400 Subject: Input: hp_sdc_mlc.c - make a struct static This patch makes the needlessly global struct hp_sdc_mlc_priv_s static. Signed-off-by: Adrian Bunk Signed-off-by: Dmitry Torokhov --- drivers/input/serio/hp_sdc_mlc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/hp_sdc_mlc.c b/drivers/input/serio/hp_sdc_mlc.c index f1fd3b638a3..6c84f4542cc 100644 --- a/drivers/input/serio/hp_sdc_mlc.c +++ b/drivers/input/serio/hp_sdc_mlc.c @@ -50,7 +50,7 @@ MODULE_AUTHOR("Brian S. Julin "); MODULE_DESCRIPTION("Glue for onboard HIL MLC in HP-PARISC machines"); MODULE_LICENSE("Dual BSD/GPL"); -struct hp_sdc_mlc_priv_s { +static struct hp_sdc_mlc_priv_s { int emtestmode; hp_sdc_transaction trans; u8 tseq[16]; -- cgit v1.2.3 From 0376bce7b0659fe1e80d045860087072583ab93f Mon Sep 17 00:00:00 2001 From: Jiri Kosina Date: Thu, 3 Jul 2008 10:45:38 -0400 Subject: Input: i8042 - add Acer Aspire 1360 to nomux blacklist Acer Aspire 1360 needs to be added to nomux blacklist, otherwise its touchpad misbehaves. Reported-by: Clark Tompsett Signed-off-by: Jiri Kosina Signed-off-by: Dmitry Torokhov --- drivers/input/serio/i8042-x86ia64io.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 9818359d26e..876b3b0fd09 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h @@ -291,6 +291,13 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = { DMI_MATCH(DMI_PRODUCT_VERSION, "3000 N100"), }, }, + { + .ident = "Acer Aspire 1360", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"), + }, + }, { } }; -- cgit v1.2.3 From 5b5b43d0b32ea586036638288c31179f00de5443 Mon Sep 17 00:00:00 2001 From: Jiri Kosina Date: Thu, 3 Jul 2008 11:00:28 -0400 Subject: Input: i8042 - add Gericom Bellagio to nomux blacklist Gericom Bellagio needs to be added to nomux blacklist, otherwise its touchpad misbehaves. Reported-by: Roland Kletzing Signed-off-by: Jiri Kosina Signed-off-by: Dmitry Torokhov --- drivers/input/serio/i8042-x86ia64io.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 876b3b0fd09..eea45c0e860 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h @@ -298,6 +298,13 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"), }, }, + { + .ident = "Gericom Bellagio", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Gericom"), + DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"), + }, + }, { } }; -- cgit v1.2.3 From 89cdb8cebe6ab6590f8083877c4ca5e92303b3b0 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Thu, 3 Jul 2008 11:00:28 -0400 Subject: Input: i8042 - add Medion NAM 2070 to noloop blacklist AUX LOOP command fails with a timeout although this laptop has a touchpad. Signed-off-by: Dmitry Torokhov --- drivers/input/serio/i8042-x86ia64io.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index eea45c0e860..2e8b0333fb4 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h @@ -118,6 +118,14 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = { DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"), }, }, + { + .ident = "Medion MAM 2070", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Notebook"), + DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"), + DMI_MATCH(DMI_PRODUCT_VERSION, "5a"), + }, + }, { } }; -- cgit v1.2.3 From 0e7e92fa3c55eee0047ee894b7eb8eb2362d83d9 Mon Sep 17 00:00:00 2001 From: Carlos Corbacho Date: Mon, 7 Jul 2008 08:55:31 -0400 Subject: Input: i8042 - add Dritek quirk for Acer Aspire 5720 The Acer Aspire 5720 series also requires the Dritek quirk to enable the extra scancodes. Signed-off-by: Carlos Corbacho Signed-off-by: Dmitry Torokhov --- drivers/input/serio/i8042-x86ia64io.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 2e8b0333fb4..5d46d6491bf 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h @@ -357,6 +357,13 @@ static struct dmi_system_id __initdata i8042_dmi_dritek_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"), }, }, + { + .ident = "Acer Aspire 5720", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"), + }, + }, { .ident = "Acer Aspire 9110", .matches = { -- cgit v1.2.3 From 4ad88901dd675acb9c8d1eca1f083c3d22cbbd4d Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Thu, 3 Jul 2008 12:10:52 -0400 Subject: Input: q40kbd - make q40kbd_lock static This patch makes the needlessly global q40kbd_lock static. Signed-off-by: Adrian Bunk Signed-off-by: Dmitry Torokhov --- drivers/input/serio/q40kbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/q40kbd.c b/drivers/input/serio/q40kbd.c index eca125c8d53..ab28cf5949f 100644 --- a/drivers/input/serio/q40kbd.c +++ b/drivers/input/serio/q40kbd.c @@ -47,7 +47,7 @@ MODULE_AUTHOR("Vojtech Pavlik "); MODULE_DESCRIPTION("Q40 PS/2 keyboard controller driver"); MODULE_LICENSE("GPL"); -DEFINE_SPINLOCK(q40kbd_lock); +static DEFINE_SPINLOCK(q40kbd_lock); static struct serio *q40kbd_port; static struct platform_device *q40kbd_device; -- cgit v1.2.3 From 1191828f8e6454ebb51da3e1da21912f1783e469 Mon Sep 17 00:00:00 2001 From: John Linn Date: Mon, 7 Jul 2008 16:17:48 -0400 Subject: Input: add new serio driver for Xilinx XPS PS2 IP Added a new driver for Xilinx XPS PS2 IP. This driver is a flat driver to better match the Linux driver pattern. Signed-off-by: Sadanand Signed-off-by: John Linn Signed-off-by: Dmitry Torokhov --- drivers/input/serio/Kconfig | 10 ++ drivers/input/serio/Makefile | 1 + drivers/input/serio/xilinx_ps2.c | 380 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 391 insertions(+) create mode 100644 drivers/input/serio/xilinx_ps2.c (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig index ec4b6610f73..27d70d326ff 100644 --- a/drivers/input/serio/Kconfig +++ b/drivers/input/serio/Kconfig @@ -190,4 +190,14 @@ config SERIO_RAW To compile this driver as a module, choose M here: the module will be called serio_raw. +config SERIO_XILINX_XPS_PS2 + tristate "Xilinx XPS PS/2 Controller Support" + depends on PPC + help + This driver supports XPS PS/2 IP from the Xilinx EDK on + PowerPC platform. + + To compile this driver as a module, choose M here: the + module will be called xilinx_ps2. + endif diff --git a/drivers/input/serio/Makefile b/drivers/input/serio/Makefile index 38b886887cb..9b6c8135955 100644 --- a/drivers/input/serio/Makefile +++ b/drivers/input/serio/Makefile @@ -21,3 +21,4 @@ obj-$(CONFIG_SERIO_PCIPS2) += pcips2.o obj-$(CONFIG_SERIO_MACEPS2) += maceps2.o obj-$(CONFIG_SERIO_LIBPS2) += libps2.o obj-$(CONFIG_SERIO_RAW) += serio_raw.o +obj-$(CONFIG_SERIO_XILINX_XPS_PS2) += xilinx_ps2.o diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c new file mode 100644 index 00000000000..0ed044d5e68 --- /dev/null +++ b/drivers/input/serio/xilinx_ps2.c @@ -0,0 +1,380 @@ +/* + * Xilinx XPS PS/2 device driver + * + * (c) 2005 MontaVista Software, Inc. + * (c) 2008 Xilinx, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define DRIVER_NAME "xilinx_ps2" + +/* Register offsets for the xps2 device */ +#define XPS2_SRST_OFFSET 0x00000000 /* Software Reset register */ +#define XPS2_STATUS_OFFSET 0x00000004 /* Status register */ +#define XPS2_RX_DATA_OFFSET 0x00000008 /* Receive Data register */ +#define XPS2_TX_DATA_OFFSET 0x0000000C /* Transmit Data register */ +#define XPS2_GIER_OFFSET 0x0000002C /* Global Interrupt Enable reg */ +#define XPS2_IPISR_OFFSET 0x00000030 /* Interrupt Status register */ +#define XPS2_IPIER_OFFSET 0x00000038 /* Interrupt Enable register */ + +/* Reset Register Bit Definitions */ +#define XPS2_SRST_RESET 0x0000000A /* Software Reset */ + +/* Status Register Bit Positions */ +#define XPS2_STATUS_RX_FULL 0x00000001 /* Receive Full */ +#define XPS2_STATUS_TX_FULL 0x00000002 /* Transmit Full */ + +/* Bit definitions for ISR/IER registers. Both the registers have the same bit + * definitions and are only defined once. */ +#define XPS2_IPIXR_WDT_TOUT 0x00000001 /* Watchdog Timeout Interrupt */ +#define XPS2_IPIXR_TX_NOACK 0x00000002 /* Transmit No ACK Interrupt */ +#define XPS2_IPIXR_TX_ACK 0x00000004 /* Transmit ACK (Data) Interrupt */ +#define XPS2_IPIXR_RX_OVF 0x00000008 /* Receive Overflow Interrupt */ +#define XPS2_IPIXR_RX_ERR 0x00000010 /* Receive Error Interrupt */ +#define XPS2_IPIXR_RX_FULL 0x00000020 /* Receive Data Interrupt */ + +/* Mask for all the Transmit Interrupts */ +#define XPS2_IPIXR_TX_ALL (XPS2_IPIXR_TX_NOACK | XPS2_IPIXR_TX_ACK) + +/* Mask for all the Receive Interrupts */ +#define XPS2_IPIXR_RX_ALL (XPS2_IPIXR_RX_OVF | XPS2_IPIXR_RX_ERR | \ + XPS2_IPIXR_RX_FULL) + +/* Mask for all the Interrupts */ +#define XPS2_IPIXR_ALL (XPS2_IPIXR_TX_ALL | XPS2_IPIXR_RX_ALL | \ + XPS2_IPIXR_WDT_TOUT) + +/* Global Interrupt Enable mask */ +#define XPS2_GIER_GIE_MASK 0x80000000 + +struct xps2data { + int irq; + u32 phys_addr; + u32 remap_size; + spinlock_t lock; + u8 rxb; /* Rx buffer */ + void __iomem *base_address; /* virt. address of control registers */ + unsigned int dfl; + struct serio serio; /* serio */ +}; + +/************************************/ +/* XPS PS/2 data transmission calls */ +/************************************/ + +/* + * xps2_recv() will attempt to receive a byte of data from the PS/2 port. + */ +static int xps2_recv(struct xps2data *drvdata, u8 *byte) +{ + u32 sr; + int status = -1; + + /* If there is data available in the PS/2 receiver, read it */ + sr = in_be32(drvdata->base_address + XPS2_STATUS_OFFSET); + if (sr & XPS2_STATUS_RX_FULL) { + *byte = in_be32(drvdata->base_address + XPS2_RX_DATA_OFFSET); + status = 0; + } + + return status; +} + +/*********************/ +/* Interrupt handler */ +/*********************/ +static irqreturn_t xps2_interrupt(int irq, void *dev_id) +{ + struct xps2data *drvdata = dev_id; + u32 intr_sr; + u8 c; + int status; + + /* Get the PS/2 interrupts and clear them */ + intr_sr = in_be32(drvdata->base_address + XPS2_IPISR_OFFSET); + out_be32(drvdata->base_address + XPS2_IPISR_OFFSET, intr_sr); + + /* Check which interrupt is active */ + if (intr_sr & XPS2_IPIXR_RX_OVF) + printk(KERN_WARNING "%s: receive overrun error\n", + drvdata->serio.name); + + if (intr_sr & XPS2_IPIXR_RX_ERR) + drvdata->dfl |= SERIO_PARITY; + + if (intr_sr & (XPS2_IPIXR_TX_NOACK | XPS2_IPIXR_WDT_TOUT)) + drvdata->dfl |= SERIO_TIMEOUT; + + if (intr_sr & XPS2_IPIXR_RX_FULL) { + status = xps2_recv(drvdata, &drvdata->rxb); + + /* Error, if a byte is not received */ + if (status) { + printk(KERN_ERR + "%s: wrong rcvd byte count (%d)\n", + drvdata->serio.name, status); + } else { + c = drvdata->rxb; + serio_interrupt(&drvdata->serio, c, drvdata->dfl); + drvdata->dfl = 0; + } + } + + if (intr_sr & XPS2_IPIXR_TX_ACK) + drvdata->dfl = 0; + + return IRQ_HANDLED; +} + +/*******************/ +/* serio callbacks */ +/*******************/ + +/* + * sxps2_write() sends a byte out through the PS/2 interface. + */ +static int sxps2_write(struct serio *pserio, unsigned char c) +{ + struct xps2data *drvdata = pserio->port_data; + unsigned long flags; + u32 sr; + int status = -1; + + spin_lock_irqsave(&drvdata->lock, flags); + + /* If the PS/2 transmitter is empty send a byte of data */ + sr = in_be32(drvdata->base_address + XPS2_STATUS_OFFSET); + if (!(sr & XPS2_STATUS_TX_FULL)) { + out_be32(drvdata->base_address + XPS2_TX_DATA_OFFSET, c); + status = 0; + } + + spin_unlock_irqrestore(&drvdata->lock, flags); + + return status; +} + +/* + * sxps2_open() is called when a port is open by the higher layer. + */ +static int sxps2_open(struct serio *pserio) +{ + struct xps2data *drvdata = pserio->port_data; + int retval; + + retval = request_irq(drvdata->irq, &xps2_interrupt, 0, + DRIVER_NAME, drvdata); + if (retval) { + printk(KERN_ERR + "%s: Couldn't allocate interrupt %d\n", + drvdata->serio.name, drvdata->irq); + return retval; + } + + /* start reception by enabling the interrupts */ + out_be32(drvdata->base_address + XPS2_GIER_OFFSET, XPS2_GIER_GIE_MASK); + out_be32(drvdata->base_address + XPS2_IPIER_OFFSET, XPS2_IPIXR_RX_ALL); + (void)xps2_recv(drvdata, &drvdata->rxb); + + return 0; /* success */ +} + +/* + * sxps2_close() frees the interrupt. + */ +static void sxps2_close(struct serio *pserio) +{ + struct xps2data *drvdata = pserio->port_data; + + /* Disable the PS2 interrupts */ + out_be32(drvdata->base_address + XPS2_GIER_OFFSET, 0x00); + out_be32(drvdata->base_address + XPS2_IPIER_OFFSET, 0x00); + free_irq(drvdata->irq, drvdata); +} + +/*********************/ +/* Device setup code */ +/*********************/ + +static int xps2_setup(struct device *dev, struct resource *regs_res, + struct resource *irq_res) +{ + struct xps2data *drvdata; + struct serio *serio; + unsigned long remap_size; + int retval; + + if (!dev) + return -EINVAL; + + if (!regs_res || !irq_res) { + dev_err(dev, "IO resource(s) not found\n"); + return -EINVAL; + } + + drvdata = kzalloc(sizeof(struct xps2data), GFP_KERNEL); + if (!drvdata) { + dev_err(dev, "Couldn't allocate device private record\n"); + return -ENOMEM; + } + + dev_set_drvdata(dev, drvdata); + + spin_lock_init(&drvdata->lock); + drvdata->irq = irq_res->start; + + remap_size = regs_res->end - regs_res->start + 1; + if (!request_mem_region(regs_res->start, remap_size, DRIVER_NAME)) { + dev_err(dev, "Couldn't lock memory region at 0x%08X\n", + (unsigned int)regs_res->start); + retval = -EBUSY; + goto failed1; + } + + /* Fill in configuration data and add them to the list */ + drvdata->phys_addr = regs_res->start; + drvdata->remap_size = remap_size; + drvdata->base_address = ioremap(regs_res->start, remap_size); + if (drvdata->base_address == NULL) { + dev_err(dev, "Couldn't ioremap memory at 0x%08X\n", + (unsigned int)regs_res->start); + retval = -EFAULT; + goto failed2; + } + + /* Disable all the interrupts, just in case */ + out_be32(drvdata->base_address + XPS2_IPIER_OFFSET, 0); + + /* Reset the PS2 device and abort any current transaction, to make sure + * we have the PS2 in a good state */ + out_be32(drvdata->base_address + XPS2_SRST_OFFSET, XPS2_SRST_RESET); + + dev_info(dev, "Xilinx PS2 at 0x%08X mapped to 0x%08X, irq=%d\n", + drvdata->phys_addr, (u32)drvdata->base_address, drvdata->irq); + + serio = &drvdata->serio; + serio->id.type = SERIO_8042; + serio->write = sxps2_write; + serio->open = sxps2_open; + serio->close = sxps2_close; + serio->port_data = drvdata; + serio->dev.parent = dev; + snprintf(serio->name, sizeof(serio->name), + "Xilinx XPS PS/2 at %08X", drvdata->phys_addr); + snprintf(serio->phys, sizeof(serio->phys), + "xilinxps2/serio at %08X", drvdata->phys_addr); + serio_register_port(serio); + + return 0; /* success */ + +failed2: + release_mem_region(regs_res->start, remap_size); +failed1: + kfree(drvdata); + dev_set_drvdata(dev, NULL); + + return retval; +} + +/***************************/ +/* OF Platform Bus Support */ +/***************************/ + +static int __devinit xps2_of_probe(struct of_device *ofdev, const struct + of_device_id * match) +{ + struct resource r_irq; /* Interrupt resources */ + struct resource r_mem; /* IO mem resources */ + int rc = 0; + + printk(KERN_INFO "Device Tree Probing \'%s\'\n", + ofdev->node->name); + + /* Get iospace for the device */ + rc = of_address_to_resource(ofdev->node, 0, &r_mem); + if (rc) { + dev_err(&ofdev->dev, "invalid address\n"); + return rc; + } + + /* Get IRQ for the device */ + rc = of_irq_to_resource(ofdev->node, 0, &r_irq); + if (rc == NO_IRQ) { + dev_err(&ofdev->dev, "no IRQ found\n"); + return rc; + } + + return xps2_setup(&ofdev->dev, &r_mem, &r_irq); +} + +static int __devexit xps2_of_remove(struct of_device *of_dev) +{ + struct device *dev = &of_dev->dev; + struct xps2data *drvdata; + + if (!dev) + return -EINVAL; + + drvdata = dev_get_drvdata(dev); + + serio_unregister_port(&drvdata->serio); + iounmap(drvdata->base_address); + release_mem_region(drvdata->phys_addr, drvdata->remap_size); + kfree(drvdata); + + dev_set_drvdata(dev, NULL); + + return 0; /* success */ +} + +/* Match table for of_platform binding */ +static struct of_device_id xps2_of_match[] __devinitdata = { + { .compatible = "xlnx,xps-ps2-1.00.a", }, + { /* end of list */ }, +}; +MODULE_DEVICE_TABLE(of, xps2_of_match); + +static struct of_platform_driver xps2_of_driver = { + .name = DRIVER_NAME, + .match_table = xps2_of_match, + .probe = xps2_of_probe, + .remove = __devexit_p(xps2_of_remove), +}; + +static int __init xps2_init(void) +{ + return of_register_platform_driver(&xps2_of_driver); +} + +static void __exit xps2_cleanup(void) +{ + of_unregister_platform_driver(&xps2_of_driver); +} + +module_init(xps2_init); +module_exit(xps2_cleanup); + +MODULE_AUTHOR("Xilinx, Inc."); +MODULE_DESCRIPTION("Xilinx XPS PS/2 driver"); +MODULE_LICENSE("GPL"); + -- cgit v1.2.3 From 305e342bba16730a0821131af6d7d0df43bfff4c Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Mon, 14 Jul 2008 10:28:32 -0400 Subject: Input: add option to disable HP SDC driver Add "no_hpsdc" kernel module option to the hp_sdc driver, so that the driver can be instructed to not enable the HP SDC port. This is useful on some older HPPA boxes with HIL keyboard and HIL mouse where the new HP SDC HIL drivers don't work yet. By disabling the new hp_sdc driver users are able to use the older hilkbd driver instead. Signed-off-by: Helge Deller Signed-off-by: Dmitry Torokhov --- drivers/input/serio/hp_sdc.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/hp_sdc.c b/drivers/input/serio/hp_sdc.c index edfedd9a166..7b233a492ad 100644 --- a/drivers/input/serio/hp_sdc.c +++ b/drivers/input/serio/hp_sdc.c @@ -105,6 +105,10 @@ EXPORT_SYMBOL(__hp_sdc_enqueue_transaction); EXPORT_SYMBOL(hp_sdc_enqueue_transaction); EXPORT_SYMBOL(hp_sdc_dequeue_transaction); +static unsigned int hp_sdc_disabled; +module_param_named(no_hpsdc, hp_sdc_disabled, bool, 0); +MODULE_PARM_DESC(no_hpsdc, "Do not enable HP SDC driver."); + static hp_i8042_sdc hp_sdc; /* All driver state is kept in here. */ /*************** primitives for use in any context *********************/ @@ -980,6 +984,11 @@ static int __init hp_sdc_register(void) unsigned char i; #endif + if (hp_sdc_disabled) { + printk(KERN_WARNING PREFIX "HP SDC driver disabled by no_hpsdc=1.\n"); + return -ENODEV; + } + hp_sdc.dev = NULL; hp_sdc.dev_err = 0; #if defined(__hppa__) -- cgit v1.2.3 From 87d9173ea0c820021cf49e4c675b3821cfb4f0eb Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sat, 19 Jul 2008 00:35:43 -0400 Subject: Input: i8042 - add Arima-Rioworks HDAMB board to noloop list The board does not raise AUX IRQ in response to AUX LOOP command. Reported-by: Guillaume Morin Signed-off-by: Dmitry Torokhov --- drivers/input/serio/i8042-x86ia64io.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 5d46d6491bf..fe732a574ec 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h @@ -68,6 +68,15 @@ static inline void i8042_write_command(int val) #include static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = { + { + /* AUX LOOP command does not raise AUX IRQ */ + .ident = "Arima-Rioworks HDAMB", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"), + DMI_MATCH(DMI_BOARD_NAME, "HDAMB"), + DMI_MATCH(DMI_BOARD_VERSION, "Rev E"), + }, + }, { /* AUX LOOP command does not raise AUX IRQ */ .ident = "ASUS P65UP5", -- cgit v1.2.3 From a352def21a642133758b868c71bee12ab34ad5c5 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 16 Jul 2008 21:53:12 +0100 Subject: tty: Ldisc revamp Move the line disciplines towards a conventional ->ops arrangement. For the moment the actual 'tty_ldisc' struct in the tty is kept as part of the tty struct but this can then be changed if it turns out that when it all settles down we want to refcount ldiscs separately to the tty. Pull the ldisc code out of /proc and put it with our ldisc code. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- drivers/input/serio/serport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/serport.c b/drivers/input/serio/serport.c index 7ff71ba7b7c..b9694b6445d 100644 --- a/drivers/input/serio/serport.c +++ b/drivers/input/serio/serport.c @@ -216,7 +216,7 @@ static void serport_ldisc_write_wakeup(struct tty_struct * tty) * The line discipline structure. */ -static struct tty_ldisc serport_ldisc = { +static struct tty_ldisc_ops serport_ldisc = { .owner = THIS_MODULE, .name = "input", .open = serport_ldisc_open, -- cgit v1.2.3 From 0f17e4c796e89d1f69f13b653aba60e6ccfb8ae0 Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Thu, 24 Jul 2008 08:30:48 -0400 Subject: Add missing semaphore.h includes These files use semaphores but don't include semaphore.h Signed-off-by: Matthew Wilcox Acked-by: Geert Uytterhoeven --- drivers/input/serio/hp_sdc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/hp_sdc.c b/drivers/input/serio/hp_sdc.c index 7b233a492ad..aad664d5259 100644 --- a/drivers/input/serio/hp_sdc.c +++ b/drivers/input/serio/hp_sdc.c @@ -67,6 +67,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3 From 29b309e52d3d51ef8a15bd15590903cf272beb93 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 25 Jul 2008 09:19:36 -0700 Subject: Undo duplicate "m68k: drivers/input/serio/hp_sdc.c needs " Both commits 0f17e4c796e89d1f69f13b653aba60e6ccfb8ae0 ("Add missing semaphore.h includes") and 4933d07531711e399d8d578036aa9fc1be2f9b20 ("m68k: drivers/input/serio/hp_sdc.c needs ") added a We only really need one ;) Reported-by: Huang Weiyi Requested-by: Dmitry Torokhov Signed-off-by: Linus Torvalds --- drivers/input/serio/hp_sdc.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/hp_sdc.c b/drivers/input/serio/hp_sdc.c index aad664d5259..0d395979b2d 100644 --- a/drivers/input/serio/hp_sdc.c +++ b/drivers/input/serio/hp_sdc.c @@ -70,7 +70,6 @@ #include #include #include -#include #include #include -- cgit v1.2.3