Commit 50078a90 authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab

media: rc: replace IR_dprintk() with dev_dbg in IR decoders

Use dev_dbg() rather than custom debug function.
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 069edf8a
...@@ -56,7 +56,7 @@ static int ir_jvc_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -56,7 +56,7 @@ static int ir_jvc_decode(struct rc_dev *dev, struct ir_raw_event ev)
if (!geq_margin(ev.duration, JVC_UNIT, JVC_UNIT / 2)) if (!geq_margin(ev.duration, JVC_UNIT, JVC_UNIT / 2))
goto out; goto out;
IR_dprintk(2, "JVC decode started at state %d (%uus %s)\n", dev_dbg(&dev->dev, "JVC decode started at state %d (%uus %s)\n",
data->state, TO_US(ev.duration), TO_STR(ev.pulse)); data->state, TO_US(ev.duration), TO_STR(ev.pulse));
again: again:
...@@ -136,15 +136,15 @@ static int ir_jvc_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -136,15 +136,15 @@ static int ir_jvc_decode(struct rc_dev *dev, struct ir_raw_event ev)
u32 scancode; u32 scancode;
scancode = (bitrev8((data->bits >> 8) & 0xff) << 8) | scancode = (bitrev8((data->bits >> 8) & 0xff) << 8) |
(bitrev8((data->bits >> 0) & 0xff) << 0); (bitrev8((data->bits >> 0) & 0xff) << 0);
IR_dprintk(1, "JVC scancode 0x%04x\n", scancode); dev_dbg(&dev->dev, "JVC scancode 0x%04x\n", scancode);
rc_keydown(dev, RC_PROTO_JVC, scancode, data->toggle); rc_keydown(dev, RC_PROTO_JVC, scancode, data->toggle);
data->first = false; data->first = false;
data->old_bits = data->bits; data->old_bits = data->bits;
} else if (data->bits == data->old_bits) { } else if (data->bits == data->old_bits) {
IR_dprintk(1, "JVC repeat\n"); dev_dbg(&dev->dev, "JVC repeat\n");
rc_repeat(dev); rc_repeat(dev);
} else { } else {
IR_dprintk(1, "JVC invalid repeat msg\n"); dev_dbg(&dev->dev, "JVC invalid repeat msg\n");
break; break;
} }
...@@ -164,7 +164,7 @@ static int ir_jvc_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -164,7 +164,7 @@ static int ir_jvc_decode(struct rc_dev *dev, struct ir_raw_event ev)
} }
out: out:
IR_dprintk(1, "JVC decode failed at state %d (%uus %s)\n", dev_dbg(&dev->dev, "JVC decode failed at state %d (%uus %s)\n",
data->state, TO_US(ev.duration), TO_STR(ev.pulse)); data->state, TO_US(ev.duration), TO_STR(ev.pulse));
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return -EINVAL; return -EINVAL;
......
...@@ -117,19 +117,19 @@ static unsigned char kbd_keycodes[256] = { ...@@ -117,19 +117,19 @@ static unsigned char kbd_keycodes[256] = {
static void mce_kbd_rx_timeout(struct timer_list *t) static void mce_kbd_rx_timeout(struct timer_list *t)
{ {
struct mce_kbd_dec *mce_kbd = from_timer(mce_kbd, t, rx_timeout); struct ir_raw_event_ctrl *raw = from_timer(raw, t, mce_kbd.rx_timeout);
int i;
unsigned char maskcode; unsigned char maskcode;
int i;
IR_dprintk(2, "timer callback clearing all keys\n"); dev_dbg(&raw->dev->dev, "timer callback clearing all keys\n");
for (i = 0; i < 7; i++) { for (i = 0; i < 7; i++) {
maskcode = kbd_keycodes[MCIR2_MASK_KEYS_START + i]; maskcode = kbd_keycodes[MCIR2_MASK_KEYS_START + i];
input_report_key(mce_kbd->idev, maskcode, 0); input_report_key(raw->mce_kbd.idev, maskcode, 0);
} }
for (i = 0; i < MCIR2_MASK_KEYS_START; i++) for (i = 0; i < MCIR2_MASK_KEYS_START; i++)
input_report_key(mce_kbd->idev, kbd_keycodes[i], 0); input_report_key(raw->mce_kbd.idev, kbd_keycodes[i], 0);
} }
static enum mce_kbd_mode mce_kbd_mode(struct mce_kbd_dec *data) static enum mce_kbd_mode mce_kbd_mode(struct mce_kbd_dec *data)
...@@ -144,15 +144,15 @@ static enum mce_kbd_mode mce_kbd_mode(struct mce_kbd_dec *data) ...@@ -144,15 +144,15 @@ static enum mce_kbd_mode mce_kbd_mode(struct mce_kbd_dec *data)
} }
} }
static void ir_mce_kbd_process_keyboard_data(struct input_dev *idev, static void ir_mce_kbd_process_keyboard_data(struct rc_dev *dev, u32 scancode)
u32 scancode)
{ {
struct mce_kbd_dec *data = &dev->raw->mce_kbd;
u8 keydata = (scancode >> 8) & 0xff; u8 keydata = (scancode >> 8) & 0xff;
u8 shiftmask = scancode & 0xff; u8 shiftmask = scancode & 0xff;
unsigned char keycode, maskcode; unsigned char keycode, maskcode;
int i, keystate; int i, keystate;
IR_dprintk(1, "keyboard: keydata = 0x%02x, shiftmask = 0x%02x\n", dev_dbg(&dev->dev, "keyboard: keydata = 0x%02x, shiftmask = 0x%02x\n",
keydata, shiftmask); keydata, shiftmask);
for (i = 0; i < 7; i++) { for (i = 0; i < 7; i++) {
...@@ -161,20 +161,21 @@ static void ir_mce_kbd_process_keyboard_data(struct input_dev *idev, ...@@ -161,20 +161,21 @@ static void ir_mce_kbd_process_keyboard_data(struct input_dev *idev,
keystate = 1; keystate = 1;
else else
keystate = 0; keystate = 0;
input_report_key(idev, maskcode, keystate); input_report_key(data->idev, maskcode, keystate);
} }
if (keydata) { if (keydata) {
keycode = kbd_keycodes[keydata]; keycode = kbd_keycodes[keydata];
input_report_key(idev, keycode, 1); input_report_key(data->idev, keycode, 1);
} else { } else {
for (i = 0; i < MCIR2_MASK_KEYS_START; i++) for (i = 0; i < MCIR2_MASK_KEYS_START; i++)
input_report_key(idev, kbd_keycodes[i], 0); input_report_key(data->idev, kbd_keycodes[i], 0);
} }
} }
static void ir_mce_kbd_process_mouse_data(struct input_dev *idev, u32 scancode) static void ir_mce_kbd_process_mouse_data(struct rc_dev *dev, u32 scancode)
{ {
struct mce_kbd_dec *data = &dev->raw->mce_kbd;
/* raw mouse coordinates */ /* raw mouse coordinates */
u8 xdata = (scancode >> 7) & 0x7f; u8 xdata = (scancode >> 7) & 0x7f;
u8 ydata = (scancode >> 14) & 0x7f; u8 ydata = (scancode >> 14) & 0x7f;
...@@ -193,14 +194,14 @@ static void ir_mce_kbd_process_mouse_data(struct input_dev *idev, u32 scancode) ...@@ -193,14 +194,14 @@ static void ir_mce_kbd_process_mouse_data(struct input_dev *idev, u32 scancode)
else else
y = ydata; y = ydata;
IR_dprintk(1, "mouse: x = %d, y = %d, btns = %s%s\n", dev_dbg(&dev->dev, "mouse: x = %d, y = %d, btns = %s%s\n",
x, y, left ? "L" : "", right ? "R" : ""); x, y, left ? "L" : "", right ? "R" : "");
input_report_rel(idev, REL_X, x); input_report_rel(data->idev, REL_X, x);
input_report_rel(idev, REL_Y, y); input_report_rel(data->idev, REL_Y, y);
input_report_key(idev, BTN_LEFT, left); input_report_key(data->idev, BTN_LEFT, left);
input_report_key(idev, BTN_RIGHT, right); input_report_key(data->idev, BTN_RIGHT, right);
} }
/** /**
...@@ -227,7 +228,7 @@ static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -227,7 +228,7 @@ static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev)
goto out; goto out;
again: again:
IR_dprintk(2, "started at state %i (%uus %s)\n", dev_dbg(&dev->dev, "started at state %i (%uus %s)\n",
data->state, TO_US(ev.duration), TO_STR(ev.pulse)); data->state, TO_US(ev.duration), TO_STR(ev.pulse));
if (!geq_margin(ev.duration, MCIR2_UNIT, MCIR2_UNIT / 2)) if (!geq_margin(ev.duration, MCIR2_UNIT, MCIR2_UNIT / 2))
...@@ -280,7 +281,7 @@ static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -280,7 +281,7 @@ static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev)
data->wanted_bits = MCIR2_MOUSE_NBITS; data->wanted_bits = MCIR2_MOUSE_NBITS;
break; break;
default: default:
IR_dprintk(1, "not keyboard or mouse data\n"); dev_dbg(&dev->dev, "not keyboard or mouse data\n");
goto out; goto out;
} }
...@@ -319,25 +320,26 @@ static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -319,25 +320,26 @@ static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev)
switch (data->wanted_bits) { switch (data->wanted_bits) {
case MCIR2_KEYBOARD_NBITS: case MCIR2_KEYBOARD_NBITS:
scancode = data->body & 0xffff; scancode = data->body & 0xffff;
IR_dprintk(1, "keyboard data 0x%08x\n", data->body); dev_dbg(&dev->dev, "keyboard data 0x%08x\n",
data->body);
if (dev->timeout) if (dev->timeout)
delay = usecs_to_jiffies(dev->timeout / 1000); delay = usecs_to_jiffies(dev->timeout / 1000);
else else
delay = msecs_to_jiffies(100); delay = msecs_to_jiffies(100);
mod_timer(&data->rx_timeout, jiffies + delay); mod_timer(&data->rx_timeout, jiffies + delay);
/* Pass data to keyboard buffer parser */ /* Pass data to keyboard buffer parser */
ir_mce_kbd_process_keyboard_data(data->idev, scancode); ir_mce_kbd_process_keyboard_data(dev, scancode);
lsc.rc_proto = RC_PROTO_MCIR2_KBD; lsc.rc_proto = RC_PROTO_MCIR2_KBD;
break; break;
case MCIR2_MOUSE_NBITS: case MCIR2_MOUSE_NBITS:
scancode = data->body & 0x1fffff; scancode = data->body & 0x1fffff;
IR_dprintk(1, "mouse data 0x%06x\n", scancode); dev_dbg(&dev->dev, "mouse data 0x%06x\n", scancode);
/* Pass data to mouse buffer parser */ /* Pass data to mouse buffer parser */
ir_mce_kbd_process_mouse_data(data->idev, scancode); ir_mce_kbd_process_mouse_data(dev, scancode);
lsc.rc_proto = RC_PROTO_MCIR2_MSE; lsc.rc_proto = RC_PROTO_MCIR2_MSE;
break; break;
default: default:
IR_dprintk(1, "not keyboard or mouse data\n"); dev_dbg(&dev->dev, "not keyboard or mouse data\n");
goto out; goto out;
} }
...@@ -350,7 +352,7 @@ static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -350,7 +352,7 @@ static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev)
} }
out: out:
IR_dprintk(1, "failed at state %i (%uus %s)\n", dev_dbg(&dev->dev, "failed at state %i (%uus %s)\n",
data->state, TO_US(ev.duration), TO_STR(ev.pulse)); data->state, TO_US(ev.duration), TO_STR(ev.pulse));
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
input_sync(data->idev); input_sync(data->idev);
......
...@@ -49,7 +49,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -49,7 +49,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
return 0; return 0;
} }
IR_dprintk(2, "NEC decode started at state %d (%uus %s)\n", dev_dbg(&dev->dev, "NEC decode started at state %d (%uus %s)\n",
data->state, TO_US(ev.duration), TO_STR(ev.pulse)); data->state, TO_US(ev.duration), TO_STR(ev.pulse));
switch (data->state) { switch (data->state) {
...@@ -99,13 +99,11 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -99,13 +99,11 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
break; break;
if (data->necx_repeat && data->count == NECX_REPEAT_BITS && if (data->necx_repeat && data->count == NECX_REPEAT_BITS &&
geq_margin(ev.duration, geq_margin(ev.duration, NEC_TRAILER_SPACE, NEC_UNIT / 2)) {
NEC_TRAILER_SPACE, NEC_UNIT / 2)) { dev_dbg(&dev->dev, "Repeat last key\n");
IR_dprintk(1, "Repeat last key\n");
rc_repeat(dev); rc_repeat(dev);
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return 0; return 0;
} else if (data->count > NECX_REPEAT_BITS) } else if (data->count > NECX_REPEAT_BITS)
data->necx_repeat = false; data->necx_repeat = false;
...@@ -164,7 +162,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -164,7 +162,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
return 0; return 0;
} }
IR_dprintk(1, "NEC decode failed at count %d state %d (%uus %s)\n", dev_dbg(&dev->dev, "NEC decode failed at count %d state %d (%uus %s)\n",
data->count, data->state, TO_US(ev.duration), TO_STR(ev.pulse)); data->count, data->state, TO_US(ev.duration), TO_STR(ev.pulse));
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return -EINVAL; return -EINVAL;
......
...@@ -54,7 +54,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -54,7 +54,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev)
goto out; goto out;
again: again:
IR_dprintk(2, "RC5(x/sz) decode started at state %i (%uus %s)\n", dev_dbg(&dev->dev, "RC5(x/sz) decode started at state %i (%uus %s)\n",
data->state, TO_US(ev.duration), TO_STR(ev.pulse)); data->state, TO_US(ev.duration), TO_STR(ev.pulse));
if (!geq_margin(ev.duration, RC5_UNIT, RC5_UNIT / 2)) if (!geq_margin(ev.duration, RC5_UNIT, RC5_UNIT / 2))
...@@ -157,7 +157,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -157,7 +157,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev)
} else } else
break; break;
IR_dprintk(1, "RC5(x/sz) scancode 0x%06x (p: %u, t: %u)\n", dev_dbg(&dev->dev, "RC5(x/sz) scancode 0x%06x (p: %u, t: %u)\n",
scancode, protocol, toggle); scancode, protocol, toggle);
rc_keydown(dev, protocol, scancode, toggle); rc_keydown(dev, protocol, scancode, toggle);
...@@ -166,7 +166,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -166,7 +166,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev)
} }
out: out:
IR_dprintk(1, "RC5(x/sz) decode failed at state %i count %d (%uus %s)\n", dev_dbg(&dev->dev, "RC5(x/sz) decode failed at state %i count %d (%uus %s)\n",
data->state, data->count, TO_US(ev.duration), TO_STR(ev.pulse)); data->state, data->count, TO_US(ev.duration), TO_STR(ev.pulse));
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return -EINVAL; return -EINVAL;
......
...@@ -100,7 +100,7 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -100,7 +100,7 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev)
goto out; goto out;
again: again:
IR_dprintk(2, "RC6 decode started at state %i (%uus %s)\n", dev_dbg(&dev->dev, "RC6 decode started at state %i (%uus %s)\n",
data->state, TO_US(ev.duration), TO_STR(ev.pulse)); data->state, TO_US(ev.duration), TO_STR(ev.pulse));
if (!geq_margin(ev.duration, RC6_UNIT, RC6_UNIT / 2)) if (!geq_margin(ev.duration, RC6_UNIT, RC6_UNIT / 2))
...@@ -170,7 +170,7 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -170,7 +170,7 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev)
break; break;
if (!(data->header & RC6_STARTBIT_MASK)) { if (!(data->header & RC6_STARTBIT_MASK)) {
IR_dprintk(1, "RC6 invalid start bit\n"); dev_dbg(&dev->dev, "RC6 invalid start bit\n");
break; break;
} }
...@@ -187,7 +187,7 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -187,7 +187,7 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev)
data->wanted_bits = RC6_6A_NBITS; data->wanted_bits = RC6_6A_NBITS;
break; break;
default: default:
IR_dprintk(1, "RC6 unknown mode\n"); dev_dbg(&dev->dev, "RC6 unknown mode\n");
goto out; goto out;
} }
goto again; goto again;
...@@ -230,13 +230,13 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -230,13 +230,13 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev)
scancode = data->body; scancode = data->body;
toggle = data->toggle; toggle = data->toggle;
protocol = RC_PROTO_RC6_0; protocol = RC_PROTO_RC6_0;
IR_dprintk(1, "RC6(0) scancode 0x%04x (toggle: %u)\n", dev_dbg(&dev->dev, "RC6(0) scancode 0x%04x (toggle: %u)\n",
scancode, toggle); scancode, toggle);
break; break;
case RC6_MODE_6A: case RC6_MODE_6A:
if (data->count > CHAR_BIT * sizeof data->body) { if (data->count > CHAR_BIT * sizeof data->body) {
IR_dprintk(1, "RC6 too many (%u) data bits\n", dev_dbg(&dev->dev, "RC6 too many (%u) data bits\n",
data->count); data->count);
goto out; goto out;
} }
...@@ -262,15 +262,15 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -262,15 +262,15 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev)
} }
break; break;
default: default:
IR_dprintk(1, "RC6(6A) unsupported length\n"); dev_dbg(&dev->dev, "RC6(6A) unsupported length\n");
goto out; goto out;
} }
IR_dprintk(1, "RC6(6A) proto 0x%04x, scancode 0x%08x (toggle: %u)\n", dev_dbg(&dev->dev, "RC6(6A) proto 0x%04x, scancode 0x%08x (toggle: %u)\n",
protocol, scancode, toggle); protocol, scancode, toggle);
break; break;
default: default:
IR_dprintk(1, "RC6 unknown mode\n"); dev_dbg(&dev->dev, "RC6 unknown mode\n");
goto out; goto out;
} }
...@@ -280,7 +280,7 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -280,7 +280,7 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev)
} }
out: out:
IR_dprintk(1, "RC6 decode failed at state %i (%uus %s)\n", dev_dbg(&dev->dev, "RC6 decode failed at state %i (%uus %s)\n",
data->state, TO_US(ev.duration), TO_STR(ev.pulse)); data->state, TO_US(ev.duration), TO_STR(ev.pulse));
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return -EINVAL; return -EINVAL;
......
...@@ -52,13 +52,13 @@ static int ir_sanyo_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -52,13 +52,13 @@ static int ir_sanyo_decode(struct rc_dev *dev, struct ir_raw_event ev)
if (!is_timing_event(ev)) { if (!is_timing_event(ev)) {
if (ev.reset) { if (ev.reset) {
IR_dprintk(1, "SANYO event reset received. reset to state 0\n"); dev_dbg(&dev->dev, "SANYO event reset received. reset to state 0\n");
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
} }
return 0; return 0;
} }
IR_dprintk(2, "SANYO decode started at state %d (%uus %s)\n", dev_dbg(&dev->dev, "SANYO decode started at state %d (%uus %s)\n",
data->state, TO_US(ev.duration), TO_STR(ev.pulse)); data->state, TO_US(ev.duration), TO_STR(ev.pulse));
switch (data->state) { switch (data->state) {
...@@ -102,7 +102,7 @@ static int ir_sanyo_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -102,7 +102,7 @@ static int ir_sanyo_decode(struct rc_dev *dev, struct ir_raw_event ev)
if (!data->count && geq_margin(ev.duration, SANYO_REPEAT_SPACE, SANYO_UNIT / 2)) { if (!data->count && geq_margin(ev.duration, SANYO_REPEAT_SPACE, SANYO_UNIT / 2)) {
rc_repeat(dev); rc_repeat(dev);
IR_dprintk(1, "SANYO repeat last key\n"); dev_dbg(&dev->dev, "SANYO repeat last key\n");
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return 0; return 0;
} }
...@@ -144,20 +144,20 @@ static int ir_sanyo_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -144,20 +144,20 @@ static int ir_sanyo_decode(struct rc_dev *dev, struct ir_raw_event ev)
not_command = bitrev8((data->bits >> 0) & 0xff); not_command = bitrev8((data->bits >> 0) & 0xff);
if ((command ^ not_command) != 0xff) { if ((command ^ not_command) != 0xff) {
IR_dprintk(1, "SANYO checksum error: received 0x%08Lx\n", dev_dbg(&dev->dev, "SANYO checksum error: received 0x%08llx\n",
data->bits); data->bits);
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return 0; return 0;
} }
scancode = address << 8 | command; scancode = address << 8 | command;
IR_dprintk(1, "SANYO scancode: 0x%06x\n", scancode); dev_dbg(&dev->dev, "SANYO scancode: 0x%06x\n", scancode);
rc_keydown(dev, RC_PROTO_SANYO, scancode, 0); rc_keydown(dev, RC_PROTO_SANYO, scancode, 0);
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return 0; return 0;
} }
IR_dprintk(1, "SANYO decode failed at count %d state %d (%uus %s)\n", dev_dbg(&dev->dev, "SANYO decode failed at count %d state %d (%uus %s)\n",
data->count, data->state, TO_US(ev.duration), TO_STR(ev.pulse)); data->count, data->state, TO_US(ev.duration), TO_STR(ev.pulse));
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return -EINVAL; return -EINVAL;
......
...@@ -54,7 +54,7 @@ static int ir_sharp_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -54,7 +54,7 @@ static int ir_sharp_decode(struct rc_dev *dev, struct ir_raw_event ev)
return 0; return 0;
} }
IR_dprintk(2, "Sharp decode started at state %d (%uus %s)\n", dev_dbg(&dev->dev, "Sharp decode started at state %d (%uus %s)\n",
data->state, TO_US(ev.duration), TO_STR(ev.pulse)); data->state, TO_US(ev.duration), TO_STR(ev.pulse));
switch (data->state) { switch (data->state) {
...@@ -149,7 +149,7 @@ static int ir_sharp_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -149,7 +149,7 @@ static int ir_sharp_decode(struct rc_dev *dev, struct ir_raw_event ev)
msg = (data->bits >> 15) & 0x7fff; msg = (data->bits >> 15) & 0x7fff;
echo = data->bits & 0x7fff; echo = data->bits & 0x7fff;
if ((msg ^ echo) != 0x3ff) { if ((msg ^ echo) != 0x3ff) {
IR_dprintk(1, dev_dbg(&dev->dev,
"Sharp checksum error: received 0x%04x, 0x%04x\n", "Sharp checksum error: received 0x%04x, 0x%04x\n",
msg, echo); msg, echo);
break; break;
...@@ -159,16 +159,15 @@ static int ir_sharp_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -159,16 +159,15 @@ static int ir_sharp_decode(struct rc_dev *dev, struct ir_raw_event ev)
command = bitrev8((msg >> 2) & 0xff); command = bitrev8((msg >> 2) & 0xff);
scancode = address << 8 | command; scancode = address << 8 | command;
IR_dprintk(1, "Sharp scancode 0x%04x\n", scancode); dev_dbg(&dev->dev, "Sharp scancode 0x%04x\n", scancode);
rc_keydown(dev, RC_PROTO_SHARP, scancode, 0); rc_keydown(dev, RC_PROTO_SHARP, scancode, 0);
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return 0; return 0;
} }
IR_dprintk(1, "Sharp decode failed at count %d state %d (%uus %s)\n", dev_dbg(&dev->dev, "Sharp decode failed at count %d state %d (%uus %s)\n",
data->count, data->state, TO_US(ev.duration), data->count, data->state, TO_US(ev.duration), TO_STR(ev.pulse));
TO_STR(ev.pulse));
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return -EINVAL; return -EINVAL;
} }
......
...@@ -55,7 +55,7 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -55,7 +55,7 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev)
if (!geq_margin(ev.duration, SONY_UNIT, SONY_UNIT / 2)) if (!geq_margin(ev.duration, SONY_UNIT, SONY_UNIT / 2))
goto out; goto out;
IR_dprintk(2, "Sony decode started at state %d (%uus %s)\n", dev_dbg(&dev->dev, "Sony decode started at state %d (%uus %s)\n",
data->state, TO_US(ev.duration), TO_STR(ev.pulse)); data->state, TO_US(ev.duration), TO_STR(ev.pulse));
switch (data->state) { switch (data->state) {
...@@ -148,18 +148,20 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -148,18 +148,20 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev)
protocol = RC_PROTO_SONY20; protocol = RC_PROTO_SONY20;
break; break;
default: default:
IR_dprintk(1, "Sony invalid bitcount %u\n", data->count); dev_dbg(&dev->dev, "Sony invalid bitcount %u\n",
data->count);
goto out; goto out;
} }
scancode = device << 16 | subdevice << 8 | function; scancode = device << 16 | subdevice << 8 | function;
IR_dprintk(1, "Sony(%u) scancode 0x%05x\n", data->count, scancode); dev_dbg(&dev->dev, "Sony(%u) scancode 0x%05x\n", data->count,
scancode);
rc_keydown(dev, protocol, scancode, 0); rc_keydown(dev, protocol, scancode, 0);
goto finish_state_machine; goto finish_state_machine;
} }
out: out:
IR_dprintk(1, "Sony decode failed at state %d (%uus %s)\n", dev_dbg(&dev->dev, "Sony decode failed at state %d (%uus %s)\n",
data->state, TO_US(ev.duration), TO_STR(ev.pulse)); data->state, TO_US(ev.duration), TO_STR(ev.pulse));
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return -EINVAL; return -EINVAL;
......
...@@ -49,7 +49,7 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -49,7 +49,7 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev)
return 0; return 0;
} }
IR_dprintk(2, "XMP decode started at state %d %d (%uus %s)\n", dev_dbg(&dev->dev, "XMP decode started at state %d %d (%uus %s)\n",
data->state, data->count, TO_US(ev.duration), TO_STR(ev.pulse)); data->state, data->count, TO_US(ev.duration), TO_STR(ev.pulse));
switch (data->state) { switch (data->state) {
...@@ -85,7 +85,7 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -85,7 +85,7 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev)
u32 scancode; u32 scancode;
if (data->count != 16) { if (data->count != 16) {
IR_dprintk(2, "received TRAILER period at index %d: %u\n", dev_dbg(&dev->dev, "received TRAILER period at index %d: %u\n",
data->count, ev.duration); data->count, ev.duration);
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return -EINVAL; return -EINVAL;
...@@ -99,7 +99,8 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -99,7 +99,8 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev)
*/ */
divider = (n[3] - XMP_NIBBLE_PREFIX) / 15 - 2000; divider = (n[3] - XMP_NIBBLE_PREFIX) / 15 - 2000;
if (divider < 50) { if (divider < 50) {
IR_dprintk(2, "divider to small %d.\n", divider); dev_dbg(&dev->dev, "divider to small %d.\n",
divider);
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return -EINVAL; return -EINVAL;
} }
...@@ -113,7 +114,7 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -113,7 +114,7 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev)
n[12] + n[13] + n[14] + n[15]) % 16; n[12] + n[13] + n[14] + n[15]) % 16;
if (sum1 != 15 || sum2 != 15) { if (sum1 != 15 || sum2 != 15) {
IR_dprintk(2, "checksum errors sum1=0x%X sum2=0x%X\n", dev_dbg(&dev->dev, "checksum errors sum1=0x%X sum2=0x%X\n",
sum1, sum2); sum1, sum2);
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return -EINVAL; return -EINVAL;
...@@ -127,24 +128,24 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -127,24 +128,24 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev)
obc1 = n[12] << 4 | n[13]; obc1 = n[12] << 4 | n[13];
obc2 = n[14] << 4 | n[15]; obc2 = n[14] << 4 | n[15];
if (subaddr != subaddr2) { if (subaddr != subaddr2) {
IR_dprintk(2, "subaddress nibbles mismatch 0x%02X != 0x%02X\n", dev_dbg(&dev->dev, "subaddress nibbles mismatch 0x%02X != 0x%02X\n",
subaddr, subaddr2); subaddr, subaddr2);
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return -EINVAL; return -EINVAL;
} }
if (oem != 0x44) if (oem != 0x44)
IR_dprintk(1, "Warning: OEM nibbles 0x%02X. Expected 0x44\n", dev_dbg(&dev->dev, "Warning: OEM nibbles 0x%02X. Expected 0x44\n",
oem); oem);
scancode = addr << 24 | subaddr << 16 | scancode = addr << 24 | subaddr << 16 |
obc1 << 8 | obc2; obc1 << 8 | obc2;
IR_dprintk(1, "XMP scancode 0x%06x\n", scancode); dev_dbg(&dev->dev, "XMP scancode 0x%06x\n", scancode);
if (toggle == 0) { if (toggle == 0) {
rc_keydown(dev, RC_PROTO_XMP, scancode, 0); rc_keydown(dev, RC_PROTO_XMP, scancode, 0);
} else { } else {
rc_repeat(dev); rc_repeat(dev);
IR_dprintk(1, "Repeat last key\n"); dev_dbg(&dev->dev, "Repeat last key\n");
} }
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
...@@ -153,7 +154,7 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -153,7 +154,7 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev)
} else if (geq_margin(ev.duration, XMP_HALFFRAME_SPACE, XMP_NIBBLE_PREFIX)) { } else if (geq_margin(ev.duration, XMP_HALFFRAME_SPACE, XMP_NIBBLE_PREFIX)) {
/* Expect 8 or 16 nibble pulses. 16 in case of 'final' frame */ /* Expect 8 or 16 nibble pulses. 16 in case of 'final' frame */
if (data->count == 16) { if (data->count == 16) {
IR_dprintk(2, "received half frame pulse at index %d. Probably a final frame key-up event: %u\n", dev_dbg(&dev->dev, "received half frame pulse at index %d. Probably a final frame key-up event: %u\n",
data->count, ev.duration); data->count, ev.duration);
/* /*
* TODO: for now go back to half frame position * TODO: for now go back to half frame position
...@@ -164,7 +165,7 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -164,7 +165,7 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev)
} }
else if (data->count != 8) else if (data->count != 8)
IR_dprintk(2, "received half frame pulse at index %d: %u\n", dev_dbg(&dev->dev, "received half frame pulse at index %d: %u\n",
data->count, ev.duration); data->count, ev.duration);
data->state = STATE_LEADER_PULSE; data->state = STATE_LEADER_PULSE;
...@@ -173,7 +174,7 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -173,7 +174,7 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev)
} else if (geq_margin(ev.duration, XMP_NIBBLE_PREFIX, XMP_UNIT)) { } else if (geq_margin(ev.duration, XMP_NIBBLE_PREFIX, XMP_UNIT)) {
/* store nibble raw data, decode after trailer */ /* store nibble raw data, decode after trailer */
if (data->count == 16) { if (data->count == 16) {
IR_dprintk(2, "to many pulses (%d) ignoring: %u\n", dev_dbg(&dev->dev, "to many pulses (%d) ignoring: %u\n",
data->count, ev.duration); data->count, ev.duration);
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return -EINVAL; return -EINVAL;
...@@ -189,7 +190,7 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -189,7 +190,7 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev)
break; break;
} }
IR_dprintk(1, "XMP decode failed at count %d state %d (%uus %s)\n", dev_dbg(&dev->dev, "XMP decode failed at count %d state %d (%uus %s)\n",
data->count, data->state, TO_US(ev.duration), TO_STR(ev.pulse)); data->count, data->state, TO_US(ev.duration), TO_STR(ev.pulse));
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return -EINVAL; return -EINVAL;
......
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