Skip to content

Commit 1cb2603

Browse files
seanyoungmchehab
authored andcommitted
media: i2c: enable i2c IR for hardware which isn't HD-PVR
This is a fix for commit 329d88d ("[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: 329d88d ("[media] media: i2c: Don't export ir-kbd-i2c module alias") Signed-off-by: Sean Young <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent acaa34b commit 1cb2603

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/media/i2c/ir-kbd-i2c.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@
6363
#define FLAG_TX 1
6464
#define FLAG_HDPVR 2
6565

66+
static bool enable_hdpvr;
67+
module_param(enable_hdpvr, bool, 0644);
68+
6669
static int get_key_haup_common(struct IR_i2c *ir, enum rc_proto *protocol,
6770
u32 *scancode, u8 *ptoggle, int size)
6871
{
@@ -726,6 +729,11 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
726729
unsigned short addr = client->addr;
727730
int err;
728731

732+
if ((id->driver_data & FLAG_HDPVR) && !enable_hdpvr) {
733+
dev_err(&client->dev, "IR for HDPVR is known to cause problems during recording, use enable_hdpvr modparam to enable\n");
734+
return -ENODEV;
735+
}
736+
729737
ir = devm_kzalloc(&client->dev, sizeof(*ir), GFP_KERNEL);
730738
if (!ir)
731739
return -ENOMEM;
@@ -925,6 +933,7 @@ static const struct i2c_device_id ir_kbd_id[] = {
925933
{ "ir_z8f0811_hdpvr", FLAG_TX | FLAG_HDPVR },
926934
{ }
927935
};
936+
MODULE_DEVICE_TABLE(i2c, ir_kbd_id);
928937

929938
static struct i2c_driver ir_kbd_driver = {
930939
.driver = {

0 commit comments

Comments
 (0)