From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: jarod@redhat.com
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: [PATCH 2/3] mceusb: allow a per-model RC map
Date: Fri, 22 Oct 2010 11:25:27 -0200 [thread overview]
Message-ID: <20101022112527.7104b849@pedra> (raw)
In-Reply-To: <cover.1287753463.git.mchehab@redhat.com>
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>
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
next prev parent reply other threads:[~2010-10-22 13:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1287753463.git.mchehab@redhat.com>
2010-10-22 13:25 ` [PATCH 1/3] mceusb: add a per-model structure Mauro Carvalho Chehab
2010-10-22 13:25 ` Mauro Carvalho Chehab [this message]
2010-10-22 13:25 ` [PATCH 3/3] mceusb: Allow a per-model device name Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101022112527.7104b849@pedra \
--to=mchehab@redhat.com \
--cc=jarod@redhat.com \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox