diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-22 10:51:50 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-22 18:05:37 -0400 |
commit | 17c2b1fd71f75a50284a33af9bc0d98ed1cbcd30 (patch) | |
tree | 9f7ee4ec42c7f0a995ac6abda5ee1a2c1fbacad2 /drivers/media/IR | |
parent | 37dbd3a64ed6dd62ab5a49dbfcfae7e8ac0413a9 (diff) |
[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>
Diffstat (limited to 'drivers/media/IR')
-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 712f93f26093..4d4ab7046bfa 100644 --- a/drivers/media/IR/mceusb.c +++ b/drivers/media/IR/mceusb.c | |||
@@ -123,10 +123,7 @@ struct mceusb_model { | |||
123 | u32 tx_mask_inverted:1; | 123 | u32 tx_mask_inverted:1; |
124 | u32 is_polaris:1; | 124 | u32 is_polaris:1; |
125 | 125 | ||
126 | /* | 126 | const char *rc_map; /* Allow specify a per-board map */ |
127 | * Allow specify a per-board extra data, like | ||
128 | * device names, and per-device rc_maps | ||
129 | */ | ||
130 | }; | 127 | }; |
131 | 128 | ||
132 | static const struct mceusb_model mceusb_model[] = { | 129 | static const struct mceusb_model mceusb_model[] = { |
@@ -147,6 +144,12 @@ static const struct mceusb_model mceusb_model[] = { | |||
147 | }, | 144 | }, |
148 | [POLARIS_EVK] = { | 145 | [POLARIS_EVK] = { |
149 | .is_polaris = 1, | 146 | .is_polaris = 1, |
147 | /* | ||
148 | * In fact, the EVK is shipped without | ||
149 | * remotes, but we should have something handy, | ||
150 | * to allow testing it | ||
151 | */ | ||
152 | .rc_map = RC_MAP_RC5_HAUPPAUGE_NEW, | ||
150 | }, | 153 | }, |
151 | }; | 154 | }; |
152 | 155 | ||
@@ -951,6 +954,7 @@ static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir) | |||
951 | struct input_dev *idev; | 954 | struct input_dev *idev; |
952 | struct ir_dev_props *props; | 955 | struct ir_dev_props *props; |
953 | struct device *dev = ir->dev; | 956 | struct device *dev = ir->dev; |
957 | const char *rc_map = RC_MAP_RC6_MCE; | ||
954 | int ret = -ENODEV; | 958 | int ret = -ENODEV; |
955 | 959 | ||
956 | idev = input_allocate_device(); | 960 | idev = input_allocate_device(); |
@@ -985,7 +989,10 @@ static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir) | |||
985 | 989 | ||
986 | ir->props = props; | 990 | ir->props = props; |
987 | 991 | ||
988 | ret = ir_input_register(idev, RC_MAP_RC6_MCE, props, DRIVER_NAME); | 992 | if (mceusb_model[ir->model].rc_map) |
993 | rc_map = mceusb_model[ir->model].rc_map; | ||
994 | |||
995 | ret = ir_input_register(idev, rc_map, props, DRIVER_NAME); | ||
989 | if (ret < 0) { | 996 | if (ret < 0) { |
990 | dev_err(dev, "remote input device register failed\n"); | 997 | dev_err(dev, "remote input device register failed\n"); |
991 | goto irdev_failed; | 998 | goto irdev_failed; |