aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-11-21 14:19:27 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:41:57 -0500
commit7ce5c41db3672c8b4419b16d9b3ac1ccf11a1445 (patch)
tree779bbbfba98ebea95b43f5e96bfb2458730e1ed8 /drivers/media/video/ivtv
parent8352619043a04785b8d20e438629b14e556fffce (diff)
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: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/ivtv')
-rw-r--r--drivers/media/video/ivtv/ivtv-cards.c7
-rw-r--r--drivers/media/video/ivtv/ivtv-cards.h51
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.c3
-rw-r--r--drivers/media/video/ivtv/ivtv-i2c.c53
4 files changed, 88 insertions, 26 deletions
diff --git a/drivers/media/video/ivtv/ivtv-cards.c b/drivers/media/video/ivtv/ivtv-cards.c
index e98ecadfde2..79d0fe4990d 100644
--- a/drivers/media/video/ivtv/ivtv-cards.c
+++ b/drivers/media/video/ivtv/ivtv-cards.c
@@ -136,7 +136,8 @@ static const struct ivtv_card ivtv_card_pvr350 = {
136 .hw_audio = IVTV_HW_MSP34XX, 136 .hw_audio = IVTV_HW_MSP34XX,
137 .hw_audio_ctrl = IVTV_HW_MSP34XX, 137 .hw_audio_ctrl = IVTV_HW_MSP34XX,
138 .hw_all = IVTV_HW_MSP34XX | IVTV_HW_SAA7115 | 138 .hw_all = IVTV_HW_MSP34XX | IVTV_HW_SAA7115 |
139 IVTV_HW_SAA7127 | IVTV_HW_TVEEPROM | IVTV_HW_TUNER, 139 IVTV_HW_SAA7127 | IVTV_HW_TVEEPROM | IVTV_HW_TUNER |
140 IVTV_HW_I2C_IR_RX_HAUP_EXT | IVTV_HW_I2C_IR_RX_HAUP_INT,
140 .video_inputs = { 141 .video_inputs = {
141 { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_COMPOSITE4 }, 142 { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_COMPOSITE4 },
142 { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO0 }, 143 { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO0 },
@@ -199,7 +200,9 @@ static const struct ivtv_card ivtv_card_pvr150 = {
199 .hw_audio_ctrl = IVTV_HW_CX25840, 200 .hw_audio_ctrl = IVTV_HW_CX25840,
200 .hw_muxer = IVTV_HW_WM8775, 201 .hw_muxer = IVTV_HW_WM8775,
201 .hw_all = IVTV_HW_WM8775 | IVTV_HW_CX25840 | 202 .hw_all = IVTV_HW_WM8775 | IVTV_HW_CX25840 |
202 IVTV_HW_TVEEPROM | IVTV_HW_TUNER, 203 IVTV_HW_TVEEPROM | IVTV_HW_TUNER |
204 IVTV_HW_I2C_IR_RX_HAUP_EXT | IVTV_HW_I2C_IR_RX_HAUP_INT |
205 IVTV_HW_Z8F0811_IR_HAUP,
203 .video_inputs = { 206 .video_inputs = {
204 { IVTV_CARD_INPUT_VID_TUNER, 0, CX25840_COMPOSITE7 }, 207 { IVTV_CARD_INPUT_VID_TUNER, 0, CX25840_COMPOSITE7 },
205 { IVTV_CARD_INPUT_SVIDEO1, 1, CX25840_SVIDEO1 }, 208 { IVTV_CARD_INPUT_SVIDEO1, 1, CX25840_SVIDEO1 },
diff --git a/drivers/media/video/ivtv/ivtv-cards.h b/drivers/media/video/ivtv/ivtv-cards.h
index 1ac09ebaa2f..6148827ec88 100644
--- a/drivers/media/video/ivtv/ivtv-cards.h
+++ b/drivers/media/video/ivtv/ivtv-cards.h
@@ -88,26 +88,41 @@
88#define IVTV_PCI_ID_GOTVIEW2 0xffad 88#define IVTV_PCI_ID_GOTVIEW2 0xffad
89 89
90/* hardware flags, no gaps allowed */ 90/* hardware flags, no gaps allowed */
91#define IVTV_HW_CX25840 (1 << 0) 91#define IVTV_HW_CX25840 (1 << 0)
92#define IVTV_HW_SAA7115 (1 << 1) 92#define IVTV_HW_SAA7115 (1 << 1)
93#define IVTV_HW_SAA7127 (1 << 2) 93#define IVTV_HW_SAA7127 (1 << 2)
94#define IVTV_HW_MSP34XX (1 << 3) 94#define IVTV_HW_MSP34XX (1 << 3)
95#define IVTV_HW_TUNER (1 << 4) 95#define IVTV_HW_TUNER (1 << 4)
96#define IVTV_HW_WM8775 (1 << 5) 96#define IVTV_HW_WM8775 (1 << 5)
97#define IVTV_HW_CS53L32A (1 << 6) 97#define IVTV_HW_CS53L32A (1 << 6)
98#define IVTV_HW_TVEEPROM (1 << 7) 98#define IVTV_HW_TVEEPROM (1 << 7)
99#define IVTV_HW_SAA7114 (1 << 8) 99#define IVTV_HW_SAA7114 (1 << 8)
100#define IVTV_HW_UPD64031A (1 << 9) 100#define IVTV_HW_UPD64031A (1 << 9)
101#define IVTV_HW_UPD6408X (1 << 10) 101#define IVTV_HW_UPD6408X (1 << 10)
102#define IVTV_HW_SAA717X (1 << 11) 102#define IVTV_HW_SAA717X (1 << 11)
103#define IVTV_HW_WM8739 (1 << 12) 103#define IVTV_HW_WM8739 (1 << 12)
104#define IVTV_HW_VP27SMPX (1 << 13) 104#define IVTV_HW_VP27SMPX (1 << 13)
105#define IVTV_HW_M52790 (1 << 14) 105#define IVTV_HW_M52790 (1 << 14)
106#define IVTV_HW_GPIO (1 << 15) 106#define IVTV_HW_GPIO (1 << 15)
107#define IVTV_HW_I2C_IR_RX_AVER (1 << 16) 107#define IVTV_HW_I2C_IR_RX_AVER (1 << 16)
108#define IVTV_HW_I2C_IR_RX_HAUP_EXT (1 << 17) /* External before internal */
109#define IVTV_HW_I2C_IR_RX_HAUP_INT (1 << 18)
110#define IVTV_HW_Z8F0811_IR_TX_HAUP (1 << 19)
111#define IVTV_HW_Z8F0811_IR_RX_HAUP (1 << 20)
112
113#define IVTV_HW_Z8F0811_IR_HAUP (IVTV_HW_Z8F0811_IR_RX_HAUP | \
114 IVTV_HW_Z8F0811_IR_TX_HAUP)
108 115
109#define IVTV_HW_SAA711X (IVTV_HW_SAA7115 | IVTV_HW_SAA7114) 116#define IVTV_HW_SAA711X (IVTV_HW_SAA7115 | IVTV_HW_SAA7114)
110#define IVTV_HW_IR_ANY (IVTV_HW_I2C_IR_RX_AVER) 117
118#define IVTV_HW_IR_RX_ANY (IVTV_HW_I2C_IR_RX_AVER | \
119 IVTV_HW_I2C_IR_RX_HAUP_EXT | \
120 IVTV_HW_I2C_IR_RX_HAUP_INT | \
121 IVTV_HW_Z8F0811_IR_RX_HAUP)
122
123#define IVTV_HW_IR_TX_ANY (IVTV_HW_Z8F0811_IR_TX_HAUP)
124
125#define IVTV_HW_IR_ANY (IVTV_HW_IR_RX_ANY | IVTV_HW_IR_TX_ANY)
111 126
112/* video inputs */ 127/* video inputs */
113#define IVTV_CARD_INPUT_VID_TUNER 1 128#define IVTV_CARD_INPUT_VID_TUNER 1
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
index d14f94e254b..347c3344f56 100644
--- a/drivers/media/video/ivtv/ivtv-driver.c
+++ b/drivers/media/video/ivtv/ivtv-driver.c
@@ -885,7 +885,8 @@ static void ivtv_load_and_init_modules(struct ivtv *itv)
885 } 885 }
886 886
887 /* probe for legacy IR controllers that aren't in card definitions */ 887 /* probe for legacy IR controllers that aren't in card definitions */
888 ivtv_i2c_new_ir_legacy(itv); 888 if ((itv->hw_flags & IVTV_HW_IR_ANY) == 0)
889 ivtv_i2c_new_ir_legacy(itv);
889 890
890 if (itv->card->hw_all & IVTV_HW_CX25840) 891 if (itv->card->hw_all & IVTV_HW_CX25840)
891 itv->sd_video = ivtv_find_hw(itv, IVTV_HW_CX25840); 892 itv->sd_video = ivtv_find_hw(itv, IVTV_HW_CX25840);
diff --git a/drivers/media/video/ivtv/ivtv-i2c.c b/drivers/media/video/ivtv/ivtv-i2c.c
index 6838683cdaa..2ee03c2a1b5 100644
--- a/drivers/media/video/ivtv/ivtv-i2c.c
+++ b/drivers/media/video/ivtv/ivtv-i2c.c
@@ -89,6 +89,10 @@
89#define IVTV_VP27SMPX_I2C_ADDR 0x5b 89#define IVTV_VP27SMPX_I2C_ADDR 0x5b
90#define IVTV_M52790_I2C_ADDR 0x48 90#define IVTV_M52790_I2C_ADDR 0x48
91#define IVTV_AVERMEDIA_IR_RX_I2C_ADDR 0x40 91#define IVTV_AVERMEDIA_IR_RX_I2C_ADDR 0x40
92#define IVTV_HAUP_EXT_IR_RX_I2C_ADDR 0x1a
93#define IVTV_HAUP_INT_IR_RX_I2C_ADDR 0x18
94#define IVTV_Z8F0811_IR_TX_I2C_ADDR 0x70
95#define IVTV_Z8F0811_IR_RX_I2C_ADDR 0x71
92 96
93/* This array should match the IVTV_HW_ defines */ 97/* This array should match the IVTV_HW_ defines */
94static const u8 hw_addrs[] = { 98static const u8 hw_addrs[] = {
@@ -108,7 +112,11 @@ static const u8 hw_addrs[] = {
108 IVTV_VP27SMPX_I2C_ADDR, 112 IVTV_VP27SMPX_I2C_ADDR,
109 IVTV_M52790_I2C_ADDR, 113 IVTV_M52790_I2C_ADDR,
110 0, /* IVTV_HW_GPIO dummy driver ID */ 114 0, /* IVTV_HW_GPIO dummy driver ID */
111 IVTV_AVERMEDIA_IR_RX_I2C_ADDR /* IVTV_HW_I2C_IR_RX_AVER */ 115 IVTV_AVERMEDIA_IR_RX_I2C_ADDR, /* IVTV_HW_I2C_IR_RX_AVER */
116 IVTV_HAUP_EXT_IR_RX_I2C_ADDR, /* IVTV_HW_I2C_IR_RX_HAUP_EXT */
117 IVTV_HAUP_INT_IR_RX_I2C_ADDR, /* IVTV_HW_I2C_IR_RX_HAUP_INT */
118 IVTV_Z8F0811_IR_TX_I2C_ADDR, /* IVTV_HW_Z8F0811_IR_TX_HAUP */
119 IVTV_Z8F0811_IR_RX_I2C_ADDR, /* IVTV_HW_Z8F0811_IR_RX_HAUP */
112}; 120};
113 121
114/* This array should match the IVTV_HW_ defines */ 122/* This array should match the IVTV_HW_ defines */
@@ -129,7 +137,11 @@ static const char *hw_modules[] = {
129 "vp27smpx", 137 "vp27smpx",
130 "m52790", 138 "m52790",
131 NULL, 139 NULL,
132 NULL /* IVTV_HW_I2C_IR_RX_AVER */ 140 NULL, /* IVTV_HW_I2C_IR_RX_AVER */
141 NULL, /* IVTV_HW_I2C_IR_RX_HAUP_EXT */
142 NULL, /* IVTV_HW_I2C_IR_RX_HAUP_INT */
143 NULL, /* IVTV_HW_Z8F0811_IR_TX_HAUP */
144 NULL, /* IVTV_HW_Z8F0811_IR_RX_HAUP */
133}; 145};
134 146
135/* This array should match the IVTV_HW_ defines */ 147/* This array should match the IVTV_HW_ defines */
@@ -150,7 +162,11 @@ static const char * const hw_devicenames[] = {
150 "vp27smpx", 162 "vp27smpx",
151 "m52790", 163 "m52790",
152 "gpio", 164 "gpio",
153 "ir_video", /* IVTV_HW_I2C_IR_RX_AVER */ 165 "ir_video", /* IVTV_HW_I2C_IR_RX_AVER */
166 "ir_video", /* IVTV_HW_I2C_IR_RX_HAUP_EXT */
167 "ir_video", /* IVTV_HW_I2C_IR_RX_HAUP_INT */
168 "ir_tx_z8f0811_haup", /* IVTV_HW_Z8F0811_IR_TX_HAUP */
169 "ir_rx_z8f0811_haup", /* IVTV_HW_Z8F0811_IR_RX_HAUP */
154}; 170};
155 171
156static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr) 172static 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)
160 struct IR_i2c_init_data *init_data = &itv->ir_i2c_init_data; 176 struct IR_i2c_init_data *init_data = &itv->ir_i2c_init_data;
161 unsigned short addr_list[2] = { addr, I2C_CLIENT_END }; 177 unsigned short addr_list[2] = { addr, I2C_CLIENT_END };
162 178
179 /* Only allow one IR transmitter to be registered per board */
180 if (hw & IVTV_HW_IR_TX_ANY) {
181 if (itv->hw_flags & IVTV_HW_IR_TX_ANY)
182 return -1;
183 memset(&info, 0, sizeof(struct i2c_board_info));
184 strlcpy(info.type, type, I2C_NAME_SIZE);
185 return i2c_new_probed_device(adap, &info, addr_list) == NULL
186 ? -1 : 0;
187 }
188
189 /* Only allow one IR receiver to be registered per board */
190 if (itv->hw_flags & IVTV_HW_IR_RX_ANY)
191 return -1;
192
163 /* Our default information for ir-kbd-i2c.c to use */ 193 /* Our default information for ir-kbd-i2c.c to use */
164 switch (hw) { 194 switch (hw) {
165 case IVTV_HW_I2C_IR_RX_AVER: 195 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)
169 init_data->type = IR_TYPE_OTHER; 199 init_data->type = IR_TYPE_OTHER;
170 init_data->name = "AVerMedia AVerTV card"; 200 init_data->name = "AVerMedia AVerTV card";
171 break; 201 break;
202 case IVTV_HW_I2C_IR_RX_HAUP_EXT:
203 case IVTV_HW_I2C_IR_RX_HAUP_INT:
204 /* Default to old black remote */
205 init_data->ir_codes = &ir_codes_rc5_tv_table;
206 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP;
207 init_data->type = IR_TYPE_RC5;
208 init_data->name = itv->card_name;
209 break;
210 case IVTV_HW_Z8F0811_IR_RX_HAUP:
211 /* Default to grey remote */
212 init_data->ir_codes = &ir_codes_hauppauge_new_table;
213 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
214 init_data->type = IR_TYPE_RC5;
215 init_data->name = itv->card_name;
216 break;
172 } 217 }
173 218
174 memset(&info, 0, sizeof(struct i2c_board_info)); 219 memset(&info, 0, sizeof(struct i2c_board_info));
@@ -197,8 +242,6 @@ struct i2c_client *ivtv_i2c_new_ir_legacy(struct ivtv *itv)
197 0x1a, /* Hauppauge IR external - collides with WM8739 */ 242 0x1a, /* Hauppauge IR external - collides with WM8739 */
198 0x18, /* Hauppauge IR internal */ 243 0x18, /* Hauppauge IR internal */
199 0x71, /* Hauppauge IR (PVR150) */ 244 0x71, /* Hauppauge IR (PVR150) */
200 0x64, /* Pixelview IR */
201 0x30, /* KNC ONE IR */
202 0x6b, /* Adaptec IR */ 245 0x6b, /* Adaptec IR */
203 I2C_CLIENT_END 246 I2C_CLIENT_END
204 }; 247 };