diff options
-rw-r--r-- | drivers/media/video/saa7134/saa7134-cards.c | 104 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-dvb.c | 152 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134.h | 3 |
3 files changed, 236 insertions, 23 deletions
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index fea2188b2fa9..8291ed709736 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c | |||
@@ -2185,6 +2185,72 @@ struct saa7134_board saa7134_boards[] = { | |||
2185 | .gpio = 0x00200003, | 2185 | .gpio = 0x00200003, |
2186 | }, | 2186 | }, |
2187 | }, | 2187 | }, |
2188 | [SAA7134_BOARD_PHILIPS_EUROPA] = { | ||
2189 | .name = "Philips EUROPA V3 reference design", | ||
2190 | .audio_clock = 0x00187de7, | ||
2191 | .tuner_type = TUNER_PHILIPS_TD1316, | ||
2192 | .radio_type = UNSET, | ||
2193 | .tuner_addr = 0x61, | ||
2194 | .radio_addr = ADDR_UNSET, | ||
2195 | .tda9887_conf = TDA9887_PRESENT, | ||
2196 | .mpeg = SAA7134_MPEG_DVB, | ||
2197 | .inputs = {{ | ||
2198 | .name = name_tv, | ||
2199 | .vmux = 3, | ||
2200 | .amux = TV, | ||
2201 | .tv = 1, | ||
2202 | },{ | ||
2203 | .name = name_comp1, | ||
2204 | .vmux = 0, | ||
2205 | .amux = LINE2, | ||
2206 | },{ | ||
2207 | .name = name_svideo, | ||
2208 | .vmux = 8, | ||
2209 | .amux = LINE2, | ||
2210 | }}, | ||
2211 | }, | ||
2212 | [SAA7134_BOARD_VIDEOMATE_DVBT_300] = { | ||
2213 | .name = "Compro Videomate DVB-T300", | ||
2214 | .audio_clock = 0x00187de7, | ||
2215 | .tuner_type = TUNER_PHILIPS_TD1316, | ||
2216 | .radio_type = UNSET, | ||
2217 | .tuner_addr = 0x61, | ||
2218 | .radio_addr = ADDR_UNSET, | ||
2219 | .tda9887_conf = TDA9887_PRESENT, | ||
2220 | .mpeg = SAA7134_MPEG_DVB, | ||
2221 | .inputs = {{ | ||
2222 | .name = name_tv, | ||
2223 | .vmux = 3, | ||
2224 | .amux = TV, | ||
2225 | .tv = 1, | ||
2226 | },{ | ||
2227 | .name = name_comp1, | ||
2228 | .vmux = 1, | ||
2229 | .amux = LINE2, | ||
2230 | },{ | ||
2231 | .name = name_svideo, | ||
2232 | .vmux = 8, | ||
2233 | .amux = LINE2, | ||
2234 | }}, | ||
2235 | }, | ||
2236 | [SAA7134_BOARD_VIDEOMATE_DVBT_200] = { | ||
2237 | .name = "Compro Videomate DVB-T200", | ||
2238 | .tuner_type = TUNER_ABSENT, | ||
2239 | .audio_clock = 0x00187de7, | ||
2240 | .radio_type = UNSET, | ||
2241 | .tuner_addr = ADDR_UNSET, | ||
2242 | .radio_addr = ADDR_UNSET, | ||
2243 | .mpeg = SAA7134_MPEG_DVB, | ||
2244 | .inputs = {{ | ||
2245 | .name = name_comp1, | ||
2246 | .vmux = 0, | ||
2247 | .amux = LINE1, | ||
2248 | },{ | ||
2249 | .name = name_svideo, | ||
2250 | .vmux = 8, | ||
2251 | .amux = LINE1, | ||
2252 | }}, | ||
2253 | }, | ||
2188 | }; | 2254 | }; |
2189 | 2255 | ||
2190 | const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards); | 2256 | const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards); |
@@ -2555,6 +2621,24 @@ struct pci_device_id saa7134_pci_tbl[] = { | |||
2555 | .subdevice = 0x7135, | 2621 | .subdevice = 0x7135, |
2556 | .driver_data = SAA7134_BOARD_GOTVIEW_7135, | 2622 | .driver_data = SAA7134_BOARD_GOTVIEW_7135, |
2557 | },{ | 2623 | },{ |
2624 | .vendor = PCI_VENDOR_ID_PHILIPS, | ||
2625 | .device = PCI_DEVICE_ID_PHILIPS_SAA7134, | ||
2626 | .subvendor = PCI_VENDOR_ID_PHILIPS, | ||
2627 | .subdevice = 0x2004, | ||
2628 | .driver_data = SAA7134_BOARD_PHILIPS_EUROPA, | ||
2629 | },{ | ||
2630 | .vendor = PCI_VENDOR_ID_PHILIPS, | ||
2631 | .device = PCI_DEVICE_ID_PHILIPS_SAA7134, | ||
2632 | .subvendor = 0x185b, | ||
2633 | .subdevice = 0xc900, | ||
2634 | .driver_data = SAA7134_BOARD_VIDEOMATE_DVBT_300, | ||
2635 | },{ | ||
2636 | .vendor = PCI_VENDOR_ID_PHILIPS, | ||
2637 | .device = PCI_DEVICE_ID_PHILIPS_SAA7130, | ||
2638 | .subvendor = 0x185b, | ||
2639 | .subdevice = 0xc901, | ||
2640 | .driver_data = SAA7134_BOARD_VIDEOMATE_DVBT_200, | ||
2641 | },{ | ||
2558 | /* --- boards without eeprom + subsystem ID --- */ | 2642 | /* --- boards without eeprom + subsystem ID --- */ |
2559 | .vendor = PCI_VENDOR_ID_PHILIPS, | 2643 | .vendor = PCI_VENDOR_ID_PHILIPS, |
2560 | .device = PCI_DEVICE_ID_PHILIPS_SAA7134, | 2644 | .device = PCI_DEVICE_ID_PHILIPS_SAA7134, |
@@ -2708,7 +2792,7 @@ int saa7134_board_init2(struct saa7134_dev *dev) | |||
2708 | saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR, &tun_setup); | 2792 | saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR, &tun_setup); |
2709 | } | 2793 | } |
2710 | break; | 2794 | break; |
2711 | case SAA7134_BOARD_MD7134: | 2795 | case SAA7134_BOARD_MD7134: |
2712 | { | 2796 | { |
2713 | struct tuner_setup tun_setup; | 2797 | struct tuner_setup tun_setup; |
2714 | u8 subaddr; | 2798 | u8 subaddr; |
@@ -2775,6 +2859,24 @@ case SAA7134_BOARD_MD7134: | |||
2775 | saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR,&tun_setup); | 2859 | saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR,&tun_setup); |
2776 | } | 2860 | } |
2777 | break; | 2861 | break; |
2862 | case SAA7134_BOARD_PHILIPS_EUROPA: | ||
2863 | case SAA7134_BOARD_VIDEOMATE_DVBT_300: | ||
2864 | /* The Philips EUROPA based hybrid boards have the tuner connected through | ||
2865 | * the channel decoder. We have to make it transparent to find it | ||
2866 | */ | ||
2867 | { | ||
2868 | struct tuner_setup tun_setup; | ||
2869 | u8 data[] = { 0x07, 0x02}; | ||
2870 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; | ||
2871 | i2c_transfer(&dev->i2c_adap, &msg, 1); | ||
2872 | |||
2873 | tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV; | ||
2874 | tun_setup.type = dev->tuner_type; | ||
2875 | tun_setup.addr = dev->tuner_addr; | ||
2876 | |||
2877 | saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR,&tun_setup); | ||
2878 | } | ||
2879 | break; | ||
2778 | } | 2880 | } |
2779 | return 0; | 2881 | return 0; |
2780 | } | 2882 | } |
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index 639ae51a052d..f8e01030fbc7 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c | |||
@@ -151,25 +151,12 @@ static struct mt352_config pinnacle_300i = { | |||
151 | /* ------------------------------------------------------------------ */ | 151 | /* ------------------------------------------------------------------ */ |
152 | 152 | ||
153 | #ifdef HAVE_TDA1004X | 153 | #ifdef HAVE_TDA1004X |
154 | static int philips_tu1216_pll_init(struct dvb_frontend *fe) | ||
155 | { | ||
156 | struct saa7134_dev *dev = fe->dvb->priv; | ||
157 | static u8 tu1216_init[] = { 0x0b, 0xf5, 0x85, 0xab }; | ||
158 | struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tu1216_init,.len = sizeof(tu1216_init) }; | ||
159 | |||
160 | /* setup PLL configuration */ | ||
161 | if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) | ||
162 | return -EIO; | ||
163 | msleep(1); | ||
164 | |||
165 | return 0; | ||
166 | } | ||
167 | 154 | ||
168 | static int philips_tu1216_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) | 155 | static int philips_tda6651_pll_set(u8 addr, struct dvb_frontend *fe, struct dvb_frontend_parameters *params) |
169 | { | 156 | { |
170 | struct saa7134_dev *dev = fe->dvb->priv; | 157 | struct saa7134_dev *dev = fe->dvb->priv; |
171 | u8 tuner_buf[4]; | 158 | u8 tuner_buf[4]; |
172 | struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tuner_buf,.len = | 159 | struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tuner_buf,.len = |
173 | sizeof(tuner_buf) }; | 160 | sizeof(tuner_buf) }; |
174 | int tuner_frequency = 0; | 161 | int tuner_frequency = 0; |
175 | u8 band, cp, filter; | 162 | u8 band, cp, filter; |
@@ -242,11 +229,36 @@ static int philips_tu1216_pll_set(struct dvb_frontend *fe, struct dvb_frontend_p | |||
242 | 229 | ||
243 | if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) | 230 | if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) |
244 | return -EIO; | 231 | return -EIO; |
232 | msleep(1); | ||
233 | return 0; | ||
234 | } | ||
235 | |||
236 | static int philips_tda6651_pll_init(u8 addr, struct dvb_frontend *fe) | ||
237 | { | ||
238 | struct saa7134_dev *dev = fe->dvb->priv; | ||
239 | static u8 tu1216_init[] = { 0x0b, 0xf5, 0x85, 0xab }; | ||
240 | struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tu1216_init,.len = sizeof(tu1216_init) }; | ||
245 | 241 | ||
242 | /* setup PLL configuration */ | ||
243 | if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) | ||
244 | return -EIO; | ||
246 | msleep(1); | 245 | msleep(1); |
246 | |||
247 | return 0; | 247 | return 0; |
248 | } | 248 | } |
249 | 249 | ||
250 | /* ------------------------------------------------------------------ */ | ||
251 | |||
252 | static int philips_tu1216_pll_60_init(struct dvb_frontend *fe) | ||
253 | { | ||
254 | return philips_tda6651_pll_init(0x60, fe); | ||
255 | } | ||
256 | |||
257 | static int philips_tu1216_pll_60_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) | ||
258 | { | ||
259 | return philips_tda6651_pll_set(0x60, fe, params); | ||
260 | } | ||
261 | |||
250 | static int philips_tu1216_request_firmware(struct dvb_frontend *fe, | 262 | static int philips_tu1216_request_firmware(struct dvb_frontend *fe, |
251 | const struct firmware **fw, char *name) | 263 | const struct firmware **fw, char *name) |
252 | { | 264 | { |
@@ -254,22 +266,108 @@ static int philips_tu1216_request_firmware(struct dvb_frontend *fe, | |||
254 | return request_firmware(fw, name, &dev->pci->dev); | 266 | return request_firmware(fw, name, &dev->pci->dev); |
255 | } | 267 | } |
256 | 268 | ||
257 | static struct tda1004x_config philips_tu1216_config = { | 269 | static struct tda1004x_config philips_tu1216_60_config = { |
258 | 270 | ||
259 | .demod_address = 0x8, | 271 | .demod_address = 0x8, |
260 | .invert = 1, | 272 | .invert = 1, |
261 | .invert_oclk = 1, | 273 | .invert_oclk = 0, |
262 | .xtal_freq = TDA10046_XTAL_4M, | 274 | .xtal_freq = TDA10046_XTAL_4M, |
263 | .agc_config = TDA10046_AGC_DEFAULT, | 275 | .agc_config = TDA10046_AGC_DEFAULT, |
264 | .if_freq = TDA10046_FREQ_3617, | 276 | .if_freq = TDA10046_FREQ_3617, |
265 | .pll_init = philips_tu1216_pll_init, | 277 | .pll_init = philips_tu1216_pll_60_init, |
266 | .pll_set = philips_tu1216_pll_set, | 278 | .pll_set = philips_tu1216_pll_60_set, |
267 | .pll_sleep = NULL, | 279 | .pll_sleep = NULL, |
268 | .request_firmware = philips_tu1216_request_firmware, | 280 | .request_firmware = philips_tu1216_request_firmware, |
269 | }; | 281 | }; |
270 | 282 | ||
271 | /* ------------------------------------------------------------------ */ | 283 | /* ------------------------------------------------------------------ */ |
272 | 284 | ||
285 | static int philips_tu1216_pll_61_init(struct dvb_frontend *fe) | ||
286 | { | ||
287 | return philips_tda6651_pll_init(0x61, fe); | ||
288 | } | ||
289 | |||
290 | static int philips_tu1216_pll_61_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) | ||
291 | { | ||
292 | return philips_tda6651_pll_set(0x61, fe, params); | ||
293 | } | ||
294 | |||
295 | static struct tda1004x_config philips_tu1216_61_config = { | ||
296 | |||
297 | .demod_address = 0x8, | ||
298 | .invert = 1, | ||
299 | .invert_oclk = 0, | ||
300 | .xtal_freq = TDA10046_XTAL_4M, | ||
301 | .agc_config = TDA10046_AGC_DEFAULT, | ||
302 | .if_freq = TDA10046_FREQ_3617, | ||
303 | .pll_init = philips_tu1216_pll_61_init, | ||
304 | .pll_set = philips_tu1216_pll_61_set, | ||
305 | .pll_sleep = NULL, | ||
306 | .request_firmware = philips_tu1216_request_firmware, | ||
307 | }; | ||
308 | |||
309 | /* ------------------------------------------------------------------ */ | ||
310 | |||
311 | static int philips_europa_pll_init(struct dvb_frontend *fe) | ||
312 | { | ||
313 | struct saa7134_dev *dev = fe->dvb->priv; | ||
314 | static u8 msg[] = { 0x0b, 0xf5, 0x86, 0xab }; | ||
315 | struct i2c_msg init_msg = {.addr = 0x61,.flags = 0,.buf = msg,.len = sizeof(msg) }; | ||
316 | |||
317 | /* setup PLL configuration */ | ||
318 | if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1) | ||
319 | return -EIO; | ||
320 | msleep(1); | ||
321 | |||
322 | /* switch the board to dvb mode */ | ||
323 | init_msg.addr = 0x43; | ||
324 | init_msg.len = 0x02; | ||
325 | msg[0] = 0x00; | ||
326 | msg[1] = 0x40; | ||
327 | if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1) | ||
328 | return -EIO; | ||
329 | |||
330 | return 0; | ||
331 | } | ||
332 | |||
333 | static int philips_td1316_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) | ||
334 | { | ||
335 | return philips_tda6651_pll_set(0x61, fe, params); | ||
336 | } | ||
337 | |||
338 | static void philips_europa_analog(struct dvb_frontend *fe) | ||
339 | { | ||
340 | struct saa7134_dev *dev = fe->dvb->priv; | ||
341 | /* this message actually turns the tuner back to analog mode */ | ||
342 | static u8 msg[] = { 0x0b, 0xdc, 0x86, 0xa4 }; | ||
343 | struct i2c_msg analog_msg = {.addr = 0x61,.flags = 0,.buf = msg,.len = sizeof(msg) }; | ||
344 | |||
345 | i2c_transfer(&dev->i2c_adap, &analog_msg, 1); | ||
346 | msleep(1); | ||
347 | |||
348 | /* switch the board to analog mode */ | ||
349 | analog_msg.addr = 0x43; | ||
350 | analog_msg.len = 0x02; | ||
351 | msg[0] = 0x00; | ||
352 | msg[1] = 0x14; | ||
353 | i2c_transfer(&dev->i2c_adap, &analog_msg, 1); | ||
354 | } | ||
355 | |||
356 | static struct tda1004x_config philips_europa_config = { | ||
357 | |||
358 | .demod_address = 0x8, | ||
359 | .invert = 0, | ||
360 | .invert_oclk = 0, | ||
361 | .xtal_freq = TDA10046_XTAL_4M, | ||
362 | .agc_config = TDA10046_AGC_IFO_AUTO_POS, | ||
363 | .if_freq = TDA10046_FREQ_052, | ||
364 | .pll_init = philips_europa_pll_init, | ||
365 | .pll_set = philips_td1316_pll_set, | ||
366 | .pll_sleep = philips_europa_analog, | ||
367 | .request_firmware = NULL, | ||
368 | }; | ||
369 | |||
370 | /* ------------------------------------------------------------------ */ | ||
273 | 371 | ||
274 | static int philips_fmd1216_pll_init(struct dvb_frontend *fe) | 372 | static int philips_fmd1216_pll_init(struct dvb_frontend *fe) |
275 | { | 373 | { |
@@ -382,7 +480,6 @@ static int philips_fmd1216_pll_set(struct dvb_frontend *fe, struct dvb_frontend_ | |||
382 | return 0; | 480 | return 0; |
383 | } | 481 | } |
384 | 482 | ||
385 | #ifdef HAVE_TDA1004X | ||
386 | static struct tda1004x_config medion_cardbus = { | 483 | static struct tda1004x_config medion_cardbus = { |
387 | .demod_address = 0x08, | 484 | .demod_address = 0x08, |
388 | .invert = 1, | 485 | .invert = 1, |
@@ -395,7 +492,6 @@ static struct tda1004x_config medion_cardbus = { | |||
395 | .pll_sleep = philips_fmd1216_analog, | 492 | .pll_sleep = philips_fmd1216_analog, |
396 | .request_firmware = NULL, | 493 | .request_firmware = NULL, |
397 | }; | 494 | }; |
398 | #endif | ||
399 | 495 | ||
400 | /* ------------------------------------------------------------------ */ | 496 | /* ------------------------------------------------------------------ */ |
401 | 497 | ||
@@ -558,7 +654,7 @@ static int dvb_init(struct saa7134_dev *dev) | |||
558 | &dev->i2c_adap); | 654 | &dev->i2c_adap); |
559 | break; | 655 | break; |
560 | case SAA7134_BOARD_PHILIPS_TOUGH: | 656 | case SAA7134_BOARD_PHILIPS_TOUGH: |
561 | dev->dvb.frontend = tda10046_attach(&philips_tu1216_config, | 657 | dev->dvb.frontend = tda10046_attach(&philips_tu1216_60_config, |
562 | &dev->i2c_adap); | 658 | &dev->i2c_adap); |
563 | break; | 659 | break; |
564 | case SAA7134_BOARD_FLYDVBTDUO: | 660 | case SAA7134_BOARD_FLYDVBTDUO: |
@@ -569,6 +665,18 @@ static int dvb_init(struct saa7134_dev *dev) | |||
569 | dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config, | 665 | dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config, |
570 | &dev->i2c_adap); | 666 | &dev->i2c_adap); |
571 | break; | 667 | break; |
668 | case SAA7134_BOARD_PHILIPS_EUROPA: | ||
669 | dev->dvb.frontend = tda10046_attach(&philips_europa_config, | ||
670 | &dev->i2c_adap); | ||
671 | break; | ||
672 | case SAA7134_BOARD_VIDEOMATE_DVBT_300: | ||
673 | dev->dvb.frontend = tda10046_attach(&philips_europa_config, | ||
674 | &dev->i2c_adap); | ||
675 | break; | ||
676 | case SAA7134_BOARD_VIDEOMATE_DVBT_200: | ||
677 | dev->dvb.frontend = tda10046_attach(&philips_tu1216_61_config, | ||
678 | &dev->i2c_adap); | ||
679 | break; | ||
572 | #endif | 680 | #endif |
573 | default: | 681 | default: |
574 | printk("%s: Huh? unknown DVB card?\n",dev->name); | 682 | printk("%s: Huh? unknown DVB card?\n",dev->name); |
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h index 291c2e8d1086..69a2cebe8860 100644 --- a/drivers/media/video/saa7134/saa7134.h +++ b/drivers/media/video/saa7134/saa7134.h | |||
@@ -189,6 +189,9 @@ struct saa7134_format { | |||
189 | #define SAA7134_BOARD_YUAN_TUN900 66 | 189 | #define SAA7134_BOARD_YUAN_TUN900 66 |
190 | #define SAA7134_BOARD_BEHOLD_409FM 67 | 190 | #define SAA7134_BOARD_BEHOLD_409FM 67 |
191 | #define SAA7134_BOARD_GOTVIEW_7135 68 | 191 | #define SAA7134_BOARD_GOTVIEW_7135 68 |
192 | #define SAA7134_BOARD_PHILIPS_EUROPA 69 | ||
193 | #define SAA7134_BOARD_VIDEOMATE_DVBT_300 70 | ||
194 | #define SAA7134_BOARD_VIDEOMATE_DVBT_200 71 | ||
192 | 195 | ||
193 | #define SAA7134_MAXBOARDS 8 | 196 | #define SAA7134_MAXBOARDS 8 |
194 | #define SAA7134_INPUT_MAX 8 | 197 | #define SAA7134_INPUT_MAX 8 |