diff options
author | Alexey Chernov <4ernov@gmail.com> | 2010-10-28 17:12:02 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-12-29 05:16:56 -0500 |
commit | a363436396ad68509db4513c886055cc067a184c (patch) | |
tree | e6cfe9516c14c51d5d65529fa2fe44b1a80646cf /drivers/media/video/cx18 | |
parent | 97108cf682566a79ad49f165435bddbb91844d9a (diff) |
[media] Patch for cx18 module with added support of GoTView PCI DVD3 Hybrid tuner
I've got code which adds support of GoTView PCI DVD3 Hybrid tuner in
cx18 module and Andy Walls in ivtv mailing-list gave me some advice on
making a patch and sending it here. So here's the patch against
staging/2.6.37-rc1 branch (the tutorial recommends to include it as
plain text but if it's the case I can surely send as an attachment):
Several comments on the patch:
1. Both users on the official Gotview forum and support said that PCI
DVD3 is very similar to Yuan MPC718 card so the main part of code is
taken from Yuan configuration. Some users reported it to work properly.
2. Everything is being initialized correctly including analog, dvb,
radio and alsa parts. Analogue part and alsa virtual card is tested by
myself using original Gotview card.
[mchehab@redhat.com: Whitespace cleanups]
Signed-off-by: Alexey Chernov <4ernov@gmail.com>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18')
-rw-r--r-- | drivers/media/video/cx18/cx18-cards.c | 63 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-driver.c | 2 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-driver.h | 4 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-dvb.c | 32 |
4 files changed, 99 insertions, 2 deletions
diff --git a/drivers/media/video/cx18/cx18-cards.c b/drivers/media/video/cx18/cx18-cards.c index fe1090940b01..52ba913b5af8 100644 --- a/drivers/media/video/cx18/cx18-cards.c +++ b/drivers/media/video/cx18/cx18-cards.c | |||
@@ -39,7 +39,7 @@ static struct cx18_card_tuner_i2c cx18_i2c_std = { | |||
39 | .tv = { 0x61, 0x60, I2C_CLIENT_END }, | 39 | .tv = { 0x61, 0x60, I2C_CLIENT_END }, |
40 | }; | 40 | }; |
41 | 41 | ||
42 | /* Please add new PCI IDs to: http://pci-ids.ucw.cz/ | 42 | /* Please add new PCI IDs to: http://pci-ids.ucw.cz/ |
43 | This keeps the PCI ID database up to date. Note that the entries | 43 | This keeps the PCI ID database up to date. Note that the entries |
44 | must be added under vendor 0x4444 (Conexant) as subsystem IDs. | 44 | must be added under vendor 0x4444 (Conexant) as subsystem IDs. |
45 | New vendor IDs should still be added to the vendor ID list. */ | 45 | New vendor IDs should still be added to the vendor ID list. */ |
@@ -251,6 +251,66 @@ static const struct cx18_card cx18_card_mpc718 = { | |||
251 | 251 | ||
252 | /* ------------------------------------------------------------------------- */ | 252 | /* ------------------------------------------------------------------------- */ |
253 | 253 | ||
254 | /* GoTView PCI */ | ||
255 | |||
256 | static const struct cx18_card_pci_info cx18_pci_gotview_dvd3[] = { | ||
257 | { PCI_DEVICE_ID_CX23418, CX18_PCI_ID_GOTVIEW, 0x3343 }, | ||
258 | { 0, 0, 0 } | ||
259 | }; | ||
260 | |||
261 | static const struct cx18_card cx18_card_gotview_dvd3 = { | ||
262 | .type = CX18_CARD_GOTVIEW_PCI_DVD3, | ||
263 | .name = "GoTView PCI DVD3 Hybrid", | ||
264 | .comment = "Experimenters needed for device to work well.\n" | ||
265 | "\tTo help, mail the ivtv-devel list (www.ivtvdriver.org).\n", | ||
266 | .v4l2_capabilities = CX18_CAP_ENCODER, | ||
267 | .hw_audio_ctrl = CX18_HW_418_AV, | ||
268 | .hw_muxer = CX18_HW_GPIO_MUX, | ||
269 | .hw_all = CX18_HW_TVEEPROM | CX18_HW_418_AV | CX18_HW_TUNER | | ||
270 | CX18_HW_GPIO_MUX | CX18_HW_DVB | CX18_HW_GPIO_RESET_CTRL, | ||
271 | .video_inputs = { | ||
272 | { CX18_CARD_INPUT_VID_TUNER, 0, CX18_AV_COMPOSITE2 }, | ||
273 | { CX18_CARD_INPUT_SVIDEO1, 1, | ||
274 | CX18_AV_SVIDEO_LUMA3 | CX18_AV_SVIDEO_CHROMA4 }, | ||
275 | { CX18_CARD_INPUT_COMPOSITE1, 1, CX18_AV_COMPOSITE1 }, | ||
276 | { CX18_CARD_INPUT_SVIDEO2, 2, | ||
277 | CX18_AV_SVIDEO_LUMA7 | CX18_AV_SVIDEO_CHROMA8 }, | ||
278 | { CX18_CARD_INPUT_COMPOSITE2, 2, CX18_AV_COMPOSITE6 }, | ||
279 | }, | ||
280 | .audio_inputs = { | ||
281 | { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO5, 0 }, | ||
282 | { CX18_CARD_INPUT_LINE_IN1, CX18_AV_AUDIO_SERIAL1, 1 }, | ||
283 | { CX18_CARD_INPUT_LINE_IN2, CX18_AV_AUDIO_SERIAL2, 1 }, | ||
284 | }, | ||
285 | .tuners = { | ||
286 | /* XC3028 tuner */ | ||
287 | { .std = V4L2_STD_ALL, .tuner = TUNER_XC2028 }, | ||
288 | }, | ||
289 | /* FIXME - the FM radio is just a guess and driver doesn't use SIF */ | ||
290 | .radio_input = { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO5, 2 }, | ||
291 | .ddr = { | ||
292 | /* Hynix HY5DU283222B DDR RAM */ | ||
293 | .chip_config = 0x303, | ||
294 | .refresh = 0x3bd, | ||
295 | .timing1 = 0x36320966, | ||
296 | .timing2 = 0x1f, | ||
297 | .tune_lane = 0, | ||
298 | .initial_emrs = 2, | ||
299 | }, | ||
300 | .gpio_init.initial_value = 0x1, | ||
301 | .gpio_init.direction = 0x3, | ||
302 | |||
303 | .gpio_audio_input = { .mask = 0x3, | ||
304 | .tuner = 0x1, | ||
305 | .linein = 0x2, | ||
306 | .radio = 0x1 }, | ||
307 | .xceive_pin = 0, | ||
308 | .pci_list = cx18_pci_gotview_dvd3, | ||
309 | .i2c = &cx18_i2c_std, | ||
310 | }; | ||
311 | |||
312 | /* ------------------------------------------------------------------------- */ | ||
313 | |||
254 | /* Conexant Raptor PAL/SECAM: note that this card is analog only! */ | 314 | /* Conexant Raptor PAL/SECAM: note that this card is analog only! */ |
255 | 315 | ||
256 | static const struct cx18_card_pci_info cx18_pci_cnxt_raptor_pal[] = { | 316 | static const struct cx18_card_pci_info cx18_pci_cnxt_raptor_pal[] = { |
@@ -463,6 +523,7 @@ static const struct cx18_card *cx18_card_list[] = { | |||
463 | &cx18_card_toshiba_qosmio_dvbt, | 523 | &cx18_card_toshiba_qosmio_dvbt, |
464 | &cx18_card_leadtek_pvr2100, | 524 | &cx18_card_leadtek_pvr2100, |
465 | &cx18_card_leadtek_dvr3100h, | 525 | &cx18_card_leadtek_dvr3100h, |
526 | &cx18_card_gotview_dvd3 | ||
466 | }; | 527 | }; |
467 | 528 | ||
468 | const struct cx18_card *cx18_get_card(u16 index) | 529 | const struct cx18_card *cx18_get_card(u16 index) |
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c index df60f27337cf..98ac2e935743 100644 --- a/drivers/media/video/cx18/cx18-driver.c +++ b/drivers/media/video/cx18/cx18-driver.c | |||
@@ -156,6 +156,7 @@ MODULE_PARM_DESC(cardtype, | |||
156 | "\t\t\t 6 = Toshiba Qosmio DVB-T/Analog\n" | 156 | "\t\t\t 6 = Toshiba Qosmio DVB-T/Analog\n" |
157 | "\t\t\t 7 = Leadtek WinFast PVR2100\n" | 157 | "\t\t\t 7 = Leadtek WinFast PVR2100\n" |
158 | "\t\t\t 8 = Leadtek WinFast DVR3100 H\n" | 158 | "\t\t\t 8 = Leadtek WinFast DVR3100 H\n" |
159 | "\t\t\t 9 = GoTView PCI DVD3 Hybrid\n" | ||
159 | "\t\t\t 0 = Autodetect (default)\n" | 160 | "\t\t\t 0 = Autodetect (default)\n" |
160 | "\t\t\t-1 = Ignore this card\n\t\t"); | 161 | "\t\t\t-1 = Ignore this card\n\t\t"); |
161 | MODULE_PARM_DESC(pal, "Set PAL standard: B, G, H, D, K, I, M, N, Nc, 60"); | 162 | MODULE_PARM_DESC(pal, "Set PAL standard: B, G, H, D, K, I, M, N, Nc, 60"); |
@@ -333,6 +334,7 @@ void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv) | |||
333 | tveeprom_hauppauge_analog(&c, tv, eedata); | 334 | tveeprom_hauppauge_analog(&c, tv, eedata); |
334 | break; | 335 | break; |
335 | case CX18_CARD_YUAN_MPC718: | 336 | case CX18_CARD_YUAN_MPC718: |
337 | case CX18_CARD_GOTVIEW_PCI_DVD3: | ||
336 | tv->model = 0x718; | 338 | tv->model = 0x718; |
337 | cx18_eeprom_dump(cx, eedata, sizeof(eedata)); | 339 | cx18_eeprom_dump(cx, eedata, sizeof(eedata)); |
338 | CX18_INFO("eeprom PCI ID: %02x%02x:%02x%02x\n", | 340 | CX18_INFO("eeprom PCI ID: %02x%02x:%02x%02x\n", |
diff --git a/drivers/media/video/cx18/cx18-driver.h b/drivers/media/video/cx18/cx18-driver.h index 77be58c1096b..cf4f20e91858 100644 --- a/drivers/media/video/cx18/cx18-driver.h +++ b/drivers/media/video/cx18/cx18-driver.h | |||
@@ -84,7 +84,8 @@ | |||
84 | #define CX18_CARD_TOSHIBA_QOSMIO_DVBT 5 /* Toshiba Qosmio Interal DVB-T/Analog*/ | 84 | #define CX18_CARD_TOSHIBA_QOSMIO_DVBT 5 /* Toshiba Qosmio Interal DVB-T/Analog*/ |
85 | #define CX18_CARD_LEADTEK_PVR2100 6 /* Leadtek WinFast PVR2100 */ | 85 | #define CX18_CARD_LEADTEK_PVR2100 6 /* Leadtek WinFast PVR2100 */ |
86 | #define CX18_CARD_LEADTEK_DVR3100H 7 /* Leadtek WinFast DVR3100 H */ | 86 | #define CX18_CARD_LEADTEK_DVR3100H 7 /* Leadtek WinFast DVR3100 H */ |
87 | #define CX18_CARD_LAST 7 | 87 | #define CX18_CARD_GOTVIEW_PCI_DVD3 8 /* GoTView PCI DVD3 Hybrid */ |
88 | #define CX18_CARD_LAST 8 | ||
88 | 89 | ||
89 | #define CX18_ENC_STREAM_TYPE_MPG 0 | 90 | #define CX18_ENC_STREAM_TYPE_MPG 0 |
90 | #define CX18_ENC_STREAM_TYPE_TS 1 | 91 | #define CX18_ENC_STREAM_TYPE_TS 1 |
@@ -106,6 +107,7 @@ | |||
106 | #define CX18_PCI_ID_CONEXANT 0x14f1 | 107 | #define CX18_PCI_ID_CONEXANT 0x14f1 |
107 | #define CX18_PCI_ID_TOSHIBA 0x1179 | 108 | #define CX18_PCI_ID_TOSHIBA 0x1179 |
108 | #define CX18_PCI_ID_LEADTEK 0x107D | 109 | #define CX18_PCI_ID_LEADTEK 0x107D |
110 | #define CX18_PCI_ID_GOTVIEW 0x5854 | ||
109 | 111 | ||
110 | /* ======================================================================== */ | 112 | /* ======================================================================== */ |
111 | /* ========================== START USER SETTABLE DMA VARIABLES =========== */ | 113 | /* ========================== START USER SETTABLE DMA VARIABLES =========== */ |
diff --git a/drivers/media/video/cx18/cx18-dvb.c b/drivers/media/video/cx18/cx18-dvb.c index 6d19f040d70f..c7f0bad39ad0 100644 --- a/drivers/media/video/cx18/cx18-dvb.c +++ b/drivers/media/video/cx18/cx18-dvb.c | |||
@@ -203,6 +203,14 @@ static struct zl10353_config yuan_mpc718_zl10353_demod = { | |||
203 | .disable_i2c_gate_ctrl = 1, /* Disable the I2C gate */ | 203 | .disable_i2c_gate_ctrl = 1, /* Disable the I2C gate */ |
204 | }; | 204 | }; |
205 | 205 | ||
206 | static struct zl10353_config gotview_dvd3_zl10353_demod = { | ||
207 | .demod_address = 0x1e >> 1, /* Datasheet suggested straps */ | ||
208 | .if2 = 45600, /* 4.560 MHz IF from the XC3028 */ | ||
209 | .parallel_ts = 1, /* Not a serial TS */ | ||
210 | .no_tuner = 1, /* XC3028 is not behind the gate */ | ||
211 | .disable_i2c_gate_ctrl = 1, /* Disable the I2C gate */ | ||
212 | }; | ||
213 | |||
206 | static int dvb_register(struct cx18_stream *stream); | 214 | static int dvb_register(struct cx18_stream *stream); |
207 | 215 | ||
208 | /* Kernel DVB framework calls this when the feed needs to start. | 216 | /* Kernel DVB framework calls this when the feed needs to start. |
@@ -247,6 +255,7 @@ static int cx18_dvb_start_feed(struct dvb_demux_feed *feed) | |||
247 | 255 | ||
248 | case CX18_CARD_LEADTEK_DVR3100H: | 256 | case CX18_CARD_LEADTEK_DVR3100H: |
249 | case CX18_CARD_YUAN_MPC718: | 257 | case CX18_CARD_YUAN_MPC718: |
258 | case CX18_CARD_GOTVIEW_PCI_DVD3: | ||
250 | default: | 259 | default: |
251 | /* Assumption - Parallel transport - Signalling | 260 | /* Assumption - Parallel transport - Signalling |
252 | * undefined or default. | 261 | * undefined or default. |
@@ -495,6 +504,29 @@ static int dvb_register(struct cx18_stream *stream) | |||
495 | fe->ops.tuner_ops.set_config(fe, &ctrl); | 504 | fe->ops.tuner_ops.set_config(fe, &ctrl); |
496 | } | 505 | } |
497 | break; | 506 | break; |
507 | case CX18_CARD_GOTVIEW_PCI_DVD3: | ||
508 | dvb->fe = dvb_attach(zl10353_attach, | ||
509 | &gotview_dvd3_zl10353_demod, | ||
510 | &cx->i2c_adap[1]); | ||
511 | if (dvb->fe != NULL) { | ||
512 | struct dvb_frontend *fe; | ||
513 | struct xc2028_config cfg = { | ||
514 | .i2c_adap = &cx->i2c_adap[1], | ||
515 | .i2c_addr = 0xc2 >> 1, | ||
516 | .ctrl = NULL, | ||
517 | }; | ||
518 | static struct xc2028_ctrl ctrl = { | ||
519 | .fname = XC2028_DEFAULT_FIRMWARE, | ||
520 | .max_len = 64, | ||
521 | .demod = XC3028_FE_ZARLINK456, | ||
522 | .type = XC2028_AUTO, | ||
523 | }; | ||
524 | |||
525 | fe = dvb_attach(xc2028_attach, dvb->fe, &cfg); | ||
526 | if (fe != NULL && fe->ops.tuner_ops.set_config != NULL) | ||
527 | fe->ops.tuner_ops.set_config(fe, &ctrl); | ||
528 | } | ||
529 | break; | ||
498 | default: | 530 | default: |
499 | /* No Digital Tv Support */ | 531 | /* No Digital Tv Support */ |
500 | break; | 532 | break; |