diff options
author | Akihiro Tsukada <tskd2@yahoo.co.jp> | 2009-11-19 10:19:50 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-15 21:18:12 -0500 |
commit | 0e2f0d348a65b48a8af52d7fd64d77b5759413fa (patch) | |
tree | 2cdbee759b4ecee701e26086598dce71acc6de8d /drivers/media | |
parent | 05395a3d86a928d374c970a0b35a6a711072f86c (diff) |
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: Akihiro Tsukada <tskd2@yahoo.co.jp>
Signed-off-by: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/dvb-usb/friio-fe.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/dvb/dvb-usb/friio-fe.c b/drivers/media/dvb/dvb-usb/friio-fe.c index 9cbbe42ca44b..ebb7b9fd115b 100644 --- a/drivers/media/dvb/dvb-usb/friio-fe.c +++ b/drivers/media/dvb/dvb-usb/friio-fe.c | |||
@@ -134,11 +134,13 @@ static int jdvbt90502_pll_set_freq(struct jdvbt90502_state *state, u32 freq) | |||
134 | deb_fe("%s: freq=%d, step=%d\n", __func__, freq, | 134 | deb_fe("%s: freq=%d, step=%d\n", __func__, freq, |
135 | state->frontend.ops.info.frequency_stepsize); | 135 | state->frontend.ops.info.frequency_stepsize); |
136 | /* freq -> oscilator frequency conversion. */ | 136 | /* freq -> oscilator frequency conversion. */ |
137 | /* freq: 473,000,000 + n*6,000,000 (no 1/7MHz shift to center freq) */ | 137 | /* freq: 473,000,000 + n*6,000,000 [+ 142857 (center freq. shift)] */ |
138 | /* add 400[1/7 MHZ] = 57.142857MHz. 57MHz for the IF, */ | ||
139 | /* 1/7MHz for center freq shift */ | ||
140 | f = freq / state->frontend.ops.info.frequency_stepsize; | 138 | f = freq / state->frontend.ops.info.frequency_stepsize; |
141 | f += 400; | 139 | /* add 399[1/7 MHZ] = 57MHz for the IF */ |
140 | f += 399; | ||
141 | /* add center frequency shift if necessary */ | ||
142 | if (f % 7 == 0) | ||
143 | f++; | ||
142 | pll_freq_cmd[DEMOD_REDIRECT_REG] = JDVBT90502_2ND_I2C_REG; /* 0xFE */ | 144 | pll_freq_cmd[DEMOD_REDIRECT_REG] = JDVBT90502_2ND_I2C_REG; /* 0xFE */ |
143 | pll_freq_cmd[ADDRESS_BYTE] = state->config.pll_address << 1; | 145 | pll_freq_cmd[ADDRESS_BYTE] = state->config.pll_address << 1; |
144 | pll_freq_cmd[DIVIDER_BYTE1] = (f >> 8) & 0x7F; | 146 | pll_freq_cmd[DIVIDER_BYTE1] = (f >> 8) & 0x7F; |