Skip to content

Commit

Permalink
V4L/DVB: dvb-usb: get rid of struct dvb_usb_rc_key
Browse files Browse the repository at this point in the history
dvb-usb has its own IR handle code. Now that we have a Remote
Controller subsystem, we should start using it. So, remove this
struct, in favor of the similar struct defined at the RC subsystem.

This is a big, but trivial patch. It is a 3 line delect, plus
lots of rename on several dvb-usb files.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Mauro Carvalho Chehab committed Aug 2, 2010
1 parent 0172fea commit 34abf21
Show file tree
Hide file tree
Showing 23 changed files with 90 additions and 100 deletions.
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/a800.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static int a800_identify_state(struct usb_device *udev, struct dvb_usb_device_pr
return 0;
}

static struct dvb_usb_rc_key ir_codes_a800_table[] = {
static struct ir_scancode ir_codes_a800_table[] = {
{ 0x0201, KEY_PROG1 }, /* SOURCE */
{ 0x0200, KEY_POWER }, /* POWER */
{ 0x0205, KEY_1 }, /* 1 */
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/dvb/dvb-usb/af9005-remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ MODULE_PARM_DESC(debug,

#define deb_decode(args...) dprintk(dvb_usb_af9005_remote_debug,0x01,args)

struct dvb_usb_rc_key ir_codes_af9005_table[] = {
struct ir_scancode ir_codes_af9005_table[] = {

{0x01b7, KEY_POWER},
{0x01a7, KEY_VOLUMEUP},
Expand Down Expand Up @@ -133,7 +133,7 @@ int af9005_rc_decode(struct dvb_usb_device *d, u8 * data, int len, u32 * event,
for (i = 0; i < ir_codes_af9005_table_size; i++) {
if (rc5_custom(&ir_codes_af9005_table[i]) == cust
&& rc5_data(&ir_codes_af9005_table[i]) == dat) {
*event = ir_codes_af9005_table[i].event;
*event = ir_codes_af9005_table[i].keycode;
*state = REMOTE_KEY_PRESSED;
deb_decode
("key pressed, event %x\n", *event);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/af9005.h
Original file line number Diff line number Diff line change
Expand Up @@ -3490,7 +3490,7 @@ extern u8 regmask[8];
/* remote control decoder */
extern int af9005_rc_decode(struct dvb_usb_device *d, u8 * data, int len,
u32 * event, int *state);
extern struct dvb_usb_rc_key ir_codes_af9005_table[];
extern struct ir_scancode ir_codes_af9005_table[];
extern int ir_codes_af9005_table_size;

#endif
6 changes: 3 additions & 3 deletions drivers/media/dvb/dvb-usb/af9015.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ static int af9015_download_firmware(struct usb_device *udev,

struct af9015_setup {
unsigned int id;
struct dvb_usb_rc_key *rc_key_map;
struct ir_scancode *rc_key_map;
unsigned int rc_key_map_size;
u8 *ir_table;
unsigned int ir_table_size;
Expand Down Expand Up @@ -1063,7 +1063,7 @@ static int af9015_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
{
u8 buf[8];
struct req_t req = {GET_IR_CODE, 0, 0, 0, 0, sizeof(buf), buf};
struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
struct ir_scancode *keymap = d->props.rc_key_map;
int i, ret;

memset(buf, 0, sizeof(buf));
Expand All @@ -1078,7 +1078,7 @@ static int af9015_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
for (i = 0; i < d->props.rc_key_map_size; i++) {
if (!buf[1] && rc5_custom(&keymap[i]) == buf[0] &&
rc5_data(&keymap[i]) == buf[2]) {
*event = keymap[i].event;
*event = keymap[i].keycode;
*state = REMOTE_KEY_PRESSED;
break;
}
Expand Down
18 changes: 9 additions & 9 deletions drivers/media/dvb/dvb-usb/af9015.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ enum af9015_remote {

/* LeadTek - Y04G0051 */
/* Leadtek WinFast DTV Dongle Gold */
static struct dvb_usb_rc_key ir_codes_af9015_table_leadtek[] = {
static struct ir_scancode ir_codes_af9015_table_leadtek[] = {
{ 0x001e, KEY_1 },
{ 0x001f, KEY_2 },
{ 0x0020, KEY_3 },
Expand Down Expand Up @@ -227,7 +227,7 @@ static u8 af9015_ir_table_leadtek[] = {
};

/* TwinHan AzureWave AD-TU700(704J) */
static struct dvb_usb_rc_key ir_codes_af9015_table_twinhan[] = {
static struct ir_scancode ir_codes_af9015_table_twinhan[] = {
{ 0x053f, KEY_POWER },
{ 0x0019, KEY_FAVORITES }, /* Favorite List */
{ 0x0004, KEY_TEXT }, /* Teletext */
Expand Down Expand Up @@ -338,7 +338,7 @@ static u8 af9015_ir_table_twinhan[] = {
};

/* A-Link DTU(m) */
static struct dvb_usb_rc_key ir_codes_af9015_table_a_link[] = {
static struct ir_scancode ir_codes_af9015_table_a_link[] = {
{ 0x001e, KEY_1 },
{ 0x001f, KEY_2 },
{ 0x0020, KEY_3 },
Expand Down Expand Up @@ -381,7 +381,7 @@ static u8 af9015_ir_table_a_link[] = {
};

/* MSI DIGIVOX mini II V3.0 */
static struct dvb_usb_rc_key ir_codes_af9015_table_msi[] = {
static struct ir_scancode ir_codes_af9015_table_msi[] = {
{ 0x001e, KEY_1 },
{ 0x001f, KEY_2 },
{ 0x0020, KEY_3 },
Expand Down Expand Up @@ -424,7 +424,7 @@ static u8 af9015_ir_table_msi[] = {
};

/* MYGICTV U718 */
static struct dvb_usb_rc_key ir_codes_af9015_table_mygictv[] = {
static struct ir_scancode ir_codes_af9015_table_mygictv[] = {
{ 0x003d, KEY_SWITCHVIDEOMODE },
/* TV / AV */
{ 0x0545, KEY_POWER },
Expand Down Expand Up @@ -550,7 +550,7 @@ static u8 af9015_ir_table_kworld[] = {
};

/* AverMedia Volar X */
static struct dvb_usb_rc_key ir_codes_af9015_table_avermedia[] = {
static struct ir_scancode ir_codes_af9015_table_avermedia[] = {
{ 0x053d, KEY_PROG1 }, /* SOURCE */
{ 0x0512, KEY_POWER }, /* POWER */
{ 0x051e, KEY_1 }, /* 1 */
Expand Down Expand Up @@ -656,7 +656,7 @@ static u8 af9015_ir_table_avermedia_ks[] = {
};

/* Digittrade DVB-T USB Stick */
static struct dvb_usb_rc_key ir_codes_af9015_table_digittrade[] = {
static struct ir_scancode ir_codes_af9015_table_digittrade[] = {
{ 0x010f, KEY_LAST }, /* RETURN */
{ 0x0517, KEY_TEXT }, /* TELETEXT */
{ 0x0108, KEY_EPG }, /* EPG */
Expand Down Expand Up @@ -719,7 +719,7 @@ static u8 af9015_ir_table_digittrade[] = {
};

/* TREKSTOR DVB-T USB Stick */
static struct dvb_usb_rc_key ir_codes_af9015_table_trekstor[] = {
static struct ir_scancode ir_codes_af9015_table_trekstor[] = {
{ 0x0704, KEY_AGAIN }, /* Home */
{ 0x0705, KEY_MUTE }, /* Mute */
{ 0x0706, KEY_UP }, /* Up */
Expand Down Expand Up @@ -782,7 +782,7 @@ static u8 af9015_ir_table_trekstor[] = {
};

/* MSI DIGIVOX mini III */
static struct dvb_usb_rc_key ir_codes_af9015_table_msi_digivox_iii[] = {
static struct ir_scancode ir_codes_af9015_table_msi_digivox_iii[] = {
{ 0x0713, KEY_POWER }, /* [red power button] */
{ 0x073b, KEY_VIDEO }, /* Source */
{ 0x073e, KEY_ZOOM }, /* Zoom */
Expand Down
6 changes: 3 additions & 3 deletions drivers/media/dvb/dvb-usb/anysee.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
static int anysee_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
{
u8 buf[] = {CMD_GET_IR_CODE};
struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
struct ir_scancode *keymap = d->props.rc_key_map;
u8 ircode[2];
int i, ret;

Expand All @@ -391,15 +391,15 @@ static int anysee_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
for (i = 0; i < d->props.rc_key_map_size; i++) {
if (rc5_custom(&keymap[i]) == ircode[0] &&
rc5_data(&keymap[i]) == ircode[1]) {
*event = keymap[i].event;
*event = keymap[i].keycode;
*state = REMOTE_KEY_PRESSED;
return 0;
}
}
return 0;
}

static struct dvb_usb_rc_key ir_codes_anysee_table[] = {
static struct ir_scancode ir_codes_anysee_table[] = {
{ 0x0100, KEY_0 },
{ 0x0101, KEY_1 },
{ 0x0102, KEY_2 },
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/az6027.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ static int az6027_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
}

/* keys for the enclosed remote control */
static struct dvb_usb_rc_key ir_codes_az6027_table[] = {
static struct ir_scancode ir_codes_az6027_table[] = {
{ 0x01, KEY_1 },
{ 0x02, KEY_2 },
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/cinergyT2-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static int cinergyt2_frontend_attach(struct dvb_usb_adapter *adap)
return 0;
}

static struct dvb_usb_rc_key ir_codes_cinergyt2_table[] = {
static struct ir_scancode ir_codes_cinergyt2_table[] = {
{ 0x0401, KEY_POWER },
{ 0x0402, KEY_1 },
{ 0x0403, KEY_2 },
Expand Down
18 changes: 9 additions & 9 deletions drivers/media/dvb/dvb-usb/cxusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ static int cxusb_d680_dmb_streaming_ctrl(

static int cxusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
{
struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
struct ir_scancode *keymap = d->props.rc_key_map;
u8 ircode[4];
int i;

Expand All @@ -397,7 +397,7 @@ static int cxusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
for (i = 0; i < d->props.rc_key_map_size; i++) {
if (rc5_custom(&keymap[i]) == ircode[2] &&
rc5_data(&keymap[i]) == ircode[3]) {
*event = keymap[i].event;
*event = keymap[i].keycode;
*state = REMOTE_KEY_PRESSED;

return 0;
Expand All @@ -410,7 +410,7 @@ static int cxusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
static int cxusb_bluebird2_rc_query(struct dvb_usb_device *d, u32 *event,
int *state)
{
struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
struct ir_scancode *keymap = d->props.rc_key_map;
u8 ircode[4];
int i;
struct i2c_msg msg = { .addr = 0x6b, .flags = I2C_M_RD,
Expand All @@ -425,7 +425,7 @@ static int cxusb_bluebird2_rc_query(struct dvb_usb_device *d, u32 *event,
for (i = 0; i < d->props.rc_key_map_size; i++) {
if (rc5_custom(&keymap[i]) == ircode[1] &&
rc5_data(&keymap[i]) == ircode[2]) {
*event = keymap[i].event;
*event = keymap[i].keycode;
*state = REMOTE_KEY_PRESSED;

return 0;
Expand All @@ -438,7 +438,7 @@ static int cxusb_bluebird2_rc_query(struct dvb_usb_device *d, u32 *event,
static int cxusb_d680_dmb_rc_query(struct dvb_usb_device *d, u32 *event,
int *state)
{
struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
struct ir_scancode *keymap = d->props.rc_key_map;
u8 ircode[2];
int i;

Expand All @@ -451,7 +451,7 @@ static int cxusb_d680_dmb_rc_query(struct dvb_usb_device *d, u32 *event,
for (i = 0; i < d->props.rc_key_map_size; i++) {
if (rc5_custom(&keymap[i]) == ircode[0] &&
rc5_data(&keymap[i]) == ircode[1]) {
*event = keymap[i].event;
*event = keymap[i].keycode;
*state = REMOTE_KEY_PRESSED;

return 0;
Expand All @@ -461,7 +461,7 @@ static int cxusb_d680_dmb_rc_query(struct dvb_usb_device *d, u32 *event,
return 0;
}

static struct dvb_usb_rc_key ir_codes_dvico_mce_table[] = {
static struct ir_scancode ir_codes_dvico_mce_table[] = {
{ 0xfe02, KEY_TV },
{ 0xfe0e, KEY_MP3 },
{ 0xfe1a, KEY_DVD },
Expand Down Expand Up @@ -509,7 +509,7 @@ static struct dvb_usb_rc_key ir_codes_dvico_mce_table[] = {
{ 0xfe4e, KEY_POWER },
};

static struct dvb_usb_rc_key ir_codes_dvico_portable_table[] = {
static struct ir_scancode ir_codes_dvico_portable_table[] = {
{ 0xfc02, KEY_SETUP }, /* Profile */
{ 0xfc43, KEY_POWER2 },
{ 0xfc06, KEY_EPG },
Expand Down Expand Up @@ -548,7 +548,7 @@ static struct dvb_usb_rc_key ir_codes_dvico_portable_table[] = {
{ 0xfc00, KEY_UNKNOWN }, /* HD */
};

static struct dvb_usb_rc_key ir_codes_d680_dmb_table[] = {
static struct ir_scancode ir_codes_d680_dmb_table[] = {
{ 0x0038, KEY_UNKNOWN }, /* TV/AV */
{ 0x080c, KEY_ZOOM },
{ 0x0800, KEY_0 },
Expand Down
8 changes: 4 additions & 4 deletions drivers/media/dvb/dvb-usb/dib0700_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ struct dib0700_rc_response {
static void dib0700_rc_urb_completion(struct urb *purb)
{
struct dvb_usb_device *d = purb->context;
struct dvb_usb_rc_key *keymap;
struct ir_scancode *keymap;
struct dib0700_state *st;
struct dib0700_rc_response poll_reply;
u8 *buf;
Expand Down Expand Up @@ -574,7 +574,7 @@ static void dib0700_rc_urb_completion(struct urb *purb)
for (i = 0; i < d->props.rc_key_map_size; i++) {
if (rc5_custom(&keymap[i]) == (poll_reply.system & 0xff) &&
rc5_data(&keymap[i]) == poll_reply.data) {
event = keymap[i].event;
event = keymap[i].keycode;
found = 1;
break;
}
Expand All @@ -590,9 +590,9 @@ static void dib0700_rc_urb_completion(struct urb *purb)
if (poll_reply.data_state == 1) {
/* New key hit */
st->rc_counter = 0;
event = keymap[i].event;
event = keymap[i].keycode;
state = REMOTE_KEY_PRESSED;
d->last_event = keymap[i].event;
d->last_event = keymap[i].keycode;
} else if (poll_reply.data_state == 2) {
/* Key repeated */
st->rc_counter++;
Expand Down
14 changes: 7 additions & 7 deletions drivers/media/dvb/dvb-usb/dib0700_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
{
u8 key[4];
int i;
struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
struct ir_scancode *keymap = d->props.rc_key_map;
struct dib0700_state *st = d->priv;

*event = 0;
Expand Down Expand Up @@ -521,9 +521,9 @@ static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
if (rc5_custom(&keymap[i]) == key[3-2] &&
rc5_data(&keymap[i]) == key[3-3]) {
st->rc_counter = 0;
*event = keymap[i].event;
*event = keymap[i].keycode;
*state = REMOTE_KEY_PRESSED;
d->last_event = keymap[i].event;
d->last_event = keymap[i].keycode;
return 0;
}
}
Expand All @@ -534,7 +534,7 @@ static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
for (i = 0; i < d->props.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].event &&
if (d->last_event == keymap[i].keycode &&
key[3-1] == st->rc_toggle) {
st->rc_counter++;
/* prevents unwanted double hits */
Expand All @@ -547,10 +547,10 @@ static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
return 0;
}
st->rc_counter = 0;
*event = keymap[i].event;
*event = keymap[i].keycode;
*state = REMOTE_KEY_PRESSED;
st->rc_toggle = key[3-1];
d->last_event = keymap[i].event;
d->last_event = keymap[i].keycode;
return 0;
}
}
Expand All @@ -562,7 +562,7 @@ static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
return 0;
}

static struct dvb_usb_rc_key ir_codes_dib0700_table[] = {
static struct ir_scancode ir_codes_dib0700_table[] = {
/* Key codes for the tiny Pinnacle remote*/
{ 0x0700, KEY_MUTE },
{ 0x0701, KEY_MENU }, /* Pinnacle logo */
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/dibusb-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ EXPORT_SYMBOL(dibusb_dib3000mc_tuner_attach);
/*
* common remote control stuff
*/
struct dvb_usb_rc_key ir_codes_dibusb_table[] = {
struct ir_scancode ir_codes_dibusb_table[] = {
/* Key codes for the little Artec T1/Twinhan/HAMA/ remote. */
{ 0x0016, KEY_POWER },
{ 0x0010, KEY_MUTE },
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/dibusb.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ extern int dibusb2_0_power_ctrl(struct dvb_usb_device *, int);
#define DEFAULT_RC_INTERVAL 150
//#define DEFAULT_RC_INTERVAL 100000

extern struct dvb_usb_rc_key ir_codes_dibusb_table[];
extern struct ir_scancode ir_codes_dibusb_table[];
extern int dibusb_rc_query(struct dvb_usb_device *, u32 *, int *);
extern int dibusb_read_eeprom_byte(struct dvb_usb_device *, u8, u8 *);

Expand Down
4 changes: 2 additions & 2 deletions drivers/media/dvb/dvb-usb/digitv.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ static int digitv_tuner_attach(struct dvb_usb_adapter *adap)
return 0;
}

static struct dvb_usb_rc_key ir_codes_digitv_table[] = {
static struct ir_scancode ir_codes_digitv_table[] = {
{ 0x5f55, KEY_0 },
{ 0x6f55, KEY_1 },
{ 0x9f55, KEY_2 },
Expand Down Expand Up @@ -240,7 +240,7 @@ static int digitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
for (i = 0; i < d->props.rc_key_map_size; i++) {
if (rc5_custom(&d->props.rc_key_map[i]) == key[1] &&
rc5_data(&d->props.rc_key_map[i]) == key[2]) {
*event = d->props.rc_key_map[i].event;
*event = d->props.rc_key_map[i].keycode;
*state = REMOTE_KEY_PRESSED;
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/dtt200u.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static int dtt200u_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid,

/* remote control */
/* key list for the tiny remote control (Yakumo, don't know about the others) */
static struct dvb_usb_rc_key ir_codes_dtt200u_table[] = {
static struct ir_scancode ir_codes_dtt200u_table[] = {
{ 0x8001, KEY_MUTE },
{ 0x8002, KEY_CHANNELDOWN },
{ 0x8003, KEY_VOLUMEDOWN },
Expand Down
Loading

0 comments on commit 34abf21

Please sign in to comment.