summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx88/cx88-tvaudio.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <devnull@localhost>2005-08-07 17:36:20 +0000
committerMauro Carvalho Chehab <devnull@localhost>2005-08-07 17:36:20 +0000
commit6c54a21dd882f8c7f539bce0a447aea82d6d27a2 (patch)
tree3e1edf7711ab8660ca322c131ab2d6edccfb43e0 /linux/drivers/media/video/cx88/cx88-tvaudio.c
parent994e2cb596d90afaa2b9ebf529b9fc220e77b6ea (diff)
downloadmediapointer-dvb-s2-6c54a21dd882f8c7f539bce0a447aea82d6d27a2.tar.gz
mediapointer-dvb-s2-6c54a21dd882f8c7f539bce0a447aea82d6d27a2.tar.bz2
* cx88-tvaudio.c:
- Support for BTSC improved. Signed-off-by: Torsten Seeboth <Torsten.Seeboth@t-online.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'linux/drivers/media/video/cx88/cx88-tvaudio.c')
-rw-r--r--linux/drivers/media/video/cx88/cx88-tvaudio.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-tvaudio.c b/linux/drivers/media/video/cx88/cx88-tvaudio.c
index 05aa9f401..5f3de9678 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.39 2005/08/07 17:01:24 mchehab Exp $
+ $Id: cx88-tvaudio.c,v 1.40 2005/08/07 17:36:20 mchehab Exp $
cx88x-audio.c - Conexant CX23880/23881 audio downstream driver driver
@@ -149,22 +149,22 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl)
cx_write(AUD_I2SOUTPUTCNTL, 1);
cx_write(AUD_I2SCNTL, 0);
//cx_write(AUD_APB_IN_RATE_ADJ, 0);
-} else {
+ } else {
ctl |= EN_DAC_ENABLE;
cx_write(AUD_CTL, ctl);
}
-/* finish programming */
+ /* finish programming */
cx_write(AUD_SOFT_RESET, 0x0000);
-/* unmute */
+ /* unmute */
volume = cx_sread(SHADOW_AUD_VOL_CTL);
cx_swrite(SHADOW_AUD_VOL_CTL, AUD_VOL_CTL, volume);
}
/* ----------------------------------------------------------- */
-static void set_audio_standard_BTSC(struct cx88_core *core, unsigned int sap)
+static void set_audio_standard_BTSC(struct cx88_core *core, unsigned int sap, u32 mode)
{
static const struct rlist btsc[] = {
{ AUD_AFE_12DB_EN, 0x00000001 },
@@ -258,16 +258,18 @@ static void set_audio_standard_BTSC(struct cx88_core *core, unsigned int sap)
{ /* end of list */ },
};
+ mode |= EN_FMRADIO_EN_RDS;
+
if (sap) {
dprintk("%s SAP (status: unknown)\n",__FUNCTION__);
set_audio_start(core, SEL_SAP);
set_audio_registers(core, btsc_sap);
- set_audio_finish(core, EN_FMRADIO_EN_RDS | EN_BTSC_FORCE_SAP);
+ set_audio_finish(core, mode);
} else {
dprintk("%s (status: known-good)\n",__FUNCTION__);
set_audio_start(core, SEL_BTSC);
set_audio_registers(core, btsc);
- set_audio_finish(core, EN_FMRADIO_EN_RDS | EN_BTSC_AUTO_STEREO);
+ set_audio_finish(core, mode);
}
}
@@ -281,7 +283,7 @@ static void set_audio_standard_NICAM(struct cx88_core *core)
{ AUD_RATE_ADJ3, 0x00000100 },
{ AUD_RATE_ADJ4, 0x00000400 },
{ AUD_RATE_ADJ5, 0x00001000 },
-// { AUD_DMD_RA_DDS, 0x00c0d5ce },
+ // { AUD_DMD_RA_DDS, 0x00c0d5ce },
// Deemphasis 1:
{ AUD_DEEMPHGAIN_R, 0x000023c2 },
@@ -472,7 +474,7 @@ static void set_audio_standard_NICAM_L(struct cx88_core *core, int stereo)
static void set_audio_standard_PAL_I(struct cx88_core *core, int stereo)
{
-static const struct rlist pal_i_fm_mono[] = {
+ static const struct rlist pal_i_fm_mono[] = {
{AUD_ERRLOGPERIOD_R, 0x00000064},
{AUD_ERRINTRPTTHSHLD1_R, 0x00000fff},
{AUD_ERRINTRPTTHSHLD2_R, 0x0000001f},
@@ -539,9 +541,9 @@ static const struct rlist pal_i_fm_mono[] = {
{AUD_POLYPH80SCALEFAC, 0x00000001},
{AUD_START_TIMER, 0x00000000},
{ /* end of list */ },
-};
+ };
-static const struct rlist pal_i_nicam[] = {
+ static const struct rlist pal_i_nicam[] = {
{ AUD_RATE_ADJ1, 0x00000010 },
{ AUD_RATE_ADJ2, 0x00000040 },
{ AUD_RATE_ADJ3, 0x00000100 },
@@ -642,9 +644,9 @@ static void set_audio_standard_A2(struct cx88_core *core, u32 mode)
{AUD_POLYPH80SCALEFAC, 0x00000001},
{AUD_START_TIMER, 0x00000000},
{ /* end of list */ },
-};
+ };
-static const struct rlist a2_bg[] = {
+ static const struct rlist a2_bg[] = {
{AUD_DMD_RA_DDS, 0x002a4f2f},
{AUD_C1_UP_THR, 0x00007000},
{AUD_C1_LO_THR, 0x00005400},
@@ -653,7 +655,7 @@ static const struct rlist a2_bg[] = {
{ /* end of list */ },
};
-static const struct rlist a2_dk[] = {
+ static const struct rlist a2_dk[] = {
{AUD_DMD_RA_DDS, 0x002a4f2f},
{AUD_C1_UP_THR, 0x00007000},
{AUD_C1_LO_THR, 0x00005400},
@@ -664,7 +666,7 @@ static const struct rlist a2_dk[] = {
{ /* end of list */ },
};
/* unknown, probably NTSC-M */
-static const struct rlist a2_m[] = {
+ static const struct rlist a2_m[] = {
{AUD_DMD_RA_DDS, 0x002a0425},
{AUD_C1_UP_THR, 0x00003c00},
{AUD_C1_LO_THR, 0x00003000},
@@ -681,16 +683,16 @@ static const struct rlist a2_m[] = {
{ /* end of list */ },
};
-static const struct rlist a2_deemph50[] = {
+ static const struct rlist a2_deemph50[] = {
{AUD_DEEMPH0_G0, 0x00000380},
{AUD_DEEMPH1_G0, 0x00000380},
{AUD_DEEMPHGAIN_R, 0x000011e1},
{AUD_DEEMPHNUMER1_R, 0x0002a7bc},
{AUD_DEEMPHNUMER2_R, 0x0003023c},
{ /* end of list */ },
-};
+ };
-static const struct rlist a2_deemph75[] = {
+ static const struct rlist a2_deemph75[] = {
{AUD_DEEMPH0_G0, 0x00000480},
{AUD_DEEMPH1_G0, 0x00000480},
{AUD_DEEMPHGAIN_R, 0x00009000},
@@ -699,7 +701,7 @@ static const struct rlist a2_deemph75[] = {
{ /* end of list */ },
};
-set_audio_start(core, SEL_A2);
+ set_audio_start(core, SEL_A2);
set_audio_registers(core, a2_common);
switch (core->tvaudio) {
case WW_A2_BG:
@@ -719,8 +721,8 @@ set_audio_start(core, SEL_A2);
break;
};
-mode |= EN_FMRADIO_EN_RDS | EN_DMTRX_SUMDIFF;
-set_audio_finish(core, mode);
+ mode |= EN_FMRADIO_EN_RDS | EN_DMTRX_SUMDIFF;
+ set_audio_finish(core, mode);
}
static void set_audio_standard_EIAJ(struct cx88_core *core)
@@ -732,9 +734,9 @@ static void set_audio_standard_EIAJ(struct cx88_core *core)
};
dprintk("%s (status: unknown)\n",__FUNCTION__);
-set_audio_start(core, SEL_EIAJ);
+ set_audio_start(core, SEL_EIAJ);
set_audio_registers(core, eiaj);
-set_audio_finish(core, EN_EIAJ_AUTO_STEREO);
+ set_audio_finish(core, EN_EIAJ_AUTO_STEREO);
}
static void set_audio_standard_FM(struct cx88_core *core, enum cx88_deemph_type deemph)
@@ -780,7 +782,7 @@ static void set_audio_standard_FM(struct cx88_core *core, enum cx88_deemph_type
};
dprintk("%s (status: unknown)\n",__FUNCTION__);
-set_audio_start(core, SEL_FMRADIO);
+ set_audio_start(core, SEL_FMRADIO);
switch (deemph)
{
@@ -797,7 +799,7 @@ set_audio_start(core, SEL_FMRADIO);
break;
}
-set_audio_finish(core, EN_FMRADIO_AUTO_STEREO);
+ set_audio_finish(core, EN_FMRADIO_AUTO_STEREO);
}
/* ----------------------------------------------------------- */
@@ -806,7 +808,7 @@ void cx88_set_tvaudio(struct cx88_core *core)
{
switch (core->tvaudio) {
case WW_BTSC:
- set_audio_standard_BTSC(core,0);
+ set_audio_standard_BTSC(core, 0, EN_BTSC_FORCE_MONO);
break;
case WW_NICAM_BGDKL:
set_audio_standard_NICAM_L(core,0);
@@ -940,16 +942,14 @@ void cx88_set_stereo(struct cx88_core *core, u32 mode, int manual)
case WW_BTSC:
switch (mode) {
case V4L2_TUNER_MODE_MONO:
- ctl = EN_BTSC_FORCE_MONO;
- mask = 0x3f;
+ case V4L2_TUNER_MODE_LANG1:
+ set_audio_standard_BTSC(core, 0, EN_BTSC_FORCE_MONO);
break;
- case V4L2_TUNER_MODE_SAP:
- ctl = EN_BTSC_FORCE_SAP;
- mask = 0x3f;
+ case V4L2_TUNER_MODE_LANG2:
+ set_audio_standard_BTSC(core, 1, EN_BTSC_FORCE_SAP);
break;
case V4L2_TUNER_MODE_STEREO:
- ctl = EN_BTSC_AUTO_STEREO;
- mask = 0x3f;
+ set_audio_standard_BTSC(core, 0, EN_BTSC_FORCE_STEREO);
break;
}
break;