From 4dd9bb91bb5dc44e3f8c23c60a0ba432e50d7488 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Thu, 3 Apr 2014 20:31:25 -0300 Subject: [media] rc-core: improve ir-kbd-i2c get_key functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The arguments used for ir-kbd-i2c's get_key() functions are not really suited for rc-core and the ir_raw/ir_key distinction is just confusing. Convert all of them to return a protocol/scancode/toggle triple instead. Signed-off-by: David Härdeman Signed-off-by: Mauro Carvalho Chehab --- drivers/media/pci/ivtv/ivtv-i2c.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/media/pci/ivtv/ivtv-i2c.c') diff --git a/drivers/media/pci/ivtv/ivtv-i2c.c b/drivers/media/pci/ivtv/ivtv-i2c.c index ceed2d87abfd..1a41ba5c7d30 100644 --- a/drivers/media/pci/ivtv/ivtv-i2c.c +++ b/drivers/media/pci/ivtv/ivtv-i2c.c @@ -148,7 +148,8 @@ static const char * const hw_devicenames[] = { "ir_video", /* IVTV_HW_I2C_IR_RX_ADAPTEC */ }; -static int get_key_adaptec(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) +static int get_key_adaptec(struct IR_i2c *ir, enum rc_type *protocol, + u32 *scancode, u8 *toggle) { unsigned char keybuf[4]; @@ -167,9 +168,9 @@ static int get_key_adaptec(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) keybuf[2] &= 0x7f; keybuf[3] |= 0x80; - *ir_key = keybuf[3] | keybuf[2] << 8 | keybuf[1] << 16 |keybuf[0] << 24; - *ir_raw = *ir_key; - + *protocol = RC_TYPE_UNKNOWN; + *scancode = keybuf[3] | keybuf[2] << 8 | keybuf[1] << 16 |keybuf[0] << 24; + *toggle = 0; return 1; } -- cgit