aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/dib3000mc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/frontends/dib3000mc.c')
-rw-r--r--drivers/media/dvb/frontends/dib3000mc.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/media/dvb/frontends/dib3000mc.c b/drivers/media/dvb/frontends/dib3000mc.c
index 38d2322cbaf6..f0096de2279e 100644
--- a/drivers/media/dvb/frontends/dib3000mc.c
+++ b/drivers/media/dvb/frontends/dib3000mc.c
@@ -13,10 +13,6 @@
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/i2c.h> 15#include <linux/i2c.h>
16//#include <linux/init.h>
17//#include <linux/delay.h>
18//#include <linux/string.h>
19//#include <linux/slab.h>
20 16
21#include "dvb_frontend.h" 17#include "dvb_frontend.h"
22 18
@@ -26,6 +22,10 @@ static int debug;
26module_param(debug, int, 0644); 22module_param(debug, int, 0644);
27MODULE_PARM_DESC(debug, "turn on debugging (default: 0)"); 23MODULE_PARM_DESC(debug, "turn on debugging (default: 0)");
28 24
25static int buggy_sfn_workaround;
26module_param(buggy_sfn_workaround, int, 0644);
27MODULE_PARM_DESC(debug, "Enable work-around for buggy SFNs (default: 0)");
28
29#define dprintk(args...) do { if (debug) { printk(KERN_DEBUG "DiB3000MC/P:"); printk(args); printk("\n"); } } while (0) 29#define dprintk(args...) do { if (debug) { printk(KERN_DEBUG "DiB3000MC/P:"); printk(args); printk("\n"); } } while (0)
30 30
31struct dib3000mc_state { 31struct dib3000mc_state {
@@ -42,6 +42,8 @@ struct dib3000mc_state {
42 fe_bandwidth_t current_bandwidth; 42 fe_bandwidth_t current_bandwidth;
43 43
44 u16 dev_id; 44 u16 dev_id;
45
46 u8 sfn_workaround_active :1;
45}; 47};
46 48
47static u16 dib3000mc_read_word(struct dib3000mc_state *state, u16 reg) 49static u16 dib3000mc_read_word(struct dib3000mc_state *state, u16 reg)
@@ -591,7 +593,14 @@ static int dib3000mc_tune(struct dvb_frontend *demod, struct dvb_frontend_parame
591 dib3000mc_set_channel_cfg(state, ch, 0); 593 dib3000mc_set_channel_cfg(state, ch, 0);
592 594
593 // activates isi 595 // activates isi
594 dib3000mc_write_word(state, 29, 0x1073); 596 if (state->sfn_workaround_active) {
597 dprintk("SFN workaround is active\n");
598 dib3000mc_write_word(state, 29, 0x1273);
599 dib3000mc_write_word(state, 108, 0x4000); // P_pha3_force_pha_shift
600 } else {
601 dib3000mc_write_word(state, 29, 0x1073);
602 dib3000mc_write_word(state, 108, 0x0000); // P_pha3_force_pha_shift
603 }
595 604
596 dib3000mc_set_adp_cfg(state, (u8)ch->u.ofdm.constellation); 605 dib3000mc_set_adp_cfg(state, (u8)ch->u.ofdm.constellation);
597 if (ch->u.ofdm.transmission_mode == TRANSMISSION_MODE_8K) { 606 if (ch->u.ofdm.transmission_mode == TRANSMISSION_MODE_8K) {
@@ -679,6 +688,9 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe,
679 state->current_bandwidth = fep->u.ofdm.bandwidth; 688 state->current_bandwidth = fep->u.ofdm.bandwidth;
680 dib3000mc_set_bandwidth(state, BANDWIDTH_TO_KHZ(fep->u.ofdm.bandwidth)); 689 dib3000mc_set_bandwidth(state, BANDWIDTH_TO_KHZ(fep->u.ofdm.bandwidth));
681 690
691 /* maybe the parameter has been changed */
692 state->sfn_workaround_active = buggy_sfn_workaround;
693
682 if (fe->ops.tuner_ops.set_params) { 694 if (fe->ops.tuner_ops.set_params) {
683 fe->ops.tuner_ops.set_params(fe, fep); 695 fe->ops.tuner_ops.set_params(fe, fep);
684 msleep(100); 696 msleep(100);