aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/ir-nec-decoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/rc/ir-nec-decoder.c')
-rw-r--r--drivers/media/rc/ir-nec-decoder.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/media/rc/ir-nec-decoder.c b/drivers/media/rc/ir-nec-decoder.c
index cad4e994aa7..8ff157a140c 100644
--- a/drivers/media/rc/ir-nec-decoder.c
+++ b/drivers/media/rc/ir-nec-decoder.c
@@ -39,19 +39,18 @@ enum nec_state {
39 39
40/** 40/**
41 * ir_nec_decode() - Decode one NEC pulse or space 41 * ir_nec_decode() - Decode one NEC pulse or space
42 * @input_dev: the struct input_dev descriptor of the device 42 * @dev: the struct rc_dev descriptor of the device
43 * @duration: the struct ir_raw_event descriptor of the pulse/space 43 * @duration: the struct ir_raw_event descriptor of the pulse/space
44 * 44 *
45 * This function returns -EINVAL if the pulse violates the state machine 45 * This function returns -EINVAL if the pulse violates the state machine
46 */ 46 */
47static int ir_nec_decode(struct input_dev *input_dev, struct ir_raw_event ev) 47static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
48{ 48{
49 struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); 49 struct nec_dec *data = &dev->raw->nec;
50 struct nec_dec *data = &ir_dev->raw->nec;
51 u32 scancode; 50 u32 scancode;
52 u8 address, not_address, command, not_command; 51 u8 address, not_address, command, not_command;
53 52
54 if (!(ir_dev->raw->enabled_protocols & IR_TYPE_NEC)) 53 if (!(dev->raw->enabled_protocols & IR_TYPE_NEC))
55 return 0; 54 return 0;
56 55
57 if (!is_timing_event(ev)) { 56 if (!is_timing_event(ev)) {
@@ -89,7 +88,7 @@ static int ir_nec_decode(struct input_dev *input_dev, struct ir_raw_event ev)
89 data->state = STATE_BIT_PULSE; 88 data->state = STATE_BIT_PULSE;
90 return 0; 89 return 0;
91 } else if (eq_margin(ev.duration, NEC_REPEAT_SPACE, NEC_UNIT / 2)) { 90 } else if (eq_margin(ev.duration, NEC_REPEAT_SPACE, NEC_UNIT / 2)) {
92 ir_repeat(input_dev); 91 ir_repeat(dev);
93 IR_dprintk(1, "Repeat last key\n"); 92 IR_dprintk(1, "Repeat last key\n");
94 data->state = STATE_TRAILER_PULSE; 93 data->state = STATE_TRAILER_PULSE;
95 return 0; 94 return 0;
@@ -115,7 +114,7 @@ static int ir_nec_decode(struct input_dev *input_dev, struct ir_raw_event ev)
115 geq_margin(ev.duration, 114 geq_margin(ev.duration,
116 NEC_TRAILER_SPACE, NEC_UNIT / 2)) { 115 NEC_TRAILER_SPACE, NEC_UNIT / 2)) {
117 IR_dprintk(1, "Repeat last key\n"); 116 IR_dprintk(1, "Repeat last key\n");
118 ir_repeat(input_dev); 117 ir_repeat(dev);
119 data->state = STATE_INACTIVE; 118 data->state = STATE_INACTIVE;
120 return 0; 119 return 0;
121 120
@@ -179,7 +178,7 @@ static int ir_nec_decode(struct input_dev *input_dev, struct ir_raw_event ev)
179 if (data->is_nec_x) 178 if (data->is_nec_x)
180 data->necx_repeat = true; 179 data->necx_repeat = true;
181 180
182 ir_keydown(input_dev, scancode, 0); 181 ir_keydown(dev, scancode, 0);
183 data->state = STATE_INACTIVE; 182 data->state = STATE_INACTIVE;
184 return 0; 183 return 0;
185 } 184 }