Skip to content

Commit

Permalink
[media] dvb_usb_v2: remote controller
Browse files Browse the repository at this point in the history
* remove old legacy code totally
* move default RC keymap definition the the (struct dvb_usb_driver_info)

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Aug 4, 2012
1 parent 43402bb commit 6492167
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 317 deletions.
60 changes: 4 additions & 56 deletions drivers/media/dvb/dvb-usb/dvb_usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,10 @@

struct dvb_usb_driver_info {
const char *name;
const char *rc_map;
const struct dvb_usb_device_properties *props;
};

static inline u8 rc5_custom(struct rc_map_table *key)
{
return (key->scancode >> 8) & 0xff;
}

static inline u8 rc5_data(struct rc_map_table *key)
{
return key->scancode & 0xff;
}

static inline u16 rc5_scan(struct rc_map_table *key)
{
return key->scancode & 0xffff;
}

struct dvb_usb_device;
struct dvb_usb_adapter;
struct usb_data_stream;
Expand Down Expand Up @@ -160,25 +146,6 @@ struct dvb_usb_adapter_properties {
struct dvb_usb_adapter_fe_properties fe[MAX_NO_OF_FE_PER_ADAP];
};

/**
* struct dvb_rc_legacy - old properties of remote controller
* @rc_map_table: a hard-wired array of struct rc_map_table (NULL to disable
* remote control handling).
* @rc_map_size: number of items in @rc_map_table.
* @rc_query: called to query an event event.
* @rc_interval: time in ms between two queries.
*/
struct dvb_rc_legacy {
/* remote control properties */
#define REMOTE_NO_KEY_PRESSED 0x00
#define REMOTE_KEY_PRESSED 0x01
#define REMOTE_KEY_REPEAT 0x02
struct rc_map_table *rc_map_table;
int rc_map_size;
int (*rc_query) (struct dvb_usb_device *, u32 *, int *);
int rc_interval;
};

/**
* struct dvb_rc properties of remote controller, using rc-core
* @rc_codes: name of rc codes table
Expand All @@ -202,17 +169,6 @@ struct dvb_rc {
bool bulk_mode; /* uses bulk mode */
};

/**
* enum dvb_usb_mode - Specifies if it is using a legacy driver or a new one
* based on rc-core
* This is initialized/used only inside dvb-usb-remote.c.
* It shouldn't be set by the drivers.
*/
enum dvb_usb_mode {
DVB_RC_LEGACY,
DVB_RC_CORE,
};

/**
* struct dvb_usb_device_properties - properties of a dvb-usb-device
* @owner: owner of the dvb_adapter
Expand Down Expand Up @@ -283,16 +239,12 @@ struct dvb_usb_device_properties {
int (*identify_state) (struct dvb_usb_device *);
int (*init) (struct dvb_usb_device *);

struct {
enum dvb_usb_mode mode; /* Drivers shouldn't touch on it */
struct dvb_rc_legacy legacy;
struct dvb_rc core;
} rc;

struct i2c_algorithm *i2c_algo;

int generic_bulk_ctrl_endpoint;
int generic_bulk_ctrl_endpoint_response;

struct dvb_rc rc;
};

/**
Expand Down Expand Up @@ -419,7 +371,7 @@ struct dvb_usb_adapter {
struct dvb_usb_device {
struct dvb_usb_device_properties props;
const char *name;

const char *rc_map;
struct usb_device *udev;

#define DVB_USB_STATE_INIT 0x000
Expand Down Expand Up @@ -460,10 +412,6 @@ extern int dvb_usbv2_generic_rw(struct dvb_usb_device *, u8 *, u16, u8 *, u16,
int);
extern int dvb_usbv2_generic_write(struct dvb_usb_device *, u8 *, u16);

/* commonly used remote control parsing */
extern int dvb_usbv2_nec_rc_key_to_event(struct dvb_usb_device *, u8[], u32 *,
int *);

/* commonly used firmware download types and function */
struct hexline {
u8 len;
Expand Down
1 change: 1 addition & 0 deletions drivers/media/dvb/dvb-usb/dvb_usb_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ int dvb_usbv2_device_init(struct usb_interface *intf,

d->udev = udev;
d->name = driver_info->name;
d->rc_map = driver_info->rc_map;
memcpy(&d->props, props, sizeof(struct dvb_usb_device_properties));

if (d->props.size_of_priv > 0) {
Expand Down
Loading

0 comments on commit 6492167

Please sign in to comment.