diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-22 11:51:50 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-22 20:05:37 -0200 |
commit | 17c2b1fd71f75a50284a33af9bc0d98ed1cbcd30 (patch) | |
tree | 9f7ee4ec42c7f0a995ac6abda5ee1a2c1fbacad2 | |
parent | 37dbd3a64ed6dd62ab5a49dbfcfae7e8ac0413a9 (diff) | |
download | linux-3.10-17c2b1fd71f75a50284a33af9bc0d98ed1cbcd30.tar.gz linux-3.10-17c2b1fd71f75a50284a33af9bc0d98ed1cbcd30.tar.bz2 linux-3.10-17c2b1fd71f75a50284a33af9bc0d98ed1cbcd30.zip |
[media] mceusb: allow a per-model RC map
Especially when used with Polaris boards, devices may have different
types of remotes shipped. So, we need a per-model rc-map.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
-rw-r--r-- | drivers/media/IR/mceusb.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/media/IR/mceusb.c b/drivers/media/IR/mceusb.c index 712f93f2609..4d4ab7046bf 100644 --- a/drivers/media/IR/mceusb.c +++ b/drivers/media/IR/mceusb.c @@ -123,10 +123,7 @@ struct mceusb_model { u32 tx_mask_inverted:1; u32 is_polaris:1; - /* - * Allow specify a per-board extra data, like - * device names, and per-device rc_maps - */ + const char *rc_map; /* Allow specify a per-board map */ }; static const struct mceusb_model mceusb_model[] = { @@ -147,6 +144,12 @@ static const struct mceusb_model mceusb_model[] = { }, [POLARIS_EVK] = { .is_polaris = 1, + /* + * In fact, the EVK is shipped without + * remotes, but we should have something handy, + * to allow testing it + */ + .rc_map = RC_MAP_RC5_HAUPPAUGE_NEW, }, }; @@ -951,6 +954,7 @@ static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir) struct input_dev *idev; struct ir_dev_props *props; struct device *dev = ir->dev; + const char *rc_map = RC_MAP_RC6_MCE; int ret = -ENODEV; idev = input_allocate_device(); @@ -985,7 +989,10 @@ static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir) ir->props = props; - ret = ir_input_register(idev, RC_MAP_RC6_MCE, props, DRIVER_NAME); + if (mceusb_model[ir->model].rc_map) + rc_map = mceusb_model[ir->model].rc_map; + + ret = ir_input_register(idev, rc_map, props, DRIVER_NAME); if (ret < 0) { dev_err(dev, "remote input device register failed\n"); goto irdev_failed; |