aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-10-22 10:52:53 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-22 18:05:37 -0400
commit3459d4553b95084a6390e9b62687488538f33c57 (patch)
tree2a486ba1f05e4a8a37b5300e9830c3044124b251 /drivers/media
parent17c2b1fd71f75a50284a33af9bc0d98ed1cbcd30 (diff)
[media] mceusb: Allow a per-model device name
It is better to use a per-model device name, especially on multi-function devices like Polaris. So, allow overriding the default name at the mceusb model table. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Jarod Wilson <jarod@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/IR/mceusb.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/IR/mceusb.c b/drivers/media/IR/mceusb.c
index 4d4ab7046bfa..6c3918867257 100644
--- a/drivers/media/IR/mceusb.c
+++ b/drivers/media/IR/mceusb.c
@@ -124,6 +124,7 @@ struct mceusb_model {
124 u32 is_polaris:1; 124 u32 is_polaris:1;
125 125
126 const char *rc_map; /* Allow specify a per-board map */ 126 const char *rc_map; /* Allow specify a per-board map */
127 const char *name; /* per-board name */
127}; 128};
128 129
129static const struct mceusb_model mceusb_model[] = { 130static const struct mceusb_model mceusb_model[] = {
@@ -150,6 +151,7 @@ static const struct mceusb_model mceusb_model[] = {
150 * to allow testing it 151 * to allow testing it
151 */ 152 */
152 .rc_map = RC_MAP_RC5_HAUPPAUGE_NEW, 153 .rc_map = RC_MAP_RC5_HAUPPAUGE_NEW,
154 .name = "cx231xx MCE IR",
153 }, 155 },
154}; 156};
155 157
@@ -955,6 +957,7 @@ static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir)
955 struct ir_dev_props *props; 957 struct ir_dev_props *props;
956 struct device *dev = ir->dev; 958 struct device *dev = ir->dev;
957 const char *rc_map = RC_MAP_RC6_MCE; 959 const char *rc_map = RC_MAP_RC6_MCE;
960 const char *name = "Media Center Ed. eHome Infrared Remote Transceiver";
958 int ret = -ENODEV; 961 int ret = -ENODEV;
959 962
960 idev = input_allocate_device(); 963 idev = input_allocate_device();
@@ -970,8 +973,11 @@ static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir)
970 goto props_alloc_failed; 973 goto props_alloc_failed;
971 } 974 }
972 975
973 snprintf(ir->name, sizeof(ir->name), "Media Center Ed. eHome " 976 if (mceusb_model[ir->model].name)
974 "Infrared Remote Transceiver (%04x:%04x)", 977 name = mceusb_model[ir->model].name;
978
979 snprintf(ir->name, sizeof(ir->name), "%s (%04x:%04x)",
980 name,
975 le16_to_cpu(ir->usbdev->descriptor.idVendor), 981 le16_to_cpu(ir->usbdev->descriptor.idVendor),
976 le16_to_cpu(ir->usbdev->descriptor.idProduct)); 982 le16_to_cpu(ir->usbdev->descriptor.idProduct));
977 983