aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/ir-kbd-i2c.c
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2017-10-24 17:04:16 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-14 09:58:20 -0500
commit1cb26030f3494a8bb3c953d45cffba838ec4d454 (patch)
tree0f71f7b0740676e8d6f13d5cffe6743601256e5c /drivers/media/i2c/ir-kbd-i2c.c
parentmedia: rc: implement zilog transmitter (diff)
downloadlinux-dev-1cb26030f3494a8bb3c953d45cffba838ec4d454.tar.xz
linux-dev-1cb26030f3494a8bb3c953d45cffba838ec4d454.zip
media: i2c: enable i2c IR for hardware which isn't HD-PVR
This is a fix for commit 329d88da4df9 ("[media] media: i2c: Don't export ir-kbd-i2c module alias") that stopped the module from being loaded automagically. The problems described only affect the HD-PVR, so it should not affect other hardware; also if the module happens to be loaded, the i2c IR part of the HD-PVR will be enabled anyway. Fixes: 329d88da4df9 ("[media] media: i2c: Don't export ir-kbd-i2c module alias") Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/i2c/ir-kbd-i2c.c')
-rw-r--r--drivers/media/i2c/ir-kbd-i2c.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/i2c/ir-kbd-i2c.c b/drivers/media/i2c/ir-kbd-i2c.c
index 020ef0d7058e..193020d64e51 100644
--- a/drivers/media/i2c/ir-kbd-i2c.c
+++ b/drivers/media/i2c/ir-kbd-i2c.c
@@ -63,6 +63,9 @@
#define FLAG_TX 1
#define FLAG_HDPVR 2
+static bool enable_hdpvr;
+module_param(enable_hdpvr, bool, 0644);
+
static int get_key_haup_common(struct IR_i2c *ir, enum rc_proto *protocol,
u32 *scancode, u8 *ptoggle, int size)
{
@@ -726,6 +729,11 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
unsigned short addr = client->addr;
int err;
+ if ((id->driver_data & FLAG_HDPVR) && !enable_hdpvr) {
+ dev_err(&client->dev, "IR for HDPVR is known to cause problems during recording, use enable_hdpvr modparam to enable\n");
+ return -ENODEV;
+ }
+
ir = devm_kzalloc(&client->dev, sizeof(*ir), GFP_KERNEL);
if (!ir)
return -ENOMEM;
@@ -925,6 +933,7 @@ static const struct i2c_device_id ir_kbd_id[] = {
{ "ir_z8f0811_hdpvr", FLAG_TX | FLAG_HDPVR },
{ }
};
+MODULE_DEVICE_TABLE(i2c, ir_kbd_id);
static struct i2c_driver ir_kbd_driver = {
.driver = {