aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2006-01-05 22:25:13 -0500
committerDmitry Torokhov <dtor_core@ameritech.net>2006-01-05 22:25:13 -0500
commitfed8bf19ec20efc0641740b2d10aa589dbd6d1ab (patch)
treec104a13c7b8cb7f4152b15729dc5aede7c063e91 /drivers/input
parente7c3aad53dba54d375b632f2a21b680546828dec (diff)
parent46f25dffbaba48c571d75f5f574f31978287b8d2 (diff)
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/input.c54
-rw-r--r--drivers/input/joystick/iforce/iforce-usb.c1
-rw-r--r--drivers/input/joystick/warrior.c2
-rw-r--r--drivers/input/misc/Kconfig2
-rw-r--r--drivers/input/mouse/sermouse.c2
-rw-r--r--drivers/input/serio/i8042.h2
-rw-r--r--drivers/input/serio/serio.c22
7 files changed, 61 insertions, 24 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index bdd2a7fc268d..ef5824c8846b 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -18,7 +18,6 @@
18#include <linux/random.h> 18#include <linux/random.h>
19#include <linux/major.h> 19#include <linux/major.h>
20#include <linux/proc_fs.h> 20#include <linux/proc_fs.h>
21#include <linux/kobject_uevent.h>
22#include <linux/interrupt.h> 21#include <linux/interrupt.h>
23#include <linux/poll.h> 22#include <linux/poll.h>
24#include <linux/device.h> 23#include <linux/device.h>
@@ -529,10 +528,49 @@ INPUT_DEV_STRING_ATTR_SHOW(name);
529INPUT_DEV_STRING_ATTR_SHOW(phys); 528INPUT_DEV_STRING_ATTR_SHOW(phys);
530INPUT_DEV_STRING_ATTR_SHOW(uniq); 529INPUT_DEV_STRING_ATTR_SHOW(uniq);
531 530
531static int print_modalias_bits(char *buf, char prefix, unsigned long *arr,
532 unsigned int min, unsigned int max)
533{
534 int len, i;
535
536 len = sprintf(buf, "%c", prefix);
537 for (i = min; i < max; i++)
538 if (arr[LONG(i)] & BIT(i))
539 len += sprintf(buf+len, "%X,", i);
540 return len;
541}
542
543static ssize_t input_dev_show_modalias(struct class_device *dev, char *buf)
544{
545 struct input_dev *id = to_input_dev(dev);
546 ssize_t len = 0;
547
548 len += sprintf(buf+len, "input:b%04Xv%04Xp%04Xe%04X-",
549 id->id.bustype,
550 id->id.vendor,
551 id->id.product,
552 id->id.version);
553
554 len += print_modalias_bits(buf+len, 'e', id->evbit, 0, EV_MAX);
555 len += print_modalias_bits(buf+len, 'k', id->keybit,
556 KEY_MIN_INTERESTING, KEY_MAX);
557 len += print_modalias_bits(buf+len, 'r', id->relbit, 0, REL_MAX);
558 len += print_modalias_bits(buf+len, 'a', id->absbit, 0, ABS_MAX);
559 len += print_modalias_bits(buf+len, 'm', id->mscbit, 0, MSC_MAX);
560 len += print_modalias_bits(buf+len, 'l', id->ledbit, 0, LED_MAX);
561 len += print_modalias_bits(buf+len, 's', id->sndbit, 0, SND_MAX);
562 len += print_modalias_bits(buf+len, 'f', id->ffbit, 0, FF_MAX);
563 len += print_modalias_bits(buf+len, 'w', id->swbit, 0, SW_MAX);
564 len += sprintf(buf+len, "\n");
565 return len;
566}
567static CLASS_DEVICE_ATTR(modalias, S_IRUGO, input_dev_show_modalias, NULL);
568
532static struct attribute *input_dev_attrs[] = { 569static struct attribute *input_dev_attrs[] = {
533 &class_device_attr_name.attr, 570 &class_device_attr_name.attr,
534 &class_device_attr_phys.attr, 571 &class_device_attr_phys.attr,
535 &class_device_attr_uniq.attr, 572 &class_device_attr_uniq.attr,
573 &class_device_attr_modalias.attr,
536 NULL 574 NULL
537}; 575};
538 576
@@ -611,10 +649,10 @@ static void input_dev_release(struct class_device *class_dev)
611} 649}
612 650
613/* 651/*
614 * Input hotplugging interface - loading event handlers based on 652 * Input uevent interface - loading event handlers based on
615 * device bitfields. 653 * device bitfields.
616 */ 654 */
617static int input_add_hotplug_bm_var(char **envp, int num_envp, int *cur_index, 655static int input_add_uevent_bm_var(char **envp, int num_envp, int *cur_index,
618 char *buffer, int buffer_size, int *cur_len, 656 char *buffer, int buffer_size, int *cur_len,
619 const char *name, unsigned long *bitmap, int max) 657 const char *name, unsigned long *bitmap, int max)
620{ 658{
@@ -639,7 +677,7 @@ static int input_add_hotplug_bm_var(char **envp, int num_envp, int *cur_index,
639 677
640#define INPUT_ADD_HOTPLUG_VAR(fmt, val...) \ 678#define INPUT_ADD_HOTPLUG_VAR(fmt, val...) \
641 do { \ 679 do { \
642 int err = add_hotplug_env_var(envp, num_envp, &i, \ 680 int err = add_uevent_var(envp, num_envp, &i, \
643 buffer, buffer_size, &len, \ 681 buffer, buffer_size, &len, \
644 fmt, val); \ 682 fmt, val); \
645 if (err) \ 683 if (err) \
@@ -648,15 +686,15 @@ static int input_add_hotplug_bm_var(char **envp, int num_envp, int *cur_index,
648 686
649#define INPUT_ADD_HOTPLUG_BM_VAR(name, bm, max) \ 687#define INPUT_ADD_HOTPLUG_BM_VAR(name, bm, max) \
650 do { \ 688 do { \
651 int err = input_add_hotplug_bm_var(envp, num_envp, &i, \ 689 int err = input_add_uevent_bm_var(envp, num_envp, &i, \
652 buffer, buffer_size, &len, \ 690 buffer, buffer_size, &len, \
653 name, bm, max); \ 691 name, bm, max); \
654 if (err) \ 692 if (err) \
655 return err; \ 693 return err; \
656 } while (0) 694 } while (0)
657 695
658static int input_dev_hotplug(struct class_device *cdev, char **envp, 696static int input_dev_uevent(struct class_device *cdev, char **envp,
659 int num_envp, char *buffer, int buffer_size) 697 int num_envp, char *buffer, int buffer_size)
660{ 698{
661 struct input_dev *dev = to_input_dev(cdev); 699 struct input_dev *dev = to_input_dev(cdev);
662 int i = 0; 700 int i = 0;
@@ -698,7 +736,7 @@ static int input_dev_hotplug(struct class_device *cdev, char **envp,
698struct class input_class = { 736struct class input_class = {
699 .name = "input", 737 .name = "input",
700 .release = input_dev_release, 738 .release = input_dev_release,
701 .hotplug = input_dev_hotplug, 739 .uevent = input_dev_uevent,
702}; 740};
703 741
704struct input_dev *input_allocate_device(void) 742struct input_dev *input_allocate_device(void)
diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c
index 64b4a3080985..bc2fce60f9f8 100644
--- a/drivers/input/joystick/iforce/iforce-usb.c
+++ b/drivers/input/joystick/iforce/iforce-usb.c
@@ -235,7 +235,6 @@ static struct usb_device_id iforce_usb_ids [] = {
235MODULE_DEVICE_TABLE (usb, iforce_usb_ids); 235MODULE_DEVICE_TABLE (usb, iforce_usb_ids);
236 236
237struct usb_driver iforce_usb_driver = { 237struct usb_driver iforce_usb_driver = {
238 .owner = THIS_MODULE,
239 .name = "iforce", 238 .name = "iforce",
240 .probe = iforce_usb_probe, 239 .probe = iforce_usb_probe,
241 .disconnect = iforce_usb_disconnect, 240 .disconnect = iforce_usb_disconnect,
diff --git a/drivers/input/joystick/warrior.c b/drivers/input/joystick/warrior.c
index 99a642d2a1fe..1849b176cf18 100644
--- a/drivers/input/joystick/warrior.c
+++ b/drivers/input/joystick/warrior.c
@@ -172,7 +172,7 @@ static int warrior_connect(struct serio *serio, struct serio_driver *drv)
172 input_set_abs_params(input_dev, ABS_Y, -64, 64, 0, 8); 172 input_set_abs_params(input_dev, ABS_Y, -64, 64, 0, 8);
173 input_set_abs_params(input_dev, ABS_THROTTLE, -112, 112, 0, 0); 173 input_set_abs_params(input_dev, ABS_THROTTLE, -112, 112, 0, 0);
174 input_set_abs_params(input_dev, ABS_HAT0X, -1, 1, 0, 0); 174 input_set_abs_params(input_dev, ABS_HAT0X, -1, 1, 0, 0);
175 input_set_abs_params(input_dev, ABS_HAT0X, -1, 1, 0, 0); 175 input_set_abs_params(input_dev, ABS_HAT0Y, -1, 1, 0, 0);
176 176
177 serio_set_drvdata(serio, warrior); 177 serio_set_drvdata(serio, warrior);
178 178
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 07813fc0523f..e08dbe08f46d 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -26,7 +26,7 @@ config INPUT_PCSPKR
26 26
27config INPUT_SPARCSPKR 27config INPUT_SPARCSPKR
28 tristate "SPARC Speaker support" 28 tristate "SPARC Speaker support"
29 depends on PCI && (SPARC32 || SPARC64) 29 depends on PCI && SPARC
30 help 30 help
31 Say Y here if you want the standard Speaker on Sparc PCI systems 31 Say Y here if you want the standard Speaker on Sparc PCI systems
32 to be used for bells and whistles. 32 to be used for bells and whistles.
diff --git a/drivers/input/mouse/sermouse.c b/drivers/input/mouse/sermouse.c
index 4bf584364d28..2f9a04ae725f 100644
--- a/drivers/input/mouse/sermouse.c
+++ b/drivers/input/mouse/sermouse.c
@@ -95,7 +95,7 @@ static void sermouse_process_msc(struct sermouse *sermouse, signed char data, st
95 95
96 input_sync(dev); 96 input_sync(dev);
97 97
98 if (++sermouse->count == (5 - ((sermouse->type == SERIO_SUN) << 1))) 98 if (++sermouse->count == 5)
99 sermouse->count = 0; 99 sermouse->count = 0;
100} 100}
101 101
diff --git a/drivers/input/serio/i8042.h b/drivers/input/serio/i8042.h
index 13835039a2a7..cbbf3842da5b 100644
--- a/drivers/input/serio/i8042.h
+++ b/drivers/input/serio/i8042.h
@@ -21,7 +21,7 @@
21#include "i8042-ip22io.h" 21#include "i8042-ip22io.h"
22#elif defined(CONFIG_PPC) 22#elif defined(CONFIG_PPC)
23#include "i8042-ppcio.h" 23#include "i8042-ppcio.h"
24#elif defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) 24#elif defined(CONFIG_SPARC)
25#include "i8042-sparcio.h" 25#include "i8042-sparcio.h"
26#elif defined(CONFIG_X86) || defined(CONFIG_IA64) 26#elif defined(CONFIG_X86) || defined(CONFIG_IA64)
27#include "i8042-x86ia64io.h" 27#include "i8042-x86ia64io.h"
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index fbb69ef6a77b..8e530cc970e1 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -800,16 +800,16 @@ static int serio_bus_match(struct device *dev, struct device_driver *drv)
800 800
801#ifdef CONFIG_HOTPLUG 801#ifdef CONFIG_HOTPLUG
802 802
803#define SERIO_ADD_HOTPLUG_VAR(fmt, val...) \ 803#define SERIO_ADD_UEVENT_VAR(fmt, val...) \
804 do { \ 804 do { \
805 int err = add_hotplug_env_var(envp, num_envp, &i, \ 805 int err = add_uevent_var(envp, num_envp, &i, \
806 buffer, buffer_size, &len, \ 806 buffer, buffer_size, &len, \
807 fmt, val); \ 807 fmt, val); \
808 if (err) \ 808 if (err) \
809 return err; \ 809 return err; \
810 } while (0) 810 } while (0)
811 811
812static int serio_hotplug(struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size) 812static int serio_uevent(struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size)
813{ 813{
814 struct serio *serio; 814 struct serio *serio;
815 int i = 0; 815 int i = 0;
@@ -820,21 +820,21 @@ static int serio_hotplug(struct device *dev, char **envp, int num_envp, char *bu
820 820
821 serio = to_serio_port(dev); 821 serio = to_serio_port(dev);
822 822
823 SERIO_ADD_HOTPLUG_VAR("SERIO_TYPE=%02x", serio->id.type); 823 SERIO_ADD_UEVENT_VAR("SERIO_TYPE=%02x", serio->id.type);
824 SERIO_ADD_HOTPLUG_VAR("SERIO_PROTO=%02x", serio->id.proto); 824 SERIO_ADD_UEVENT_VAR("SERIO_PROTO=%02x", serio->id.proto);
825 SERIO_ADD_HOTPLUG_VAR("SERIO_ID=%02x", serio->id.id); 825 SERIO_ADD_UEVENT_VAR("SERIO_ID=%02x", serio->id.id);
826 SERIO_ADD_HOTPLUG_VAR("SERIO_EXTRA=%02x", serio->id.extra); 826 SERIO_ADD_UEVENT_VAR("SERIO_EXTRA=%02x", serio->id.extra);
827 SERIO_ADD_HOTPLUG_VAR("MODALIAS=serio:ty%02Xpr%02Xid%02Xex%02X", 827 SERIO_ADD_UEVENT_VAR("MODALIAS=serio:ty%02Xpr%02Xid%02Xex%02X",
828 serio->id.type, serio->id.proto, serio->id.id, serio->id.extra); 828 serio->id.type, serio->id.proto, serio->id.id, serio->id.extra);
829 envp[i] = NULL; 829 envp[i] = NULL;
830 830
831 return 0; 831 return 0;
832} 832}
833#undef SERIO_ADD_HOTPLUG_VAR 833#undef SERIO_ADD_UEVENT_VAR
834 834
835#else 835#else
836 836
837static int serio_hotplug(struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size) 837static int serio_uevent(struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size)
838{ 838{
839 return -ENODEV; 839 return -ENODEV;
840} 840}
@@ -908,7 +908,7 @@ static int __init serio_init(void)
908 serio_bus.dev_attrs = serio_device_attrs; 908 serio_bus.dev_attrs = serio_device_attrs;
909 serio_bus.drv_attrs = serio_driver_attrs; 909 serio_bus.drv_attrs = serio_driver_attrs;
910 serio_bus.match = serio_bus_match; 910 serio_bus.match = serio_bus_match;
911 serio_bus.hotplug = serio_hotplug; 911 serio_bus.uevent = serio_uevent;
912 serio_bus.resume = serio_resume; 912 serio_bus.resume = serio_resume;
913 bus_register(&serio_bus); 913 bus_register(&serio_bus);
914 914