aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/ir-sony-decoder.c
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2010-10-29 15:08:23 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-29 05:16:37 -0500
commitd8b4b5822f51e2142b731b42c81e3f03eec475b2 (patch)
treefce9a9b7ca5031adc95fbd6be118352fb2527da5 /drivers/media/rc/ir-sony-decoder.c
parent4c7b355df6e7f05304e05f6b7a286e59a5f1cc54 (diff)
[media] ir-core: make struct rc_dev the primary interface
This patch merges the ir_input_dev and ir_dev_props structs into a single struct called rc_dev. The drivers and various functions in rc-core used by the drivers are also changed to use rc_dev as the primary interface when dealing with rc-core. This means that the input_dev is abstracted away from the drivers which is necessary if we ever want to support multiple input devs per rc device. The new API is similar to what the input subsystem uses, i.e: rc_device_alloc() rc_device_free() rc_device_register() rc_device_unregister() [mchehab@redhat.com: Fix compilation on mceusb and cx231xx, due to merge conflicts] Signed-off-by: David Härdeman <david@hardeman.nu> Acked-by: Jarod Wilson <jarod@redhat.com> Tested-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc/ir-sony-decoder.c')
-rw-r--r--drivers/media/rc/ir-sony-decoder.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/media/rc/ir-sony-decoder.c b/drivers/media/rc/ir-sony-decoder.c
index 0a5cadbf9bfb..3138520fb9e7 100644
--- a/drivers/media/rc/ir-sony-decoder.c
+++ b/drivers/media/rc/ir-sony-decoder.c
@@ -33,19 +33,18 @@ enum sony_state {
33 33
34/** 34/**
35 * ir_sony_decode() - Decode one Sony pulse or space 35 * ir_sony_decode() - Decode one Sony pulse or space
36 * @input_dev: the struct input_dev descriptor of the device 36 * @dev: the struct rc_dev descriptor of the device
37 * @ev: the struct ir_raw_event descriptor of the pulse/space 37 * @ev: the struct ir_raw_event descriptor of the pulse/space
38 * 38 *
39 * This function returns -EINVAL if the pulse violates the state machine 39 * This function returns -EINVAL if the pulse violates the state machine
40 */ 40 */
41static int ir_sony_decode(struct input_dev *input_dev, struct ir_raw_event ev) 41static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev)
42{ 42{
43 struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); 43 struct sony_dec *data = &dev->raw->sony;
44 struct sony_dec *data = &ir_dev->raw->sony;
45 u32 scancode; 44 u32 scancode;
46 u8 device, subdevice, function; 45 u8 device, subdevice, function;
47 46
48 if (!(ir_dev->raw->enabled_protocols & IR_TYPE_SONY)) 47 if (!(dev->raw->enabled_protocols & IR_TYPE_SONY))
49 return 0; 48 return 0;
50 49
51 if (!is_timing_event(ev)) { 50 if (!is_timing_event(ev)) {
@@ -144,7 +143,7 @@ static int ir_sony_decode(struct input_dev *input_dev, struct ir_raw_event ev)
144 143
145 scancode = device << 16 | subdevice << 8 | function; 144 scancode = device << 16 | subdevice << 8 | function;
146 IR_dprintk(1, "Sony(%u) scancode 0x%05x\n", data->count, scancode); 145 IR_dprintk(1, "Sony(%u) scancode 0x%05x\n", data->count, scancode);
147 ir_keydown(input_dev, scancode, 0); 146 ir_keydown(dev, scancode, 0);
148 data->state = STATE_INACTIVE; 147 data->state = STATE_INACTIVE;
149 return 0; 148 return 0;
150 } 149 }