* [git pull 00/14] Input updates for 2.6.15
@ 2005-11-20 6:36 Dmitry Torokhov
2005-11-20 6:36 ` [git pull 01/14] atkbd - speed up setting leds/repeat state Dmitry Torokhov
` (15 more replies)
0 siblings, 16 replies; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-20 6:36 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List
Hi Linus,
Please consider pulling from:
master.kernel.org:/pub/scm/linux/kernel/git/dtor/input.git
It corrects couple of problems caused by recein input dynalloc
conversion, converts uinput driver to dynamic allocation and
adds new wistron button driver which was siting in -mm for quite
a while.
Vojtech, please bless the pull.
Changelog:
Fix missing initialization in ir-kbd-gpio.c
Fix an OOPS when initializing IR remote on saa7134
Input: make serio and gameport more swsusp friendly
Input: handle failures in input_register_device()
Input: uinput - don't use "interruptible" in FF code
Input: uinput - add UI_SET_SWBIT ioctl
Input: uinput - convert to dynalloc allocation
Input: wistron - disable wifi/bluetooth on suspend
Input: wistron - add PM support
Input: wistron - convert to dynamic input_dev allocation
Input: wistron - add support for Acer Aspire 1500 notebooks
Input: wistron - disable for x86_64
Input: add Wistron driver
Input: atkbd - speed up setting leds/repeat state
Diffstat:
MAINTAINERS | 5
drivers/input/gameport/gameport.c | 12
drivers/input/input.c | 63 +--
drivers/input/keyboard/atkbd.c | 99 +++-
drivers/input/misc/Kconfig | 10
drivers/input/misc/Makefile | 1
drivers/input/misc/uinput.c | 323 ++++++++--------
drivers/input/misc/wistron_btns.c | 561 ++++++++++++++++++++++++++++
drivers/input/serio/serio.c | 12
drivers/media/video/ir-kbd-gpio.c | 5
drivers/media/video/saa7134/saa7134-input.c | 2
include/linux/uinput.h | 13
12 files changed, 880 insertions(+), 226 deletions(-)
--
Dmitry
^ permalink raw reply [flat|nested] 29+ messages in thread
* [git pull 01/14] atkbd - speed up setting leds/repeat state
2005-11-20 6:36 [git pull 00/14] Input updates for 2.6.15 Dmitry Torokhov
@ 2005-11-20 6:36 ` Dmitry Torokhov
2005-11-20 6:36 ` [git pull 02/14] Add Wistron driver Dmitry Torokhov
` (14 subsequent siblings)
15 siblings, 0 replies; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-20 6:36 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List
[-- Attachment #1: atkbd-led-handling.patch --]
[-- Type: text/plain, Size: 5097 bytes --]
Input: atkbd - speed up setting leds/repeat state
Changing led state is pretty slow operation; when there are multiple
requests coming at a high rate they may interfere with normal typing.
Try optimize (skip) changing hardware state when multiple requests
are coming back-to-back.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/keyboard/atkbd.c | 99 ++++++++++++++++++++++++++++-------------
1 files changed, 68 insertions(+), 31 deletions(-)
Index: work/drivers/input/keyboard/atkbd.c
===================================================================
--- work.orig/drivers/input/keyboard/atkbd.c
+++ work/drivers/input/keyboard/atkbd.c
@@ -166,6 +166,9 @@ static unsigned char atkbd_unxlate_table
#define ATKBD_SPECIAL 248
+#define ATKBD_LED_EVENT_BIT 0
+#define ATKBD_REP_EVENT_BIT 1
+
static struct {
unsigned char keycode;
unsigned char set2;
@@ -211,6 +214,10 @@ struct atkbd {
unsigned char err_xl;
unsigned int last;
unsigned long time;
+
+ struct work_struct event_work;
+ struct semaphore event_sem;
+ unsigned long event_mask;
};
static ssize_t atkbd_attr_show_helper(struct device *dev, char *buf,
@@ -424,58 +431,86 @@ out:
}
/*
- * Event callback from the input module. Events that change the state of
- * the hardware are processed here.
+ * atkbd_event_work() is used to complete processing of events that
+ * can not be processed by input_event() which is often called from
+ * interrupt context.
*/
-static int atkbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
+static void atkbd_event_work(void *data)
{
- struct atkbd *atkbd = dev->private;
const short period[32] =
{ 33, 37, 42, 46, 50, 54, 58, 63, 67, 75, 83, 92, 100, 109, 116, 125,
133, 149, 167, 182, 200, 217, 232, 250, 270, 303, 333, 370, 400, 435, 470, 500 };
const short delay[4] =
{ 250, 500, 750, 1000 };
+
+ struct atkbd *atkbd = data;
+ struct input_dev *dev = atkbd->dev;
unsigned char param[2];
int i, j;
+ down(&atkbd->event_sem);
+
+ if (test_and_clear_bit(ATKBD_LED_EVENT_BIT, &atkbd->event_mask)) {
+ param[0] = (test_bit(LED_SCROLLL, dev->led) ? 1 : 0)
+ | (test_bit(LED_NUML, dev->led) ? 2 : 0)
+ | (test_bit(LED_CAPSL, dev->led) ? 4 : 0);
+ ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_SETLEDS);
+
+ if (atkbd->extra) {
+ param[0] = 0;
+ param[1] = (test_bit(LED_COMPOSE, dev->led) ? 0x01 : 0)
+ | (test_bit(LED_SLEEP, dev->led) ? 0x02 : 0)
+ | (test_bit(LED_SUSPEND, dev->led) ? 0x04 : 0)
+ | (test_bit(LED_MISC, dev->led) ? 0x10 : 0)
+ | (test_bit(LED_MUTE, dev->led) ? 0x20 : 0);
+ ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_EX_SETLEDS);
+ }
+ }
+
+ if (test_and_clear_bit(ATKBD_REP_EVENT_BIT, &atkbd->event_mask)) {
+ i = j = 0;
+ while (i < 31 && period[i] < dev->rep[REP_PERIOD])
+ i++;
+ while (j < 3 && delay[j] < dev->rep[REP_DELAY])
+ j++;
+ dev->rep[REP_PERIOD] = period[i];
+ dev->rep[REP_DELAY] = delay[j];
+ param[0] = i | (j << 5);
+ ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_SETREP);
+ }
+
+ up(&atkbd->event_sem);
+}
+
+/*
+ * Event callback from the input module. Events that change the state of
+ * the hardware are processed here. If action can not be performed in
+ * interrupt context it is offloaded to atkbd_event_work.
+ */
+
+static int atkbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
+{
+ struct atkbd *atkbd = dev->private;
+
if (!atkbd->write)
return -1;
switch (type) {
case EV_LED:
-
- param[0] = (test_bit(LED_SCROLLL, dev->led) ? 1 : 0)
- | (test_bit(LED_NUML, dev->led) ? 2 : 0)
- | (test_bit(LED_CAPSL, dev->led) ? 4 : 0);
- ps2_schedule_command(&atkbd->ps2dev, param, ATKBD_CMD_SETLEDS);
-
- if (atkbd->extra) {
- param[0] = 0;
- param[1] = (test_bit(LED_COMPOSE, dev->led) ? 0x01 : 0)
- | (test_bit(LED_SLEEP, dev->led) ? 0x02 : 0)
- | (test_bit(LED_SUSPEND, dev->led) ? 0x04 : 0)
- | (test_bit(LED_MISC, dev->led) ? 0x10 : 0)
- | (test_bit(LED_MUTE, dev->led) ? 0x20 : 0);
- ps2_schedule_command(&atkbd->ps2dev, param, ATKBD_CMD_EX_SETLEDS);
- }
-
+ set_bit(ATKBD_LED_EVENT_BIT, &atkbd->event_mask);
+ wmb();
+ schedule_work(&atkbd->event_work);
return 0;
case EV_REP:
- if (atkbd->softrepeat) return 0;
-
- i = j = 0;
- while (i < 31 && period[i] < dev->rep[REP_PERIOD])
- i++;
- while (j < 3 && delay[j] < dev->rep[REP_DELAY])
- j++;
- dev->rep[REP_PERIOD] = period[i];
- dev->rep[REP_DELAY] = delay[j];
- param[0] = i | (j << 5);
- ps2_schedule_command(&atkbd->ps2dev, param, ATKBD_CMD_SETREP);
+ if (!atkbd->softrepeat) {
+ set_bit(ATKBD_REP_EVENT_BIT, &atkbd->event_mask);
+ wmb();
+ schedule_work(&atkbd->event_work);
+ }
return 0;
}
@@ -810,6 +845,8 @@ static int atkbd_connect(struct serio *s
atkbd->dev = dev;
ps2_init(&atkbd->ps2dev, serio);
+ INIT_WORK(&atkbd->event_work, atkbd_event_work, atkbd);
+ init_MUTEX(&atkbd->event_sem);
switch (serio->id.type) {
^ permalink raw reply [flat|nested] 29+ messages in thread
* [git pull 02/14] Add Wistron driver
2005-11-20 6:36 [git pull 00/14] Input updates for 2.6.15 Dmitry Torokhov
2005-11-20 6:36 ` [git pull 01/14] atkbd - speed up setting leds/repeat state Dmitry Torokhov
@ 2005-11-20 6:36 ` Dmitry Torokhov
2005-11-20 6:36 ` [git pull 03/14] Wistron - disable for x86_64 Dmitry Torokhov
` (13 subsequent siblings)
15 siblings, 0 replies; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-20 6:36 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List
[-- Attachment #1: wistron_buttons.patch --]
[-- Type: text/plain, Size: 13077 bytes --]
Input: add Wistron driver
A driver for laptop buttons using an x86 BIOS interface that is
apparently used on quite a few laptops and seems to be originating
from Wistron.
This driver currently "knows" only about Fujitsu-Siemens Amilo Pro V2000
(i.e. it can detect the laptop using DMI and it contains the
keycode->key meaning mapping for this laptop) and Xeron SonicPro X 155G
(probably can't be reliably autodetected, requires a module parameter),
adding other laptops should be easy.
In addition to reporting button presses to the input layer the driver
also allows enabling/disabling the embedded wireless NIC (using the
"Wifi" button); this is done using the same BIOS interface, so it seems
only logical to keep the implementation together. Any flexibility
possibly gained by allowing users to remap the function of the "Wifi"
button is IMHO not worth it when weighted against the necessity to run
an user-space daemon to convert button presses to wifi state changes.
Signed-off-by: Miloslav Trmac <mitr@volny.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
MAINTAINERS | 5
drivers/input/misc/Kconfig | 10
drivers/input/misc/Makefile | 1
drivers/input/misc/wistron_btns.c | 443 ++++++++++++++++++++++++++++++++++++++
4 files changed, 459 insertions(+)
Index: work/drivers/input/misc/Kconfig
===================================================================
--- work.orig/drivers/input/misc/Kconfig
+++ work/drivers/input/misc/Kconfig
@@ -40,6 +40,16 @@ config INPUT_M68K_BEEP
tristate "M68k Beeper support"
depends on M68K
+config INPUT_WISTRON_BTNS
+ tristate "x86 Wistron laptop button interface"
+ depends on X86
+ help
+ Say Y here for support of Winstron laptop button interface, used on
+ laptops of various brands, including Acer and Fujitsu-Siemens.
+
+ To compile this driver as a module, choose M here: the module will
+ be called wistron_btns.
+
config INPUT_UINPUT
tristate "User level driver support"
help
Index: work/drivers/input/misc/Makefile
===================================================================
--- work.orig/drivers/input/misc/Makefile
+++ work/drivers/input/misc/Makefile
@@ -9,4 +9,5 @@ obj-$(CONFIG_INPUT_PCSPKR) += pcspkr.o
obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o
obj-$(CONFIG_INPUT_98SPKR) += 98spkr.o
obj-$(CONFIG_INPUT_UINPUT) += uinput.o
+obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o
obj-$(CONFIG_HP_SDC_RTC) += hp_sdc_rtc.o
Index: work/drivers/input/misc/wistron_btns.c
===================================================================
--- /dev/null
+++ work/drivers/input/misc/wistron_btns.c
@@ -0,0 +1,443 @@
+/*
+ * Wistron laptop button driver
+ * Copyright (C) 2005 Miloslav Trmac <mitr@volny.cz>
+ *
+ * You can redistribute and/or modify this program under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * 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.,
+ * 59 Temple Place Suite 330, Boston, MA 02111-1307, USA.
+ */
+#include <asm/io.h>
+#include <linux/dmi.h>
+#include <linux/init.h>
+#include <linux/input.h>
+#include <linux/interrupt.h>
+#include <linux/kernel.h>
+#include <linux/mc146818rtc.h>
+#include <linux/module.h>
+#include <linux/preempt.h>
+#include <linux/string.h>
+#include <linux/timer.h>
+#include <linux/types.h>
+
+/*
+ * Number of attempts to read data from queue per poll;
+ * the queue can hold up to 31 entries
+ */
+#define MAX_POLL_ITERATIONS 64
+
+#define POLL_FREQUENCY 10 /* Number of polls per second */
+
+#if POLL_FREQUENCY > HZ
+#error "POLL_FREQUENCY too high"
+#endif
+
+MODULE_AUTHOR("Miloslav Trmac <mitr@volny.cz>");
+MODULE_DESCRIPTION("Wistron laptop button driver");
+MODULE_LICENSE("GPL v2");
+MODULE_VERSION("0.1");
+
+static int force; /* = 0; */
+module_param(force, bool, 0);
+MODULE_PARM_DESC(force, "Load even if computer is not in database");
+
+static char *keymap_name; /* = NULL; */
+module_param_named(keymap, keymap_name, charp, 0);
+MODULE_PARM_DESC(keymap, "Keymap name, if it can't be autodetected");
+
+ /* BIOS interface implementation */
+
+static void __iomem *bios_entry_point; /* BIOS routine entry point */
+static void __iomem *bios_code_map_base;
+static void __iomem *bios_data_map_base;
+
+static u8 cmos_address;
+
+struct regs {
+ u32 eax, ebx, ecx;
+};
+
+static void call_bios(struct regs *regs)
+{
+ unsigned long flags;
+
+ preempt_disable();
+ local_irq_save(flags);
+ asm volatile ("pushl %%ebp;"
+ "movl %7, %%ebp;"
+ "call *%6;"
+ "popl %%ebp"
+ : "=a" (regs->eax), "=b" (regs->ebx), "=c" (regs->ecx)
+ : "0" (regs->eax), "1" (regs->ebx), "2" (regs->ecx),
+ "m" (bios_entry_point), "m" (bios_data_map_base)
+ : "edx", "edi", "esi", "memory");
+ local_irq_restore(flags);
+ preempt_enable();
+}
+
+static size_t __init locate_wistron_bios(void __iomem *base)
+{
+ static const unsigned char __initdata signature[] =
+ { 0x42, 0x21, 0x55, 0x30 };
+ size_t offset;
+
+ for (offset = 0; offset < 0x10000; offset += 0x10) {
+ if (check_signature(base + offset, signature,
+ sizeof(signature)) != 0)
+ return offset;
+ }
+ return -1;
+}
+
+static int __init map_bios(void)
+{
+ void __iomem *base;
+ size_t offset;
+ u32 entry_point;
+
+ base = ioremap(0xF0000, 0x10000); /* Can't fail */
+ offset = locate_wistron_bios(base);
+ if (offset < 0) {
+ printk(KERN_ERR "wistron_btns: BIOS entry point not found\n");
+ iounmap(base);
+ return -ENODEV;
+ }
+
+ entry_point = readl(base + offset + 5);
+ printk(KERN_DEBUG
+ "wistron_btns: BIOS signature found at %p, entry point %08X\n",
+ base + offset, entry_point);
+
+ if (entry_point >= 0xF0000) {
+ bios_code_map_base = base;
+ bios_entry_point = bios_code_map_base + (entry_point & 0xFFFF);
+ } else {
+ iounmap(base);
+ bios_code_map_base = ioremap(entry_point & ~0x3FFF, 0x4000);
+ if (bios_code_map_base == NULL) {
+ printk(KERN_ERR
+ "wistron_btns: Can't map BIOS code at %08X\n",
+ entry_point & ~0x3FFF);
+ goto err;
+ }
+ bios_entry_point = bios_code_map_base + (entry_point & 0x3FFF);
+ }
+ /* The Windows driver maps 0x10000 bytes, we keep only one page... */
+ bios_data_map_base = ioremap(0x400, 0xc00);
+ if (bios_data_map_base == NULL) {
+ printk(KERN_ERR "wistron_btns: Can't map BIOS data\n");
+ goto err_code;
+ }
+ return 0;
+
+err_code:
+ iounmap(bios_code_map_base);
+err:
+ return -ENOMEM;
+}
+
+static void __exit unmap_bios(void)
+{
+ iounmap(bios_code_map_base);
+ iounmap(bios_data_map_base);
+}
+
+ /* BIOS calls */
+
+static u16 bios_pop_queue(void)
+{
+ struct regs regs;
+
+ memset(®s, 0, sizeof (regs));
+ regs.eax = 0x9610;
+ regs.ebx = 0x061C;
+ regs.ecx = 0x0000;
+ call_bios(®s);
+
+ return regs.eax;
+}
+
+static void __init bios_attach(void)
+{
+ struct regs regs;
+
+ memset(®s, 0, sizeof (regs));
+ regs.eax = 0x9610;
+ regs.ebx = 0x012E;
+ call_bios(®s);
+}
+
+static void __exit bios_detach(void)
+{
+ struct regs regs;
+
+ memset(®s, 0, sizeof (regs));
+ regs.eax = 0x9610;
+ regs.ebx = 0x002E;
+ call_bios(®s);
+}
+
+static u8 __init bios_get_cmos_address(void)
+{
+ struct regs regs;
+
+ memset(®s, 0, sizeof (regs));
+ regs.eax = 0x9610;
+ regs.ebx = 0x051C;
+ call_bios(®s);
+
+ return regs.ecx;
+}
+
+static u16 __init bios_wifi_get_default_setting(void)
+{
+ struct regs regs;
+
+ memset(®s, 0, sizeof (regs));
+ regs.eax = 0x9610;
+ regs.ebx = 0x0235;
+ call_bios(®s);
+
+ return regs.eax;
+}
+
+static void bios_wifi_set_state(int enable)
+{
+ struct regs regs;
+
+ memset(®s, 0, sizeof (regs));
+ regs.eax = 0x9610;
+ regs.ebx = enable ? 0x0135 : 0x0035;
+ call_bios(®s);
+}
+
+ /* Hardware database */
+
+struct key_entry {
+ char type; /* See KE_* below */
+ u8 code;
+ unsigned keycode; /* For KE_KEY */
+};
+
+enum { KE_END, KE_KEY, KE_WIFI };
+
+static const struct key_entry *keymap; /* = NULL; Current key map */
+static int have_wifi;
+
+static int __init dmi_matched(struct dmi_system_id *dmi)
+{
+ const struct key_entry *key;
+
+ keymap = dmi->driver_data;
+ for (key = keymap; key->type != KE_END; key++) {
+ if (key->type == KE_WIFI) {
+ have_wifi = 1;
+ break;
+ }
+ }
+ return 1;
+}
+
+static struct key_entry keymap_empty[] = {
+ { KE_END, 0 }
+};
+
+static struct key_entry keymap_fs_amilo_pro_v2000[] = {
+ { KE_KEY, 0x01, KEY_HELP },
+ { KE_KEY, 0x11, KEY_PROG1 },
+ { KE_KEY, 0x12, KEY_PROG2 },
+ { KE_WIFI, 0x30, 0 },
+ { KE_KEY, 0x31, KEY_MAIL },
+ { KE_KEY, 0x36, KEY_WWW },
+ { KE_END, 0 }
+};
+
+static struct key_entry keymap_wistron_ms2141[] = {
+ { KE_KEY, 0x11, KEY_PROG1 },
+ { KE_KEY, 0x12, KEY_PROG2 },
+ { KE_WIFI, 0x30, 0 },
+ { KE_KEY, 0x22, KEY_REWIND },
+ { KE_KEY, 0x23, KEY_FORWARD },
+ { KE_KEY, 0x24, KEY_PLAYPAUSE },
+ { KE_KEY, 0x25, KEY_STOPCD },
+ { KE_KEY, 0x31, KEY_MAIL },
+ { KE_KEY, 0x36, KEY_WWW },
+ { KE_END, 0 }
+};
+
+/*
+ * If your machine is not here (which is currently rather likely), please send
+ * a list of buttons and their key codes (reported when loading this module
+ * with force=1) and the output of dmidecode to $MODULE_AUTHOR.
+ */
+static struct dmi_system_id dmi_ids[] = {
+ {
+ .callback = dmi_matched,
+ .ident = "Fujitsu-Siemens Amilo Pro V2000",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2000"),
+ },
+ .driver_data = keymap_fs_amilo_pro_v2000
+ },
+ { 0, }
+};
+
+static int __init select_keymap(void)
+{
+ if (keymap_name != NULL) {
+ if (strcmp (keymap_name, "1557/MS2141") == 0)
+ keymap = keymap_wistron_ms2141;
+ else {
+ printk(KERN_ERR "wistron_btns: Keymap unknown\n");
+ return -EINVAL;
+ }
+ }
+ dmi_check_system(dmi_ids);
+ if (keymap == NULL) {
+ if (!force) {
+ printk(KERN_ERR "wistron_btns: System unknown\n");
+ return -ENODEV;
+ }
+ keymap = keymap_empty;
+ }
+ return 0;
+}
+
+ /* Input layer interface */
+
+static struct input_dev input_dev = {
+ .name = "Wistron laptop buttons",
+};
+
+static void __init setup_input_dev(void)
+{
+ const struct key_entry *key;
+
+ for (key = keymap; key->type != KE_END; key++) {
+ if (key->type == KE_KEY) {
+ input_dev.evbit[LONG(EV_KEY)] = BIT(EV_KEY);
+ input_dev.keybit[LONG(key->keycode)]
+ |= BIT(key->keycode);
+ }
+ }
+
+ input_register_device(&input_dev);
+}
+
+static void report_key(unsigned keycode)
+{
+ input_report_key(&input_dev, keycode, 1);
+ input_sync(&input_dev);
+ input_report_key(&input_dev, keycode, 0);
+ input_sync(&input_dev);
+}
+
+ /* Driver core */
+
+static int wifi_enabled;
+
+static void poll_bios(unsigned long);
+
+static struct timer_list poll_timer = TIMER_INITIALIZER(poll_bios, 0, 0);
+
+static void handle_key(u8 code)
+{
+ const struct key_entry *key;
+
+ for (key = keymap; key->type != KE_END; key++) {
+ if (code == key->code) {
+ switch (key->type) {
+ case KE_KEY:
+ report_key(key->keycode);
+ break;
+
+ case KE_WIFI:
+ if (have_wifi) {
+ wifi_enabled = !wifi_enabled;
+ bios_wifi_set_state(wifi_enabled);
+ }
+ break;
+
+ case KE_END:
+ default:
+ BUG();
+ }
+ return;
+ }
+ }
+ printk(KERN_NOTICE "wistron_btns: Unknown key code %02X\n", code);
+}
+
+static void poll_bios(unsigned long discard)
+{
+ u8 qlen;
+ u16 val;
+
+ for (;;) {
+ qlen = CMOS_READ(cmos_address);
+ if (qlen == 0)
+ break;
+ val = bios_pop_queue();
+ if (val != 0 && !discard)
+ handle_key((u8)val);
+ }
+
+ mod_timer(&poll_timer, jiffies + HZ / POLL_FREQUENCY);
+}
+
+static int __init wb_module_init(void)
+{
+ int err;
+
+ err = select_keymap();
+ if (err)
+ return err;
+ err = map_bios();
+ if (err)
+ return err;
+ bios_attach();
+ cmos_address = bios_get_cmos_address();
+ if (have_wifi) {
+ switch (bios_wifi_get_default_setting()) {
+ case 0x01:
+ wifi_enabled = 0;
+ break;
+
+ case 0x03:
+ wifi_enabled = 1;
+ break;
+
+ default:
+ have_wifi = 0;
+ break;
+ }
+ if (have_wifi)
+ bios_wifi_set_state(wifi_enabled);
+ }
+
+ setup_input_dev();
+
+ poll_bios(1); /* Flush stale event queue and arm timer */
+
+ return 0;
+}
+
+static void __exit wb_module_exit(void)
+{
+ del_timer_sync(&poll_timer);
+ input_unregister_device(&input_dev);
+ bios_detach();
+ unmap_bios();
+}
+
+module_init(wb_module_init);
+module_exit(wb_module_exit);
Index: work/MAINTAINERS
===================================================================
--- work.orig/MAINTAINERS
+++ work/MAINTAINERS
@@ -2891,6 +2891,11 @@ M: zaga@fly.cc.fer.hr
L: linux-scsi@vger.kernel.org
S: Maintained
+WISTRON LAPTOP BUTTON DRIVER
+P: Miloslav Trmac
+M: mitr@volny.cz
+S: Maintained
+
WL3501 WIRELESS PCMCIA CARD DRIVER
P: Arnaldo Carvalho de Melo
M: acme@conectiva.com.br
^ permalink raw reply [flat|nested] 29+ messages in thread
* [git pull 03/14] Wistron - disable for x86_64
2005-11-20 6:36 [git pull 00/14] Input updates for 2.6.15 Dmitry Torokhov
2005-11-20 6:36 ` [git pull 01/14] atkbd - speed up setting leds/repeat state Dmitry Torokhov
2005-11-20 6:36 ` [git pull 02/14] Add Wistron driver Dmitry Torokhov
@ 2005-11-20 6:36 ` Dmitry Torokhov
2005-11-20 9:52 ` Geert Uytterhoeven
2005-11-20 6:36 ` [git pull 04/14] Wistron - add support for Acer Aspire notebooks Dmitry Torokhov
` (12 subsequent siblings)
15 siblings, 1 reply; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-20 6:36 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List
[-- Attachment #1: wistron-button-x86_64-fix.patch --]
[-- Type: text/plain, Size: 898 bytes --]
From: Andrew Morton <akpm@osdl.org>
Input: wistron - disable for x86_64
On x86_64:
{standard input}:233: Error: suffix or operands invalid for `push'
{standard input}:233: Error: suffix or operands invalid for `pop'
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/misc/Kconfig | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: work/drivers/input/misc/Kconfig
===================================================================
--- work.orig/drivers/input/misc/Kconfig
+++ work/drivers/input/misc/Kconfig
@@ -42,7 +42,7 @@ config INPUT_M68K_BEEP
config INPUT_WISTRON_BTNS
tristate "x86 Wistron laptop button interface"
- depends on X86
+ depends on X86 && !X86_64
help
Say Y here for support of Winstron laptop button interface, used on
laptops of various brands, including Acer and Fujitsu-Siemens.
^ permalink raw reply [flat|nested] 29+ messages in thread
* [git pull 04/14] Wistron - add support for Acer Aspire notebooks
2005-11-20 6:36 [git pull 00/14] Input updates for 2.6.15 Dmitry Torokhov
` (2 preceding siblings ...)
2005-11-20 6:36 ` [git pull 03/14] Wistron - disable for x86_64 Dmitry Torokhov
@ 2005-11-20 6:36 ` Dmitry Torokhov
2005-11-20 6:36 ` [git pull 05/14] Wistron - convert to dynamic input_dev allocation Dmitry Torokhov
` (11 subsequent siblings)
15 siblings, 0 replies; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-20 6:36 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List
[-- Attachment #1: wistron-buttons-acer-aspire-support.patch --]
[-- Type: text/plain, Size: 5176 bytes --]
From: Bernhard Rosenkraenzer <bero@arklinux.org>
Input: wistron - add support for Acer Aspire 1500 notebooks
Also fix a potential issue with some notebooks:
The current code assumes the response to bios_wifi_get_default_setting is
either 1 (disabled) or 3 (enabled), or wifi isn't supported. The BIOS
response appears to be a bit field w/ 0x1 indicating hardware presence, 0x2
indicating actiation status, and the other 6 bits being unknown/reserved --
with the patch, these 6 bits are ignored.
Signed-off-by: Bernhard Rosenkraenzer <bero@arklinux.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/misc/wistron_btns.c | 79 ++++++++++++++++++++++++++++----------
1 files changed, 59 insertions(+), 20 deletions(-)
Index: work/drivers/input/misc/wistron_btns.c
===================================================================
--- work.orig/drivers/input/misc/wistron_btns.c
+++ work/drivers/input/misc/wistron_btns.c
@@ -1,6 +1,7 @@
/*
* Wistron laptop button driver
* Copyright (C) 2005 Miloslav Trmac <mitr@volny.cz>
+ * Copyright (C) 2005 Bernhard Rosenkraenzer <bero@arklinux.org>
*
* You can redistribute and/or modify this program under the terms of the
* GNU General Public License version 2 as published by the Free Software
@@ -40,6 +41,10 @@
#error "POLL_FREQUENCY too high"
#endif
+/* BIOS subsystem IDs */
+#define WIFI 0x35
+#define BLUETOOTH 0x34
+
MODULE_AUTHOR("Miloslav Trmac <mitr@volny.cz>");
MODULE_DESCRIPTION("Wistron laptop button driver");
MODULE_LICENSE("GPL v2");
@@ -197,29 +202,29 @@ static u8 __init bios_get_cmos_address(v
return regs.ecx;
}
-static u16 __init bios_wifi_get_default_setting(void)
+static u16 __init bios_get_default_setting(u8 subsys)
{
struct regs regs;
memset(®s, 0, sizeof (regs));
regs.eax = 0x9610;
- regs.ebx = 0x0235;
+ regs.ebx = 0x0200 | subsys;
call_bios(®s);
return regs.eax;
}
-static void bios_wifi_set_state(int enable)
+static void bios_set_state(u8 subsys, int enable)
{
struct regs regs;
memset(®s, 0, sizeof (regs));
regs.eax = 0x9610;
- regs.ebx = enable ? 0x0135 : 0x0035;
+ regs.ebx = (enable ? 0x0100 : 0x0000) | subsys;
call_bios(®s);
}
- /* Hardware database */
+/* Hardware database */
struct key_entry {
char type; /* See KE_* below */
@@ -227,10 +232,11 @@ struct key_entry {
unsigned keycode; /* For KE_KEY */
};
-enum { KE_END, KE_KEY, KE_WIFI };
+enum { KE_END, KE_KEY, KE_WIFI, KE_BLUETOOTH };
static const struct key_entry *keymap; /* = NULL; Current key map */
static int have_wifi;
+static int have_bluetooth;
static int __init dmi_matched(struct dmi_system_id *dmi)
{
@@ -241,6 +247,9 @@ static int __init dmi_matched(struct dmi
if (key->type == KE_WIFI) {
have_wifi = 1;
break;
+ } else if (key->type == KE_BLUETOOTH) {
+ have_bluetooth = 1;
+ break;
}
}
return 1;
@@ -273,6 +282,16 @@ static struct key_entry keymap_wistron_m
{ KE_END, 0 }
};
+static struct key_entry keymap_acer_aspire_1500[] = {
+ { KE_KEY, 0x11, KEY_PROG1 },
+ { KE_KEY, 0x12, KEY_PROG2 },
+ { KE_WIFI, 0x30, 0 },
+ { KE_KEY, 0x31, KEY_MAIL },
+ { KE_KEY, 0x36, KEY_WWW },
+ { KE_BLUETOOTH, 0x44, 0 },
+ { KE_END, 0 }
+};
+
/*
* If your machine is not here (which is currently rather likely), please send
* a list of buttons and their key codes (reported when loading this module
@@ -288,6 +307,15 @@ static struct dmi_system_id dmi_ids[] =
},
.driver_data = keymap_fs_amilo_pro_v2000
},
+ {
+ .callback = dmi_matched,
+ .ident = "Acer Aspire 1500",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1500"),
+ },
+ .driver_data = keymap_acer_aspire_1500
+ },
{ 0, }
};
@@ -344,6 +372,7 @@ static void report_key(unsigned keycode)
/* Driver core */
static int wifi_enabled;
+static int bluetooth_enabled;
static void poll_bios(unsigned long);
@@ -363,7 +392,14 @@ static void handle_key(u8 code)
case KE_WIFI:
if (have_wifi) {
wifi_enabled = !wifi_enabled;
- bios_wifi_set_state(wifi_enabled);
+ bios_set_state(WIFI, wifi_enabled);
+ }
+ break;
+
+ case KE_BLUETOOTH:
+ if (have_bluetooth) {
+ bluetooth_enabled = !bluetooth_enabled;
+ bios_set_state(BLUETOOTH, bluetooth_enabled);
}
break;
@@ -407,21 +443,24 @@ static int __init wb_module_init(void)
bios_attach();
cmos_address = bios_get_cmos_address();
if (have_wifi) {
- switch (bios_wifi_get_default_setting()) {
- case 0x01:
- wifi_enabled = 0;
- break;
-
- case 0x03:
- wifi_enabled = 1;
- break;
-
- default:
+ u16 wifi = bios_get_default_setting(WIFI);
+ if (wifi & 1)
+ wifi_enabled = (wifi & 2) ? 1 : 0;
+ else
have_wifi = 0;
- break;
- }
+
if (have_wifi)
- bios_wifi_set_state(wifi_enabled);
+ bios_set_state(WIFI, wifi_enabled);
+ }
+ if (have_bluetooth) {
+ u16 bt = bios_get_default_setting(BLUETOOTH);
+ if (bt & 1)
+ bluetooth_enabled = (bt & 2) ? 1 : 0;
+ else
+ have_bluetooth = 0;
+
+ if (have_bluetooth)
+ bios_set_state(BLUETOOTH, bluetooth_enabled);
}
setup_input_dev();
^ permalink raw reply [flat|nested] 29+ messages in thread
* [git pull 05/14] Wistron - convert to dynamic input_dev allocation
2005-11-20 6:36 [git pull 00/14] Input updates for 2.6.15 Dmitry Torokhov
` (3 preceding siblings ...)
2005-11-20 6:36 ` [git pull 04/14] Wistron - add support for Acer Aspire notebooks Dmitry Torokhov
@ 2005-11-20 6:36 ` Dmitry Torokhov
2005-11-20 6:36 ` [git pull 06/14] Wistron - add PM support Dmitry Torokhov
` (10 subsequent siblings)
15 siblings, 0 replies; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-20 6:36 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List
[-- Attachment #1: input-dynalloc-wistron.patch --]
[-- Type: text/plain, Size: 3234 bytes --]
Input: wistron - convert to dynamic input_dev allocation
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/misc/wistron_btns.c | 53 ++++++++++++++++++++++++++------------
1 files changed, 37 insertions(+), 16 deletions(-)
Index: work/drivers/input/misc/wistron_btns.c
===================================================================
--- work.orig/drivers/input/misc/wistron_btns.c
+++ work/drivers/input/misc/wistron_btns.c
@@ -149,7 +149,7 @@ err:
return -ENOMEM;
}
-static void __exit unmap_bios(void)
+static inline void unmap_bios(void)
{
iounmap(bios_code_map_base);
iounmap(bios_data_map_base);
@@ -180,7 +180,7 @@ static void __init bios_attach(void)
call_bios(®s);
}
-static void __exit bios_detach(void)
+static void bios_detach(void)
{
struct regs regs;
@@ -342,31 +342,43 @@ static int __init select_keymap(void)
/* Input layer interface */
-static struct input_dev input_dev = {
- .name = "Wistron laptop buttons",
-};
+static struct input_dev *input_dev;
-static void __init setup_input_dev(void)
+static int __init setup_input_dev(void)
{
const struct key_entry *key;
+ int error;
+
+ input_dev = input_allocate_device();
+ if (!input_dev)
+ return -ENOMEM;
+
+ input_dev->name = "Wistron laptop buttons";
+ input_dev->phys = "wistron/input0";
+ input_dev->id.bustype = BUS_HOST;
for (key = keymap; key->type != KE_END; key++) {
if (key->type == KE_KEY) {
- input_dev.evbit[LONG(EV_KEY)] = BIT(EV_KEY);
- input_dev.keybit[LONG(key->keycode)]
- |= BIT(key->keycode);
+ input_dev->evbit[LONG(EV_KEY)] = BIT(EV_KEY);
+ set_bit(key->keycode, input_dev->keybit);
}
}
- input_register_device(&input_dev);
+ error = input_register_device(input_dev);
+ if (error) {
+ input_free_device(input_dev);
+ return error;
+ }
+
+ return 0;
}
static void report_key(unsigned keycode)
{
- input_report_key(&input_dev, keycode, 1);
- input_sync(&input_dev);
- input_report_key(&input_dev, keycode, 0);
- input_sync(&input_dev);
+ input_report_key(input_dev, keycode, 1);
+ input_sync(input_dev);
+ input_report_key(input_dev, keycode, 0);
+ input_sync(input_dev);
}
/* Driver core */
@@ -437,11 +449,14 @@ static int __init wb_module_init(void)
err = select_keymap();
if (err)
return err;
+
err = map_bios();
if (err)
return err;
+
bios_attach();
cmos_address = bios_get_cmos_address();
+
if (have_wifi) {
u16 wifi = bios_get_default_setting(WIFI);
if (wifi & 1)
@@ -452,6 +467,7 @@ static int __init wb_module_init(void)
if (have_wifi)
bios_set_state(WIFI, wifi_enabled);
}
+
if (have_bluetooth) {
u16 bt = bios_get_default_setting(BLUETOOTH);
if (bt & 1)
@@ -463,7 +479,12 @@ static int __init wb_module_init(void)
bios_set_state(BLUETOOTH, bluetooth_enabled);
}
- setup_input_dev();
+ err = setup_input_dev();
+ if (err) {
+ bios_detach();
+ unmap_bios();
+ return err;
+ }
poll_bios(1); /* Flush stale event queue and arm timer */
@@ -473,7 +494,7 @@ static int __init wb_module_init(void)
static void __exit wb_module_exit(void)
{
del_timer_sync(&poll_timer);
- input_unregister_device(&input_dev);
+ input_unregister_device(input_dev);
bios_detach();
unmap_bios();
}
^ permalink raw reply [flat|nested] 29+ messages in thread
* [git pull 06/14] Wistron - add PM support
2005-11-20 6:36 [git pull 00/14] Input updates for 2.6.15 Dmitry Torokhov
` (4 preceding siblings ...)
2005-11-20 6:36 ` [git pull 05/14] Wistron - convert to dynamic input_dev allocation Dmitry Torokhov
@ 2005-11-20 6:36 ` Dmitry Torokhov
2005-11-20 6:36 ` [git pull 07/14] wistron - disable wifi/bluetooth on suspend Dmitry Torokhov
` (9 subsequent siblings)
15 siblings, 0 replies; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-20 6:36 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List
[-- Attachment #1: wistron-platform-device.patch --]
[-- Type: text/plain, Size: 3650 bytes --]
Input: wistron - add PM support
Register wistron-bios as a platform device, restore WIFI and
Bluetooth state upon resume.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/misc/wistron_btns.c | 62 ++++++++++++++++++++++++++++++++++----
1 files changed, 57 insertions(+), 5 deletions(-)
Index: work/drivers/input/misc/wistron_btns.c
===================================================================
--- work.orig/drivers/input/misc/wistron_btns.c
+++ work/drivers/input/misc/wistron_btns.c
@@ -2,6 +2,7 @@
* Wistron laptop button driver
* Copyright (C) 2005 Miloslav Trmac <mitr@volny.cz>
* Copyright (C) 2005 Bernhard Rosenkraenzer <bero@arklinux.org>
+ * Copyright (C) 2005 Dmitry Torokhov <dtor@mail.ru>
*
* You can redistribute and/or modify this program under the terms of the
* GNU General Public License version 2 as published by the Free Software
@@ -28,6 +29,7 @@
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/types.h>
+#include <linux/platform_device.h>
/*
* Number of attempts to read data from queue per poll;
@@ -58,6 +60,8 @@ static char *keymap_name; /* = NULL; */
module_param_named(keymap, keymap_name, charp, 0);
MODULE_PARM_DESC(keymap, "Keymap name, if it can't be autodetected");
+static struct platform_device *wistron_device;
+
/* BIOS interface implementation */
static void __iomem *bios_entry_point; /* BIOS routine entry point */
@@ -356,6 +360,7 @@ static int __init setup_input_dev(void)
input_dev->name = "Wistron laptop buttons";
input_dev->phys = "wistron/input0";
input_dev->id.bustype = BUS_HOST;
+ input_dev->cdev.dev = &wistron_device->dev;
for (key = keymap; key->type != KE_END; key++) {
if (key->type == KE_KEY) {
@@ -442,6 +447,34 @@ static void poll_bios(unsigned long disc
mod_timer(&poll_timer, jiffies + HZ / POLL_FREQUENCY);
}
+static int wistron_suspend(struct platform_device *dev, pm_message_t state)
+{
+ del_timer_sync(&poll_timer);
+
+ return 0;
+}
+
+static int wistron_resume(struct platform_device *dev)
+{
+ if (have_wifi)
+ bios_set_state(WIFI, wifi_enabled);
+
+ if (have_bluetooth)
+ bios_set_state(BLUETOOTH, bluetooth_enabled);
+
+ poll_bios(1);
+
+ return 0;
+}
+
+static struct platform_driver wistron_driver = {
+ .suspend = wistron_suspend,
+ .resume = wistron_resume,
+ .driver = {
+ .name = "wistron-bios",
+ },
+};
+
static int __init wb_module_init(void)
{
int err;
@@ -457,6 +490,16 @@ static int __init wb_module_init(void)
bios_attach();
cmos_address = bios_get_cmos_address();
+ err = platform_driver_register(&wistron_driver);
+ if (err)
+ goto err_detach_bios;
+
+ wistron_device = platform_device_register_simple("wistron-bios", -1, NULL, 0);
+ if (IS_ERR(wistron_device)) {
+ err = PTR_ERR(wistron_device);
+ goto err_unregister_driver;
+ }
+
if (have_wifi) {
u16 wifi = bios_get_default_setting(WIFI);
if (wifi & 1)
@@ -480,21 +523,30 @@ static int __init wb_module_init(void)
}
err = setup_input_dev();
- if (err) {
- bios_detach();
- unmap_bios();
- return err;
- }
+ if (err)
+ goto err_unregister_device;
poll_bios(1); /* Flush stale event queue and arm timer */
return 0;
+
+ err_unregister_device:
+ platform_device_unregister(wistron_device);
+ err_unregister_driver:
+ platform_driver_unregister(&wistron_driver);
+ err_detach_bios:
+ bios_detach();
+ unmap_bios();
+
+ return err;
}
static void __exit wb_module_exit(void)
{
del_timer_sync(&poll_timer);
input_unregister_device(input_dev);
+ platform_device_unregister(wistron_device);
+ platform_driver_unregister(&wistron_driver);
bios_detach();
unmap_bios();
}
^ permalink raw reply [flat|nested] 29+ messages in thread
* [git pull 07/14] wistron - disable wifi/bluetooth on suspend
2005-11-20 6:36 [git pull 00/14] Input updates for 2.6.15 Dmitry Torokhov
` (5 preceding siblings ...)
2005-11-20 6:36 ` [git pull 06/14] Wistron - add PM support Dmitry Torokhov
@ 2005-11-20 6:36 ` Dmitry Torokhov
2005-11-20 6:36 ` [git pull 08/14] Uinput: convert to dynalloc allocation Dmitry Torokhov
` (8 subsequent siblings)
15 siblings, 0 replies; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-20 6:36 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List
[-- Attachment #1: wistron-disable-on-suspend.patch --]
[-- Type: text/plain, Size: 767 bytes --]
From: Miloslav Trmac <mitr@volny.cz>
Input: wistron - disable wifi/bluetooth on suspend
Try to save battery power by disabling wifi and bluetooth on suspend.
Signed-off-by: Miloslav Trmac <mitr@volny.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/misc/wistron_btns.c | 6 ++++++
1 files changed, 6 insertions(+)
Index: work/drivers/input/misc/wistron_btns.c
===================================================================
--- work.orig/drivers/input/misc/wistron_btns.c
+++ work/drivers/input/misc/wistron_btns.c
@@ -451,6 +451,12 @@ static int wistron_suspend(struct platfo
{
del_timer_sync(&poll_timer);
+ if (have_wifi)
+ bios_set_state(WIFI, 0);
+
+ if (have_bluetooth)
+ bios_set_state(BLUETOOTH, 0);
+
return 0;
}
^ permalink raw reply [flat|nested] 29+ messages in thread
* [git pull 08/14] Uinput: convert to dynalloc allocation
2005-11-20 6:36 [git pull 00/14] Input updates for 2.6.15 Dmitry Torokhov
` (6 preceding siblings ...)
2005-11-20 6:36 ` [git pull 07/14] wistron - disable wifi/bluetooth on suspend Dmitry Torokhov
@ 2005-11-20 6:36 ` Dmitry Torokhov
2005-11-20 6:36 ` [git pull 09/14] Uinput: add UI_SET_SWBIT ioctl Dmitry Torokhov
` (7 subsequent siblings)
15 siblings, 0 replies; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-20 6:36 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List
[-- Attachment #1: input-dynalloc-uinput.patch --]
[-- Type: text/plain, Size: 12998 bytes --]
Input: uinput - convert to dynalloc allocation
Also introduce proper locking when creating/deleting device.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/misc/uinput.c | 308 +++++++++++++++++++++++---------------------
include/linux/uinput.h | 12 -
2 files changed, 168 insertions(+), 152 deletions(-)
Index: work/drivers/input/misc/uinput.c
===================================================================
--- work.orig/drivers/input/misc/uinput.c
+++ work/drivers/input/misc/uinput.c
@@ -152,67 +152,62 @@ static int uinput_dev_erase_effect(struc
return retval;
}
-static int uinput_create_device(struct uinput_device *udev)
+static void uinput_destroy_device(struct uinput_device *udev)
{
- if (!udev->dev->name) {
- printk(KERN_DEBUG "%s: write device info first\n", UINPUT_NAME);
- return -EINVAL;
- }
+ const char *name, *phys;
- udev->dev->event = uinput_dev_event;
- udev->dev->upload_effect = uinput_dev_upload_effect;
- udev->dev->erase_effect = uinput_dev_erase_effect;
- udev->dev->private = udev;
-
- init_waitqueue_head(&udev->waitq);
-
- input_register_device(udev->dev);
-
- set_bit(UIST_CREATED, &udev->state);
+ if (udev->dev) {
+ name = udev->dev->name;
+ phys = udev->dev->phys;
+ if (udev->state == UIST_CREATED)
+ input_unregister_device(udev->dev);
+ else
+ input_free_device(udev->dev);
+ kfree(name);
+ kfree(phys);
+ udev->dev = NULL;
+ }
- return 0;
+ udev->state = UIST_NEW_DEVICE;
}
-static int uinput_destroy_device(struct uinput_device *udev)
+static int uinput_create_device(struct uinput_device *udev)
{
- if (!test_bit(UIST_CREATED, &udev->state)) {
- printk(KERN_WARNING "%s: create the device first\n", UINPUT_NAME);
+ int error;
+
+ if (udev->state != UIST_SETUP_COMPLETE) {
+ printk(KERN_DEBUG "%s: write device info first\n", UINPUT_NAME);
return -EINVAL;
}
- input_unregister_device(udev->dev);
+ error = input_register_device(udev->dev);
+ if (error) {
+ uinput_destroy_device(udev);
+ return error;
+ }
- clear_bit(UIST_CREATED, &udev->state);
+ udev->state = UIST_CREATED;
return 0;
}
static int uinput_open(struct inode *inode, struct file *file)
{
- struct uinput_device *newdev;
- struct input_dev *newinput;
+ struct uinput_device *newdev;
- newdev = kmalloc(sizeof(struct uinput_device), GFP_KERNEL);
+ newdev = kzalloc(sizeof(struct uinput_device), GFP_KERNEL);
if (!newdev)
- goto error;
- memset(newdev, 0, sizeof(struct uinput_device));
+ return -ENOMEM;
+
+ init_MUTEX(&newdev->sem);
spin_lock_init(&newdev->requests_lock);
init_waitqueue_head(&newdev->requests_waitq);
-
- newinput = kmalloc(sizeof(struct input_dev), GFP_KERNEL);
- if (!newinput)
- goto cleanup;
- memset(newinput, 0, sizeof(struct input_dev));
-
- newdev->dev = newinput;
+ init_waitqueue_head(&newdev->waitq);
+ newdev->state = UIST_NEW_DEVICE;
file->private_data = newdev;
return 0;
-cleanup:
- kfree(newdev);
-error:
- return -ENOMEM;
}
static int uinput_validate_absbits(struct input_dev *dev)
@@ -246,34 +241,55 @@ static int uinput_validate_absbits(struc
return retval;
}
-static int uinput_alloc_device(struct file *file, const char __user *buffer, size_t count)
+static int uinput_allocate_device(struct uinput_device *udev)
+{
+ udev->dev = input_allocate_device();
+ if (!udev->dev)
+ return -ENOMEM;
+
+ udev->dev->event = uinput_dev_event;
+ udev->dev->upload_effect = uinput_dev_upload_effect;
+ udev->dev->erase_effect = uinput_dev_erase_effect;
+ udev->dev->private = udev;
+
+ return 0;
+}
+
+static int uinput_setup_device(struct uinput_device *udev, const char __user *buffer, size_t count)
{
struct uinput_user_dev *user_dev;
struct input_dev *dev;
- struct uinput_device *udev;
char *name;
int size;
int retval;
- retval = count;
+ if (count != sizeof(struct uinput_user_dev))
+ return -EINVAL;
+
+ if (!udev->dev) {
+ retval = uinput_allocate_device(udev);
+ if (retval)
+ return retval;
+ }
- udev = file->private_data;
dev = udev->dev;
user_dev = kmalloc(sizeof(struct uinput_user_dev), GFP_KERNEL);
- if (!user_dev) {
- retval = -ENOMEM;
- goto exit;
- }
+ if (!user_dev)
+ return -ENOMEM;
if (copy_from_user(user_dev, buffer, sizeof(struct uinput_user_dev))) {
retval = -EFAULT;
goto exit;
}
- kfree(dev->name);
-
size = strnlen(user_dev->name, UINPUT_MAX_NAME_SIZE) + 1;
+ if (!size) {
+ retval = -EINVAL;
+ goto exit;
+ }
+
+ kfree(dev->name);
dev->name = name = kmalloc(size, GFP_KERNEL);
if (!name) {
retval = -ENOMEM;
@@ -296,32 +312,50 @@ static int uinput_alloc_device(struct fi
/* check if absmin/absmax/absfuzz/absflat are filled as
* told in Documentation/input/input-programming.txt */
if (test_bit(EV_ABS, dev->evbit)) {
- int err = uinput_validate_absbits(dev);
- if (err < 0) {
- retval = err;
- kfree(dev->name);
- }
+ retval = uinput_validate_absbits(dev);
+ if (retval < 0)
+ goto exit;
}
-exit:
+ udev->state = UIST_SETUP_COMPLETE;
+ retval = count;
+
+ exit:
kfree(user_dev);
return retval;
}
+static inline ssize_t uinput_inject_event(struct uinput_device *udev, const char __user *buffer, size_t count)
+{
+ struct input_event ev;
+
+ if (count != sizeof(struct input_event))
+ return -EINVAL;
+
+ if (copy_from_user(&ev, buffer, sizeof(struct input_event)))
+ return -EFAULT;
+
+ input_event(udev->dev, ev.type, ev.code, ev.value);
+
+ return sizeof(struct input_event);
+}
+
static ssize_t uinput_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
{
struct uinput_device *udev = file->private_data;
+ int retval;
- if (test_bit(UIST_CREATED, &udev->state)) {
- struct input_event ev;
+ retval = down_interruptible(&udev->sem);
+ if (retval)
+ return retval;
- if (copy_from_user(&ev, buffer, sizeof(struct input_event)))
- return -EFAULT;
- input_event(udev->dev, ev.type, ev.code, ev.value);
- } else
- count = uinput_alloc_device(file, buffer, count);
+ retval = udev->state == UIST_CREATED ?
+ uinput_inject_event(udev, buffer, count) :
+ uinput_setup_device(udev, buffer, count);
- return count;
+ up(&udev->sem);
+
+ return retval;
}
static ssize_t uinput_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
@@ -329,28 +363,38 @@ static ssize_t uinput_read(struct file *
struct uinput_device *udev = file->private_data;
int retval = 0;
- if (!test_bit(UIST_CREATED, &udev->state))
+ if (udev->state != UIST_CREATED)
return -ENODEV;
if (udev->head == udev->tail && (file->f_flags & O_NONBLOCK))
return -EAGAIN;
retval = wait_event_interruptible(udev->waitq,
- udev->head != udev->tail || !test_bit(UIST_CREATED, &udev->state));
+ udev->head != udev->tail || udev->state != UIST_CREATED);
if (retval)
return retval;
- if (!test_bit(UIST_CREATED, &udev->state))
- return -ENODEV;
+ retval = down_interruptible(&udev->sem);
+ if (retval)
+ return retval;
- while ((udev->head != udev->tail) &&
- (retval + sizeof(struct input_event) <= count)) {
- if (copy_to_user(buffer + retval, &udev->buff[udev->tail], sizeof(struct input_event)))
- return -EFAULT;
+ if (udev->state != UIST_CREATED) {
+ retval = -ENODEV;
+ goto out;
+ }
+
+ while (udev->head != udev->tail && retval + sizeof(struct input_event) <= count) {
+ if (copy_to_user(buffer + retval, &udev->buff[udev->tail], sizeof(struct input_event))) {
+ retval = -EFAULT;
+ goto out;
+ }
udev->tail = (udev->tail + 1) % UINPUT_BUFFER_SIZE;
retval += sizeof(struct input_event);
}
+ out:
+ up(&udev->sem);
+
return retval;
}
@@ -366,28 +410,30 @@ static unsigned int uinput_poll(struct f
return 0;
}
-static int uinput_burn_device(struct uinput_device *udev)
+static int uinput_release(struct inode *inode, struct file *file)
{
- if (test_bit(UIST_CREATED, &udev->state))
- uinput_destroy_device(udev);
+ struct uinput_device *udev = file->private_data;
- kfree(udev->dev->name);
- kfree(udev->dev->phys);
- kfree(udev->dev);
+ uinput_destroy_device(udev);
kfree(udev);
return 0;
}
-static int uinput_close(struct inode *inode, struct file *file)
-{
- uinput_burn_device(file->private_data);
- return 0;
-}
+#define uinput_set_bit(_arg, _bit, _max) \
+({ \
+ int __ret = 0; \
+ if (udev->state == UIST_CREATED) \
+ __ret = -EINVAL; \
+ else if ((_arg) > (_max)) \
+ __ret = -EINVAL; \
+ else set_bit((_arg), udev->dev->_bit); \
+ __ret; \
+})
-static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+static long uinput_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
- int retval = 0;
+ int retval;
struct uinput_device *udev;
void __user *p = (void __user *)arg;
struct uinput_ff_upload ff_up;
@@ -398,19 +444,14 @@ static int uinput_ioctl(struct inode *in
udev = file->private_data;
- /* device attributes can not be changed after the device is created */
- switch (cmd) {
- case UI_SET_EVBIT:
- case UI_SET_KEYBIT:
- case UI_SET_RELBIT:
- case UI_SET_ABSBIT:
- case UI_SET_MSCBIT:
- case UI_SET_LEDBIT:
- case UI_SET_SNDBIT:
- case UI_SET_FFBIT:
- case UI_SET_PHYS:
- if (test_bit(UIST_CREATED, &udev->state))
- return -EINVAL;
+ retval = down_interruptible(&udev->sem);
+ if (retval)
+ return retval;
+
+ if (!udev->dev) {
+ retval = uinput_allocate_device(udev);
+ if (retval)
+ goto out;
}
switch (cmd) {
@@ -419,74 +460,46 @@ static int uinput_ioctl(struct inode *in
break;
case UI_DEV_DESTROY:
- retval = uinput_destroy_device(udev);
+ uinput_destroy_device(udev);
break;
case UI_SET_EVBIT:
- if (arg > EV_MAX) {
- retval = -EINVAL;
- break;
- }
- set_bit(arg, udev->dev->evbit);
+ retval = uinput_set_bit(arg, evbit, EV_MAX);
break;
case UI_SET_KEYBIT:
- if (arg > KEY_MAX) {
- retval = -EINVAL;
- break;
- }
- set_bit(arg, udev->dev->keybit);
+ retval = uinput_set_bit(arg, keybit, KEY_MAX);
break;
case UI_SET_RELBIT:
- if (arg > REL_MAX) {
- retval = -EINVAL;
- break;
- }
- set_bit(arg, udev->dev->relbit);
+ retval = uinput_set_bit(arg, relbit, REL_MAX);
break;
case UI_SET_ABSBIT:
- if (arg > ABS_MAX) {
- retval = -EINVAL;
- break;
- }
- set_bit(arg, udev->dev->absbit);
+ retval = uinput_set_bit(arg, absbit, ABS_MAX);
break;
case UI_SET_MSCBIT:
- if (arg > MSC_MAX) {
- retval = -EINVAL;
- break;
- }
- set_bit(arg, udev->dev->mscbit);
+ retval = uinput_set_bit(arg, mscbit, MSC_MAX);
break;
case UI_SET_LEDBIT:
- if (arg > LED_MAX) {
- retval = -EINVAL;
- break;
- }
- set_bit(arg, udev->dev->ledbit);
+ retval = uinput_set_bit(arg, ledbit, LED_MAX);
break;
case UI_SET_SNDBIT:
- if (arg > SND_MAX) {
- retval = -EINVAL;
- break;
- }
- set_bit(arg, udev->dev->sndbit);
+ retval = uinput_set_bit(arg, sndbit, SND_MAX);
break;
case UI_SET_FFBIT:
- if (arg > FF_MAX) {
- retval = -EINVAL;
- break;
- }
- set_bit(arg, udev->dev->ffbit);
+ retval = uinput_set_bit(arg, ffbit, FF_MAX);
break;
case UI_SET_PHYS:
+ if (udev->state == UIST_CREATED) {
+ retval = -EINVAL;
+ goto out;
+ }
length = strnlen_user(p, 1024);
if (length <= 0) {
retval = -EFAULT;
@@ -575,23 +588,26 @@ static int uinput_ioctl(struct inode *in
default:
retval = -EINVAL;
}
+
+ out:
+ up(&udev->sem);
return retval;
}
static struct file_operations uinput_fops = {
- .owner = THIS_MODULE,
- .open = uinput_open,
- .release = uinput_close,
- .read = uinput_read,
- .write = uinput_write,
- .poll = uinput_poll,
- .ioctl = uinput_ioctl,
+ .owner = THIS_MODULE,
+ .open = uinput_open,
+ .release = uinput_release,
+ .read = uinput_read,
+ .write = uinput_write,
+ .poll = uinput_poll,
+ .unlocked_ioctl = uinput_ioctl,
};
static struct miscdevice uinput_misc = {
- .fops = &uinput_fops,
- .minor = UINPUT_MINOR,
- .name = UINPUT_NAME,
+ .fops = &uinput_fops,
+ .minor = UINPUT_MINOR,
+ .name = UINPUT_NAME,
};
static int __init uinput_init(void)
Index: work/include/linux/uinput.h
===================================================================
--- work.orig/include/linux/uinput.h
+++ work/include/linux/uinput.h
@@ -34,8 +34,7 @@
#define UINPUT_BUFFER_SIZE 16
#define UINPUT_NUM_REQUESTS 16
-/* state flags => bit index for {set|clear|test}_bit ops */
-#define UIST_CREATED 0
+enum uinput_state { UIST_NEW_DEVICE, UIST_SETUP_COMPLETE, UIST_CREATED };
struct uinput_request {
int id;
@@ -52,11 +51,12 @@ struct uinput_request {
struct uinput_device {
struct input_dev *dev;
- unsigned long state;
+ struct semaphore sem;
+ enum uinput_state state;
wait_queue_head_t waitq;
- unsigned char ready,
- head,
- tail;
+ unsigned char ready;
+ unsigned char head;
+ unsigned char tail;
struct input_event buff[UINPUT_BUFFER_SIZE];
struct uinput_request *requests[UINPUT_NUM_REQUESTS];
^ permalink raw reply [flat|nested] 29+ messages in thread
* [git pull 09/14] Uinput: add UI_SET_SWBIT ioctl
2005-11-20 6:36 [git pull 00/14] Input updates for 2.6.15 Dmitry Torokhov
` (7 preceding siblings ...)
2005-11-20 6:36 ` [git pull 08/14] Uinput: convert to dynalloc allocation Dmitry Torokhov
@ 2005-11-20 6:36 ` Dmitry Torokhov
2005-11-23 22:53 ` Benjamin Herrenschmidt
2005-11-23 23:01 ` Benjamin Herrenschmidt
2005-11-20 6:36 ` [git pull 10/14] Uinput: dont use "interruptible" in FF code Dmitry Torokhov
` (6 subsequent siblings)
15 siblings, 2 replies; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-20 6:36 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List
[-- Attachment #1: uinput-add-sw-ioctl.patch --]
[-- Type: text/plain, Size: 1294 bytes --]
Input: uinput - add UI_SET_SWBIT ioctl
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/misc/uinput.c | 4 ++++
include/linux/uinput.h | 1 +
2 files changed, 5 insertions(+)
Index: work/drivers/input/misc/uinput.c
===================================================================
--- work.orig/drivers/input/misc/uinput.c
+++ work/drivers/input/misc/uinput.c
@@ -495,6 +495,10 @@ static long uinput_ioctl(struct file *fi
retval = uinput_set_bit(arg, ffbit, FF_MAX);
break;
+ case UI_SET_SWBIT:
+ retval = uinput_set_bit(arg, swbit, SW_MAX);
+ break;
+
case UI_SET_PHYS:
if (udev->state == UIST_CREATED) {
retval = -EINVAL;
Index: work/include/linux/uinput.h
===================================================================
--- work.orig/include/linux/uinput.h
+++ work/include/linux/uinput.h
@@ -91,6 +91,7 @@ struct uinput_ff_erase {
#define UI_SET_SNDBIT _IOW(UINPUT_IOCTL_BASE, 106, int)
#define UI_SET_FFBIT _IOW(UINPUT_IOCTL_BASE, 107, int)
#define UI_SET_PHYS _IOW(UINPUT_IOCTL_BASE, 108, char*)
+#define UI_SET_SWBIT _IOW(UINPUT_IOCTL_BASE, 109, int)
#define UI_BEGIN_FF_UPLOAD _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload)
#define UI_END_FF_UPLOAD _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [git pull 10/14] Uinput: dont use "interruptible" in FF code
2005-11-20 6:36 [git pull 00/14] Input updates for 2.6.15 Dmitry Torokhov
` (8 preceding siblings ...)
2005-11-20 6:36 ` [git pull 09/14] Uinput: add UI_SET_SWBIT ioctl Dmitry Torokhov
@ 2005-11-20 6:36 ` Dmitry Torokhov
2005-11-20 6:36 ` [git pull 11/14] Handle failures in input_register_device() Dmitry Torokhov
` (5 subsequent siblings)
15 siblings, 0 replies; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-20 6:36 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List
[-- Attachment #1: uinput-dont-use-wait-completion-interruptible.patch --]
[-- Type: text/plain, Size: 1475 bytes --]
Input: uinput - don't use "interruptible" in FF code
If thread that submitted FF request gets interrupted somehow it
will release request structure and ioctl handler will work with
freed memory. TO prevent that from happening switch to using
wait_for_completion instead of wait_for_completion_interruptible.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/misc/uinput.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
Index: work/drivers/input/misc/uinput.c
===================================================================
--- work.orig/drivers/input/misc/uinput.c
+++ work/drivers/input/misc/uinput.c
@@ -92,24 +92,19 @@ static void uinput_request_done(struct u
{
/* Mark slot as available */
udev->requests[request->id] = NULL;
- wake_up_interruptible(&udev->requests_waitq);
+ wake_up(&udev->requests_waitq);
complete(&request->done);
}
static int uinput_request_submit(struct input_dev *dev, struct uinput_request *request)
{
- int retval;
-
/* Tell our userspace app about this new request by queueing an input event */
uinput_dev_event(dev, EV_UINPUT, request->code, request->id);
/* Wait for the request to complete */
- retval = wait_for_completion_interruptible(&request->done);
- if (!retval)
- retval = request->retval;
-
- return retval;
+ wait_for_completion(&request->done);
+ return request->retval;
}
static int uinput_dev_upload_effect(struct input_dev *dev, struct ff_effect *effect)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [git pull 11/14] Handle failures in input_register_device()
2005-11-20 6:36 [git pull 00/14] Input updates for 2.6.15 Dmitry Torokhov
` (9 preceding siblings ...)
2005-11-20 6:36 ` [git pull 10/14] Uinput: dont use "interruptible" in FF code Dmitry Torokhov
@ 2005-11-20 6:36 ` Dmitry Torokhov
2005-11-20 6:36 ` [git pull 12/14] Input - help swsusp Dmitry Torokhov
` (4 subsequent siblings)
15 siblings, 0 replies; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-20 6:36 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List
[-- Attachment #1: input-device-registration-cleanup.patch --]
[-- Type: text/plain, Size: 3636 bytes --]
Input: handle failures in input_register_device()
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/input.c | 63 ++++++++++++++++++++++++++++----------------------
1 files changed, 36 insertions(+), 27 deletions(-)
Index: work/drivers/input/input.c
===================================================================
--- work.orig/drivers/input/input.c
+++ work/drivers/input/input.c
@@ -536,7 +536,7 @@ static struct attribute *input_dev_attrs
NULL
};
-static struct attribute_group input_dev_group = {
+static struct attribute_group input_dev_attr_group = {
.attrs = input_dev_attrs,
};
@@ -717,35 +717,14 @@ struct input_dev *input_allocate_device(
return dev;
}
-static void input_register_classdevice(struct input_dev *dev)
-{
- static atomic_t input_no = ATOMIC_INIT(0);
- const char *path;
-
- __module_get(THIS_MODULE);
-
- dev->dev = dev->cdev.dev;
-
- snprintf(dev->cdev.class_id, sizeof(dev->cdev.class_id),
- "input%ld", (unsigned long) atomic_inc_return(&input_no) - 1);
-
- path = kobject_get_path(&dev->cdev.class->subsys.kset.kobj, GFP_KERNEL);
- printk(KERN_INFO "input: %s as %s/%s\n",
- dev->name ? dev->name : "Unspecified device",
- path ? path : "", dev->cdev.class_id);
- kfree(path);
-
- class_device_add(&dev->cdev);
- sysfs_create_group(&dev->cdev.kobj, &input_dev_group);
- sysfs_create_group(&dev->cdev.kobj, &input_dev_id_attr_group);
- sysfs_create_group(&dev->cdev.kobj, &input_dev_caps_attr_group);
-}
-
int input_register_device(struct input_dev *dev)
{
+ static atomic_t input_no = ATOMIC_INIT(0);
struct input_handle *handle;
struct input_handler *handler;
struct input_device_id *id;
+ const char *path;
+ int error;
if (!dev->dynalloc) {
printk(KERN_WARNING "input: device %s is statically allocated, will not register\n"
@@ -773,7 +752,32 @@ int input_register_device(struct input_d
INIT_LIST_HEAD(&dev->h_list);
list_add_tail(&dev->node, &input_dev_list);
- input_register_classdevice(dev);
+ dev->cdev.class = &input_class;
+ snprintf(dev->cdev.class_id, sizeof(dev->cdev.class_id),
+ "input%ld", (unsigned long) atomic_inc_return(&input_no) - 1);
+
+ error = class_device_add(&dev->cdev);
+ if (error)
+ return error;
+
+ error = sysfs_create_group(&dev->cdev.kobj, &input_dev_attr_group);
+ if (error)
+ goto fail1;
+
+ error = sysfs_create_group(&dev->cdev.kobj, &input_dev_id_attr_group);
+ if (error)
+ goto fail2;
+
+ error = sysfs_create_group(&dev->cdev.kobj, &input_dev_caps_attr_group);
+ if (error)
+ goto fail3;
+
+ __module_get(THIS_MODULE);
+
+ path = kobject_get_path(&dev->cdev.kobj, GFP_KERNEL);
+ printk(KERN_INFO "input: %s as %s\n",
+ dev->name ? dev->name : "Unspecified device", path ? path : "N/A");
+ kfree(path);
list_for_each_entry(handler, &input_handler_list, node)
if (!handler->blacklist || !input_match_device(handler->blacklist, dev))
@@ -784,6 +788,11 @@ int input_register_device(struct input_d
input_wakeup_procfs_readers();
return 0;
+
+ fail3: sysfs_remove_group(&dev->cdev.kobj, &input_dev_id_attr_group);
+ fail2: sysfs_remove_group(&dev->cdev.kobj, &input_dev_attr_group);
+ fail1: class_device_del(&dev->cdev);
+ return error;
}
void input_unregister_device(struct input_dev *dev)
@@ -805,7 +814,7 @@ void input_unregister_device(struct inpu
sysfs_remove_group(&dev->cdev.kobj, &input_dev_caps_attr_group);
sysfs_remove_group(&dev->cdev.kobj, &input_dev_id_attr_group);
- sysfs_remove_group(&dev->cdev.kobj, &input_dev_group);
+ sysfs_remove_group(&dev->cdev.kobj, &input_dev_attr_group);
class_device_unregister(&dev->cdev);
input_wakeup_procfs_readers();
^ permalink raw reply [flat|nested] 29+ messages in thread
* [git pull 12/14] Input - help swsusp
2005-11-20 6:36 [git pull 00/14] Input updates for 2.6.15 Dmitry Torokhov
` (10 preceding siblings ...)
2005-11-20 6:36 ` [git pull 11/14] Handle failures in input_register_device() Dmitry Torokhov
@ 2005-11-20 6:36 ` Dmitry Torokhov
2005-11-20 6:36 ` [git pull 13/14] Input updates for 2.6.15 Dmitry Torokhov
` (3 subsequent siblings)
15 siblings, 0 replies; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-20 6:36 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List
[-- Attachment #1: input-help-swsusp.patch --]
[-- Type: text/plain, Size: 2705 bytes --]
Input: make serio and gameport more swsusp friendly
kseriod and kgameportd used to process all pending events before
checking for freeze condition. This may cause swsusp to time out
while stopping tasks when resuming. Switch to process events one
by one to check freeze status more often.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/gameport/gameport.c | 12 +++++++++---
drivers/input/serio/serio.c | 12 +++++++++---
2 files changed, 18 insertions(+), 6 deletions(-)
Index: work/drivers/input/serio/serio.c
===================================================================
--- work.orig/drivers/input/serio/serio.c
+++ work/drivers/input/serio/serio.c
@@ -269,14 +269,20 @@ static struct serio_event *serio_get_eve
return event;
}
-static void serio_handle_events(void)
+static void serio_handle_event(void)
{
struct serio_event *event;
struct serio_driver *serio_drv;
down(&serio_sem);
- while ((event = serio_get_event())) {
+ /*
+ * Note that we handle only one event here to give swsusp
+ * a chance to freeze kseriod thread. Serio events should
+ * be pretty rare so we are not concerned about taking
+ * performance hit.
+ */
+ if ((event = serio_get_event())) {
switch (event->type) {
case SERIO_REGISTER_PORT:
@@ -368,7 +374,7 @@ static struct serio *serio_get_pending_c
static int serio_thread(void *nothing)
{
do {
- serio_handle_events();
+ serio_handle_event();
wait_event_interruptible(serio_wait,
kthread_should_stop() || !list_empty(&serio_event_list));
try_to_freeze();
Index: work/drivers/input/gameport/gameport.c
===================================================================
--- work.orig/drivers/input/gameport/gameport.c
+++ work/drivers/input/gameport/gameport.c
@@ -339,14 +339,20 @@ static struct gameport_event *gameport_g
return event;
}
-static void gameport_handle_events(void)
+static void gameport_handle_event(void)
{
struct gameport_event *event;
struct gameport_driver *gameport_drv;
down(&gameport_sem);
- while ((event = gameport_get_event())) {
+ /*
+ * Note that we handle only one event here to give swsusp
+ * a chance to freeze kgameportd thread. Gameport events
+ * should be pretty rare so we are not concerned about
+ * taking performance hit.
+ */
+ if ((event = gameport_get_event())) {
switch (event->type) {
case GAMEPORT_REGISTER_PORT:
@@ -433,7 +439,7 @@ static struct gameport *gameport_get_pen
static int gameport_thread(void *nothing)
{
do {
- gameport_handle_events();
+ gameport_handle_event();
wait_event_interruptible(gameport_wait,
kthread_should_stop() || !list_empty(&gameport_event_list));
try_to_freeze();
^ permalink raw reply [flat|nested] 29+ messages in thread
* [git pull 13/14] Input updates for 2.6.15
2005-11-20 6:36 [git pull 00/14] Input updates for 2.6.15 Dmitry Torokhov
` (11 preceding siblings ...)
2005-11-20 6:36 ` [git pull 12/14] Input - help swsusp Dmitry Torokhov
@ 2005-11-20 6:36 ` Dmitry Torokhov
2005-11-20 6:36 ` [git pull 14/14] Fix missing initialization in ir-kbd-gpio.c Dmitry Torokhov
` (2 subsequent siblings)
15 siblings, 0 replies; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-20 6:36 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List
[-- Attachment #1: saa7133-fix-ir-init.patch --]
[-- Type: text/plain, Size: 646 bytes --]
Fix an OOPS when initializing IR remote on saa7134
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/media/video/saa7134/saa7134-input.c | 2 ++
1 files changed, 2 insertions(+)
Index: work/drivers/media/video/saa7134/saa7134-input.c
===================================================================
--- work.orig/drivers/media/video/saa7134/saa7134-input.c
+++ work/drivers/media/video/saa7134/saa7134-input.c
@@ -713,6 +713,8 @@ int saa7134_input_init1(struct saa7134_d
return -ENOMEM;
}
+ ir->dev = input_dev;
+
/* init hardware-specific stuff */
ir->mask_keycode = mask_keycode;
ir->mask_keydown = mask_keydown;
^ permalink raw reply [flat|nested] 29+ messages in thread
* [git pull 14/14] Fix missing initialization in ir-kbd-gpio.c
2005-11-20 6:36 [git pull 00/14] Input updates for 2.6.15 Dmitry Torokhov
` (12 preceding siblings ...)
2005-11-20 6:36 ` [git pull 13/14] Input updates for 2.6.15 Dmitry Torokhov
@ 2005-11-20 6:36 ` Dmitry Torokhov
2005-11-20 8:37 ` [git pull 00/14] Input updates for 2.6.15 Vojtech Pavlik
2005-11-20 17:04 ` Dmitry Torokhov
15 siblings, 0 replies; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-20 6:36 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List
[-- Attachment #1: ir-kbd-gpio-init-input-dev.patch --]
[-- Type: text/plain, Size: 1219 bytes --]
Fix missing initialization in ir-kbd-gpio.c
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/media/video/ir-kbd-gpio.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
Index: work/drivers/media/video/ir-kbd-gpio.c
===================================================================
--- work.orig/drivers/media/video/ir-kbd-gpio.c
+++ work/drivers/media/video/ir-kbd-gpio.c
@@ -673,7 +673,6 @@ static int ir_probe(struct device *dev)
snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0",
pci_name(sub->core->pci));
- ir->sub = sub;
ir_input_init(input_dev, &ir->ir, ir_type, ir_codes);
input_dev->name = ir->name;
input_dev->phys = ir->phys;
@@ -688,6 +687,9 @@ static int ir_probe(struct device *dev)
}
input_dev->cdev.dev = &sub->core->pci->dev;
+ ir->input = input_dev;
+ ir->sub = sub;
+
if (ir->polling) {
INIT_WORK(&ir->work, ir_work, ir);
init_timer(&ir->timer);
@@ -708,7 +710,6 @@ static int ir_probe(struct device *dev)
/* all done */
dev_set_drvdata(dev, ir);
input_register_device(ir->input);
- printk(DEVNAME ": %s detected at %s\n",ir->name,ir->phys);
/* the remote isn't as bouncy as a keyboard */
ir->input->rep[REP_DELAY] = repeat_delay;
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [git pull 00/14] Input updates for 2.6.15
2005-11-20 6:36 [git pull 00/14] Input updates for 2.6.15 Dmitry Torokhov
` (13 preceding siblings ...)
2005-11-20 6:36 ` [git pull 14/14] Fix missing initialization in ir-kbd-gpio.c Dmitry Torokhov
@ 2005-11-20 8:37 ` Vojtech Pavlik
2005-11-20 17:04 ` Dmitry Torokhov
15 siblings, 0 replies; 29+ messages in thread
From: Vojtech Pavlik @ 2005-11-20 8:37 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: Linus Torvalds, Andrew Morton, Linux Kernel Mailing List
On Sun, Nov 20, 2005 at 01:36:11AM -0500, Dmitry Torokhov wrote:
> Hi Linus,
>
> Please consider pulling from:
>
> master.kernel.org:/pub/scm/linux/kernel/git/dtor/input.git
>
> It corrects couple of problems caused by recein input dynalloc
> conversion, converts uinput driver to dynamic allocation and
> adds new wistron button driver which was siting in -mm for quite
> a while.
>
> Vojtech, please bless the pull.
Yup, I have no objections at all. Thanks, Dmitry!
Linus, please pull these changes into your tree.
> Changelog:
>
> Fix missing initialization in ir-kbd-gpio.c
> Fix an OOPS when initializing IR remote on saa7134
> Input: make serio and gameport more swsusp friendly
> Input: handle failures in input_register_device()
> Input: uinput - don't use "interruptible" in FF code
> Input: uinput - add UI_SET_SWBIT ioctl
> Input: uinput - convert to dynalloc allocation
> Input: wistron - disable wifi/bluetooth on suspend
> Input: wistron - add PM support
> Input: wistron - convert to dynamic input_dev allocation
> Input: wistron - add support for Acer Aspire 1500 notebooks
> Input: wistron - disable for x86_64
> Input: add Wistron driver
> Input: atkbd - speed up setting leds/repeat state
>
> Diffstat:
>
> MAINTAINERS | 5
> drivers/input/gameport/gameport.c | 12
> drivers/input/input.c | 63 +--
> drivers/input/keyboard/atkbd.c | 99 +++-
> drivers/input/misc/Kconfig | 10
> drivers/input/misc/Makefile | 1
> drivers/input/misc/uinput.c | 323 ++++++++--------
> drivers/input/misc/wistron_btns.c | 561 ++++++++++++++++++++++++++++
> drivers/input/serio/serio.c | 12
> drivers/media/video/ir-kbd-gpio.c | 5
> drivers/media/video/saa7134/saa7134-input.c | 2
> include/linux/uinput.h | 13
> 12 files changed, 880 insertions(+), 226 deletions(-)
--
Vojtech Pavlik
SuSE Labs, SuSE CR
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [git pull 03/14] Wistron - disable for x86_64
2005-11-20 6:36 ` [git pull 03/14] Wistron - disable for x86_64 Dmitry Torokhov
@ 2005-11-20 9:52 ` Geert Uytterhoeven
2005-11-22 3:42 ` Dmitry Torokhov
0 siblings, 1 reply; 29+ messages in thread
From: Geert Uytterhoeven @ 2005-11-20 9:52 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Linus Torvalds, Vojtech Pavlik, Andrew Morton,
Linux Kernel Mailing List
On Sun, 20 Nov 2005, Dmitry Torokhov wrote:
> From: Andrew Morton <akpm@osdl.org>
>
> Input: wistron - disable for x86_64
>
> On x86_64:
>
> {standard input}:233: Error: suffix or operands invalid for `push'
> {standard input}:233: Error: suffix or operands invalid for `pop'
>
> Signed-off-by: Andrew Morton <akpm@osdl.org>
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
> ---
>
> drivers/input/misc/Kconfig | 2 +-
> 1 files changed, 1 insertion(+), 1 deletion(-)
>
> Index: work/drivers/input/misc/Kconfig
> ===================================================================
> --- work.orig/drivers/input/misc/Kconfig
> +++ work/drivers/input/misc/Kconfig
> @@ -42,7 +42,7 @@ config INPUT_M68K_BEEP
>
> config INPUT_WISTRON_BTNS
> tristate "x86 Wistron laptop button interface"
> - depends on X86
> + depends on X86 && !X86_64
^^^^^^^^^^^^^^
That should be just `X86_32' these days.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [git pull 00/14] Input updates for 2.6.15
2005-11-20 6:36 [git pull 00/14] Input updates for 2.6.15 Dmitry Torokhov
` (14 preceding siblings ...)
2005-11-20 8:37 ` [git pull 00/14] Input updates for 2.6.15 Vojtech Pavlik
@ 2005-11-20 17:04 ` Dmitry Torokhov
2005-11-20 17:19 ` Linus Torvalds
15 siblings, 1 reply; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-20 17:04 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List
On Sunday 20 November 2005 01:36, Dmitry Torokhov wrote:
> Hi Linus,
>
> Please consider pulling from:
>
> master.kernel.org:/pub/scm/linux/kernel/git/dtor/input.git
>
> It corrects couple of problems caused by recein input dynalloc
> conversion, converts uinput driver to dynamic allocation and
> adds new wistron button driver which was siting in -mm for quite
> a while.
>
Linus, please hold off the pull - I messed up authorship of Wistron
driver in commit history plus there is another fix for cinergyT2 driver.
I will redo the tree...
--
Dmitry
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [git pull 00/14] Input updates for 2.6.15
2005-11-20 17:04 ` Dmitry Torokhov
@ 2005-11-20 17:19 ` Linus Torvalds
2005-11-20 17:42 ` Dmitry Torokhov
0 siblings, 1 reply; 29+ messages in thread
From: Linus Torvalds @ 2005-11-20 17:19 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List
On Sun, 20 Nov 2005, Dmitry Torokhov wrote:
>
> Linus, please hold off the pull - I messed up authorship of Wistron
> driver in commit history plus there is another fix for cinergyT2 driver.
Too late. Already pulled, and more importantly, already pushed out.
Linus
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [git pull 00/14] Input updates for 2.6.15
2005-11-20 17:19 ` Linus Torvalds
@ 2005-11-20 17:42 ` Dmitry Torokhov
2005-11-20 18:17 ` Linus Torvalds
0 siblings, 1 reply; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-20 17:42 UTC (permalink / raw)
To: Linus Torvalds
Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List,
Miloslav Trmac
On Sunday 20 November 2005 12:19, Linus Torvalds wrote:
>
> On Sun, 20 Nov 2005, Dmitry Torokhov wrote:
> >
> > Linus, please hold off the pull - I messed up authorship of Wistron
> > driver in commit history plus there is another fix for cinergyT2 driver.
>
> Too late. Already pulled, and more importantly, already pushed out.
>
Oh, ok.. Hopefully Miloslav will forgive me.
That cinergyT2 fix (from Linux-2.6.15-rc2 thread) - do you already have it
or would you prefer a pull prepared later tonight?
--
Dmitry
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [git pull 00/14] Input updates for 2.6.15
2005-11-20 17:42 ` Dmitry Torokhov
@ 2005-11-20 18:17 ` Linus Torvalds
2005-11-22 3:40 ` Dmitry Torokhov
0 siblings, 1 reply; 29+ messages in thread
From: Linus Torvalds @ 2005-11-20 18:17 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List,
Miloslav Trmac
On Sun, 20 Nov 2005, Dmitry Torokhov wrote:
>
> That cinergyT2 fix (from Linux-2.6.15-rc2 thread) - do you already have it
> or would you prefer a pull prepared later tonight?
The only one I have is the one I got through davem a couple of days ago:
cinergyT2: cinergyt2_register_rc() should return 0 on success
is that the one you're talking about?
Linus
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [git pull 00/14] Input updates for 2.6.15
2005-11-20 18:17 ` Linus Torvalds
@ 2005-11-22 3:40 ` Dmitry Torokhov
0 siblings, 0 replies; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-22 3:40 UTC (permalink / raw)
To: Linus Torvalds
Cc: Vojtech Pavlik, Andrew Morton, Linux Kernel Mailing List,
Miloslav Trmac
On Sunday 20 November 2005 13:17, Linus Torvalds wrote:
>
> On Sun, 20 Nov 2005, Dmitry Torokhov wrote:
> >
> > That cinergyT2 fix (from Linux-2.6.15-rc2 thread) - do you already have it
> > or would you prefer a pull prepared later tonight?
>
> The only one I have is the one I got through davem a couple of days ago:
>
> cinergyT2: cinergyt2_register_rc() should return 0 on success
>
> is that the one you're talking about?
>
Sorry for the delay...
I see that you already merged the patch I was talking about:
db93a82fa9d8b4d6e31c227922eaae829253bb88 [PATCH] Fix an OOPS is CinergyT2
--
Dmitry
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [git pull 03/14] Wistron - disable for x86_64
2005-11-20 9:52 ` Geert Uytterhoeven
@ 2005-11-22 3:42 ` Dmitry Torokhov
0 siblings, 0 replies; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-22 3:42 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Linus Torvalds, Vojtech Pavlik, Andrew Morton,
Linux Kernel Mailing List
On Sunday 20 November 2005 04:52, Geert Uytterhoeven wrote:
> On Sun, 20 Nov 2005, Dmitry Torokhov wrote:
> >
> > config INPUT_WISTRON_BTNS
> > tristate "x86 Wistron laptop button interface"
> > - depends on X86
> > + depends on X86 && !X86_64
> ^^^^^^^^^^^^^^
> That should be just `X86_32' these days.
>
Oh, I wasn't aware of the new symbol. I will have that changed with the
next batch.
Thanks!
--
Dmitry
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [git pull 09/14] Uinput: add UI_SET_SWBIT ioctl
2005-11-20 6:36 ` [git pull 09/14] Uinput: add UI_SET_SWBIT ioctl Dmitry Torokhov
@ 2005-11-23 22:53 ` Benjamin Herrenschmidt
2005-11-23 23:06 ` Benjamin Herrenschmidt
2005-11-23 23:01 ` Benjamin Herrenschmidt
1 sibling, 1 reply; 29+ messages in thread
From: Benjamin Herrenschmidt @ 2005-11-23 22:53 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Linus Torvalds, Vojtech Pavlik, Andrew Morton,
Linux Kernel Mailing List
On Sun, 2005-11-20 at 01:36 -0500, Dmitry Torokhov wrote:
> plain text document attachment (uinput-add-sw-ioctl.patch)
> Input: uinput - add UI_SET_SWBIT ioctl
>
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
All these new ioctl's and no compat layer for 32 bits apps on 64 bits
kernels ...
I'll send a patch later today for the current ones, but please, do it
from day #1 next time :)
Ben.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [git pull 09/14] Uinput: add UI_SET_SWBIT ioctl
2005-11-20 6:36 ` [git pull 09/14] Uinput: add UI_SET_SWBIT ioctl Dmitry Torokhov
2005-11-23 22:53 ` Benjamin Herrenschmidt
@ 2005-11-23 23:01 ` Benjamin Herrenschmidt
2005-11-23 23:12 ` Dmitry Torokhov
1 sibling, 1 reply; 29+ messages in thread
From: Benjamin Herrenschmidt @ 2005-11-23 23:01 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Linus Torvalds, Vojtech Pavlik, Andrew Morton,
Linux Kernel Mailing List
Oh,and ... ARGH !
So you pass that nice structure
struct input_event {
struct timeval time;
__u16 type;
__u16 code;
__s32 value;
};
to userland via read() ... cool, a structure that is not compatible
between 32 and 64 bits passed around via a read call. that will be fun
to fix.
Ben.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [git pull 09/14] Uinput: add UI_SET_SWBIT ioctl
2005-11-23 22:53 ` Benjamin Herrenschmidt
@ 2005-11-23 23:06 ` Benjamin Herrenschmidt
2005-11-23 23:13 ` Dmitry Torokhov
0 siblings, 1 reply; 29+ messages in thread
From: Benjamin Herrenschmidt @ 2005-11-23 23:06 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Linus Torvalds, Vojtech Pavlik, Andrew Morton,
Linux Kernel Mailing List
On Thu, 2005-11-24 at 09:54 +1100, Benjamin Herrenschmidt wrote:
> On Sun, 2005-11-20 at 01:36 -0500, Dmitry Torokhov wrote:
> > plain text document attachment (uinput-add-sw-ioctl.patch)
> > Input: uinput - add UI_SET_SWBIT ioctl
> >
> > Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
>
> All these new ioctl's and no compat layer for 32 bits apps on 64 bits
> kernels ...
>
> I'll send a patch later today for the current ones, but please, do it
> from day #1 next time :)
Ok, forget my promise, I won't do a compat layer for it today. Way too
much crap in there, read's of structs made of other structs & unions
etc... all of this would need compat versions etc... no time for that.
Couldn't you have designed that properly in the first place ?
Ben.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [git pull 09/14] Uinput: add UI_SET_SWBIT ioctl
2005-11-23 23:01 ` Benjamin Herrenschmidt
@ 2005-11-23 23:12 ` Dmitry Torokhov
2005-11-23 23:28 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-23 23:12 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Linus Torvalds, Vojtech Pavlik, Andrew Morton,
Linux Kernel Mailing List
On 11/23/05, Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> Oh,and ... ARGH !
>
> So you pass that nice structure
>
> struct input_event {
> struct timeval time;
> __u16 type;
> __u16 code;
> __s32 value;
> };
>
> to userland via read() ... cool, a structure that is not compatible
> between 32 and 64 bits passed around via a read call. that will be fun
> to fix.
>
It would need the same treatment as evdev got. Entire uinput is not
32/64 bit friendly (hostorically). However, it should be used by an
userspace "driver", not an ordinary program, so we probably shoudl
just require using native-sized binary with uinput.
--
Dmitry
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [git pull 09/14] Uinput: add UI_SET_SWBIT ioctl
2005-11-23 23:06 ` Benjamin Herrenschmidt
@ 2005-11-23 23:13 ` Dmitry Torokhov
0 siblings, 0 replies; 29+ messages in thread
From: Dmitry Torokhov @ 2005-11-23 23:13 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Linus Torvalds, Vojtech Pavlik, Andrew Morton,
Linux Kernel Mailing List
On 11/23/05, Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> On Thu, 2005-11-24 at 09:54 +1100, Benjamin Herrenschmidt wrote:
> > On Sun, 2005-11-20 at 01:36 -0500, Dmitry Torokhov wrote:
> > > plain text document attachment (uinput-add-sw-ioctl.patch)
> > > Input: uinput - add UI_SET_SWBIT ioctl
> > >
> > > Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
> >
> > All these new ioctl's and no compat layer for 32 bits apps on 64 bits
> > kernels ...
> >
> > I'll send a patch later today for the current ones, but please, do it
> > from day #1 next time :)
>
> Ok, forget my promise, I won't do a compat layer for it today. Way too
> much crap in there, read's of structs made of other structs & unions
> etc... all of this would need compat versions etc... no time for that.
>
> Couldn't you have designed that properly in the first place ?
>
I couldn't event design it improperly ;)
--
Dmitry
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [git pull 09/14] Uinput: add UI_SET_SWBIT ioctl
2005-11-23 23:12 ` Dmitry Torokhov
@ 2005-11-23 23:28 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 29+ messages in thread
From: Benjamin Herrenschmidt @ 2005-11-23 23:28 UTC (permalink / raw)
To: dtor_core
Cc: Linus Torvalds, Vojtech Pavlik, Andrew Morton,
Linux Kernel Mailing List
> > to userland via read() ... cool, a structure that is not compatible
> > between 32 and 64 bits passed around via a read call. that will be fun
> > to fix.
> >
>
> It would need the same treatment as evdev got. Entire uinput is not
> 32/64 bit friendly (hostorically). However, it should be used by an
> userspace "driver", not an ordinary program, so we probably shoudl
> just require using native-sized binary with uinput.
Not realistic. Some distros still don't have 64 bits userland ...
Ben.
^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2005-11-23 23:32 UTC | newest]
Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-20 6:36 [git pull 00/14] Input updates for 2.6.15 Dmitry Torokhov
2005-11-20 6:36 ` [git pull 01/14] atkbd - speed up setting leds/repeat state Dmitry Torokhov
2005-11-20 6:36 ` [git pull 02/14] Add Wistron driver Dmitry Torokhov
2005-11-20 6:36 ` [git pull 03/14] Wistron - disable for x86_64 Dmitry Torokhov
2005-11-20 9:52 ` Geert Uytterhoeven
2005-11-22 3:42 ` Dmitry Torokhov
2005-11-20 6:36 ` [git pull 04/14] Wistron - add support for Acer Aspire notebooks Dmitry Torokhov
2005-11-20 6:36 ` [git pull 05/14] Wistron - convert to dynamic input_dev allocation Dmitry Torokhov
2005-11-20 6:36 ` [git pull 06/14] Wistron - add PM support Dmitry Torokhov
2005-11-20 6:36 ` [git pull 07/14] wistron - disable wifi/bluetooth on suspend Dmitry Torokhov
2005-11-20 6:36 ` [git pull 08/14] Uinput: convert to dynalloc allocation Dmitry Torokhov
2005-11-20 6:36 ` [git pull 09/14] Uinput: add UI_SET_SWBIT ioctl Dmitry Torokhov
2005-11-23 22:53 ` Benjamin Herrenschmidt
2005-11-23 23:06 ` Benjamin Herrenschmidt
2005-11-23 23:13 ` Dmitry Torokhov
2005-11-23 23:01 ` Benjamin Herrenschmidt
2005-11-23 23:12 ` Dmitry Torokhov
2005-11-23 23:28 ` Benjamin Herrenschmidt
2005-11-20 6:36 ` [git pull 10/14] Uinput: dont use "interruptible" in FF code Dmitry Torokhov
2005-11-20 6:36 ` [git pull 11/14] Handle failures in input_register_device() Dmitry Torokhov
2005-11-20 6:36 ` [git pull 12/14] Input - help swsusp Dmitry Torokhov
2005-11-20 6:36 ` [git pull 13/14] Input updates for 2.6.15 Dmitry Torokhov
2005-11-20 6:36 ` [git pull 14/14] Fix missing initialization in ir-kbd-gpio.c Dmitry Torokhov
2005-11-20 8:37 ` [git pull 00/14] Input updates for 2.6.15 Vojtech Pavlik
2005-11-20 17:04 ` Dmitry Torokhov
2005-11-20 17:19 ` Linus Torvalds
2005-11-20 17:42 ` Dmitry Torokhov
2005-11-20 18:17 ` Linus Torvalds
2005-11-22 3:40 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox