Commit 05d97cb2 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Vojtech Pavlik

Input: trailing whitespace fixes

parent 39cc6458
...@@ -106,7 +106,7 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in ...@@ -106,7 +106,7 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
} }
break; break;
case EV_ABS: case EV_ABS:
if (code > ABS_MAX || !test_bit(code, dev->absbit)) if (code > ABS_MAX || !test_bit(code, dev->absbit))
...@@ -144,27 +144,27 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in ...@@ -144,27 +144,27 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
if (code > MSC_MAX || !test_bit(code, dev->mscbit)) if (code > MSC_MAX || !test_bit(code, dev->mscbit))
return; return;
if (dev->event) dev->event(dev, type, code, value); if (dev->event) dev->event(dev, type, code, value);
break; break;
case EV_LED: case EV_LED:
if (code > LED_MAX || !test_bit(code, dev->ledbit) || !!test_bit(code, dev->led) == value) if (code > LED_MAX || !test_bit(code, dev->ledbit) || !!test_bit(code, dev->led) == value)
return; return;
change_bit(code, dev->led); change_bit(code, dev->led);
if (dev->event) dev->event(dev, type, code, value); if (dev->event) dev->event(dev, type, code, value);
break; break;
case EV_SND: case EV_SND:
if (code > SND_MAX || !test_bit(code, dev->sndbit)) if (code > SND_MAX || !test_bit(code, dev->sndbit))
return; return;
if (dev->event) dev->event(dev, type, code, value); if (dev->event) dev->event(dev, type, code, value);
break; break;
case EV_REP: case EV_REP:
...@@ -181,7 +181,7 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in ...@@ -181,7 +181,7 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
break; break;
} }
if (type != EV_SYN) if (type != EV_SYN)
dev->sync = 0; dev->sync = 0;
if (dev->grab) if (dev->grab)
...@@ -282,11 +282,11 @@ static struct input_device_id *input_match_device(struct input_device_id *id, st ...@@ -282,11 +282,11 @@ static struct input_device_id *input_match_device(struct input_device_id *id, st
if (id->flags & INPUT_DEVICE_ID_MATCH_VENDOR) if (id->flags & INPUT_DEVICE_ID_MATCH_VENDOR)
if (id->id.vendor != dev->id.vendor) if (id->id.vendor != dev->id.vendor)
continue; continue;
if (id->flags & INPUT_DEVICE_ID_MATCH_PRODUCT) if (id->flags & INPUT_DEVICE_ID_MATCH_PRODUCT)
if (id->id.product != dev->id.product) if (id->id.product != dev->id.product)
continue; continue;
if (id->flags & INPUT_DEVICE_ID_MATCH_VERSION) if (id->flags & INPUT_DEVICE_ID_MATCH_VERSION)
if (id->id.version != dev->id.version) if (id->id.version != dev->id.version)
continue; continue;
...@@ -351,11 +351,11 @@ static void input_call_hotplug(char *verb, struct input_dev *dev) ...@@ -351,11 +351,11 @@ static void input_call_hotplug(char *verb, struct input_dev *dev)
} }
if (in_interrupt()) { if (in_interrupt()) {
printk(KERN_ERR "input.c: calling hotplug from interrupt\n"); printk(KERN_ERR "input.c: calling hotplug from interrupt\n");
return; return;
} }
if (!current->fs->root) { if (!current->fs->root) {
printk(KERN_WARNING "input.c: calling hotplug without valid filesystem\n"); printk(KERN_WARNING "input.c: calling hotplug without valid filesystem\n");
return; return;
} }
if (!(envp = (char **) kmalloc(20 * sizeof(char *), GFP_KERNEL))) { if (!(envp = (char **) kmalloc(20 * sizeof(char *), GFP_KERNEL))) {
printk(KERN_ERR "input.c: not enough memory allocating hotplug environment\n"); printk(KERN_ERR "input.c: not enough memory allocating hotplug environment\n");
...@@ -381,17 +381,17 @@ static void input_call_hotplug(char *verb, struct input_dev *dev) ...@@ -381,17 +381,17 @@ static void input_call_hotplug(char *verb, struct input_dev *dev)
envp[i++] = scratch; envp[i++] = scratch;
scratch += sprintf(scratch, "PRODUCT=%x/%x/%x/%x", scratch += sprintf(scratch, "PRODUCT=%x/%x/%x/%x",
dev->id.bustype, dev->id.vendor, dev->id.product, dev->id.version) + 1; dev->id.bustype, dev->id.vendor, dev->id.product, dev->id.version) + 1;
if (dev->name) { if (dev->name) {
envp[i++] = scratch; envp[i++] = scratch;
scratch += sprintf(scratch, "NAME=%s", dev->name) + 1; scratch += sprintf(scratch, "NAME=%s", dev->name) + 1;
} }
if (dev->phys) { if (dev->phys) {
envp[i++] = scratch; envp[i++] = scratch;
scratch += sprintf(scratch, "PHYS=%s", dev->phys) + 1; scratch += sprintf(scratch, "PHYS=%s", dev->phys) + 1;
} }
SPRINTF_BIT_A(evbit, "EV=", EV_MAX); SPRINTF_BIT_A(evbit, "EV=", EV_MAX);
SPRINTF_BIT_A2(keybit, "KEY=", KEY_MAX, EV_KEY); SPRINTF_BIT_A2(keybit, "KEY=", KEY_MAX, EV_KEY);
...@@ -506,7 +506,7 @@ void input_register_handler(struct input_handler *handler) ...@@ -506,7 +506,7 @@ void input_register_handler(struct input_handler *handler)
input_table[handler->minor >> 5] = handler; input_table[handler->minor >> 5] = handler;
list_add_tail(&handler->node, &input_handler_list); list_add_tail(&handler->node, &input_handler_list);
list_for_each_entry(dev, &input_dev_list, node) list_for_each_entry(dev, &input_dev_list, node)
if (!handler->blacklist || !input_match_device(handler->blacklist, dev)) if (!handler->blacklist || !input_match_device(handler->blacklist, dev))
if ((id = input_match_device(handler->id_table, dev))) if ((id = input_match_device(handler->id_table, dev)))
......
...@@ -41,11 +41,11 @@ static int spkr98_event(struct input_dev *dev, unsigned int type, unsigned int c ...@@ -41,11 +41,11 @@ static int spkr98_event(struct input_dev *dev, unsigned int type, unsigned int c
case SND_BELL: if (value) value = 1000; case SND_BELL: if (value) value = 1000;
case SND_TONE: break; case SND_TONE: break;
default: return -1; default: return -1;
} }
if (value > 20 && value < 32767) if (value > 20 && value < 32767)
count = CLOCK_TICK_RATE / value; count = CLOCK_TICK_RATE / value;
spin_lock_irqsave(&i8253_beep_lock, flags); spin_lock_irqsave(&i8253_beep_lock, flags);
if (count) { if (count) {
......
...@@ -40,11 +40,11 @@ static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int c ...@@ -40,11 +40,11 @@ static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int c
case SND_BELL: if (value) value = 1000; case SND_BELL: if (value) value = 1000;
case SND_TONE: break; case SND_TONE: break;
default: return -1; default: return -1;
} }
if (value > 20 && value < 32767) if (value > 20 && value < 32767)
count = CLOCK_TICK_RATE / value; count = CLOCK_TICK_RATE / value;
spin_lock_irqsave(&i8253_beep_lock, flags); spin_lock_irqsave(&i8253_beep_lock, flags);
if (count) { if (count) {
......
...@@ -53,11 +53,11 @@ static int ebus_spkr_event(struct input_dev *dev, unsigned int type, unsigned in ...@@ -53,11 +53,11 @@ static int ebus_spkr_event(struct input_dev *dev, unsigned int type, unsigned in
case SND_BELL: if (value) value = 1000; case SND_BELL: if (value) value = 1000;
case SND_TONE: break; case SND_TONE: break;
default: return -1; default: return -1;
} }
if (value > 20 && value < 32767) if (value > 20 && value < 32767)
count = 1193182 / value; count = 1193182 / value;
spin_lock_irqsave(&beep_lock, flags); spin_lock_irqsave(&beep_lock, flags);
/* EBUS speaker only has on/off state, the frequency does not /* EBUS speaker only has on/off state, the frequency does not
...@@ -108,11 +108,11 @@ static int isa_spkr_event(struct input_dev *dev, unsigned int type, unsigned int ...@@ -108,11 +108,11 @@ static int isa_spkr_event(struct input_dev *dev, unsigned int type, unsigned int
case SND_BELL: if (value) value = 1000; case SND_BELL: if (value) value = 1000;
case SND_TONE: break; case SND_TONE: break;
default: return -1; default: return -1;
} }
if (value > 20 && value < 32767) if (value > 20 && value < 32767)
count = 1193182 / value; count = 1193182 / value;
spin_lock_irqsave(&beep_lock, flags); spin_lock_irqsave(&beep_lock, flags);
if (count) { if (count) {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org> * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
* *
* Changes/Revisions: * Changes/Revisions:
* 0.1 20/06/2002 * 0.1 20/06/2002
* - first public version * - first public version
...@@ -68,7 +68,7 @@ static int uinput_dev_upload_effect(struct input_dev *dev, struct ff_effect *eff ...@@ -68,7 +68,7 @@ static int uinput_dev_upload_effect(struct input_dev *dev, struct ff_effect *eff
static int uinput_dev_erase_effect(struct input_dev *dev, int effect_id) static int uinput_dev_erase_effect(struct input_dev *dev, int effect_id)
{ {
return 0; return 0;
} }
static int uinput_create_device(struct uinput_device *udev) static int uinput_create_device(struct uinput_device *udev)
{ {
...@@ -123,7 +123,7 @@ static int uinput_open(struct inode *inode, struct file *file) ...@@ -123,7 +123,7 @@ static int uinput_open(struct inode *inode, struct file *file)
memset(newinput, 0, sizeof(struct input_dev)); memset(newinput, 0, sizeof(struct input_dev));
newdev->dev = newinput; newdev->dev = newinput;
file->private_data = newdev; file->private_data = newdev;
return 0; return 0;
...@@ -137,16 +137,16 @@ static int uinput_validate_absbits(struct input_dev *dev) ...@@ -137,16 +137,16 @@ static int uinput_validate_absbits(struct input_dev *dev)
{ {
unsigned int cnt; unsigned int cnt;
int retval = 0; int retval = 0;
for (cnt = 0; cnt < ABS_MAX; cnt++) { for (cnt = 0; cnt < ABS_MAX; cnt++) {
if (!test_bit(cnt, dev->absbit)) if (!test_bit(cnt, dev->absbit))
continue; continue;
if (/*!dev->absmin[cnt] || !dev->absmax[cnt] || */ if (/*!dev->absmin[cnt] || !dev->absmax[cnt] || */
(dev->absmax[cnt] <= dev->absmin[cnt])) { (dev->absmax[cnt] <= dev->absmin[cnt])) {
printk(KERN_DEBUG printk(KERN_DEBUG
"%s: invalid abs[%02x] min:%d max:%d\n", "%s: invalid abs[%02x] min:%d max:%d\n",
UINPUT_NAME, cnt, UINPUT_NAME, cnt,
dev->absmin[cnt], dev->absmax[cnt]); dev->absmin[cnt], dev->absmax[cnt]);
retval = -EINVAL; retval = -EINVAL;
break; break;
...@@ -154,7 +154,7 @@ static int uinput_validate_absbits(struct input_dev *dev) ...@@ -154,7 +154,7 @@ static int uinput_validate_absbits(struct input_dev *dev)
if ((dev->absflat[cnt] < dev->absmin[cnt]) || if ((dev->absflat[cnt] < dev->absmin[cnt]) ||
(dev->absflat[cnt] > dev->absmax[cnt])) { (dev->absflat[cnt] > dev->absmax[cnt])) {
printk(KERN_DEBUG printk(KERN_DEBUG
"%s: absflat[%02x] out of range: %d " "%s: absflat[%02x] out of range: %d "
"(min:%d/max:%d)\n", "(min:%d/max:%d)\n",
UINPUT_NAME, cnt, dev->absflat[cnt], UINPUT_NAME, cnt, dev->absflat[cnt],
...@@ -190,7 +190,7 @@ static int uinput_alloc_device(struct file *file, const char *buffer, size_t cou ...@@ -190,7 +190,7 @@ static int uinput_alloc_device(struct file *file, const char *buffer, size_t cou
goto exit; goto exit;
} }
if (NULL != dev->name) if (NULL != dev->name)
kfree(dev->name); kfree(dev->name);
size = strnlen(user_dev->name, UINPUT_MAX_NAME_SIZE) + 1; size = strnlen(user_dev->name, UINPUT_MAX_NAME_SIZE) + 1;
...@@ -229,7 +229,7 @@ static int uinput_alloc_device(struct file *file, const char *buffer, size_t cou ...@@ -229,7 +229,7 @@ static int uinput_alloc_device(struct file *file, const char *buffer, size_t cou
static ssize_t uinput_write(struct file *file, const char *buffer, size_t count, loff_t *ppos) static ssize_t uinput_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
{ {
struct uinput_device *udev = file->private_data; struct uinput_device *udev = file->private_data;
if (test_bit(UIST_CREATED, &(udev->state))) { if (test_bit(UIST_CREATED, &(udev->state))) {
struct input_event ev; struct input_event ev;
...@@ -247,7 +247,7 @@ static ssize_t uinput_read(struct file *file, char *buffer, size_t count, loff_t ...@@ -247,7 +247,7 @@ static ssize_t uinput_read(struct file *file, char *buffer, size_t count, loff_t
{ {
struct uinput_device *udev = file->private_data; struct uinput_device *udev = file->private_data;
int retval = 0; int retval = 0;
if (!test_bit(UIST_CREATED, &(udev->state))) if (!test_bit(UIST_CREATED, &(udev->state)))
return -ENODEV; return -ENODEV;
...@@ -255,16 +255,16 @@ static ssize_t uinput_read(struct file *file, char *buffer, size_t count, loff_t ...@@ -255,16 +255,16 @@ static ssize_t uinput_read(struct file *file, char *buffer, size_t count, loff_t
return -EAGAIN; return -EAGAIN;
retval = wait_event_interruptible(udev->waitq, retval = wait_event_interruptible(udev->waitq,
(udev->head != udev->tail) || (udev->head != udev->tail) ||
!test_bit(UIST_CREATED, &(udev->state))); !test_bit(UIST_CREATED, &(udev->state)));
if (retval) if (retval)
return retval; return retval;
if (!test_bit(UIST_CREATED, &(udev->state))) if (!test_bit(UIST_CREATED, &(udev->state)))
return -ENODEV; return -ENODEV;
while ((udev->head != udev->tail) && while ((udev->head != udev->tail) &&
(retval + sizeof(struct input_event) <= count)) { (retval + sizeof(struct input_event) <= count)) {
if (copy_to_user(buffer + retval, &(udev->buff[udev->tail]), if (copy_to_user(buffer + retval, &(udev->buff[udev->tail]),
sizeof(struct input_event))) return -EFAULT; sizeof(struct input_event))) return -EFAULT;
...@@ -284,7 +284,7 @@ static unsigned int uinput_poll(struct file *file, poll_table *wait) ...@@ -284,7 +284,7 @@ static unsigned int uinput_poll(struct file *file, poll_table *wait)
if (udev->head != udev->tail) if (udev->head != udev->tail)
return POLLIN | POLLRDNORM; return POLLIN | POLLRDNORM;
return 0; return 0;
} }
static int uinput_burn_device(struct uinput_device *udev) static int uinput_burn_device(struct uinput_device *udev)
...@@ -318,7 +318,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd ...@@ -318,7 +318,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
case UI_DEV_CREATE: case UI_DEV_CREATE:
retval = uinput_create_device(udev); retval = uinput_create_device(udev);
break; break;
case UI_DEV_DESTROY: case UI_DEV_DESTROY:
retval = uinput_destroy_device(udev); retval = uinput_destroy_device(udev);
break; break;
...@@ -330,7 +330,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd ...@@ -330,7 +330,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
} }
set_bit(arg, udev->dev->evbit); set_bit(arg, udev->dev->evbit);
break; break;
case UI_SET_KEYBIT: case UI_SET_KEYBIT:
if (arg > KEY_MAX) { if (arg > KEY_MAX) {
retval = -EINVAL; retval = -EINVAL;
...@@ -338,7 +338,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd ...@@ -338,7 +338,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
} }
set_bit(arg, udev->dev->keybit); set_bit(arg, udev->dev->keybit);
break; break;
case UI_SET_RELBIT: case UI_SET_RELBIT:
if (arg > REL_MAX) { if (arg > REL_MAX) {
retval = -EINVAL; retval = -EINVAL;
...@@ -346,7 +346,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd ...@@ -346,7 +346,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
} }
set_bit(arg, udev->dev->relbit); set_bit(arg, udev->dev->relbit);
break; break;
case UI_SET_ABSBIT: case UI_SET_ABSBIT:
if (arg > ABS_MAX) { if (arg > ABS_MAX) {
retval = -EINVAL; retval = -EINVAL;
...@@ -354,7 +354,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd ...@@ -354,7 +354,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
} }
set_bit(arg, udev->dev->absbit); set_bit(arg, udev->dev->absbit);
break; break;
case UI_SET_MSCBIT: case UI_SET_MSCBIT:
if (arg > MSC_MAX) { if (arg > MSC_MAX) {
retval = -EINVAL; retval = -EINVAL;
...@@ -362,7 +362,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd ...@@ -362,7 +362,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
} }
set_bit(arg, udev->dev->mscbit); set_bit(arg, udev->dev->mscbit);
break; break;
case UI_SET_LEDBIT: case UI_SET_LEDBIT:
if (arg > LED_MAX) { if (arg > LED_MAX) {
retval = -EINVAL; retval = -EINVAL;
...@@ -370,7 +370,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd ...@@ -370,7 +370,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
} }
set_bit(arg, udev->dev->ledbit); set_bit(arg, udev->dev->ledbit);
break; break;
case UI_SET_SNDBIT: case UI_SET_SNDBIT:
if (arg > SND_MAX) { if (arg > SND_MAX) {
retval = -EINVAL; retval = -EINVAL;
...@@ -378,7 +378,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd ...@@ -378,7 +378,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
} }
set_bit(arg, udev->dev->sndbit); set_bit(arg, udev->dev->sndbit);
break; break;
case UI_SET_FFBIT: case UI_SET_FFBIT:
if (arg > FF_MAX) { if (arg > FF_MAX) {
retval = -EINVAL; retval = -EINVAL;
...@@ -386,7 +386,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd ...@@ -386,7 +386,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
} }
set_bit(arg, udev->dev->ffbit); set_bit(arg, udev->dev->ffbit);
break; break;
default: default:
retval = -EFAULT; retval = -EFAULT;
} }
......
...@@ -124,7 +124,7 @@ static void gunze_connect(struct serio *serio, struct serio_dev *dev) ...@@ -124,7 +124,7 @@ static void gunze_connect(struct serio *serio, struct serio_dev *dev)
memset(gunze, 0, sizeof(struct gunze)); memset(gunze, 0, sizeof(struct gunze));
init_input_dev(&gunze->dev); init_input_dev(&gunze->dev);
gunze->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); gunze->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
gunze->dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); gunze->dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y);
gunze->dev.keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); gunze->dev.keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
......
/* /*
* $Id: h3600_ts_input.c,v 1.4 2002/01/23 06:39:37 jsimmons Exp $ * $Id: h3600_ts_input.c,v 1.4 2002/01/23 06:39:37 jsimmons Exp $
* *
* Copyright (c) 2001 "Crazy" James Simmons jsimmons@transvirtual.com * Copyright (c) 2001 "Crazy" James Simmons jsimmons@transvirtual.com
* *
* Sponsored by Transvirtual Technology. * Sponsored by Transvirtual Technology.
* *
* Derived from the code in h3600_ts.[ch] by Charles Flynn * Derived from the code in h3600_ts.[ch] by Charles Flynn
*/ */
/* /*
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
#define MAX_ID 14 #define MAX_ID 14
#define H3600_MAX_LENGTH 16 #define H3600_MAX_LENGTH 16
#define H3600_KEY 0xf #define H3600_KEY 0xf
#define H3600_SCANCODE_RECORD 1 /* 1 -> record button */ #define H3600_SCANCODE_RECORD 1 /* 1 -> record button */
#define H3600_SCANCODE_CALENDAR 2 /* 2 -> calendar */ #define H3600_SCANCODE_CALENDAR 2 /* 2 -> calendar */
...@@ -118,13 +118,13 @@ static void npower_button_handler(int irq, void *dev_id, struct pt_regs *regs) ...@@ -118,13 +118,13 @@ static void npower_button_handler(int irq, void *dev_id, struct pt_regs *regs)
int down = (GPLR & GPIO_BITSY_NPOWER_BUTTON) ? 0 : 1; int down = (GPLR & GPIO_BITSY_NPOWER_BUTTON) ? 0 : 1;
struct input_dev *dev = (struct input_dev *) dev_id; struct input_dev *dev = (struct input_dev *) dev_id;
/* /*
* This interrupt is only called when we release the key. So we have * This interrupt is only called when we release the key. So we have
* to fake a key press. * to fake a key press.
*/ */
input_regs(dev, regs); input_regs(dev, regs);
input_report_key(dev, KEY_SUSPEND, 1); input_report_key(dev, KEY_SUSPEND, 1);
input_report_key(dev, KEY_SUSPEND, down); input_report_key(dev, KEY_SUSPEND, down);
input_sync(dev); input_sync(dev);
} }
...@@ -144,18 +144,18 @@ unsigned int h3600_flite_power(struct input_dev *dev, enum flite_pwr pwr) ...@@ -144,18 +144,18 @@ unsigned int h3600_flite_power(struct input_dev *dev, enum flite_pwr pwr)
unsigned char brightness = ((pwr==FLITE_PWR_OFF) ? 0:flite_brightness); unsigned char brightness = ((pwr==FLITE_PWR_OFF) ? 0:flite_brightness);
struct h3600_dev *ts = dev->private; struct h3600_dev *ts = dev->private;
/* Must be in this order */ /* Must be in this order */
ts->serio->write(ts->serio, 1); ts->serio->write(ts->serio, 1);
ts->serio->write(ts->serio, pwr); ts->serio->write(ts->serio, pwr);
ts->serio->write(ts->serio, brightness); ts->serio->write(ts->serio, brightness);
return 0; return 0;
} }
static int suspended = 0; static int suspended = 0;
static int h3600ts_pm_callback(struct pm_dev *pm_dev, pm_request_t req, static int h3600ts_pm_callback(struct pm_dev *pm_dev, pm_request_t req,
void *data) void *data)
{ {
struct input_dev *dev = (struct input_dev *) data; struct input_dev *dev = (struct input_dev *) data;
switch (req) { switch (req) {
case PM_SUSPEND: /* enter D1-D3 */ case PM_SUSPEND: /* enter D1-D3 */
...@@ -183,7 +183,7 @@ static int h3600ts_pm_callback(struct pm_dev *pm_dev, pm_request_t req, ...@@ -183,7 +183,7 @@ static int h3600ts_pm_callback(struct pm_dev *pm_dev, pm_request_t req,
/* /*
* This function translates the native event packets to linux input event * This function translates the native event packets to linux input event
* packets. Some packets coming from serial are not touchscreen related. In * packets. Some packets coming from serial are not touchscreen related. In
* this case we send them off to be processed elsewhere. * this case we send them off to be processed elsewhere.
*/ */
static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs) static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
{ {
...@@ -206,7 +206,7 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs) ...@@ -206,7 +206,7 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
Note: This is true for non interrupt generated key events. Note: This is true for non interrupt generated key events.
*/ */
case KEYBD_ID: case KEYBD_ID:
down = (ts->buf[0] & 0x80) ? 0 : 1; down = (ts->buf[0] & 0x80) ? 0 : 1;
switch (ts->buf[0] & 0x7f) { switch (ts->buf[0] & 0x7f) {
case H3600_SCANCODE_RECORD: case H3600_SCANCODE_RECORD:
...@@ -218,7 +218,7 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs) ...@@ -218,7 +218,7 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
case H3600_SCANCODE_CONTACTS: case H3600_SCANCODE_CONTACTS:
key = KEY_PROG2; key = KEY_PROG2;
break; break;
case H3600_SCANCODE_Q: case H3600_SCANCODE_Q:
key = KEY_Q; key = KEY_Q;
break; break;
case H3600_SCANCODE_START: case H3600_SCANCODE_START:
...@@ -237,9 +237,9 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs) ...@@ -237,9 +237,9 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
key = KEY_DOWN; key = KEY_DOWN;
break; break;
default: default:
key = 0; key = 0;
} }
if (key) if (key)
input_report_key(dev, key, down); input_report_key(dev, key, down);
break; break;
/* /*
...@@ -251,13 +251,13 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs) ...@@ -251,13 +251,13 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
* byte 0 1 2 3 * byte 0 1 2 3
*/ */
case TOUCHS_ID: case TOUCHS_ID:
if (!touched) { if (!touched) {
input_report_key(dev, BTN_TOUCH, 1); input_report_key(dev, BTN_TOUCH, 1);
touched = 1; touched = 1;
} }
if (ts->len) { if (ts->len) {
unsigned short x, y; unsigned short x, y;
x = ts->buf[0]; x <<= 8; x += ts->buf[1]; x = ts->buf[0]; x <<= 8; x += ts->buf[1];
y = ts->buf[2]; y <<= 8; y += ts->buf[3]; y = ts->buf[2]; y <<= 8; y += ts->buf[3];
...@@ -267,7 +267,7 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs) ...@@ -267,7 +267,7 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
} else { } else {
input_report_key(dev, BTN_TOUCH, 0); input_report_key(dev, BTN_TOUCH, 0);
touched = 0; touched = 0;
} }
break; break;
default: default:
/* Send a non input event elsewhere */ /* Send a non input event elsewhere */
...@@ -280,7 +280,7 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs) ...@@ -280,7 +280,7 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
/* /*
* h3600ts_event() handles events from the input module. * h3600ts_event() handles events from the input module.
*/ */
static int h3600ts_event(struct input_dev *dev, unsigned int type, static int h3600ts_event(struct input_dev *dev, unsigned int type,
unsigned int code, int value) unsigned int code, int value)
{ {
struct h3600_dev *ts = dev->private; struct h3600_dev *ts = dev->private;
...@@ -290,7 +290,7 @@ static int h3600ts_event(struct input_dev *dev, unsigned int type, ...@@ -290,7 +290,7 @@ static int h3600ts_event(struct input_dev *dev, unsigned int type,
// ts->serio->write(ts->serio, SOME_CMD); // ts->serio->write(ts->serio, SOME_CMD);
return 0; return 0;
} }
} }
return -1; return -1;
} }
...@@ -323,12 +323,12 @@ static void h3600ts_interrupt(struct serio *serio, unsigned char data, ...@@ -323,12 +323,12 @@ static void h3600ts_interrupt(struct serio *serio, unsigned char data,
struct h3600_dev *ts = serio->private; struct h3600_dev *ts = serio->private;
/* /*
* We have a new frame coming in. * We have a new frame coming in.
*/ */
switch (state) { switch (state) {
case STATE_SOF: case STATE_SOF:
if (data == CHAR_SOF) if (data == CHAR_SOF)
state = STATE_ID; state = STATE_ID;
return; return;
case STATE_ID: case STATE_ID:
ts->event = (data & 0xf0) >> 4; ts->event = (data & 0xf0) >> 4;
...@@ -344,7 +344,7 @@ static void h3600ts_interrupt(struct serio *serio, unsigned char data, ...@@ -344,7 +344,7 @@ static void h3600ts_interrupt(struct serio *serio, unsigned char data,
case STATE_DATA: case STATE_DATA:
ts->chksum += data; ts->chksum += data;
ts->buf[ts->idx]= data; ts->buf[ts->idx]= data;
if(++ts->idx == ts->len) if(++ts->idx == ts->len)
state = STATE_EOF; state = STATE_EOF;
break; break;
case STATE_EOF: case STATE_EOF:
...@@ -382,7 +382,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev) ...@@ -382,7 +382,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev)
set_GPIO_IRQ_edge( GPIO_BITSY_NPOWER_BUTTON, GPIO_RISING_EDGE ); set_GPIO_IRQ_edge( GPIO_BITSY_NPOWER_BUTTON, GPIO_RISING_EDGE );
if (request_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, action_button_handler, if (request_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, action_button_handler,
SA_SHIRQ | SA_INTERRUPT | SA_SAMPLE_RANDOM, SA_SHIRQ | SA_INTERRUPT | SA_SAMPLE_RANDOM,
"h3600_action", &ts->dev)) { "h3600_action", &ts->dev)) {
printk(KERN_ERR "h3600ts.c: Could not allocate Action Button IRQ!\n"); printk(KERN_ERR "h3600ts.c: Could not allocate Action Button IRQ!\n");
kfree(ts); kfree(ts);
...@@ -390,7 +390,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev) ...@@ -390,7 +390,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev)
} }
if (request_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, npower_button_handler, if (request_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, npower_button_handler,
SA_SHIRQ | SA_INTERRUPT | SA_SAMPLE_RANDOM, SA_SHIRQ | SA_INTERRUPT | SA_SAMPLE_RANDOM,
"h3600_suspend", &ts->dev)) { "h3600_suspend", &ts->dev)) {
free_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, &ts->dev); free_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, &ts->dev);
printk(KERN_ERR "h3600ts.c: Could not allocate Power Button IRQ!\n"); printk(KERN_ERR "h3600ts.c: Could not allocate Power Button IRQ!\n");
...@@ -400,7 +400,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev) ...@@ -400,7 +400,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev)
/* Now we have things going we setup our input device */ /* Now we have things going we setup our input device */
ts->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_LED) | BIT(EV_PWR); ts->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_LED) | BIT(EV_PWR);
ts->dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); ts->dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y);
ts->dev.ledbit[0] = BIT(LED_SLEEP); ts->dev.ledbit[0] = BIT(LED_SLEEP);
ts->dev.absmin[ABS_X] = 60; ts->dev.absmin[ABS_Y] = 35; ts->dev.absmin[ABS_X] = 60; ts->dev.absmin[ABS_Y] = 35;
ts->dev.absmax[ABS_X] = 985; ts->dev.absmax[ABS_Y] = 1024; ts->dev.absmax[ABS_X] = 985; ts->dev.absmax[ABS_Y] = 1024;
...@@ -442,7 +442,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev) ...@@ -442,7 +442,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev)
//h3600_flite_control(1, 25); /* default brightness */ //h3600_flite_control(1, 25); /* default brightness */
#ifdef CONFIG_PM #ifdef CONFIG_PM
ts->dev.pm_dev = pm_register(PM_ILLUMINATION_DEV, PM_SYS_LIGHT, ts->dev.pm_dev = pm_register(PM_ILLUMINATION_DEV, PM_SYS_LIGHT,
h3600ts_pm_callback); h3600ts_pm_callback);
printk("registered pm callback\n"); printk("registered pm callback\n");
#endif #endif
...@@ -458,7 +458,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev) ...@@ -458,7 +458,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev)
static void h3600ts_disconnect(struct serio *serio) static void h3600ts_disconnect(struct serio *serio)
{ {
struct h3600_dev *ts = serio->private; struct h3600_dev *ts = serio->private;
free_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, &ts->dev); free_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, &ts->dev);
free_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, &ts->dev); free_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, &ts->dev);
input_unregister_device(&ts->dev); input_unregister_device(&ts->dev);
......
...@@ -655,7 +655,7 @@ struct ff_periodic_effect { ...@@ -655,7 +655,7 @@ struct ff_periodic_effect {
struct ff_envelope envelope; struct ff_envelope envelope;
/* Only used if waveform == FF_CUSTOM */ /* Only used if waveform == FF_CUSTOM */
__u32 custom_len; /* Number of samples */ __u32 custom_len; /* Number of samples */
__s16 *custom_data; /* Buffer of samples */ __s16 *custom_data; /* Buffer of samples */
/* Note: the data pointed by custom_data is copied by the driver. You can /* Note: the data pointed by custom_data is copied by the driver. You can
* therefore dispose of the memory after the upload/update */ * therefore dispose of the memory after the upload/update */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment