[PATCH 2/3] mceusb: allow a per-model RC map

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>

diff --git a/drivers/media/IR/mceusb.c b/drivers/media/IR/mceusb.c
index 9143ab6..e72bfa1 100644
--- a/drivers/media/IR/mceusb.c
+++ b/drivers/media/IR/mceusb.c
@@ -125,10 +125,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[] = {
@@ -152,6 +149,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,
 	},
 };
 
@@ -956,6 +959,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();
@@ -990,7 +994,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;
-- 
1.7.1


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux