From d8b4b5822f51e2142b731b42c81e3f03eec475b2 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Fri, 29 Oct 2010 16:08:23 -0300 Subject: [media] ir-core: make struct rc_dev the primary interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Acked-by: Jarod Wilson Tested-by: Jarod Wilson Signed-off-by: Mauro Carvalho Chehab --- drivers/media/rc/ir-jvc-decoder.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'drivers/media/rc/ir-jvc-decoder.c') diff --git a/drivers/media/rc/ir-jvc-decoder.c b/drivers/media/rc/ir-jvc-decoder.c index d83a5f64bfe4..cfe0e70440a5 100644 --- a/drivers/media/rc/ir-jvc-decoder.c +++ b/drivers/media/rc/ir-jvc-decoder.c @@ -37,17 +37,16 @@ enum jvc_state { /** * ir_jvc_decode() - Decode one JVC pulse or space - * @input_dev: the struct input_dev descriptor of the device + * @dev: the struct rc_dev descriptor of the device * @duration: the struct ir_raw_event descriptor of the pulse/space * * This function returns -EINVAL if the pulse violates the state machine */ -static int ir_jvc_decode(struct input_dev *input_dev, struct ir_raw_event ev) +static int ir_jvc_decode(struct rc_dev *dev, struct ir_raw_event ev) { - struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); - struct jvc_dec *data = &ir_dev->raw->jvc; + struct jvc_dec *data = &dev->raw->jvc; - if (!(ir_dev->raw->enabled_protocols & IR_TYPE_JVC)) + if (!(dev->raw->enabled_protocols & IR_TYPE_JVC)) return 0; if (!is_timing_event(ev)) { @@ -140,12 +139,12 @@ again: scancode = (bitrev8((data->bits >> 8) & 0xff) << 8) | (bitrev8((data->bits >> 0) & 0xff) << 0); IR_dprintk(1, "JVC scancode 0x%04x\n", scancode); - ir_keydown(input_dev, scancode, data->toggle); + ir_keydown(dev, scancode, data->toggle); data->first = false; data->old_bits = data->bits; } else if (data->bits == data->old_bits) { IR_dprintk(1, "JVC repeat\n"); - ir_repeat(input_dev); + ir_repeat(dev); } else { IR_dprintk(1, "JVC invalid repeat msg\n"); break; -- cgit v1.2.3