summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/cx88/cx88-video.c28
-rw-r--r--linux/drivers/media/video/cx88/cx88.h1
2 files changed, 12 insertions, 17 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c
index a65e8ed9e..deaa2017a 100644
--- a/linux/drivers/media/video/cx88/cx88-video.c
+++ b/linux/drivers/media/video/cx88/cx88-video.c
@@ -146,75 +146,63 @@ static struct cx8800_tvnorm tvnorms[] = {
.id = V4L2_STD_NTSC_M,
.cxiformat = VideoFormatNTSC,
.cxoformat = 0x181f0008,
- .step_dr = 4406250,
},{
.name = "NTSC-JP",
.id = V4L2_STD_NTSC_M_JP,
.cxiformat = VideoFormatNTSCJapan,
.cxoformat = 0x181f0008,
- .step_dr = 4406250,
#if 0
},{
.name = "NTSC-4.43",
.id = FIXME,
.cxiformat = VideoFormatNTSC443,
.cxoformat = 0x181f0008,
- .step_dr = 4406250,
#endif
},{
.name = "PAL-BG",
.id = V4L2_STD_PAL_BG,
.cxiformat = VideoFormatPAL,
.cxoformat = 0x181f0008,
- .step_dr = 4406250,
},{
.name = "PAL-DK",
.id = V4L2_STD_PAL_DK,
.cxiformat = VideoFormatPAL,
.cxoformat = 0x181f0008,
- .step_dr = 4406250,
},{
.name = "PAL-I",
.id = V4L2_STD_PAL_I,
.cxiformat = VideoFormatPAL,
.cxoformat = 0x181f0008,
- .step_dr = 4406250,
},{
.name = "PAL-M",
.id = V4L2_STD_PAL_M,
.cxiformat = VideoFormatPALM,
.cxoformat = 0x1c1f0008,
- .step_dr = 4406250,
},{
.name = "PAL-N",
.id = V4L2_STD_PAL_N,
.cxiformat = VideoFormatPALN,
.cxoformat = 0x1c1f0008,
- .step_dr = 4406250,
},{
.name = "PAL-Nc",
.id = V4L2_STD_PAL_Nc,
.cxiformat = VideoFormatPALNC,
.cxoformat = 0x1c1f0008,
- .step_dr = 4406250,
},{
.name = "PAL-60",
.id = V4L2_STD_PAL_60,
.cxiformat = VideoFormatPAL60,
.cxoformat = 0x181f0008,
- .step_dr = 4406250,
},{
.name = "SECAM-L",
.id = V4L2_STD_SECAM_L,
.cxiformat = VideoFormatSECAM,
.cxoformat = 0x181f0008,
- .step_dr = 4250000,
},{
.name = "SECAM-DK",
.id = V4L2_STD_SECAM_DK,
.cxiformat = VideoFormatSECAM,
.cxoformat = 0x181f0008,
- .step_dr = 4250000,
}
};
@@ -544,6 +532,7 @@ static int set_tvnorm(struct cx8800_dev *dev, struct cx8800_tvnorm *norm)
u32 fsc8;
u32 adc_clock;
u32 vdec_clock;
+ u32 step_db,step_dr;
u64 tmp64;
u32 bdelay,agcdelay,htotal;
@@ -551,9 +540,16 @@ static int set_tvnorm(struct cx8800_dev *dev, struct cx8800_tvnorm *norm)
fsc8 = norm_fsc8(norm);
adc_clock = xtal;
vdec_clock = fsc8;
+ step_db = fsc8;
+ step_dr = fsc8;
- dprintk(1,"set_tvnorm: \"%s\" fsc8=%d adc=%d vdec=%d\n",
- norm->name, fsc8, adc_clock, vdec_clock);
+ if (norm->id & V4L2_STD_SECAM) {
+ step_db = 4250000;
+ step_dr = 4406250;
+ }
+
+ dprintk(1,"set_tvnorm: \"%s\" fsc8=%d adc=%d vdec=%d db/dr=%d/%d\n",
+ norm->name, fsc8, adc_clock, vdec_clock, step_db, step_dr);
set_pll(dev,2,vdec_clock);
dprintk(1,"set_tvnorm: MO_INPUT_FORMAT 0x%08x [old=0x%08x]\n",
@@ -575,14 +571,14 @@ static int set_tvnorm(struct cx8800_dev *dev, struct cx8800_tvnorm *norm)
cx_write(MO_SCONV_REG, (u32)tmp64);
// MO_SUB_STEP = 8 * fsc / video dec clock * 2^22
- tmp64 = fsc8 * (u64)(1 << 22);
+ tmp64 = step_db * 8 * (u64)(1 << 22);
do_div(tmp64, vdec_clock);
dprintk(1,"set_tvnorm: MO_SUB_STEP 0x%08x [old=0x%08x]\n",
(u32)tmp64, cx_read(MO_SUB_STEP));
cx_write(MO_SUB_STEP, (u32)tmp64);
// MO_SUB_STEP_DR = 8 * 4406250 / video dec clock * 2^22
- tmp64 = norm->step_dr * 8 * (u64)(1 << 22);
+ tmp64 = step_dr * 8 * (u64)(1 << 22);
do_div(tmp64, vdec_clock);
dprintk(1,"set_tvnorm: MO_SUB_STEP_DR 0x%08x [old=0x%08x]\n",
(u32)tmp64, cx_read(MO_SUB_STEP_DR));
diff --git a/linux/drivers/media/video/cx88/cx88.h b/linux/drivers/media/video/cx88/cx88.h
index b404afcd7..1b59c808b 100644
--- a/linux/drivers/media/video/cx88/cx88.h
+++ b/linux/drivers/media/video/cx88/cx88.h
@@ -83,7 +83,6 @@ struct cx8800_tvnorm {
v4l2_std_id id;
u32 cxiformat;
u32 cxoformat;
- u32 step_dr;
};
struct cx8800_fmt {