Input: elo - switch to using dev_xxx() when printing messages

Also fix formatting of "switch" statements.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
Dmitry Torokhov 2010-01-06 23:52:12 -08:00
parent a9a1f9c315
commit 8cab9ba104
1 changed files with 121 additions and 106 deletions

View File

@ -72,11 +72,13 @@ static void elo_process_data_10(struct elo *elo, unsigned char data)
struct input_dev *dev = elo->dev;
elo->data[elo->idx] = data;
switch (elo->idx++) {
case 0:
elo->csum = 0xaa;
if (data != ELO10_LEAD_BYTE) {
pr_debug("elo: unsynchronized data: 0x%02x\n", data);
dev_dbg(&elo->serio->dev,
"unsynchronized data: 0x%02x\n", data);
elo->idx = 0;
}
break;
@ -84,13 +86,15 @@ static void elo_process_data_10(struct elo *elo, unsigned char data)
case 9:
elo->idx = 0;
if (data != elo->csum) {
pr_debug("elo: bad checksum: 0x%02x, expected 0x%02x\n",
dev_dbg(&elo->serio->dev,
"bad checksum: 0x%02x, expected 0x%02x\n",
data, elo->csum);
break;
}
if (elo->data[1] != elo->expected_packet) {
if (elo->data[1] != ELO10_TOUCH_PACKET)
pr_debug("elo: unexpected packet: 0x%02x\n",
dev_dbg(&elo->serio->dev,
"unexpected packet: 0x%02x\n",
elo->data[1]);
break;
}
@ -123,9 +127,20 @@ static void elo_process_data_6(struct elo *elo, unsigned char data)
switch (elo->idx++) {
case 0: if ((data & 0xc0) != 0xc0) elo->idx = 0; break;
case 1: if ((data & 0xc0) != 0x80) elo->idx = 0; break;
case 2: if ((data & 0xc0) != 0x40) elo->idx = 0; break;
case 0:
if ((data & 0xc0) != 0xc0)
elo->idx = 0;
break;
case 1:
if ((data & 0xc0) != 0x80)
elo->idx = 0;
break;
case 2:
if ((data & 0xc0) != 0x40)
elo->idx = 0;
break;
case 3:
if (data & 0xc0) {
@ -261,8 +276,8 @@ static int elo_setup_10(struct elo *elo)
if (packet[3] & ELO10_PRESSURE)
input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0);
printk(KERN_INFO "elo: %sTouch touchscreen, fw: %02x.%02x, "
"features: 0x%02x, controller: 0x%02x\n",
dev_info(&elo->serio->dev,
"%sTouch touchscreen, fw: %02x.%02x, features: 0x%02x, controller: 0x%02x\n",
elo_types[(packet[1] -'0') & 0x03],
packet[5], packet[4], packet[3], packet[7]);