Commit 7b3c6d65 authored by Nickolay V. Shmyrev's avatar Nickolay V. Shmyrev Committed by Linus Torvalds

[PATCH] v4l: 706: reindent cx88 tvaudio c to keep coding style

- Reindent cx88-tvaudio.c to keep coding style.
Signed-off-by: default avatarNickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0bcc37c3
...@@ -57,39 +57,38 @@ ...@@ -57,39 +57,38 @@
#include "cx88.h" #include "cx88.h"
static unsigned int audio_debug = 0; static unsigned int audio_debug = 0;
module_param(audio_debug,int,0644); module_param(audio_debug, int, 0644);
MODULE_PARM_DESC(audio_debug,"enable debug messages [audio]"); MODULE_PARM_DESC(audio_debug, "enable debug messages [audio]");
#define dprintk(fmt, arg...) if (audio_debug) \ #define dprintk(fmt, arg...) if (audio_debug) \
printk(KERN_DEBUG "%s/0: " fmt, core->name , ## arg) printk(KERN_DEBUG "%s/0: " fmt, core->name , ## arg)
/* ----------------------------------------------------------- */ /* ----------------------------------------------------------- */
static char *aud_ctl_names[64] = static char *aud_ctl_names[64] = {
{ [EN_BTSC_FORCE_MONO] = "BTSC_FORCE_MONO",
[ EN_BTSC_FORCE_MONO ] = "BTSC_FORCE_MONO", [EN_BTSC_FORCE_STEREO] = "BTSC_FORCE_STEREO",
[ EN_BTSC_FORCE_STEREO ] = "BTSC_FORCE_STEREO", [EN_BTSC_FORCE_SAP] = "BTSC_FORCE_SAP",
[ EN_BTSC_FORCE_SAP ] = "BTSC_FORCE_SAP", [EN_BTSC_AUTO_STEREO] = "BTSC_AUTO_STEREO",
[ EN_BTSC_AUTO_STEREO ] = "BTSC_AUTO_STEREO", [EN_BTSC_AUTO_SAP] = "BTSC_AUTO_SAP",
[ EN_BTSC_AUTO_SAP ] = "BTSC_AUTO_SAP", [EN_A2_FORCE_MONO1] = "A2_FORCE_MONO1",
[ EN_A2_FORCE_MONO1 ] = "A2_FORCE_MONO1", [EN_A2_FORCE_MONO2] = "A2_FORCE_MONO2",
[ EN_A2_FORCE_MONO2 ] = "A2_FORCE_MONO2", [EN_A2_FORCE_STEREO] = "A2_FORCE_STEREO",
[ EN_A2_FORCE_STEREO ] = "A2_FORCE_STEREO", [EN_A2_AUTO_MONO2] = "A2_AUTO_MONO2",
[ EN_A2_AUTO_MONO2 ] = "A2_AUTO_MONO2", [EN_A2_AUTO_STEREO] = "A2_AUTO_STEREO",
[ EN_A2_AUTO_STEREO ] = "A2_AUTO_STEREO", [EN_EIAJ_FORCE_MONO1] = "EIAJ_FORCE_MONO1",
[ EN_EIAJ_FORCE_MONO1 ] = "EIAJ_FORCE_MONO1", [EN_EIAJ_FORCE_MONO2] = "EIAJ_FORCE_MONO2",
[ EN_EIAJ_FORCE_MONO2 ] = "EIAJ_FORCE_MONO2", [EN_EIAJ_FORCE_STEREO] = "EIAJ_FORCE_STEREO",
[ EN_EIAJ_FORCE_STEREO ] = "EIAJ_FORCE_STEREO", [EN_EIAJ_AUTO_MONO2] = "EIAJ_AUTO_MONO2",
[ EN_EIAJ_AUTO_MONO2 ] = "EIAJ_AUTO_MONO2", [EN_EIAJ_AUTO_STEREO] = "EIAJ_AUTO_STEREO",
[ EN_EIAJ_AUTO_STEREO ] = "EIAJ_AUTO_STEREO", [EN_NICAM_FORCE_MONO1] = "NICAM_FORCE_MONO1",
[ EN_NICAM_FORCE_MONO1 ] = "NICAM_FORCE_MONO1", [EN_NICAM_FORCE_MONO2] = "NICAM_FORCE_MONO2",
[ EN_NICAM_FORCE_MONO2 ] = "NICAM_FORCE_MONO2", [EN_NICAM_FORCE_STEREO] = "NICAM_FORCE_STEREO",
[ EN_NICAM_FORCE_STEREO ] = "NICAM_FORCE_STEREO", [EN_NICAM_AUTO_MONO2] = "NICAM_AUTO_MONO2",
[ EN_NICAM_AUTO_MONO2 ] = "NICAM_AUTO_MONO2", [EN_NICAM_AUTO_STEREO] = "NICAM_AUTO_STEREO",
[ EN_NICAM_AUTO_STEREO ] = "NICAM_AUTO_STEREO", [EN_FMRADIO_FORCE_MONO] = "FMRADIO_FORCE_MONO",
[ EN_FMRADIO_FORCE_MONO ] = "FMRADIO_FORCE_MONO", [EN_FMRADIO_FORCE_STEREO] = "FMRADIO_FORCE_STEREO",
[ EN_FMRADIO_FORCE_STEREO ] = "FMRADIO_FORCE_STEREO", [EN_FMRADIO_AUTO_STEREO] = "FMRADIO_AUTO_STEREO",
[ EN_FMRADIO_AUTO_STEREO ] = "FMRADIO_AUTO_STEREO",
}; };
struct rlist { struct rlist {
...@@ -97,8 +96,7 @@ struct rlist { ...@@ -97,8 +96,7 @@ struct rlist {
u32 val; u32 val;
}; };
static void set_audio_registers(struct cx88_core *core, static void set_audio_registers(struct cx88_core *core, const struct rlist *l)
const struct rlist *l)
{ {
int i; int i;
...@@ -119,8 +117,7 @@ static void set_audio_registers(struct cx88_core *core, ...@@ -119,8 +117,7 @@ static void set_audio_registers(struct cx88_core *core,
} }
} }
static void set_audio_start(struct cx88_core *core, static void set_audio_start(struct cx88_core *core, u32 mode)
u32 mode)
{ {
// mute // mute
cx_write(AUD_VOL_CTL, (1 << 6)); cx_write(AUD_VOL_CTL, (1 << 6));
...@@ -162,109 +159,110 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl) ...@@ -162,109 +159,110 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl)
/* ----------------------------------------------------------- */ /* ----------------------------------------------------------- */
static void set_audio_standard_BTSC(struct cx88_core *core, unsigned int sap, u32 mode) static void set_audio_standard_BTSC(struct cx88_core *core, unsigned int sap,
u32 mode)
{ {
static const struct rlist btsc[] = { static const struct rlist btsc[] = {
{ AUD_AFE_12DB_EN, 0x00000001 }, {AUD_AFE_12DB_EN, 0x00000001},
{ AUD_OUT1_SEL, 0x00000013 }, {AUD_OUT1_SEL, 0x00000013},
{ AUD_OUT1_SHIFT, 0x00000000 }, {AUD_OUT1_SHIFT, 0x00000000},
{ AUD_POLY0_DDS_CONSTANT, 0x0012010c }, {AUD_POLY0_DDS_CONSTANT, 0x0012010c},
{ AUD_DMD_RA_DDS, 0x00c3e7aa }, {AUD_DMD_RA_DDS, 0x00c3e7aa},
{ AUD_DBX_IN_GAIN, 0x00004734 }, {AUD_DBX_IN_GAIN, 0x00004734},
{ AUD_DBX_WBE_GAIN, 0x00004640 }, {AUD_DBX_WBE_GAIN, 0x00004640},
{ AUD_DBX_SE_GAIN, 0x00008d31 }, {AUD_DBX_SE_GAIN, 0x00008d31},
{ AUD_DCOC_0_SRC, 0x0000001a }, {AUD_DCOC_0_SRC, 0x0000001a},
{ AUD_IIR1_4_SEL, 0x00000021 }, {AUD_IIR1_4_SEL, 0x00000021},
{ AUD_DCOC_PASS_IN, 0x00000003 }, {AUD_DCOC_PASS_IN, 0x00000003},
{ AUD_DCOC_0_SHIFT_IN0, 0x0000000a }, {AUD_DCOC_0_SHIFT_IN0, 0x0000000a},
{ AUD_DCOC_0_SHIFT_IN1, 0x00000008 }, {AUD_DCOC_0_SHIFT_IN1, 0x00000008},
{ AUD_DCOC_1_SHIFT_IN0, 0x0000000a }, {AUD_DCOC_1_SHIFT_IN0, 0x0000000a},
{ AUD_DCOC_1_SHIFT_IN1, 0x00000008 }, {AUD_DCOC_1_SHIFT_IN1, 0x00000008},
{ AUD_DN0_FREQ, 0x0000283b }, {AUD_DN0_FREQ, 0x0000283b},
{ AUD_DN2_SRC_SEL, 0x00000008 }, {AUD_DN2_SRC_SEL, 0x00000008},
{ AUD_DN2_FREQ, 0x00003000 }, {AUD_DN2_FREQ, 0x00003000},
{ AUD_DN2_AFC, 0x00000002 }, {AUD_DN2_AFC, 0x00000002},
{ AUD_DN2_SHFT, 0x00000000 }, {AUD_DN2_SHFT, 0x00000000},
{ AUD_IIR2_2_SEL, 0x00000020 }, {AUD_IIR2_2_SEL, 0x00000020},
{ AUD_IIR2_2_SHIFT, 0x00000000 }, {AUD_IIR2_2_SHIFT, 0x00000000},
{ AUD_IIR2_3_SEL, 0x0000001f }, {AUD_IIR2_3_SEL, 0x0000001f},
{ AUD_IIR2_3_SHIFT, 0x00000000 }, {AUD_IIR2_3_SHIFT, 0x00000000},
{ AUD_CRDC1_SRC_SEL, 0x000003ce }, {AUD_CRDC1_SRC_SEL, 0x000003ce},
{ AUD_CRDC1_SHIFT, 0x00000000 }, {AUD_CRDC1_SHIFT, 0x00000000},
{ AUD_CORDIC_SHIFT_1, 0x00000007 }, {AUD_CORDIC_SHIFT_1, 0x00000007},
{ AUD_DCOC_1_SRC, 0x0000001b }, {AUD_DCOC_1_SRC, 0x0000001b},
{ AUD_DCOC1_SHIFT, 0x00000000 }, {AUD_DCOC1_SHIFT, 0x00000000},
{ AUD_RDSI_SEL, 0x00000008 }, {AUD_RDSI_SEL, 0x00000008},
{ AUD_RDSQ_SEL, 0x00000008 }, {AUD_RDSQ_SEL, 0x00000008},
{ AUD_RDSI_SHIFT, 0x00000000 }, {AUD_RDSI_SHIFT, 0x00000000},
{ AUD_RDSQ_SHIFT, 0x00000000 }, {AUD_RDSQ_SHIFT, 0x00000000},
{ AUD_POLYPH80SCALEFAC, 0x00000003 }, {AUD_POLYPH80SCALEFAC, 0x00000003},
{ /* end of list */ }, { /* end of list */ },
}; };
static const struct rlist btsc_sap[] = { static const struct rlist btsc_sap[] = {
{ AUD_AFE_12DB_EN, 0x00000001 }, {AUD_AFE_12DB_EN, 0x00000001},
{ AUD_DBX_IN_GAIN, 0x00007200 }, {AUD_DBX_IN_GAIN, 0x00007200},
{ AUD_DBX_WBE_GAIN, 0x00006200 }, {AUD_DBX_WBE_GAIN, 0x00006200},
{ AUD_DBX_SE_GAIN, 0x00006200 }, {AUD_DBX_SE_GAIN, 0x00006200},
{ AUD_IIR1_1_SEL, 0x00000000 }, {AUD_IIR1_1_SEL, 0x00000000},
{ AUD_IIR1_3_SEL, 0x00000001 }, {AUD_IIR1_3_SEL, 0x00000001},
{ AUD_DN1_SRC_SEL, 0x00000007 }, {AUD_DN1_SRC_SEL, 0x00000007},
{ AUD_IIR1_4_SHIFT, 0x00000006 }, {AUD_IIR1_4_SHIFT, 0x00000006},
{ AUD_IIR2_1_SHIFT, 0x00000000 }, {AUD_IIR2_1_SHIFT, 0x00000000},
{ AUD_IIR2_2_SHIFT, 0x00000000 }, {AUD_IIR2_2_SHIFT, 0x00000000},
{ AUD_IIR3_0_SHIFT, 0x00000000 }, {AUD_IIR3_0_SHIFT, 0x00000000},
{ AUD_IIR3_1_SHIFT, 0x00000000 }, {AUD_IIR3_1_SHIFT, 0x00000000},
{ AUD_IIR3_0_SEL, 0x0000000d }, {AUD_IIR3_0_SEL, 0x0000000d},
{ AUD_IIR3_1_SEL, 0x0000000e }, {AUD_IIR3_1_SEL, 0x0000000e},
{ AUD_DEEMPH1_SRC_SEL, 0x00000014 }, {AUD_DEEMPH1_SRC_SEL, 0x00000014},
{ AUD_DEEMPH1_SHIFT, 0x00000000 }, {AUD_DEEMPH1_SHIFT, 0x00000000},
{ AUD_DEEMPH1_G0, 0x00004000 }, {AUD_DEEMPH1_G0, 0x00004000},
{ AUD_DEEMPH1_A0, 0x00000000 }, {AUD_DEEMPH1_A0, 0x00000000},
{ AUD_DEEMPH1_B0, 0x00000000 }, {AUD_DEEMPH1_B0, 0x00000000},
{ AUD_DEEMPH1_A1, 0x00000000 }, {AUD_DEEMPH1_A1, 0x00000000},
{ AUD_DEEMPH1_B1, 0x00000000 }, {AUD_DEEMPH1_B1, 0x00000000},
{ AUD_OUT0_SEL, 0x0000003f }, {AUD_OUT0_SEL, 0x0000003f},
{ AUD_OUT1_SEL, 0x0000003f }, {AUD_OUT1_SEL, 0x0000003f},
{ AUD_DN1_AFC, 0x00000002 }, {AUD_DN1_AFC, 0x00000002},
{ AUD_DCOC_0_SHIFT_IN0, 0x0000000a }, {AUD_DCOC_0_SHIFT_IN0, 0x0000000a},
{ AUD_DCOC_0_SHIFT_IN1, 0x00000008 }, {AUD_DCOC_0_SHIFT_IN1, 0x00000008},
{ AUD_DCOC_1_SHIFT_IN0, 0x0000000a }, {AUD_DCOC_1_SHIFT_IN0, 0x0000000a},
{ AUD_DCOC_1_SHIFT_IN1, 0x00000008 }, {AUD_DCOC_1_SHIFT_IN1, 0x00000008},
{ AUD_IIR1_0_SEL, 0x0000001d }, {AUD_IIR1_0_SEL, 0x0000001d},
{ AUD_IIR1_2_SEL, 0x0000001e }, {AUD_IIR1_2_SEL, 0x0000001e},
{ AUD_IIR2_1_SEL, 0x00000002 }, {AUD_IIR2_1_SEL, 0x00000002},
{ AUD_IIR2_2_SEL, 0x00000004 }, {AUD_IIR2_2_SEL, 0x00000004},
{ AUD_IIR3_2_SEL, 0x0000000f }, {AUD_IIR3_2_SEL, 0x0000000f},
{ AUD_DCOC2_SHIFT, 0x00000001 }, {AUD_DCOC2_SHIFT, 0x00000001},
{ AUD_IIR3_2_SHIFT, 0x00000001 }, {AUD_IIR3_2_SHIFT, 0x00000001},
{ AUD_DEEMPH0_SRC_SEL, 0x00000014 }, {AUD_DEEMPH0_SRC_SEL, 0x00000014},
{ AUD_CORDIC_SHIFT_1, 0x00000006 }, {AUD_CORDIC_SHIFT_1, 0x00000006},
{ AUD_POLY0_DDS_CONSTANT, 0x000e4db2 }, {AUD_POLY0_DDS_CONSTANT, 0x000e4db2},
{ AUD_DMD_RA_DDS, 0x00f696e6 }, {AUD_DMD_RA_DDS, 0x00f696e6},
{ AUD_IIR2_3_SEL, 0x00000025 }, {AUD_IIR2_3_SEL, 0x00000025},
{ AUD_IIR1_4_SEL, 0x00000021 }, {AUD_IIR1_4_SEL, 0x00000021},
{ AUD_DN1_FREQ, 0x0000c965 }, {AUD_DN1_FREQ, 0x0000c965},
{ AUD_DCOC_PASS_IN, 0x00000003 }, {AUD_DCOC_PASS_IN, 0x00000003},
{ AUD_DCOC_0_SRC, 0x0000001a }, {AUD_DCOC_0_SRC, 0x0000001a},
{ AUD_DCOC_1_SRC, 0x0000001b }, {AUD_DCOC_1_SRC, 0x0000001b},
{ AUD_DCOC1_SHIFT, 0x00000000 }, {AUD_DCOC1_SHIFT, 0x00000000},
{ AUD_RDSI_SEL, 0x00000009 }, {AUD_RDSI_SEL, 0x00000009},
{ AUD_RDSQ_SEL, 0x00000009 }, {AUD_RDSQ_SEL, 0x00000009},
{ AUD_RDSI_SHIFT, 0x00000000 }, {AUD_RDSI_SHIFT, 0x00000000},
{ AUD_RDSQ_SHIFT, 0x00000000 }, {AUD_RDSQ_SHIFT, 0x00000000},
{ AUD_POLYPH80SCALEFAC, 0x00000003 }, {AUD_POLYPH80SCALEFAC, 0x00000003},
{ /* end of list */ }, { /* end of list */ },
}; };
mode |= EN_FMRADIO_EN_RDS; mode |= EN_FMRADIO_EN_RDS;
if (sap) { if (sap) {
dprintk("%s SAP (status: unknown)\n",__FUNCTION__); dprintk("%s SAP (status: unknown)\n", __FUNCTION__);
set_audio_start(core, SEL_SAP); set_audio_start(core, SEL_SAP);
set_audio_registers(core, btsc_sap); set_audio_registers(core, btsc_sap);
set_audio_finish(core, mode); set_audio_finish(core, mode);
} else { } else {
dprintk("%s (status: known-good)\n",__FUNCTION__); dprintk("%s (status: known-good)\n", __FUNCTION__);
set_audio_start(core, SEL_BTSC); set_audio_start(core, SEL_BTSC);
set_audio_registers(core, btsc); set_audio_registers(core, btsc);
set_audio_finish(core, mode); set_audio_finish(core, mode);
...@@ -274,87 +272,87 @@ static void set_audio_standard_BTSC(struct cx88_core *core, unsigned int sap, u3 ...@@ -274,87 +272,87 @@ static void set_audio_standard_BTSC(struct cx88_core *core, unsigned int sap, u3
static void set_audio_standard_NICAM(struct cx88_core *core, u32 mode) static void set_audio_standard_NICAM(struct cx88_core *core, u32 mode)
{ {
static const struct rlist nicam_l[] = { static const struct rlist nicam_l[] = {
{ AUD_AFE_12DB_EN, 0x00000001}, {AUD_AFE_12DB_EN, 0x00000001},
{ AUD_RATE_ADJ1, 0x00000060 }, {AUD_RATE_ADJ1, 0x00000060},
{ AUD_RATE_ADJ2, 0x000000F9 }, {AUD_RATE_ADJ2, 0x000000F9},
{ AUD_RATE_ADJ3, 0x000001CC }, {AUD_RATE_ADJ3, 0x000001CC},
{ AUD_RATE_ADJ4, 0x000002B3 }, {AUD_RATE_ADJ4, 0x000002B3},
{ AUD_RATE_ADJ5, 0x00000726 }, {AUD_RATE_ADJ5, 0x00000726},
{ AUD_DEEMPHDENOM1_R, 0x0000F3D0 }, {AUD_DEEMPHDENOM1_R, 0x0000F3D0},
{ AUD_DEEMPHDENOM2_R, 0x00000000 }, {AUD_DEEMPHDENOM2_R, 0x00000000},
{ AUD_ERRLOGPERIOD_R, 0x00000064 }, {AUD_ERRLOGPERIOD_R, 0x00000064},
{ AUD_ERRINTRPTTHSHLD1_R, 0x00000FFF }, {AUD_ERRINTRPTTHSHLD1_R, 0x00000FFF},
{ AUD_ERRINTRPTTHSHLD2_R, 0x0000001F }, {AUD_ERRINTRPTTHSHLD2_R, 0x0000001F},
{ AUD_ERRINTRPTTHSHLD3_R, 0x0000000F }, {AUD_ERRINTRPTTHSHLD3_R, 0x0000000F},
{ AUD_POLYPH80SCALEFAC, 0x00000003 }, {AUD_POLYPH80SCALEFAC, 0x00000003},
{ AUD_DMD_RA_DDS, 0x00C00000 }, {AUD_DMD_RA_DDS, 0x00C00000},
{ AUD_PLL_INT, 0x0000001E }, {AUD_PLL_INT, 0x0000001E},
{ AUD_PLL_DDS, 0x00000000 }, {AUD_PLL_DDS, 0x00000000},
{ AUD_PLL_FRAC, 0x0000E542 }, {AUD_PLL_FRAC, 0x0000E542},
{ AUD_START_TIMER, 0x00000000 }, {AUD_START_TIMER, 0x00000000},
{ AUD_DEEMPHNUMER1_R, 0x000353DE }, {AUD_DEEMPHNUMER1_R, 0x000353DE},
{ AUD_DEEMPHNUMER2_R, 0x000001B1 }, {AUD_DEEMPHNUMER2_R, 0x000001B1},
{ AUD_PDF_DDS_CNST_BYTE2, 0x06 }, {AUD_PDF_DDS_CNST_BYTE2, 0x06},
{ AUD_PDF_DDS_CNST_BYTE1, 0x82 }, {AUD_PDF_DDS_CNST_BYTE1, 0x82},
{ AUD_PDF_DDS_CNST_BYTE0, 0x12 }, {AUD_PDF_DDS_CNST_BYTE0, 0x12},
{ AUD_QAM_MODE, 0x05 }, {AUD_QAM_MODE, 0x05},
{ AUD_PHACC_FREQ_8MSB, 0x34 }, {AUD_PHACC_FREQ_8MSB, 0x34},
{ AUD_PHACC_FREQ_8LSB, 0x4C }, {AUD_PHACC_FREQ_8LSB, 0x4C},
{ AUD_DEEMPHGAIN_R, 0x00006680 }, {AUD_DEEMPHGAIN_R, 0x00006680},
{ AUD_RATE_THRES_DMD, 0x000000C0 }, {AUD_RATE_THRES_DMD, 0x000000C0},
{ /* end of list */ }, { /* end of list */ },
} ; };
static const struct rlist nicam_bgdki_common[] = { static const struct rlist nicam_bgdki_common[] = {
{ AUD_AFE_12DB_EN, 0x00000001}, {AUD_AFE_12DB_EN, 0x00000001},
{ AUD_RATE_ADJ1, 0x00000010 }, {AUD_RATE_ADJ1, 0x00000010},
{ AUD_RATE_ADJ2, 0x00000040 }, {AUD_RATE_ADJ2, 0x00000040},
{ AUD_RATE_ADJ3, 0x00000100 }, {AUD_RATE_ADJ3, 0x00000100},
{ AUD_RATE_ADJ4, 0x00000400 }, {AUD_RATE_ADJ4, 0x00000400},
{ AUD_RATE_ADJ5, 0x00001000 }, {AUD_RATE_ADJ5, 0x00001000},
//{ AUD_DMD_RA_DDS, 0x00c0d5ce }, //{ AUD_DMD_RA_DDS, 0x00c0d5ce },
{ AUD_ERRLOGPERIOD_R, 0x00000fff}, {AUD_ERRLOGPERIOD_R, 0x00000fff},
{ AUD_ERRINTRPTTHSHLD1_R, 0x000003ff}, {AUD_ERRINTRPTTHSHLD1_R, 0x000003ff},
{ AUD_ERRINTRPTTHSHLD2_R, 0x000000ff}, {AUD_ERRINTRPTTHSHLD2_R, 0x000000ff},
{ AUD_ERRINTRPTTHSHLD3_R, 0x0000003f}, {AUD_ERRINTRPTTHSHLD3_R, 0x0000003f},
{ AUD_POLYPH80SCALEFAC, 0x00000003}, {AUD_POLYPH80SCALEFAC, 0x00000003},
{ AUD_DEEMPHGAIN_R, 0x000023c2}, {AUD_DEEMPHGAIN_R, 0x000023c2},
{ AUD_DEEMPHNUMER1_R, 0x0002a7bc}, {AUD_DEEMPHNUMER1_R, 0x0002a7bc},
{ AUD_DEEMPHNUMER2_R, 0x0003023e}, {AUD_DEEMPHNUMER2_R, 0x0003023e},
{ AUD_DEEMPHDENOM1_R, 0x0000f3d0}, {AUD_DEEMPHDENOM1_R, 0x0000f3d0},
{ AUD_DEEMPHDENOM2_R, 0x00000000}, {AUD_DEEMPHDENOM2_R, 0x00000000},
{ AUD_PDF_DDS_CNST_BYTE1, 0x82 }, {AUD_PDF_DDS_CNST_BYTE1, 0x82},
{ AUD_PDF_DDS_CNST_BYTE0, 0x16 }, {AUD_PDF_DDS_CNST_BYTE0, 0x16},
{ AUD_QAM_MODE, 0x05 }, {AUD_QAM_MODE, 0x05},
{ /* end of list */ }, { /* end of list */ },
}; };
static const struct rlist nicam_i[] = { static const struct rlist nicam_i[] = {
{ AUD_PDF_DDS_CNST_BYTE0, 0x12 }, {AUD_PDF_DDS_CNST_BYTE0, 0x12},
{ AUD_PHACC_FREQ_8MSB, 0x3a }, {AUD_PHACC_FREQ_8MSB, 0x3a},
{ AUD_PHACC_FREQ_8LSB, 0x93 }, {AUD_PHACC_FREQ_8LSB, 0x93},
{ /* end of list */ }, { /* end of list */ },
}; };
static const struct rlist nicam_default[] = { static const struct rlist nicam_default[] = {
{ AUD_PDF_DDS_CNST_BYTE0, 0x16 }, {AUD_PDF_DDS_CNST_BYTE0, 0x16},
{ AUD_PHACC_FREQ_8MSB, 0x34 }, {AUD_PHACC_FREQ_8MSB, 0x34},
{ AUD_PHACC_FREQ_8LSB, 0x4c }, {AUD_PHACC_FREQ_8LSB, 0x4c},
{ /* end of list */ }, { /* end of list */ },
}; };
switch (core->tvaudio) { switch (core->tvaudio) {
case WW_L: case WW_L:
dprintk("%s SECAM-L NICAM (status: devel)\n",__FUNCTION__); dprintk("%s SECAM-L NICAM (status: devel)\n", __FUNCTION__);
set_audio_registers(core, nicam_l); set_audio_registers(core, nicam_l);
break; break;
case WW_I: case WW_I:
dprintk("%s PAL-I NICAM (status: devel)\n",__FUNCTION__); dprintk("%s PAL-I NICAM (status: devel)\n", __FUNCTION__);
set_audio_registers(core, nicam_bgdki_common); set_audio_registers(core, nicam_bgdki_common);
set_audio_registers(core, nicam_i); set_audio_registers(core, nicam_i);
break; break;
default: default:
dprintk("%s PAL-BGDK NICAM (status: unknown)\n",__FUNCTION__); dprintk("%s PAL-BGDK NICAM (status: unknown)\n", __FUNCTION__);
set_audio_registers(core, nicam_bgdki_common); set_audio_registers(core, nicam_bgdki_common);
set_audio_registers(core, nicam_default); set_audio_registers(core, nicam_default);
break; break;
...@@ -579,7 +577,7 @@ static void set_audio_standard_A2(struct cx88_core *core, u32 mode) ...@@ -579,7 +577,7 @@ static void set_audio_standard_A2(struct cx88_core *core, u32 mode)
{AUD_RATE_ADJ4, 0x00000400}, {AUD_RATE_ADJ4, 0x00000400},
{AUD_RATE_ADJ5, 0x00000500}, {AUD_RATE_ADJ5, 0x00000500},
{AUD_RATE_THRES_DMD, 0x000000C0}, {AUD_RATE_THRES_DMD, 0x000000C0},
{/* end of list */ }, { /* end of list */ },
}; };
static const struct rlist a2_deemph50[] = { static const struct rlist a2_deemph50[] = {
...@@ -594,28 +592,28 @@ static void set_audio_standard_A2(struct cx88_core *core, u32 mode) ...@@ -594,28 +592,28 @@ static void set_audio_standard_A2(struct cx88_core *core, u32 mode)
set_audio_start(core, SEL_A2); set_audio_start(core, SEL_A2);
switch (core->tvaudio) { switch (core->tvaudio) {
case WW_BG: case WW_BG:
dprintk("%s PAL-BG A1/2 (status: known-good)\n",__FUNCTION__); dprintk("%s PAL-BG A1/2 (status: known-good)\n", __FUNCTION__);
set_audio_registers(core, a2_bgdk_common); set_audio_registers(core, a2_bgdk_common);
set_audio_registers(core, a2_bg); set_audio_registers(core, a2_bg);
set_audio_registers(core, a2_deemph50); set_audio_registers(core, a2_deemph50);
break; break;
case WW_DK: case WW_DK:
dprintk("%s PAL-DK A1/2 (status: known-good)\n",__FUNCTION__); dprintk("%s PAL-DK A1/2 (status: known-good)\n", __FUNCTION__);
set_audio_registers(core, a2_bgdk_common); set_audio_registers(core, a2_bgdk_common);
set_audio_registers(core, a2_dk); set_audio_registers(core, a2_dk);
set_audio_registers(core, a2_deemph50); set_audio_registers(core, a2_deemph50);
break; break;
case WW_I: case WW_I:
dprintk("%s PAL-I A1 (status: known-good)\n",__FUNCTION__); dprintk("%s PAL-I A1 (status: known-good)\n", __FUNCTION__);
set_audio_registers(core, a1_i); set_audio_registers(core, a1_i);
set_audio_registers(core, a2_deemph50); set_audio_registers(core, a2_deemph50);
break; break;
case WW_L: case WW_L:
dprintk("%s AM-L (status: devel)\n",__FUNCTION__); dprintk("%s AM-L (status: devel)\n", __FUNCTION__);
set_audio_registers(core, am_l); set_audio_registers(core, am_l);
break; break;
default: default:
dprintk("%s Warning: wrong value\n",__FUNCTION__); dprintk("%s Warning: wrong value\n", __FUNCTION__);
return; return;
break; break;
}; };
...@@ -631,60 +629,60 @@ static void set_audio_standard_EIAJ(struct cx88_core *core) ...@@ -631,60 +629,60 @@ static void set_audio_standard_EIAJ(struct cx88_core *core)
{ /* end of list */ }, { /* end of list */ },
}; };
dprintk("%s (status: unknown)\n",__FUNCTION__); 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_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) static void set_audio_standard_FM(struct cx88_core *core,
enum cx88_deemph_type deemph)
{ {
static const struct rlist fm_deemph_50[] = { static const struct rlist fm_deemph_50[] = {
{ AUD_DEEMPH0_G0, 0x0C45 }, {AUD_DEEMPH0_G0, 0x0C45},
{ AUD_DEEMPH0_A0, 0x6262 }, {AUD_DEEMPH0_A0, 0x6262},
{ AUD_DEEMPH0_B0, 0x1C29 }, {AUD_DEEMPH0_B0, 0x1C29},
{ AUD_DEEMPH0_A1, 0x3FC66}, {AUD_DEEMPH0_A1, 0x3FC66},
{ AUD_DEEMPH0_B1, 0x399A }, {AUD_DEEMPH0_B1, 0x399A},
{ AUD_DEEMPH1_G0, 0x0D80 }, {AUD_DEEMPH1_G0, 0x0D80},
{ AUD_DEEMPH1_A0, 0x6262 }, {AUD_DEEMPH1_A0, 0x6262},
{ AUD_DEEMPH1_B0, 0x1C29 }, {AUD_DEEMPH1_B0, 0x1C29},
{ AUD_DEEMPH1_A1, 0x3FC66}, {AUD_DEEMPH1_A1, 0x3FC66},
{ AUD_DEEMPH1_B1, 0x399A}, {AUD_DEEMPH1_B1, 0x399A},
{ AUD_POLYPH80SCALEFAC, 0x0003}, {AUD_POLYPH80SCALEFAC, 0x0003},
{ /* end of list */ }, { /* end of list */ },
}; };
static const struct rlist fm_deemph_75[] = { static const struct rlist fm_deemph_75[] = {
{ AUD_DEEMPH0_G0, 0x091B }, {AUD_DEEMPH0_G0, 0x091B},
{ AUD_DEEMPH0_A0, 0x6B68 }, {AUD_DEEMPH0_A0, 0x6B68},
{ AUD_DEEMPH0_B0, 0x11EC }, {AUD_DEEMPH0_B0, 0x11EC},
{ AUD_DEEMPH0_A1, 0x3FC66}, {AUD_DEEMPH0_A1, 0x3FC66},
{ AUD_DEEMPH0_B1, 0x399A }, {AUD_DEEMPH0_B1, 0x399A},
{ AUD_DEEMPH1_G0, 0x0AA0 }, {AUD_DEEMPH1_G0, 0x0AA0},
{ AUD_DEEMPH1_A0, 0x6B68 }, {AUD_DEEMPH1_A0, 0x6B68},
{ AUD_DEEMPH1_B0, 0x11EC }, {AUD_DEEMPH1_B0, 0x11EC},
{ AUD_DEEMPH1_A1, 0x3FC66}, {AUD_DEEMPH1_A1, 0x3FC66},
{ AUD_DEEMPH1_B1, 0x399A}, {AUD_DEEMPH1_B1, 0x399A},
{ AUD_POLYPH80SCALEFAC, 0x0003}, {AUD_POLYPH80SCALEFAC, 0x0003},
{ /* end of list */ }, { /* end of list */ },
}; };
/* It is enough to leave default values? */ /* It is enough to leave default values? */
static const struct rlist fm_no_deemph[] = { static const struct rlist fm_no_deemph[] = {
{ AUD_POLYPH80SCALEFAC, 0x0003}, {AUD_POLYPH80SCALEFAC, 0x0003},
{ /* end of list */ }, { /* end of list */ },
}; };
dprintk("%s (status: unknown)\n",__FUNCTION__); dprintk("%s (status: unknown)\n", __FUNCTION__);
set_audio_start(core, SEL_FMRADIO); set_audio_start(core, SEL_FMRADIO);
switch (deemph) switch (deemph) {
{
case FM_NO_DEEMPH: case FM_NO_DEEMPH:
set_audio_registers(core, fm_no_deemph); set_audio_registers(core, fm_no_deemph);
break; break;
...@@ -705,22 +703,22 @@ static void set_audio_standard_FM(struct cx88_core *core, enum cx88_deemph_type ...@@ -705,22 +703,22 @@ static void set_audio_standard_FM(struct cx88_core *core, enum cx88_deemph_type
int cx88_detect_nicam(struct cx88_core *core) int cx88_detect_nicam(struct cx88_core *core)
{ {
int i, j=0; int i, j = 0;
dprintk("start nicam autodetect.\n"); dprintk("start nicam autodetect.\n");
for(i=0; i<6; i++) { for (i = 0; i < 6; i++) {
/* if bit1=1 then nicam is detected */ /* if bit1=1 then nicam is detected */
j+= ((cx_read(AUD_NICAM_STATUS2) & 0x02) >> 1); j += ((cx_read(AUD_NICAM_STATUS2) & 0x02) >> 1);
/* 3x detected: absolutly sure now */ /* 3x detected: absolutly sure now */
if(j==3) { if (j == 3) {
dprintk("nicam is detected.\n"); dprintk("nicam is detected.\n");
return 1; return 1;
} }
/* wait a little bit for next reading status */ /* wait a little bit for next reading status */
msleep (10); msleep(10);
} }
dprintk("nicam is not detected.\n"); dprintk("nicam is not detected.\n");
...@@ -743,7 +741,7 @@ void cx88_set_tvaudio(struct cx88_core *core) ...@@ -743,7 +741,7 @@ void cx88_set_tvaudio(struct cx88_core *core)
/* set nicam mode - otherwise /* set nicam mode - otherwise
AUD_NICAM_STATUS2 contains wrong values */ AUD_NICAM_STATUS2 contains wrong values */
set_audio_standard_NICAM(core, EN_NICAM_FORCE_MONO1); set_audio_standard_NICAM(core, EN_NICAM_FORCE_MONO1);
if(0 == cx88_detect_nicam(core)) { if (0 == cx88_detect_nicam(core)) {
/* fall back to fm / am mono */ /* fall back to fm / am mono */
set_audio_standard_A2(core, EN_A2_FORCE_MONO1); set_audio_standard_A2(core, EN_A2_FORCE_MONO1);
core->use_nicam = 0; core->use_nicam = 0;
...@@ -755,7 +753,7 @@ void cx88_set_tvaudio(struct cx88_core *core) ...@@ -755,7 +753,7 @@ void cx88_set_tvaudio(struct cx88_core *core)
set_audio_standard_EIAJ(core); set_audio_standard_EIAJ(core);
break; break;
case WW_FM: case WW_FM:
set_audio_standard_FM(core,FM_NO_DEEMPH); set_audio_standard_FM(core, FM_NO_DEEMPH);
break; break;
case WW_NONE: case WW_NONE:
default: default:
...@@ -773,9 +771,9 @@ void cx88_newstation(struct cx88_core *core) ...@@ -773,9 +771,9 @@ void cx88_newstation(struct cx88_core *core)
void cx88_get_stereo(struct cx88_core *core, struct v4l2_tuner *t) void cx88_get_stereo(struct cx88_core *core, struct v4l2_tuner *t)
{ {
static char *m[] = {"stereo", "dual mono", "mono", "sap"}; static char *m[] = { "stereo", "dual mono", "mono", "sap" };
static char *p[] = {"no pilot", "pilot c1", "pilot c2", "?"}; static char *p[] = { "no pilot", "pilot c1", "pilot c2", "?" };
u32 reg,mode,pilot; u32 reg, mode, pilot;
reg = cx_read(AUD_STATUS); reg = cx_read(AUD_STATUS);
mode = reg & 0x03; mode = reg & 0x03;
...@@ -801,8 +799,7 @@ void cx88_get_stereo(struct cx88_core *core, struct v4l2_tuner *t) ...@@ -801,8 +799,7 @@ void cx88_get_stereo(struct cx88_core *core, struct v4l2_tuner *t)
switch (core->tvaudio) { switch (core->tvaudio) {
case WW_BTSC: case WW_BTSC:
t->capability = V4L2_TUNER_CAP_STEREO | t->capability = V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_SAP;
V4L2_TUNER_CAP_SAP;
t->rxsubchans = V4L2_TUNER_SUB_STEREO; t->rxsubchans = V4L2_TUNER_SUB_STEREO;
if (1 == pilot) { if (1 == pilot) {
/* SAP */ /* SAP */
...@@ -814,13 +811,15 @@ void cx88_get_stereo(struct cx88_core *core, struct v4l2_tuner *t) ...@@ -814,13 +811,15 @@ void cx88_get_stereo(struct cx88_core *core, struct v4l2_tuner *t)
case WW_A2_M: case WW_A2_M:
if (1 == pilot) { if (1 == pilot) {
/* stereo */ /* stereo */
t->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; t->rxsubchans =
V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
if (0 == mode) if (0 == mode)
t->audmode = V4L2_TUNER_MODE_STEREO; t->audmode = V4L2_TUNER_MODE_STEREO;
} }
if (2 == pilot) { if (2 == pilot) {
/* dual language -- FIXME */ /* dual language -- FIXME */
t->rxsubchans = V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2; t->rxsubchans =
V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2;
t->audmode = V4L2_TUNER_MODE_LANG1; t->audmode = V4L2_TUNER_MODE_LANG1;
} }
break; break;
...@@ -835,7 +834,7 @@ void cx88_get_stereo(struct cx88_core *core, struct v4l2_tuner *t) ...@@ -835,7 +834,7 @@ void cx88_get_stereo(struct cx88_core *core, struct v4l2_tuner *t)
t->audmode = V4L2_TUNER_MODE_STEREO; t->audmode = V4L2_TUNER_MODE_STEREO;
t->rxsubchans |= V4L2_TUNER_SUB_STEREO; t->rxsubchans |= V4L2_TUNER_SUB_STEREO;
} }
break ; break;
default: default:
/* nothing */ /* nothing */
break; break;
...@@ -878,21 +877,24 @@ void cx88_set_stereo(struct cx88_core *core, u32 mode, int manual) ...@@ -878,21 +877,24 @@ void cx88_set_stereo(struct cx88_core *core, u32 mode, int manual)
case WW_DK: case WW_DK:
case WW_I: case WW_I:
case WW_L: case WW_L:
if(1 == core->use_nicam) { if (1 == core->use_nicam) {
switch (mode) { switch (mode) {
case V4L2_TUNER_MODE_MONO: case V4L2_TUNER_MODE_MONO:
case V4L2_TUNER_MODE_LANG1: case V4L2_TUNER_MODE_LANG1:
set_audio_standard_NICAM(core, EN_NICAM_FORCE_MONO1); set_audio_standard_NICAM(core,
EN_NICAM_FORCE_MONO1);
break; break;
case V4L2_TUNER_MODE_LANG2: case V4L2_TUNER_MODE_LANG2:
set_audio_standard_NICAM(core, EN_NICAM_FORCE_MONO2); set_audio_standard_NICAM(core,
EN_NICAM_FORCE_MONO2);
break; break;
case V4L2_TUNER_MODE_STEREO: case V4L2_TUNER_MODE_STEREO:
set_audio_standard_NICAM(core, EN_NICAM_FORCE_STEREO); set_audio_standard_NICAM(core,
EN_NICAM_FORCE_STEREO);
break; break;
} }
} else { } else {
if ( (core->tvaudio == WW_I) || (core->tvaudio == WW_L) ) { if ((core->tvaudio == WW_I) || (core->tvaudio == WW_L)) {
/* fall back to fm / am mono */ /* fall back to fm / am mono */
set_audio_standard_A2(core, EN_A2_FORCE_MONO1); set_audio_standard_A2(core, EN_A2_FORCE_MONO1);
} else { } else {
...@@ -900,13 +902,16 @@ void cx88_set_stereo(struct cx88_core *core, u32 mode, int manual) ...@@ -900,13 +902,16 @@ void cx88_set_stereo(struct cx88_core *core, u32 mode, int manual)
switch (mode) { switch (mode) {
case V4L2_TUNER_MODE_MONO: case V4L2_TUNER_MODE_MONO:
case V4L2_TUNER_MODE_LANG1: case V4L2_TUNER_MODE_LANG1:
set_audio_standard_A2(core, EN_A2_FORCE_MONO1); set_audio_standard_A2(core,
EN_A2_FORCE_MONO1);
break; break;
case V4L2_TUNER_MODE_LANG2: case V4L2_TUNER_MODE_LANG2:
set_audio_standard_A2(core, EN_A2_FORCE_MONO2); set_audio_standard_A2(core,
EN_A2_FORCE_MONO2);
break; break;
case V4L2_TUNER_MODE_STEREO: case V4L2_TUNER_MODE_STEREO:
set_audio_standard_A2(core, EN_A2_FORCE_STEREO); set_audio_standard_A2(core,
EN_A2_FORCE_STEREO);
break; break;
} }
} }
...@@ -949,8 +954,8 @@ int cx88_audio_thread(void *data) ...@@ -949,8 +954,8 @@ int cx88_audio_thread(void *data)
break; break;
/* just monitor the audio status for now ... */ /* just monitor the audio status for now ... */
memset(&t,0,sizeof(t)); memset(&t, 0, sizeof(t));
cx88_get_stereo(core,&t); cx88_get_stereo(core, &t);
if (UNSET != core->audiomode_manual) if (UNSET != core->audiomode_manual)
/* manually set, don't do anything. */ /* manually set, don't do anything. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment