Commit dd0d5443 authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: serio - don't use serio->write() directly

We have a nice wrapper for that.
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent c46dd1eb
...@@ -280,28 +280,28 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv) ...@@ -280,28 +280,28 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv)
init_MUTEX_LOCKED(&kbd->sem); init_MUTEX_LOCKED(&kbd->sem);
/* Get device info. MLC driver supplies devid/status/etc. */ /* Get device info. MLC driver supplies devid/status/etc. */
serio->write(serio, 0); serio_write(serio, 0);
serio->write(serio, 0); serio_write(serio, 0);
serio->write(serio, HIL_PKT_CMD >> 8); serio_write(serio, HIL_PKT_CMD >> 8);
serio->write(serio, HIL_CMD_IDD); serio_write(serio, HIL_CMD_IDD);
down(&kbd->sem); down(&kbd->sem);
serio->write(serio, 0); serio_write(serio, 0);
serio->write(serio, 0); serio_write(serio, 0);
serio->write(serio, HIL_PKT_CMD >> 8); serio_write(serio, HIL_PKT_CMD >> 8);
serio->write(serio, HIL_CMD_RSC); serio_write(serio, HIL_CMD_RSC);
down(&kbd->sem); down(&kbd->sem);
serio->write(serio, 0); serio_write(serio, 0);
serio->write(serio, 0); serio_write(serio, 0);
serio->write(serio, HIL_PKT_CMD >> 8); serio_write(serio, HIL_PKT_CMD >> 8);
serio->write(serio, HIL_CMD_RNM); serio_write(serio, HIL_CMD_RNM);
down(&kbd->sem); down(&kbd->sem);
serio->write(serio, 0); serio_write(serio, 0);
serio->write(serio, 0); serio_write(serio, 0);
serio->write(serio, HIL_PKT_CMD >> 8); serio_write(serio, HIL_PKT_CMD >> 8);
serio->write(serio, HIL_CMD_EXD); serio_write(serio, HIL_CMD_EXD);
down(&kbd->sem); down(&kbd->sem);
up(&kbd->sem); up(&kbd->sem);
...@@ -350,10 +350,10 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv) ...@@ -350,10 +350,10 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv)
printk(KERN_INFO "input: %s, ID: %d\n", printk(KERN_INFO "input: %s, ID: %d\n",
kbd->dev->name, did); kbd->dev->name, did);
serio->write(serio, 0); serio_write(serio, 0);
serio->write(serio, 0); serio_write(serio, 0);
serio->write(serio, HIL_PKT_CMD >> 8); serio_write(serio, HIL_PKT_CMD >> 8);
serio->write(serio, HIL_CMD_EK1); /* Enable Keyswitch Autorepeat 1 */ serio_write(serio, HIL_CMD_EK1); /* Enable Keyswitch Autorepeat 1 */
down(&kbd->sem); down(&kbd->sem);
up(&kbd->sem); up(&kbd->sem);
......
...@@ -525,12 +525,12 @@ lkkbd_event (struct input_dev *dev, unsigned int type, unsigned int code, ...@@ -525,12 +525,12 @@ lkkbd_event (struct input_dev *dev, unsigned int type, unsigned int code,
CHECK_LED (lk, leds_on, leds_off, LED_SCROLLL, LK_LED_SCROLLLOCK); CHECK_LED (lk, leds_on, leds_off, LED_SCROLLL, LK_LED_SCROLLLOCK);
CHECK_LED (lk, leds_on, leds_off, LED_SLEEP, LK_LED_WAIT); CHECK_LED (lk, leds_on, leds_off, LED_SLEEP, LK_LED_WAIT);
if (leds_on != 0) { if (leds_on != 0) {
lk->serio->write (lk->serio, LK_CMD_LED_ON); serio_write (lk->serio, LK_CMD_LED_ON);
lk->serio->write (lk->serio, leds_on); serio_write (lk->serio, leds_on);
} }
if (leds_off != 0) { if (leds_off != 0) {
lk->serio->write (lk->serio, LK_CMD_LED_OFF); serio_write (lk->serio, LK_CMD_LED_OFF);
lk->serio->write (lk->serio, leds_off); serio_write (lk->serio, leds_off);
} }
return 0; return 0;
...@@ -539,20 +539,20 @@ lkkbd_event (struct input_dev *dev, unsigned int type, unsigned int code, ...@@ -539,20 +539,20 @@ lkkbd_event (struct input_dev *dev, unsigned int type, unsigned int code,
case SND_CLICK: case SND_CLICK:
if (value == 0) { if (value == 0) {
DBG ("%s: Deactivating key clicks\n", __func__); DBG ("%s: Deactivating key clicks\n", __func__);
lk->serio->write (lk->serio, LK_CMD_DISABLE_KEYCLICK); serio_write (lk->serio, LK_CMD_DISABLE_KEYCLICK);
lk->serio->write (lk->serio, LK_CMD_DISABLE_CTRCLICK); serio_write (lk->serio, LK_CMD_DISABLE_CTRCLICK);
} else { } else {
DBG ("%s: Activating key clicks\n", __func__); DBG ("%s: Activating key clicks\n", __func__);
lk->serio->write (lk->serio, LK_CMD_ENABLE_KEYCLICK); serio_write (lk->serio, LK_CMD_ENABLE_KEYCLICK);
lk->serio->write (lk->serio, volume_to_hw (lk->keyclick_volume)); serio_write (lk->serio, volume_to_hw (lk->keyclick_volume));
lk->serio->write (lk->serio, LK_CMD_ENABLE_CTRCLICK); serio_write (lk->serio, LK_CMD_ENABLE_CTRCLICK);
lk->serio->write (lk->serio, volume_to_hw (lk->ctrlclick_volume)); serio_write (lk->serio, volume_to_hw (lk->ctrlclick_volume));
} }
return 0; return 0;
case SND_BELL: case SND_BELL:
if (value != 0) if (value != 0)
lk->serio->write (lk->serio, LK_CMD_SOUND_BELL); serio_write (lk->serio, LK_CMD_SOUND_BELL);
return 0; return 0;
} }
...@@ -579,10 +579,10 @@ lkkbd_reinit (struct work_struct *work) ...@@ -579,10 +579,10 @@ lkkbd_reinit (struct work_struct *work)
unsigned char leds_off = 0; unsigned char leds_off = 0;
/* Ask for ID */ /* Ask for ID */
lk->serio->write (lk->serio, LK_CMD_REQUEST_ID); serio_write (lk->serio, LK_CMD_REQUEST_ID);
/* Reset parameters */ /* Reset parameters */
lk->serio->write (lk->serio, LK_CMD_SET_DEFAULTS); serio_write (lk->serio, LK_CMD_SET_DEFAULTS);
/* Set LEDs */ /* Set LEDs */
CHECK_LED (lk, leds_on, leds_off, LED_CAPSL, LK_LED_SHIFTLOCK); CHECK_LED (lk, leds_on, leds_off, LED_CAPSL, LK_LED_SHIFTLOCK);
...@@ -590,12 +590,12 @@ lkkbd_reinit (struct work_struct *work) ...@@ -590,12 +590,12 @@ lkkbd_reinit (struct work_struct *work)
CHECK_LED (lk, leds_on, leds_off, LED_SCROLLL, LK_LED_SCROLLLOCK); CHECK_LED (lk, leds_on, leds_off, LED_SCROLLL, LK_LED_SCROLLLOCK);
CHECK_LED (lk, leds_on, leds_off, LED_SLEEP, LK_LED_WAIT); CHECK_LED (lk, leds_on, leds_off, LED_SLEEP, LK_LED_WAIT);
if (leds_on != 0) { if (leds_on != 0) {
lk->serio->write (lk->serio, LK_CMD_LED_ON); serio_write (lk->serio, LK_CMD_LED_ON);
lk->serio->write (lk->serio, leds_on); serio_write (lk->serio, leds_on);
} }
if (leds_off != 0) { if (leds_off != 0) {
lk->serio->write (lk->serio, LK_CMD_LED_OFF); serio_write (lk->serio, LK_CMD_LED_OFF);
lk->serio->write (lk->serio, leds_off); serio_write (lk->serio, leds_off);
} }
/* /*
...@@ -603,31 +603,31 @@ lkkbd_reinit (struct work_struct *work) ...@@ -603,31 +603,31 @@ lkkbd_reinit (struct work_struct *work)
* only work with a LK401 keyboard and grants access to * only work with a LK401 keyboard and grants access to
* LAlt, RAlt, RCompose and RShift. * LAlt, RAlt, RCompose and RShift.
*/ */
lk->serio->write (lk->serio, LK_CMD_ENABLE_LK401); serio_write (lk->serio, LK_CMD_ENABLE_LK401);
/* Set all keys to UPDOWN mode */ /* Set all keys to UPDOWN mode */
for (division = 1; division <= 14; division++) for (division = 1; division <= 14; division++)
lk->serio->write (lk->serio, LK_CMD_SET_MODE (LK_MODE_UPDOWN, serio_write (lk->serio, LK_CMD_SET_MODE (LK_MODE_UPDOWN,
division)); division));
/* Enable bell and set volume */ /* Enable bell and set volume */
lk->serio->write (lk->serio, LK_CMD_ENABLE_BELL); serio_write (lk->serio, LK_CMD_ENABLE_BELL);
lk->serio->write (lk->serio, volume_to_hw (lk->bell_volume)); serio_write (lk->serio, volume_to_hw (lk->bell_volume));
/* Enable/disable keyclick (and possibly set volume) */ /* Enable/disable keyclick (and possibly set volume) */
if (test_bit (SND_CLICK, lk->dev->snd)) { if (test_bit (SND_CLICK, lk->dev->snd)) {
lk->serio->write (lk->serio, LK_CMD_ENABLE_KEYCLICK); serio_write (lk->serio, LK_CMD_ENABLE_KEYCLICK);
lk->serio->write (lk->serio, volume_to_hw (lk->keyclick_volume)); serio_write (lk->serio, volume_to_hw (lk->keyclick_volume));
lk->serio->write (lk->serio, LK_CMD_ENABLE_CTRCLICK); serio_write (lk->serio, LK_CMD_ENABLE_CTRCLICK);
lk->serio->write (lk->serio, volume_to_hw (lk->ctrlclick_volume)); serio_write (lk->serio, volume_to_hw (lk->ctrlclick_volume));
} else { } else {
lk->serio->write (lk->serio, LK_CMD_DISABLE_KEYCLICK); serio_write (lk->serio, LK_CMD_DISABLE_KEYCLICK);
lk->serio->write (lk->serio, LK_CMD_DISABLE_CTRCLICK); serio_write (lk->serio, LK_CMD_DISABLE_CTRCLICK);
} }
/* Sound the bell if needed */ /* Sound the bell if needed */
if (test_bit (SND_BELL, lk->dev->snd)) if (test_bit (SND_BELL, lk->dev->snd))
lk->serio->write (lk->serio, LK_CMD_SOUND_BELL); serio_write (lk->serio, LK_CMD_SOUND_BELL);
} }
/* /*
...@@ -684,8 +684,10 @@ lkkbd_connect (struct serio *serio, struct serio_driver *drv) ...@@ -684,8 +684,10 @@ lkkbd_connect (struct serio *serio, struct serio_driver *drv)
input_dev->keycode = lk->keycode; input_dev->keycode = lk->keycode;
input_dev->keycodesize = sizeof (lk_keycode_t); input_dev->keycodesize = sizeof (lk_keycode_t);
input_dev->keycodemax = LK_NUM_KEYCODES; input_dev->keycodemax = LK_NUM_KEYCODES;
for (i = 0; i < LK_NUM_KEYCODES; i++) for (i = 0; i < LK_NUM_KEYCODES; i++)
set_bit (lk->keycode[i], input_dev->keybit); __set_bit (lk->keycode[i], input_dev->keybit);
__clear_bit(KEY_RESERVED, input_dev->keybit);
serio_set_drvdata (serio, lk); serio_set_drvdata (serio, lk);
...@@ -697,7 +699,7 @@ lkkbd_connect (struct serio *serio, struct serio_driver *drv) ...@@ -697,7 +699,7 @@ lkkbd_connect (struct serio *serio, struct serio_driver *drv)
if (err) if (err)
goto fail3; goto fail3;
lk->serio->write (lk->serio, LK_CMD_POWERCYCLE_RESET); serio_write (lk->serio, LK_CMD_POWERCYCLE_RESET);
return 0; return 0;
......
...@@ -150,8 +150,8 @@ static int sunkbd_event(struct input_dev *dev, unsigned int type, unsigned int c ...@@ -150,8 +150,8 @@ static int sunkbd_event(struct input_dev *dev, unsigned int type, unsigned int c
case EV_LED: case EV_LED:
sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_SETLED); serio_write(sunkbd->serio, SUNKBD_CMD_SETLED);
sunkbd->serio->write(sunkbd->serio, serio_write(sunkbd->serio,
(!!test_bit(LED_CAPSL, dev->led) << 3) | (!!test_bit(LED_SCROLLL, dev->led) << 2) | (!!test_bit(LED_CAPSL, dev->led) << 3) | (!!test_bit(LED_SCROLLL, dev->led) << 2) |
(!!test_bit(LED_COMPOSE, dev->led) << 1) | !!test_bit(LED_NUML, dev->led)); (!!test_bit(LED_COMPOSE, dev->led) << 1) | !!test_bit(LED_NUML, dev->led));
return 0; return 0;
...@@ -161,11 +161,11 @@ static int sunkbd_event(struct input_dev *dev, unsigned int type, unsigned int c ...@@ -161,11 +161,11 @@ static int sunkbd_event(struct input_dev *dev, unsigned int type, unsigned int c
switch (code) { switch (code) {
case SND_CLICK: case SND_CLICK:
sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_NOCLICK - value); serio_write(sunkbd->serio, SUNKBD_CMD_NOCLICK - value);
return 0; return 0;
case SND_BELL: case SND_BELL:
sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_BELLOFF - value); serio_write(sunkbd->serio, SUNKBD_CMD_BELLOFF - value);
return 0; return 0;
} }
...@@ -183,7 +183,7 @@ static int sunkbd_event(struct input_dev *dev, unsigned int type, unsigned int c ...@@ -183,7 +183,7 @@ static int sunkbd_event(struct input_dev *dev, unsigned int type, unsigned int c
static int sunkbd_initialize(struct sunkbd *sunkbd) static int sunkbd_initialize(struct sunkbd *sunkbd)
{ {
sunkbd->reset = -2; sunkbd->reset = -2;
sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_RESET); serio_write(sunkbd->serio, SUNKBD_CMD_RESET);
wait_event_interruptible_timeout(sunkbd->wait, sunkbd->reset >= 0, HZ); wait_event_interruptible_timeout(sunkbd->wait, sunkbd->reset >= 0, HZ);
if (sunkbd->reset < 0) if (sunkbd->reset < 0)
return -1; return -1;
...@@ -192,7 +192,7 @@ static int sunkbd_initialize(struct sunkbd *sunkbd) ...@@ -192,7 +192,7 @@ static int sunkbd_initialize(struct sunkbd *sunkbd)
if (sunkbd->type == 4) { /* Type 4 keyboard */ if (sunkbd->type == 4) { /* Type 4 keyboard */
sunkbd->layout = -2; sunkbd->layout = -2;
sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_LAYOUT); serio_write(sunkbd->serio, SUNKBD_CMD_LAYOUT);
wait_event_interruptible_timeout(sunkbd->wait, sunkbd->layout >= 0, HZ/4); wait_event_interruptible_timeout(sunkbd->wait, sunkbd->layout >= 0, HZ/4);
if (sunkbd->layout < 0) return -1; if (sunkbd->layout < 0) return -1;
if (sunkbd->layout & SUNKBD_LAYOUT_5_MASK) sunkbd->type = 5; if (sunkbd->layout & SUNKBD_LAYOUT_5_MASK) sunkbd->type = 5;
...@@ -212,12 +212,14 @@ static void sunkbd_reinit(struct work_struct *work) ...@@ -212,12 +212,14 @@ static void sunkbd_reinit(struct work_struct *work)
wait_event_interruptible_timeout(sunkbd->wait, sunkbd->reset >= 0, HZ); wait_event_interruptible_timeout(sunkbd->wait, sunkbd->reset >= 0, HZ);
sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_SETLED); serio_write(sunkbd->serio, SUNKBD_CMD_SETLED);
sunkbd->serio->write(sunkbd->serio, serio_write(sunkbd->serio,
(!!test_bit(LED_CAPSL, sunkbd->dev->led) << 3) | (!!test_bit(LED_SCROLLL, sunkbd->dev->led) << 2) | (!!test_bit(LED_CAPSL, sunkbd->dev->led) << 3) |
(!!test_bit(LED_COMPOSE, sunkbd->dev->led) << 1) | !!test_bit(LED_NUML, sunkbd->dev->led)); (!!test_bit(LED_SCROLLL, sunkbd->dev->led) << 2) |
sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_NOCLICK - !!test_bit(SND_CLICK, sunkbd->dev->snd)); (!!test_bit(LED_COMPOSE, sunkbd->dev->led) << 1) |
sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_BELLOFF - !!test_bit(SND_BELL, sunkbd->dev->snd)); !!test_bit(LED_NUML, sunkbd->dev->led));
serio_write(sunkbd->serio, SUNKBD_CMD_NOCLICK - !!test_bit(SND_CLICK, sunkbd->dev->snd));
serio_write(sunkbd->serio, SUNKBD_CMD_BELLOFF - !!test_bit(SND_BELL, sunkbd->dev->snd));
} }
static void sunkbd_enable(struct sunkbd *sunkbd, int enable) static void sunkbd_enable(struct sunkbd *sunkbd, int enable)
......
...@@ -273,28 +273,28 @@ static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver) ...@@ -273,28 +273,28 @@ static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver)
init_MUTEX_LOCKED(&ptr->sem); init_MUTEX_LOCKED(&ptr->sem);
/* Get device info. MLC driver supplies devid/status/etc. */ /* Get device info. MLC driver supplies devid/status/etc. */
serio->write(serio, 0); serio_write(serio, 0);
serio->write(serio, 0); serio_write(serio, 0);
serio->write(serio, HIL_PKT_CMD >> 8); serio_write(serio, HIL_PKT_CMD >> 8);
serio->write(serio, HIL_CMD_IDD); serio_write(serio, HIL_CMD_IDD);
down(&ptr->sem); down(&ptr->sem);
serio->write(serio, 0); serio_write(serio, 0);
serio->write(serio, 0); serio_write(serio, 0);
serio->write(serio, HIL_PKT_CMD >> 8); serio_write(serio, HIL_PKT_CMD >> 8);
serio->write(serio, HIL_CMD_RSC); serio_write(serio, HIL_CMD_RSC);
down(&ptr->sem); down(&ptr->sem);
serio->write(serio, 0); serio_write(serio, 0);
serio->write(serio, 0); serio_write(serio, 0);
serio->write(serio, HIL_PKT_CMD >> 8); serio_write(serio, HIL_PKT_CMD >> 8);
serio->write(serio, HIL_CMD_RNM); serio_write(serio, HIL_CMD_RNM);
down(&ptr->sem); down(&ptr->sem);
serio->write(serio, 0); serio_write(serio, 0);
serio->write(serio, 0); serio_write(serio, 0);
serio->write(serio, HIL_PKT_CMD >> 8); serio_write(serio, HIL_PKT_CMD >> 8);
serio->write(serio, HIL_CMD_EXD); serio_write(serio, HIL_CMD_EXD);
down(&ptr->sem); down(&ptr->sem);
up(&ptr->sem); up(&ptr->sem);
......
...@@ -384,11 +384,11 @@ vsxxxaa_handle_POR_packet (struct vsxxxaa *mouse) ...@@ -384,11 +384,11 @@ vsxxxaa_handle_POR_packet (struct vsxxxaa *mouse)
printk (KERN_NOTICE "%s on %s: Forceing standard packet format, " printk (KERN_NOTICE "%s on %s: Forceing standard packet format, "
"incremental streaming mode and 72 samples/sec\n", "incremental streaming mode and 72 samples/sec\n",
mouse->name, mouse->phys); mouse->name, mouse->phys);
mouse->serio->write (mouse->serio, 'S'); /* Standard format */ serio_write (mouse->serio, 'S'); /* Standard format */
mdelay (50); mdelay (50);
mouse->serio->write (mouse->serio, 'R'); /* Incremental */ serio_write (mouse->serio, 'R'); /* Incremental */
mdelay (50); mdelay (50);
mouse->serio->write (mouse->serio, 'L'); /* 72 samples/sec */ serio_write (mouse->serio, 'L'); /* 72 samples/sec */
} }
static void static void
...@@ -532,7 +532,7 @@ vsxxxaa_connect (struct serio *serio, struct serio_driver *drv) ...@@ -532,7 +532,7 @@ vsxxxaa_connect (struct serio *serio, struct serio_driver *drv)
* Request selftest. Standard packet format and differential * Request selftest. Standard packet format and differential
* mode will be requested after the device ID'ed successfully. * mode will be requested after the device ID'ed successfully.
*/ */
serio->write (serio, 'T'); /* Test */ serio_write (serio, 'T'); /* Test */
err = input_register_device (input_dev); err = input_register_device (input_dev);
if (err) if (err)
......
...@@ -148,9 +148,10 @@ unsigned int h3600_flite_power(struct input_dev *dev, enum flite_pwr pwr) ...@@ -148,9 +148,10 @@ unsigned int h3600_flite_power(struct input_dev *dev, enum flite_pwr pwr)
struct h3600_dev *ts = input_get_drvdata(dev); struct h3600_dev *ts = input_get_drvdata(dev);
/* Must be in this order */ /* Must be in this order */
ts->serio->write(ts->serio, 1); serio_write(ts->serio, 1);
ts->serio->write(ts->serio, pwr); serio_write(ts->serio, pwr);
ts->serio->write(ts->serio, brightness); serio_write(ts->serio, brightness);
return 0; return 0;
} }
...@@ -262,7 +263,7 @@ static int h3600ts_event(struct input_dev *dev, unsigned int type, ...@@ -262,7 +263,7 @@ static int h3600ts_event(struct input_dev *dev, unsigned int type,
switch (type) { switch (type) {
case EV_LED: { case EV_LED: {
// ts->serio->write(ts->serio, SOME_CMD); // serio_write(ts->serio, SOME_CMD);
return 0; return 0;
} }
} }
......
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