diff options
-rw-r--r-- | drivers/media/dvb/frontends/zl10353.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/zl10353.c b/drivers/media/dvb/frontends/zl10353.c index a1b0afbd47ba..0d8241de89ee 100644 --- a/drivers/media/dvb/frontends/zl10353.c +++ b/drivers/media/dvb/frontends/zl10353.c | |||
@@ -213,6 +213,29 @@ static int zl10353_read_status(struct dvb_frontend *fe, fe_status_t *status) | |||
213 | return 0; | 213 | return 0; |
214 | } | 214 | } |
215 | 215 | ||
216 | static int zl10353_read_ber(struct dvb_frontend *fe, u32 *ber) | ||
217 | { | ||
218 | struct zl10353_state *state = fe->demodulator_priv; | ||
219 | |||
220 | *ber = zl10353_read_register(state, 0x11) << 16 | | ||
221 | zl10353_read_register(state, 0x12) << 8 | | ||
222 | zl10353_read_register(state, 0x13); | ||
223 | |||
224 | return 0; | ||
225 | } | ||
226 | |||
227 | static int zl10353_read_signal_strength(struct dvb_frontend *fe, u16 *strength) | ||
228 | { | ||
229 | struct zl10353_state *state = fe->demodulator_priv; | ||
230 | |||
231 | u16 signal = zl10353_read_register(state, 0x0a) << 10 | | ||
232 | zl10353_read_register(state, 0x0b) << 2 | 3; | ||
233 | |||
234 | *strength = ~signal; | ||
235 | |||
236 | return 0; | ||
237 | } | ||
238 | |||
216 | static int zl10353_read_snr(struct dvb_frontend *fe, u16 *snr) | 239 | static int zl10353_read_snr(struct dvb_frontend *fe, u16 *snr) |
217 | { | 240 | { |
218 | struct zl10353_state *state = fe->demodulator_priv; | 241 | struct zl10353_state *state = fe->demodulator_priv; |
@@ -227,6 +250,16 @@ static int zl10353_read_snr(struct dvb_frontend *fe, u16 *snr) | |||
227 | return 0; | 250 | return 0; |
228 | } | 251 | } |
229 | 252 | ||
253 | static int zl10353_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) | ||
254 | { | ||
255 | struct zl10353_state *state = fe->demodulator_priv; | ||
256 | |||
257 | *ucblocks = zl10353_read_register(state, 0x14) << 8 | | ||
258 | zl10353_read_register(state, 0x15); | ||
259 | |||
260 | return 0; | ||
261 | } | ||
262 | |||
230 | static int zl10353_get_tune_settings(struct dvb_frontend *fe, | 263 | static int zl10353_get_tune_settings(struct dvb_frontend *fe, |
231 | struct dvb_frontend_tune_settings | 264 | struct dvb_frontend_tune_settings |
232 | *fe_tune_settings) | 265 | *fe_tune_settings) |
@@ -325,7 +358,10 @@ static struct dvb_frontend_ops zl10353_ops = { | |||
325 | .get_tune_settings = zl10353_get_tune_settings, | 358 | .get_tune_settings = zl10353_get_tune_settings, |
326 | 359 | ||
327 | .read_status = zl10353_read_status, | 360 | .read_status = zl10353_read_status, |
361 | .read_ber = zl10353_read_ber, | ||
362 | .read_signal_strength = zl10353_read_signal_strength, | ||
328 | .read_snr = zl10353_read_snr, | 363 | .read_snr = zl10353_read_snr, |
364 | .read_ucblocks = zl10353_read_ucblocks, | ||
329 | }; | 365 | }; |
330 | 366 | ||
331 | module_param(debug_regs, int, 0644); | 367 | module_param(debug_regs, int, 0644); |