enum fe_bandwidth bandwidth,
u16 *nominal_rate)
{
- u32 adc_clock = 45056; /* 45.056 MHz */
- u8 bw;
struct zl10353_state *state = fe->demodulator_priv;
+ u32 adc_clock = 450560; /* 45.056 MHz */
+ u64 value;
+ u8 bw;
if (state->config.adc_clock)
adc_clock = state->config.adc_clock;
break;
}
- *nominal_rate = (bw * (1 << 23) / 7 * 125 + adc_clock / 2) / adc_clock;
+ value = (bw * (u64)10 * (1 << 23) / 7 * 125 + adc_clock / 2);
+ do_div(value, adc_clock);
+ *nominal_rate = value;
dprintk("%s: bw %d, adc_clock %d => 0x%x\n",
__FUNCTION__, bw, adc_clock, *nominal_rate);
u16 *input_freq)
{
struct zl10353_state *state = fe->demodulator_priv;
- u32 adc_clock = 45056; /* 45.056 MHz */
- int if2 = 36167; /* 36.167 MHz */
+ u32 adc_clock = 450560; /* 45.056 MHz */
+ int if2 = 361667; /* 36.1667 MHz */
int ife;
u64 value;
if (ife > adc_clock / 2)
ife = adc_clock - ife;
}
- value = 65536ULL * ife + adc_clock / 2;
+ value = (u64)65536 * ife + adc_clock / 2;
do_div(value, adc_clock);
*input_freq = -value;
/* demodulator's I2C address */
u8 demod_address;
- /* frequencies in kHz */
- int adc_clock; /* default: 45056 */
- int if2; /* default: 36167 */
+ /* frequencies in units of 0.1kHz */
+ int adc_clock; /* default: 450560 (45.056 MHz) */
+ int if2; /* default: 361667 (36.1667 MHz) */
/* set if no pll is connected to the secondary i2c bus */
int no_tuner;
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
return NULL;
}
-#endif // CONFIG_DVB_ZL10353
+#endif /* CONFIG_DVB_ZL10353 */
#endif /* ZL10353_H */