summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorGerd Knorr <devnull@localhost>2004-04-13 12:47:14 +0000
committerGerd Knorr <devnull@localhost>2004-04-13 12:47:14 +0000
commit8c41c763f28ab70519fc5eb562d590693fa92446 (patch)
tree608c8578b1a05d1f8b0676294e14563519fb067a /linux
parentcca8604716d157840f57df616091036729c2c878 (diff)
downloadmediapointer-dvb-s2-8c41c763f28ab70519fc5eb562d590693fa92446.tar.gz
mediapointer-dvb-s2-8c41c763f28ab70519fc5eb562d590693fa92446.tar.bz2
- cx88: some tvaudio code from dscaler cvs (btsc + nicam).
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/cx88/cx88-reg.h10
-rw-r--r--linux/drivers/media/video/cx88/cx88-tvaudio.c104
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-cards.c2
3 files changed, 98 insertions, 18 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-reg.h b/linux/drivers/media/video/cx88/cx88-reg.h
index 4ecce88a8..a80b7519e 100644
--- a/linux/drivers/media/video/cx88/cx88-reg.h
+++ b/linux/drivers/media/video/cx88/cx88-reg.h
@@ -599,10 +599,20 @@
#define EN_I2SIN_STR2DAC 0x00004000
#define EN_I2SIN_ENABLE 0x00008000
+#if 0
+/* old */
#define EN_DMTRX_SUMDIFF 0x00000800
#define EN_DMTRX_SUMR 0x00000880
#define EN_DMTRX_LR 0x00000900
#define EN_DMTRX_MONO 0x00000980
+#else
+/* dscaler cvs */
+#define EN_DMTRX_SUMDIFF (0 << 7)
+#define EN_DMTRX_SUMR (1 << 7)
+#define EN_DMTRX_LR (2 << 7)
+#define EN_DMTRX_MONO (3 << 7)
+#define EN_DMTRX_BYPASS (1 << 11)
+#endif
// Video
#define VID_CAPTURE_CONTROL 0x310180
diff --git a/linux/drivers/media/video/cx88/cx88-tvaudio.c b/linux/drivers/media/video/cx88/cx88-tvaudio.c
index 24f00c356..5402709aa 100644
--- a/linux/drivers/media/video/cx88/cx88-tvaudio.c
+++ b/linux/drivers/media/video/cx88/cx88-tvaudio.c
@@ -125,26 +125,57 @@ static void set_audio_finish(struct cx8800_dev *dev)
static void set_audio_standard_BTSC(struct cx8800_dev *dev, unsigned int sap)
{
static const struct rlist btsc[] = {
- /* Magic stuff from leadtek driver + datasheet.*/
- { AUD_DBX_IN_GAIN, 0x4734 },
- { AUD_DBX_WBE_GAIN, 0x4640 },
- { AUD_DBX_SE_GAIN, 0x8D31 },
- { AUD_DEEMPH0_G0, 0x1604 },
- { AUD_PHASE_FIX_CTL, 0x0020 },
-
+ /* from dscaler */
+ { AUD_OUT1_SEL, 0x00000013 },
+ { AUD_OUT1_SHIFT, 0x00000000 },
+ { AUD_POLY0_DDS_CONSTANT, 0x0012010c },
+ { AUD_DMD_RA_DDS, 0x00c3e7aa },
+ { AUD_DBX_IN_GAIN, 0x00004734 },
+ { AUD_DBX_WBE_GAIN, 0x00004640 },
+ { AUD_DBX_SE_GAIN, 0x00008d31 },
+ { AUD_DCOC_0_SRC, 0x0000001a },
+ { AUD_IIR1_4_SEL, 0x00000021 },
+ { AUD_DCOC_PASS_IN, 0x00000003 },
+ { AUD_DCOC_0_SHIFT_IN0, 0x0000000a },
+ { AUD_DCOC_0_SHIFT_IN1, 0x00000008 },
+ { AUD_DCOC_1_SHIFT_IN0, 0x0000000a },
+ { AUD_DCOC_1_SHIFT_IN1, 0x00000008 },
+ { AUD_DN0_FREQ, 0x0000283b },
+ { AUD_DN2_SRC_SEL, 0x00000008 },
+ { AUD_DN2_FREQ, 0x00003000 },
+ { AUD_DN2_AFC, 0x00000002 },
+ { AUD_DN2_SHFT, 0x00000000 },
+ { AUD_IIR2_2_SEL, 0x00000020 },
+ { AUD_IIR2_2_SHIFT, 0x00000000 },
+ { AUD_IIR2_3_SEL, 0x0000001f },
+ { AUD_IIR2_3_SHIFT, 0x00000000 },
+ { AUD_CRDC1_SRC_SEL, 0x000003ce },
+ { AUD_CRDC1_SHIFT, 0x00000000 },
+ { AUD_CORDIC_SHIFT_1, 0x00000007 },
+ { AUD_DCOC_1_SRC, 0x0000001b },
+ { AUD_DCOC1_SHIFT, 0x00000000 },
+ { AUD_RDSI_SEL, 0x00000008 },
+ { AUD_RDSQ_SEL, 0x00000008 },
+ { AUD_RDSI_SHIFT, 0x00000000 },
+ { AUD_RDSQ_SHIFT, 0x00000000 },
+ { AUD_POLYPH80SCALEFAC, 0x00000003 },
+
{ /* end of list */ },
};
+ // dscaler: exactly taken from driver,
+ // dscaler: don't know why to set EN_FMRADIO_EN_RDS
dprintk("%s (status: unknown)\n",__FUNCTION__);
set_audio_start(dev, 0x0001,
- EN_BTSC_AUTO_STEREO);
+ EN_FMRADIO_EN_RDS | EN_BTSC_AUTO_STEREO);
set_audio_registers(dev, btsc);
set_audio_finish(dev);
}
static void set_audio_standard_NICAM(struct cx8800_dev *dev)
{
- static const struct rlist nicam[] = {
+ static const struct rlist nicam_common[] = {
+ /* from dscaler */
{ AUD_RATE_ADJ1, 0x00000010 },
{ AUD_RATE_ADJ2, 0x00000040 },
{ AUD_RATE_ADJ3, 0x00000100 },
@@ -152,21 +183,60 @@ static void set_audio_standard_NICAM(struct cx8800_dev *dev)
{ AUD_RATE_ADJ5, 0x00001000 },
// { AUD_DMD_RA_DDS, 0x00c0d5ce },
+ // Deemphasis 1:
+ { AUD_DEEMPHGAIN_R, 0x000023c2 },
+ { AUD_DEEMPHNUMER1_R, 0x0002a7bc },
+ { AUD_DEEMPHNUMER2_R, 0x0003023e },
+ { AUD_DEEMPHDENOM1_R, 0x0000f3d0 },
+ { AUD_DEEMPHDENOM2_R, 0x00000000 },
+
+#if 0
+ // Deemphasis 2: (other tv norm?)
+ { AUD_DEEMPHGAIN_R, 0x0000c600 },
+ { AUD_DEEMPHNUMER1_R, 0x00066738 },
+ { AUD_DEEMPHNUMER2_R, 0x00066739 },
+ { AUD_DEEMPHDENOM1_R, 0x0001e88c },
+ { AUD_DEEMPHDENOM2_R, 0x0001e88c },
+#endif
+
+ { AUD_DEEMPHDENOM2_R, 0x00000000 },
+ { AUD_ERRLOGPERIOD_R, 0x00000fff },
+ { AUD_ERRINTRPTTHSHLD1_R, 0x000003ff },
+ { AUD_ERRINTRPTTHSHLD2_R, 0x000000ff },
+ { AUD_ERRINTRPTTHSHLD3_R, 0x0000003f },
+ { AUD_POLYPH80SCALEFAC, 0x00000003 },
+
// setup QAM registers
{ AUD_PDF_DDS_CNST_BYTE2, 0x06 },
{ AUD_PDF_DDS_CNST_BYTE1, 0x82 },
{ AUD_PDF_DDS_CNST_BYTE0, 0x16 },
{ AUD_QAM_MODE, 0x05 },
- { AUD_PHACC_FREQ_8MSB, 0x34 },
- { AUD_PHACC_FREQ_8LSB, 0x4c },
{ /* end of list */ },
};
+ static const struct rlist nicam_pal_i[] = {
+ { AUD_PDF_DDS_CNST_BYTE0, 0x12 },
+ { AUD_PHACC_FREQ_8MSB, 0x3a },
+ { AUD_PHACC_FREQ_8LSB, 0x93 },
+ };
+ static const struct rlist nicam_default[] = {
+ { AUD_PDF_DDS_CNST_BYTE0, 0x16 },
+ { AUD_PHACC_FREQ_8MSB, 0x34 },
+ { AUD_PHACC_FREQ_8LSB, 0x4c },
+ };
- dprintk("%s (status: unknown)\n",__FUNCTION__);
set_audio_start(dev, 0x0010,
- EN_DMTRX_LR | EN_NICAM_FORCE_STEREO);
- set_audio_registers(dev, nicam);
+ EN_DMTRX_LR | EN_DMTRX_BYPASS | EN_NICAM_AUTO_STEREO);
+ set_audio_registers(dev, nicam_common);
+ switch (dev->tvaudio) {
+ case WW_NICAM_I:
+ dprintk("%s PAL-I NICAM (status: unknown)\n",__FUNCTION__);
+ set_audio_registers(dev, nicam_pal_i);
+ case WW_NICAM_BGDKL:
+ dprintk("%s PAL NICAM (status: unknown)\n",__FUNCTION__);
+ set_audio_registers(dev, nicam_default);
+ break;
+ };
set_audio_finish(dev);
}
@@ -388,15 +458,15 @@ static void set_audio_standard_A2(struct cx8800_dev *dev)
set_audio_registers(dev, a2_common);
switch (dev->tvaudio) {
case WW_A2_BG:
- dprintk("%s PAL-BG (status: known-good)\n",__FUNCTION__);
+ dprintk("%s PAL-BG A2 (status: known-good)\n",__FUNCTION__);
set_audio_registers(dev, a2_table1);
break;
case WW_A2_DK:
- dprintk("%s PAL-DK (status: known-good)\n",__FUNCTION__);
+ dprintk("%s PAL-DK A2 (status: known-good)\n",__FUNCTION__);
set_audio_registers(dev, a2_table2);
break;
case WW_A2_M:
- dprintk("%s NTSC-M (status: unknown)\n",__FUNCTION__);
+ dprintk("%s NTSC-M A2 (status: unknown)\n",__FUNCTION__);
set_audio_registers(dev, a2_table3);
break;
};
diff --git a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c
index a68f9421f..f6db11574 100644
--- a/linux/drivers/media/video/saa7134/saa7134-cards.c
+++ b/linux/drivers/media/video/saa7134/saa7134-cards.c
@@ -673,7 +673,7 @@ struct saa7134_board saa7134_boards[] = {
}},
},
[SAA7134_BOARD_MD2819] = {
- .name = "Medion 2819/ AverMedia M156",
+ .name = "AverMedia M156 + 305 / Medion 2819",
.audio_clock = 0x00187de7,
.tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
.need_tda9887 = 1,