diff options
author | Gerd Knorr <devnull@localhost> | 2005-02-10 12:40:39 +0000 |
---|---|---|
committer | Gerd Knorr <devnull@localhost> | 2005-02-10 12:40:39 +0000 |
commit | 359de9165a05a6437c0e380abbbd3b113ecec01a (patch) | |
tree | 601d722bcf47586a6869038429639df9009e7431 /linux | |
parent | 1e0a5f7ce4f1fa6d96df603e3a47f5ef4ec40f75 (diff) | |
download | mediapointer-dvb-s2-359de9165a05a6437c0e380abbbd3b113ecec01a.tar.gz mediapointer-dvb-s2-359de9165a05a6437c0e380abbbd3b113ecec01a.tar.bz2 |
- more nicam / pal-i stuff from Ian Pickworth.
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-tvaudio.c | 209 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-cards.c | 10 |
2 files changed, 151 insertions, 68 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-tvaudio.c b/linux/drivers/media/video/cx88/cx88-tvaudio.c index 21dc3c0fe..4931667f3 100644 --- a/linux/drivers/media/video/cx88/cx88-tvaudio.c +++ b/linux/drivers/media/video/cx88/cx88-tvaudio.c @@ -1,5 +1,5 @@ /* - $Id: cx88-tvaudio.c,v 1.29 2005/01/24 17:37:23 kraxel Exp $ + $Id: cx88-tvaudio.c,v 1.30 2005/02/10 12:40:39 kraxel Exp $ cx88x-audio.c - Conexant CX23880/23881 audio downstream driver driver @@ -264,6 +264,7 @@ static void set_audio_standard_BTSC(struct cx88_core *core, unsigned int sap) set_audio_finish(core); } +#if 0 static void set_audio_standard_NICAM(struct cx88_core *core) { static const struct rlist nicam_common[] = { @@ -336,6 +337,7 @@ static void set_audio_standard_NICAM(struct cx88_core *core) }; set_audio_finish(core); } +#endif static void set_audio_standard_NICAM_L(struct cx88_core *core, int stereo) { @@ -455,13 +457,126 @@ static void set_audio_standard_NICAM_L(struct cx88_core *core, int stereo) set_audio_registers(core, nicam_l_mono); } else { set_audio_start(core, 0x0010, - 0x1924 /* FIXME again */); + 0x1924 /* FIXME again */); set_audio_registers(core, nicam_l); } set_audio_finish(core); } +static void set_audio_standard_PAL_I(struct cx88_core *core, int stereo) +{ + static const struct rlist pal_i_fm_mono[] = { + {AUD_ERRLOGPERIOD_R, 0x00000064}, + {AUD_ERRINTRPTTHSHLD1_R, 0x00000fff}, + {AUD_ERRINTRPTTHSHLD2_R, 0x0000001f}, + {AUD_ERRINTRPTTHSHLD3_R, 0x0000000f}, + {AUD_PDF_DDS_CNST_BYTE2, 0x06}, + {AUD_PDF_DDS_CNST_BYTE1, 0x82}, + {AUD_PDF_DDS_CNST_BYTE0, 0x12}, + {AUD_QAM_MODE, 0x05}, + {AUD_PHACC_FREQ_8MSB, 0x3a}, + {AUD_PHACC_FREQ_8LSB, 0x93}, + {AUD_DMD_RA_DDS, 0x002a4f2f}, + {AUD_PLL_INT, 0x0000001e}, + {AUD_PLL_DDS, 0x00000004}, + {AUD_PLL_FRAC, 0x0000e542}, + {AUD_RATE_ADJ1, 0x00000100}, + {AUD_RATE_ADJ2, 0x00000200}, + {AUD_RATE_ADJ3, 0x00000300}, + {AUD_RATE_ADJ4, 0x00000400}, + {AUD_RATE_ADJ5, 0x00000500}, + {AUD_THR_FR, 0x00000000}, + {AUD_PILOT_BQD_1_K0, 0x0000755b}, + {AUD_PILOT_BQD_1_K1, 0x00551340}, + {AUD_PILOT_BQD_1_K2, 0x006d30be}, + {AUD_PILOT_BQD_1_K3, 0xffd394af}, + {AUD_PILOT_BQD_1_K4, 0x00400000}, + {AUD_PILOT_BQD_2_K0, 0x00040000}, + {AUD_PILOT_BQD_2_K1, 0x002a4841}, + {AUD_PILOT_BQD_2_K2, 0x00400000}, + {AUD_PILOT_BQD_2_K3, 0x00000000}, + {AUD_PILOT_BQD_2_K4, 0x00000000}, + {AUD_MODE_CHG_TIMER, 0x00000060}, + {AUD_AFE_12DB_EN, 0x00000001}, + {AAGC_HYST, 0x0000000a}, + {AUD_CORDIC_SHIFT_0, 0x00000007}, + {AUD_CORDIC_SHIFT_1, 0x00000007}, + {AUD_C1_UP_THR, 0x00007000}, + {AUD_C1_LO_THR, 0x00005400}, + {AUD_C2_UP_THR, 0x00005400}, + {AUD_C2_LO_THR, 0x00003000}, + {AUD_DCOC_0_SRC, 0x0000001a}, + {AUD_DCOC0_SHIFT, 0x00000000}, + {AUD_DCOC_0_SHIFT_IN0, 0x0000000a}, + {AUD_DCOC_0_SHIFT_IN1, 0x00000008}, + {AUD_DCOC_PASS_IN, 0x00000003}, + {AUD_IIR3_0_SEL, 0x00000021}, + {AUD_DN2_AFC, 0x00000002}, + {AUD_DCOC_1_SRC, 0x0000001b}, + {AUD_DCOC1_SHIFT, 0x00000000}, + {AUD_DCOC_1_SHIFT_IN0, 0x0000000a}, + {AUD_DCOC_1_SHIFT_IN1, 0x00000008}, + {AUD_IIR3_1_SEL, 0x00000023}, + {AUD_DN0_FREQ, 0x000035a3}, + {AUD_DN2_FREQ, 0x000029c7}, + {AUD_CRDC0_SRC_SEL, 0x00000511}, + {AUD_IIR1_0_SEL, 0x00000001}, + {AUD_IIR1_1_SEL, 0x00000000}, + {AUD_IIR3_2_SEL, 0x00000003}, + {AUD_IIR3_2_SHIFT, 0x00000000}, + {AUD_IIR3_0_SEL, 0x00000002}, + {AUD_IIR2_0_SEL, 0x00000021}, + {AUD_IIR2_0_SHIFT, 0x00000002}, + {AUD_DEEMPH0_SRC_SEL, 0x0000000b}, + {AUD_DEEMPH1_SRC_SEL, 0x0000000b}, + {AUD_POLYPH80SCALEFAC, 0x00000001}, + {AUD_START_TIMER, 0x00000000}, + { /* end of list */ }, + }; + + static const struct rlist pal_i_nicam[] = { + { AUD_RATE_ADJ1, 0x00000010 }, + { AUD_RATE_ADJ2, 0x00000040 }, + { AUD_RATE_ADJ3, 0x00000100 }, + { AUD_RATE_ADJ4, 0x00000400 }, + { AUD_RATE_ADJ5, 0x00001000 }, + // { AUD_DMD_RA_DDS, 0x00c0d5ce }, + { AUD_DEEMPHGAIN_R, 0x000023c2 }, + { AUD_DEEMPHNUMER1_R, 0x0002a7bc }, + { AUD_DEEMPHNUMER2_R, 0x0003023e }, + { AUD_DEEMPHDENOM1_R, 0x0000f3d0 }, + { AUD_DEEMPHDENOM2_R, 0x00000000 }, + { AUD_DEEMPHDENOM2_R, 0x00000000 }, + { AUD_ERRLOGPERIOD_R, 0x00000fff }, + { AUD_ERRINTRPTTHSHLD1_R, 0x000003ff }, + { AUD_ERRINTRPTTHSHLD2_R, 0x000000ff }, + { AUD_ERRINTRPTTHSHLD3_R, 0x0000003f }, + { AUD_POLYPH80SCALEFAC, 0x00000003 }, + { AUD_PDF_DDS_CNST_BYTE2, 0x06 }, + { AUD_PDF_DDS_CNST_BYTE1, 0x82 }, + { AUD_PDF_DDS_CNST_BYTE0, 0x16 }, + { AUD_QAM_MODE, 0x05 }, + { AUD_PDF_DDS_CNST_BYTE0, 0x12 }, + { AUD_PHACC_FREQ_8MSB, 0x3a }, + { AUD_PHACC_FREQ_8LSB, 0x93 }, + { /* end of list */ }, + }; + + dprintk("%s (status: devel), stereo : %d\n",__FUNCTION__,stereo); + + if (!stereo) { + // FM mono + set_audio_start(core, 0x0004, EN_DMTRX_SUMDIFF | EN_A2_FORCE_MONO1); + set_audio_registers(core, pal_i_fm_mono); + } else { + // Nicam Stereo + set_audio_start(core, 0x0010, EN_DMTRX_LR | EN_DMTRX_BYPASS | EN_NICAM_AUTO_STEREO); + set_audio_registers(core, pal_i_nicam); + } + set_audio_finish(core); +} + static void set_audio_standard_A2(struct cx88_core *core) { /* from dscaler cvs */ @@ -518,44 +633,6 @@ static void set_audio_standard_A2(struct cx88_core *core) { /* end of list */ }, }; - static const struct rlist a2_pal_i_mono[] = { - // PAL-I (differences from dscaler CX2388xCard_Audio.cpp 1.30) - { AUD_ERRLOGPERIOD_R, 0x00000064}, - { AUD_ERRINTRPTTHSHLD1_R, 0x00000fff}, - { AUD_ERRINTRPTTHSHLD2_R, 0x0000001f}, - { AUD_ERRINTRPTTHSHLD3_R, 0x0000000f}, - { AUD_PHACC_FREQ_8MSB, 0x3a }, - { AUD_PHACC_FREQ_8LSB, 0x93 }, - { AAGC_HYST, 0x0000000a }, - { AUD_MODE_CHG_TIMER, 0x00000060 }, - { AUD_START_TIMER, 0x00000000 }, - { AUD_AFE_12DB_EN, 0x00000001 }, - { AUD_DMD_RA_DDS, 0x002a4f2f }, - { AUD_PLL_INT, 0x0000001e }, - { AUD_C1_UP_THR, 0x00007000 }, - { AUD_C1_LO_THR, 0x00005400 }, - { AUD_C2_UP_THR, 0x00005400 }, - { AUD_C2_LO_THR, 0x00003000 }, - { AUD_DN0_FREQ, 0x000035a3 }, - { AUD_DN2_FREQ, 0x000029c7 }, - { AUD_IIR1_0_SEL, 0x00000001 }, - { AUD_IIR1_1_SEL, 0x00000000 }, - { AUD_IIR3_2_SEL, 0x00000003 }, - { AUD_IIR3_2_SHIFT, 0x00000000 }, - { AUD_IIR3_0_SEL, 0x00000002 }, - { AUD_IIR2_0_SEL, 0x00000021 }, - { AUD_IIR2_0_SHIFT, 0x00000002 }, - { AUD_DEEMPH0_SRC_SEL, 0x0000000b }, - { AUD_DEEMPH1_SRC_SEL, 0x0000000b }, - { AUD_PLL_DDS, 0x00000004 }, - { AUD_PLL_FRAC, 0x0000e542 }, - { AUD_CRDC0_SRC_SEL, 0x00000511 }, - { AUD_DEEMPHGAIN_R, 0x000011e1 }, - { AUD_DEEMPHNUMER1_R, 0x0002a7bc }, - { AUD_DEEMPHNUMER2_R, 0x0003023c }, - { /* end of list */ }, - }; - static const struct rlist a2_table1[] = { // PAL-BG { AUD_DMD_RA_DDS, 0x002a73bd }, @@ -593,13 +670,6 @@ static void set_audio_standard_A2(struct cx88_core *core) set_audio_start(core, 0x0004, EN_DMTRX_SUMDIFF | EN_A2_AUTO_STEREO); set_audio_registers(core, a2_common); switch (core->tvaudio) { - case WW_NICAM_I: - /* gives at least mono according to the dscaler guys */ - /* so use use that while nicam is broken ... */ - dprintk("%s PAL-I mono (status: works, but noisy)\n",__FUNCTION__); - set_audio_registers(core, a2_pal_i_mono); - cx_write(AUD_CTL, EN_A2_FORCE_MONO1); - break; case WW_A2_BG: dprintk("%s PAL-BG A2 (status: known-good)\n",__FUNCTION__); set_audio_registers(core, a2_table1); @@ -686,11 +756,12 @@ void cx88_set_tvaudio(struct cx88_core *core) case WW_BTSC: set_audio_standard_BTSC(core,0); break; -// case WW_NICAM_I: case WW_NICAM_BGDKL: - set_audio_standard_NICAM(core); + set_audio_standard_NICAM_L(core,0); break; case WW_NICAM_I: + set_audio_standard_PAL_I(core,0); + break; case WW_A2_BG: case WW_A2_DK: case WW_A2_M: @@ -767,12 +838,9 @@ void cx88_get_stereo(struct cx88_core *core, struct v4l2_tuner *t) case WW_SYSTEM_L_AM: if (0x0 == mode) t->audmode = V4L2_TUNER_MODE_STEREO; - else - t->audmode = V4L2_TUNER_MODE_MONO; break ; default: - t->rxsubchans = V4L2_TUNER_SUB_MONO; - t->audmode = V4L2_TUNER_MODE_MONO; + /* nothing */ break; } return; @@ -842,19 +910,28 @@ void cx88_set_stereo(struct cx88_core *core, u32 mode, int manual) break; } break; - case WW_SYSTEM_L_AM: - switch (mode) { - case V4L2_TUNER_MODE_MONO: - set_audio_standard_NICAM_L(core, 0); - break; - case V4L2_TUNER_MODE_LANG1: /* FIXME */ - set_audio_standard_NICAM_L(core, 0); - break; - case V4L2_TUNER_MODE_STEREO: - set_audio_standard_NICAM_L(core, 1); - break; - } - break; + case WW_SYSTEM_L_AM: + switch (mode) { + case V4L2_TUNER_MODE_MONO: + case V4L2_TUNER_MODE_LANG1: /* FIXME */ + set_audio_standard_NICAM_L(core, 0); + break; + case V4L2_TUNER_MODE_STEREO: + set_audio_standard_NICAM_L(core, 1); + break; + } + break; + case WW_NICAM_I: + switch (mode) { + case V4L2_TUNER_MODE_MONO: + case V4L2_TUNER_MODE_LANG1: + set_audio_standard_PAL_I(core, 0); + break; + case V4L2_TUNER_MODE_STEREO: + set_audio_standard_PAL_I(core, 1); + break; + } + break; case WW_FM: switch (mode) { case V4L2_TUNER_MODE_MONO: diff --git a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c index 702827f30..2b357d18c 100644 --- a/linux/drivers/media/video/saa7134/saa7134-cards.c +++ b/linux/drivers/media/video/saa7134/saa7134-cards.c @@ -1,6 +1,6 @@ /* - * $Id: saa7134-cards.c,v 1.50 2005/02/09 15:42:46 kraxel Exp $ + * $Id: saa7134-cards.c,v 1.51 2005/02/10 12:40:39 kraxel Exp $ * * device driver for philips saa7134 based TV cards * card-specific stuff. @@ -1551,10 +1551,16 @@ struct pci_device_id saa7134_pci_tbl[] = { .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7135, .subvendor = 0x5168, - .subdevice = 0x0212, + .subdevice = 0x0212, /* minipci, LR212 */ .driver_data = SAA7134_BOARD_FLYTVPLATINUM, },{ .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, + .subvendor = 0x5168, + .subdevice = 0x0214, /* "normal" PCI card, LR214 */ + .driver_data = SAA7134_BOARD_FLYTVPLATINUM /* fixme */, + },{ + .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7134, .subvendor = 0x16be, .subdevice = 0x0003, |