summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/ir-mce_kbd-decoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/rc/ir-mce_kbd-decoder.c')
-rw-r--r--drivers/media/rc/ir-mce_kbd-decoder.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/media/rc/ir-mce_kbd-decoder.c b/drivers/media/rc/ir-mce_kbd-decoder.c
index 69d6264d54e6..2c3df02e05ff 100644
--- a/drivers/media/rc/ir-mce_kbd-decoder.c
+++ b/drivers/media/rc/ir-mce_kbd-decoder.c
@@ -215,6 +215,7 @@ static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev)
struct mce_kbd_dec *data = &dev->raw->mce_kbd;
u32 scancode;
unsigned long delay;
+ struct lirc_scancode lsc = {};
if (!is_timing_event(ev)) {
if (ev.reset)
@@ -326,18 +327,22 @@ again:
mod_timer(&data->rx_timeout, jiffies + delay);
/* Pass data to keyboard buffer parser */
ir_mce_kbd_process_keyboard_data(data->idev, scancode);
+ lsc.rc_proto = RC_PROTO_MCIR2_KBD;
break;
case MCIR2_MOUSE_NBITS:
scancode = data->body & 0x1fffff;
IR_dprintk(1, "mouse data 0x%06x\n", scancode);
/* Pass data to mouse buffer parser */
ir_mce_kbd_process_mouse_data(data->idev, scancode);
+ lsc.rc_proto = RC_PROTO_MCIR2_MSE;
break;
default:
IR_dprintk(1, "not keyboard or mouse data\n");
goto out;
}
+ lsc.scancode = scancode;
+ ir_lirc_scancode_event(dev, &lsc);
data->state = STATE_INACTIVE;
input_event(data->idev, EV_MSC, MSC_SCAN, scancode);
input_sync(data->idev);
@@ -358,9 +363,6 @@ static int ir_mce_kbd_register(struct rc_dev *dev)
struct input_dev *idev;
int i, ret;
- if (dev->driver_type == RC_DRIVER_IR_RAW_TX)
- return 0;
-
idev = input_allocate_device();
if (!idev)
return -ENOMEM;
@@ -415,9 +417,6 @@ static int ir_mce_kbd_unregister(struct rc_dev *dev)
struct mce_kbd_dec *mce_kbd = &dev->raw->mce_kbd;
struct input_dev *idev = mce_kbd->idev;
- if (dev->driver_type == RC_DRIVER_IR_RAW_TX)
- return 0;
-
del_timer_sync(&mce_kbd->rx_timeout);
input_unregister_device(idev);
@@ -425,7 +424,7 @@ static int ir_mce_kbd_unregister(struct rc_dev *dev)
}
static const struct ir_raw_timings_manchester ir_mce_kbd_timings = {
- .leader = MCIR2_PREFIX_PULSE,
+ .leader_pulse = MCIR2_PREFIX_PULSE,
.invert = 1,
.clock = MCIR2_UNIT,
.trailer_space = MCIR2_UNIT * 10,
@@ -453,11 +452,11 @@ static int ir_mce_kbd_encode(enum rc_proto protocol, u32 scancode,
if (protocol == RC_PROTO_MCIR2_KBD) {
raw = scancode |
((u64)MCIR2_KEYBOARD_HEADER << MCIR2_KEYBOARD_NBITS);
- len = MCIR2_KEYBOARD_NBITS + MCIR2_HEADER_NBITS + 1;
+ len = MCIR2_KEYBOARD_NBITS + MCIR2_HEADER_NBITS;
} else {
raw = scancode |
((u64)MCIR2_MOUSE_HEADER << MCIR2_MOUSE_NBITS);
- len = MCIR2_MOUSE_NBITS + MCIR2_HEADER_NBITS + 1;
+ len = MCIR2_MOUSE_NBITS + MCIR2_HEADER_NBITS;
}
ret = ir_raw_gen_manchester(&e, max, &ir_mce_kbd_timings, len, raw);
@@ -473,6 +472,7 @@ static struct ir_raw_handler mce_kbd_handler = {
.encode = ir_mce_kbd_encode,
.raw_register = ir_mce_kbd_register,
.raw_unregister = ir_mce_kbd_unregister,
+ .carrier = 36000,
};
static int __init ir_mce_kbd_decode_init(void)