diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-07-31 18:04:09 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 16:43:45 -0300 |
commit | f72a27b8ed4458bb9f7203408441d27382bc93f4 (patch) | |
tree | 667c20a22af36fecdfb770384afb3ef85a9578e2 /drivers/media/dvb/dvb-usb/dib0700_devices.c | |
parent | 34abf2194499571b2efa6b4aface8c0ea0c47ce1 (diff) |
V4L/DVB: dvb-usb: prepare drivers for using rc-core
This is a big patch, yet trivial. It just move the RC properties
to a separate struct, in order to prepare the dvb-usb drivers to
use rc-core. There's no change on the behavior of the drivers.
With this change, it is possible to have both legacy and rc-core
based code inside the dvb-usb-remote, allowing a gradual migration
to rc-core, driver per driver.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dib0700_devices.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dib0700_devices.c | 142 |
1 files changed, 83 insertions, 59 deletions
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c index 0c9adbbcedb..2ae74ba3acb 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_devices.c +++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c @@ -477,7 +477,7 @@ static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state) { u8 key[4]; int i; - struct ir_scancode *keymap = d->props.rc_key_map; + struct ir_scancode *keymap = d->props.rc.legacy.rc_key_map; struct dib0700_state *st = d->priv; *event = 0; @@ -517,7 +517,7 @@ static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state) } return 0; } - for (i=0;i<d->props.rc_key_map_size; i++) { + for (i=0;i<d->props.rc.legacy.rc_key_map_size; i++) { if (rc5_custom(&keymap[i]) == key[3-2] && rc5_data(&keymap[i]) == key[3-3]) { st->rc_counter = 0; @@ -531,7 +531,7 @@ static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state) } default: { /* RC-5 protocol changes toggle bit on new keypress */ - for (i = 0; i < d->props.rc_key_map_size; i++) { + for (i = 0; i < d->props.rc.legacy.rc_key_map_size; i++) { if (rc5_custom(&keymap[i]) == key[3-2] && rc5_data(&keymap[i]) == key[3-3]) { if (d->last_event == keymap[i].keycode && @@ -2168,10 +2168,12 @@ struct dvb_usb_device_properties dib0700_devices[] = { } }, - .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = ir_codes_dib0700_table, - .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), - .rc_query = dib0700_rc_query + .rc.legacy = { + .rc_interval = DEFAULT_RC_INTERVAL, + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), + .rc_query = dib0700_rc_query + }, }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, .num_adapters = 2, @@ -2197,10 +2199,12 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, }, - .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = ir_codes_dib0700_table, - .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), - .rc_query = dib0700_rc_query + .rc.legacy = { + .rc_interval = DEFAULT_RC_INTERVAL, + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), + .rc_query = dib0700_rc_query + }, }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, .num_adapters = 2, @@ -2251,11 +2255,12 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, - .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = ir_codes_dib0700_table, - .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), - .rc_query = dib0700_rc_query - + .rc.legacy = { + .rc_interval = DEFAULT_RC_INTERVAL, + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), + .rc_query = dib0700_rc_query + }, }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, .num_adapters = 1, @@ -2288,10 +2293,12 @@ struct dvb_usb_device_properties dib0700_devices[] = { } }, - .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = ir_codes_dib0700_table, - .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), - .rc_query = dib0700_rc_query + .rc.legacy = { + .rc_interval = DEFAULT_RC_INTERVAL, + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), + .rc_query = dib0700_rc_query + }, }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, .num_adapters = 1, @@ -2358,11 +2365,12 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, }, - .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = ir_codes_dib0700_table, - .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), - .rc_query = dib0700_rc_query - + .rc.legacy = { + .rc_interval = DEFAULT_RC_INTERVAL, + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), + .rc_query = dib0700_rc_query + }, }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, .num_adapters = 1, @@ -2397,11 +2405,12 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, }, - .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = ir_codes_dib0700_table, - .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), - .rc_query = dib0700_rc_query - + .rc.legacy = { + .rc_interval = DEFAULT_RC_INTERVAL, + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), + .rc_query = dib0700_rc_query + }, }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, .num_adapters = 2, @@ -2463,10 +2472,13 @@ struct dvb_usb_device_properties dib0700_devices[] = { { NULL }, }, }, - .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = ir_codes_dib0700_table, - .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), - .rc_query = dib0700_rc_query + + .rc.legacy = { + .rc_interval = DEFAULT_RC_INTERVAL, + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), + .rc_query = dib0700_rc_query + }, }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, .num_adapters = 1, @@ -2525,10 +2537,13 @@ struct dvb_usb_device_properties dib0700_devices[] = { { NULL }, }, }, - .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = ir_codes_dib0700_table, - .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), - .rc_query = dib0700_rc_query + + .rc.legacy = { + .rc_interval = DEFAULT_RC_INTERVAL, + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), + .rc_query = dib0700_rc_query + }, }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, .num_adapters = 1, .adapter = { @@ -2554,10 +2569,12 @@ struct dvb_usb_device_properties dib0700_devices[] = { { NULL }, }, }, - .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = ir_codes_dib0700_table, - .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), - .rc_query = dib0700_rc_query + .rc.legacy = { + .rc_interval = DEFAULT_RC_INTERVAL, + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), + .rc_query = dib0700_rc_query + }, }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, .num_adapters = 1, .adapter = { @@ -2615,10 +2632,12 @@ struct dvb_usb_device_properties dib0700_devices[] = { { NULL }, }, }, - .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = ir_codes_dib0700_table, - .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), - .rc_query = dib0700_rc_query + .rc.legacy = { + .rc_interval = DEFAULT_RC_INTERVAL, + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), + .rc_query = dib0700_rc_query + }, }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, .num_adapters = 1, .adapter = { @@ -2653,11 +2672,12 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, }, - .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = ir_codes_dib0700_table, - .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), - .rc_query = dib0700_rc_query - + .rc.legacy = { + .rc_interval = DEFAULT_RC_INTERVAL, + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), + .rc_query = dib0700_rc_query + }, }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, .num_adapters = 2, .adapter = { @@ -2697,10 +2717,12 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, }, - .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = ir_codes_dib0700_table, - .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), - .rc_query = dib0700_rc_query + .rc.legacy = { + .rc_interval = DEFAULT_RC_INTERVAL, + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), + .rc_query = dib0700_rc_query + }, }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, .num_adapters = 1, .adapter = { @@ -2728,10 +2750,12 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, }, - .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = ir_codes_dib0700_table, - .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), - .rc_query = dib0700_rc_query + .rc.legacy = { + .rc_interval = DEFAULT_RC_INTERVAL, + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), + .rc_query = dib0700_rc_query + }, }, }; |