Commit 0e2f0d34 authored by Akihiro Tsukada's avatar Akihiro Tsukada Committed by Mauro Carvalho Chehab

V4L/DVB (13577): [PATCH] dvb-usb-friio: accept center-shifted frequency

This patch adds a fix to accept frequency with its center shifted.

The driver used to accept center frequencies of the normal UHF band channels,
but in ISDB-T, center frequency is shifted with 1/7MHz.
It was shifted internally in the driver,
but this patch enables to accept both types of frequency.
Signed-off-by: default avatarAkihiro Tsukada <tskd2@yahoo.co.jp>
Signed-off-by: default avatarPatrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 05395a3d
...@@ -134,11 +134,13 @@ static int jdvbt90502_pll_set_freq(struct jdvbt90502_state *state, u32 freq) ...@@ -134,11 +134,13 @@ static int jdvbt90502_pll_set_freq(struct jdvbt90502_state *state, u32 freq)
deb_fe("%s: freq=%d, step=%d\n", __func__, freq, deb_fe("%s: freq=%d, step=%d\n", __func__, freq,
state->frontend.ops.info.frequency_stepsize); state->frontend.ops.info.frequency_stepsize);
/* freq -> oscilator frequency conversion. */ /* freq -> oscilator frequency conversion. */
/* freq: 473,000,000 + n*6,000,000 (no 1/7MHz shift to center freq) */ /* freq: 473,000,000 + n*6,000,000 [+ 142857 (center freq. shift)] */
/* add 400[1/7 MHZ] = 57.142857MHz. 57MHz for the IF, */
/* 1/7MHz for center freq shift */
f = freq / state->frontend.ops.info.frequency_stepsize; f = freq / state->frontend.ops.info.frequency_stepsize;
f += 400; /* add 399[1/7 MHZ] = 57MHz for the IF */
f += 399;
/* add center frequency shift if necessary */
if (f % 7 == 0)
f++;
pll_freq_cmd[DEMOD_REDIRECT_REG] = JDVBT90502_2ND_I2C_REG; /* 0xFE */ pll_freq_cmd[DEMOD_REDIRECT_REG] = JDVBT90502_2ND_I2C_REG; /* 0xFE */
pll_freq_cmd[ADDRESS_BYTE] = state->config.pll_address << 1; pll_freq_cmd[ADDRESS_BYTE] = state->config.pll_address << 1;
pll_freq_cmd[DIVIDER_BYTE1] = (f >> 8) & 0x7F; pll_freq_cmd[DIVIDER_BYTE1] = (f >> 8) & 0x7F;
......
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