Commit 7ce5c41d authored by Andy Walls's avatar Andy Walls Committed by Mauro Carvalho Chehab

V4L/DVB (13446): ivtv: Add more explicit detection of known IR devices for Hauppauge cards

Avoid legacy IR I2C probing for PVR-150, PVR-500, and PVR-350 cards.  This
still probes, but restricts the possbile addresses probed per card.
Also removed legacy probe addresses for the KNC and PixelView cards which are
not supported by ivtv as far as I know.
Signed-off-by: default avatarAndy Walls <awalls@radix.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 83526190
......@@ -136,7 +136,8 @@ static const struct ivtv_card ivtv_card_pvr350 = {
.hw_audio = IVTV_HW_MSP34XX,
.hw_audio_ctrl = IVTV_HW_MSP34XX,
.hw_all = IVTV_HW_MSP34XX | IVTV_HW_SAA7115 |
IVTV_HW_SAA7127 | IVTV_HW_TVEEPROM | IVTV_HW_TUNER,
IVTV_HW_SAA7127 | IVTV_HW_TVEEPROM | IVTV_HW_TUNER |
IVTV_HW_I2C_IR_RX_HAUP_EXT | IVTV_HW_I2C_IR_RX_HAUP_INT,
.video_inputs = {
{ IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_COMPOSITE4 },
{ IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO0 },
......@@ -199,7 +200,9 @@ static const struct ivtv_card ivtv_card_pvr150 = {
.hw_audio_ctrl = IVTV_HW_CX25840,
.hw_muxer = IVTV_HW_WM8775,
.hw_all = IVTV_HW_WM8775 | IVTV_HW_CX25840 |
IVTV_HW_TVEEPROM | IVTV_HW_TUNER,
IVTV_HW_TVEEPROM | IVTV_HW_TUNER |
IVTV_HW_I2C_IR_RX_HAUP_EXT | IVTV_HW_I2C_IR_RX_HAUP_INT |
IVTV_HW_Z8F0811_IR_HAUP,
.video_inputs = {
{ IVTV_CARD_INPUT_VID_TUNER, 0, CX25840_COMPOSITE7 },
{ IVTV_CARD_INPUT_SVIDEO1, 1, CX25840_SVIDEO1 },
......
......@@ -105,9 +105,24 @@
#define IVTV_HW_M52790 (1 << 14)
#define IVTV_HW_GPIO (1 << 15)
#define IVTV_HW_I2C_IR_RX_AVER (1 << 16)
#define IVTV_HW_I2C_IR_RX_HAUP_EXT (1 << 17) /* External before internal */
#define IVTV_HW_I2C_IR_RX_HAUP_INT (1 << 18)
#define IVTV_HW_Z8F0811_IR_TX_HAUP (1 << 19)
#define IVTV_HW_Z8F0811_IR_RX_HAUP (1 << 20)
#define IVTV_HW_Z8F0811_IR_HAUP (IVTV_HW_Z8F0811_IR_RX_HAUP | \
IVTV_HW_Z8F0811_IR_TX_HAUP)
#define IVTV_HW_SAA711X (IVTV_HW_SAA7115 | IVTV_HW_SAA7114)
#define IVTV_HW_IR_ANY (IVTV_HW_I2C_IR_RX_AVER)
#define IVTV_HW_IR_RX_ANY (IVTV_HW_I2C_IR_RX_AVER | \
IVTV_HW_I2C_IR_RX_HAUP_EXT | \
IVTV_HW_I2C_IR_RX_HAUP_INT | \
IVTV_HW_Z8F0811_IR_RX_HAUP)
#define IVTV_HW_IR_TX_ANY (IVTV_HW_Z8F0811_IR_TX_HAUP)
#define IVTV_HW_IR_ANY (IVTV_HW_IR_RX_ANY | IVTV_HW_IR_TX_ANY)
/* video inputs */
#define IVTV_CARD_INPUT_VID_TUNER 1
......
......@@ -885,6 +885,7 @@ static void ivtv_load_and_init_modules(struct ivtv *itv)
}
/* probe for legacy IR controllers that aren't in card definitions */
if ((itv->hw_flags & IVTV_HW_IR_ANY) == 0)
ivtv_i2c_new_ir_legacy(itv);
if (itv->card->hw_all & IVTV_HW_CX25840)
......
......@@ -89,6 +89,10 @@
#define IVTV_VP27SMPX_I2C_ADDR 0x5b
#define IVTV_M52790_I2C_ADDR 0x48
#define IVTV_AVERMEDIA_IR_RX_I2C_ADDR 0x40
#define IVTV_HAUP_EXT_IR_RX_I2C_ADDR 0x1a
#define IVTV_HAUP_INT_IR_RX_I2C_ADDR 0x18
#define IVTV_Z8F0811_IR_TX_I2C_ADDR 0x70
#define IVTV_Z8F0811_IR_RX_I2C_ADDR 0x71
/* This array should match the IVTV_HW_ defines */
static const u8 hw_addrs[] = {
......@@ -108,7 +112,11 @@ static const u8 hw_addrs[] = {
IVTV_VP27SMPX_I2C_ADDR,
IVTV_M52790_I2C_ADDR,
0, /* IVTV_HW_GPIO dummy driver ID */
IVTV_AVERMEDIA_IR_RX_I2C_ADDR /* IVTV_HW_I2C_IR_RX_AVER */
IVTV_AVERMEDIA_IR_RX_I2C_ADDR, /* IVTV_HW_I2C_IR_RX_AVER */
IVTV_HAUP_EXT_IR_RX_I2C_ADDR, /* IVTV_HW_I2C_IR_RX_HAUP_EXT */
IVTV_HAUP_INT_IR_RX_I2C_ADDR, /* IVTV_HW_I2C_IR_RX_HAUP_INT */
IVTV_Z8F0811_IR_TX_I2C_ADDR, /* IVTV_HW_Z8F0811_IR_TX_HAUP */
IVTV_Z8F0811_IR_RX_I2C_ADDR, /* IVTV_HW_Z8F0811_IR_RX_HAUP */
};
/* This array should match the IVTV_HW_ defines */
......@@ -129,7 +137,11 @@ static const char *hw_modules[] = {
"vp27smpx",
"m52790",
NULL,
NULL /* IVTV_HW_I2C_IR_RX_AVER */
NULL, /* IVTV_HW_I2C_IR_RX_AVER */
NULL, /* IVTV_HW_I2C_IR_RX_HAUP_EXT */
NULL, /* IVTV_HW_I2C_IR_RX_HAUP_INT */
NULL, /* IVTV_HW_Z8F0811_IR_TX_HAUP */
NULL, /* IVTV_HW_Z8F0811_IR_RX_HAUP */
};
/* This array should match the IVTV_HW_ defines */
......@@ -151,6 +163,10 @@ static const char * const hw_devicenames[] = {
"m52790",
"gpio",
"ir_video", /* IVTV_HW_I2C_IR_RX_AVER */
"ir_video", /* IVTV_HW_I2C_IR_RX_HAUP_EXT */
"ir_video", /* IVTV_HW_I2C_IR_RX_HAUP_INT */
"ir_tx_z8f0811_haup", /* IVTV_HW_Z8F0811_IR_TX_HAUP */
"ir_rx_z8f0811_haup", /* IVTV_HW_Z8F0811_IR_RX_HAUP */
};
static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)
......@@ -160,6 +176,20 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)
struct IR_i2c_init_data *init_data = &itv->ir_i2c_init_data;
unsigned short addr_list[2] = { addr, I2C_CLIENT_END };
/* Only allow one IR transmitter to be registered per board */
if (hw & IVTV_HW_IR_TX_ANY) {
if (itv->hw_flags & IVTV_HW_IR_TX_ANY)
return -1;
memset(&info, 0, sizeof(struct i2c_board_info));
strlcpy(info.type, type, I2C_NAME_SIZE);
return i2c_new_probed_device(adap, &info, addr_list) == NULL
? -1 : 0;
}
/* Only allow one IR receiver to be registered per board */
if (itv->hw_flags & IVTV_HW_IR_RX_ANY)
return -1;
/* Our default information for ir-kbd-i2c.c to use */
switch (hw) {
case IVTV_HW_I2C_IR_RX_AVER:
......@@ -169,6 +199,21 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)
init_data->type = IR_TYPE_OTHER;
init_data->name = "AVerMedia AVerTV card";
break;
case IVTV_HW_I2C_IR_RX_HAUP_EXT:
case IVTV_HW_I2C_IR_RX_HAUP_INT:
/* Default to old black remote */
init_data->ir_codes = &ir_codes_rc5_tv_table;
init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP;
init_data->type = IR_TYPE_RC5;
init_data->name = itv->card_name;
break;
case IVTV_HW_Z8F0811_IR_RX_HAUP:
/* Default to grey remote */
init_data->ir_codes = &ir_codes_hauppauge_new_table;
init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
init_data->type = IR_TYPE_RC5;
init_data->name = itv->card_name;
break;
}
memset(&info, 0, sizeof(struct i2c_board_info));
......@@ -197,8 +242,6 @@ struct i2c_client *ivtv_i2c_new_ir_legacy(struct ivtv *itv)
0x1a, /* Hauppauge IR external - collides with WM8739 */
0x18, /* Hauppauge IR internal */
0x71, /* Hauppauge IR (PVR150) */
0x64, /* Pixelview IR */
0x30, /* KNC ONE IR */
0x6b, /* Adaptec IR */
I2C_CLIENT_END
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment