aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/frontends')
-rw-r--r--drivers/media/dvb/frontends/stb0899_algo.c14
-rw-r--r--drivers/media/dvb/frontends/stb0899_drv.c2
-rw-r--r--drivers/media/dvb/frontends/stb0899_priv.h12
-rw-r--r--drivers/media/dvb/frontends/stb6100.c4
-rw-r--r--drivers/media/dvb/frontends/zl10353.c2
-rw-r--r--drivers/media/dvb/frontends/zl10353.h3
6 files changed, 18 insertions, 19 deletions
diff --git a/drivers/media/dvb/frontends/stb0899_algo.c b/drivers/media/dvb/frontends/stb0899_algo.c
index a67d1775a43c..2da55ec20392 100644
--- a/drivers/media/dvb/frontends/stb0899_algo.c
+++ b/drivers/media/dvb/frontends/stb0899_algo.c
@@ -156,7 +156,7 @@ static void stb0899_first_subrange(struct stb0899_state *state)
156 } 156 }
157 157
158 if (range > 0) 158 if (range > 0)
159 internal->sub_range = MIN(internal->srch_range, range); 159 internal->sub_range = min(internal->srch_range, range);
160 else 160 else
161 internal->sub_range = 0; 161 internal->sub_range = 0;
162 162
@@ -185,7 +185,7 @@ static enum stb0899_status stb0899_check_tmg(struct stb0899_state *state)
185 timing = stb0899_read_reg(state, STB0899_RTF); 185 timing = stb0899_read_reg(state, STB0899_RTF);
186 186
187 if (lock >= 42) { 187 if (lock >= 42) {
188 if ((lock > 48) && (ABS(timing) >= 110)) { 188 if ((lock > 48) && (abs(timing) >= 110)) {
189 internal->status = ANALOGCARRIER; 189 internal->status = ANALOGCARRIER;
190 dprintk(state->verbose, FE_DEBUG, 1, "-->ANALOG Carrier !"); 190 dprintk(state->verbose, FE_DEBUG, 1, "-->ANALOG Carrier !");
191 } else { 191 } else {
@@ -222,7 +222,7 @@ static enum stb0899_status stb0899_search_tmg(struct stb0899_state *state)
222 index++; 222 index++;
223 derot_freq += index * internal->direction * derot_step; /* next derot zig zag position */ 223 derot_freq += index * internal->direction * derot_step; /* next derot zig zag position */
224 224
225 if (ABS(derot_freq) > derot_limit) 225 if (abs(derot_freq) > derot_limit)
226 next_loop--; 226 next_loop--;
227 227
228 if (next_loop) { 228 if (next_loop) {
@@ -298,7 +298,7 @@ static enum stb0899_status stb0899_search_carrier(struct stb0899_state *state)
298 last_derot_freq = derot_freq; 298 last_derot_freq = derot_freq;
299 derot_freq += index * internal->direction * internal->derot_step; /* next zig zag derotator position */ 299 derot_freq += index * internal->direction * internal->derot_step; /* next zig zag derotator position */
300 300
301 if(ABS(derot_freq) > derot_limit) 301 if(abs(derot_freq) > derot_limit)
302 next_loop--; 302 next_loop--;
303 303
304 if (next_loop) { 304 if (next_loop) {
@@ -400,7 +400,7 @@ static enum stb0899_status stb0899_search_data(struct stb0899_state *state)
400 if ((internal->status != CARRIEROK) || (stb0899_check_data(state) != DATAOK)) { 400 if ((internal->status != CARRIEROK) || (stb0899_check_data(state) != DATAOK)) {
401 401
402 derot_freq += index * internal->direction * derot_step; /* next zig zag derotator position */ 402 derot_freq += index * internal->direction * derot_step; /* next zig zag derotator position */
403 if (ABS(derot_freq) > derot_limit) 403 if (abs(derot_freq) > derot_limit)
404 next_loop--; 404 next_loop--;
405 405
406 if (next_loop) { 406 if (next_loop) {
@@ -467,7 +467,7 @@ static void next_sub_range(struct stb0899_state *state)
467 467
468 if (internal->sub_dir > 0) { 468 if (internal->sub_dir > 0) {
469 old_sub_range = internal->sub_range; 469 old_sub_range = internal->sub_range;
470 internal->sub_range = MIN((internal->srch_range / 2) - 470 internal->sub_range = min((internal->srch_range / 2) -
471 (internal->tuner_offst + internal->sub_range / 2), 471 (internal->tuner_offst + internal->sub_range / 2),
472 internal->sub_range); 472 internal->sub_range);
473 473
@@ -771,7 +771,7 @@ static long Log2Int(int number)
771 int i; 771 int i;
772 772
773 i = 0; 773 i = 0;
774 while ((1 << i) <= ABS(number)) 774 while ((1 << i) <= abs(number))
775 i++; 775 i++;
776 776
777 if (number == 0) 777 if (number == 0)
diff --git a/drivers/media/dvb/frontends/stb0899_drv.c b/drivers/media/dvb/frontends/stb0899_drv.c
index 10613acf18f5..a04c782fff8d 100644
--- a/drivers/media/dvb/frontends/stb0899_drv.c
+++ b/drivers/media/dvb/frontends/stb0899_drv.c
@@ -794,7 +794,7 @@ static int stb0899_send_diseqc_burst(struct dvb_frontend *fe, fe_sec_mini_cmd_t
794 reg = stb0899_read_reg(state, STB0899_DISCNTRL1); 794 reg = stb0899_read_reg(state, STB0899_DISCNTRL1);
795 old_state = reg; 795 old_state = reg;
796 /* set to burst mode */ 796 /* set to burst mode */
797 STB0899_SETFIELD_VAL(DISEQCMODE, reg, 0x02); 797 STB0899_SETFIELD_VAL(DISEQCMODE, reg, 0x03);
798 STB0899_SETFIELD_VAL(DISPRECHARGE, reg, 0x01); 798 STB0899_SETFIELD_VAL(DISPRECHARGE, reg, 0x01);
799 stb0899_write_reg(state, STB0899_DISCNTRL1, reg); 799 stb0899_write_reg(state, STB0899_DISCNTRL1, reg);
800 switch (burst) { 800 switch (burst) {
diff --git a/drivers/media/dvb/frontends/stb0899_priv.h b/drivers/media/dvb/frontends/stb0899_priv.h
index 24619e3689db..82395b912815 100644
--- a/drivers/media/dvb/frontends/stb0899_priv.h
+++ b/drivers/media/dvb/frontends/stb0899_priv.h
@@ -59,10 +59,6 @@
59#define MAKEWORD32(a, b, c, d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d)) 59#define MAKEWORD32(a, b, c, d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
60#define MAKEWORD16(a, b) (((a) << 8) | (b)) 60#define MAKEWORD16(a, b) (((a) << 8) | (b))
61 61
62#define MIN(x, y) ((x) <= (y) ? (x) : (y))
63#define MAX(x, y) ((x) >= (y) ? (x) : (y))
64#define ABS(x) ((x) >= 0 ? (x) : -(x))
65
66#define LSB(x) ((x & 0xff)) 62#define LSB(x) ((x & 0xff))
67#define MSB(y) ((y >> 8) & 0xff) 63#define MSB(y) ((y >> 8) & 0xff)
68 64
@@ -168,10 +164,10 @@ struct stb0899_internal {
168 u32 freq; /* Demod internal Frequency */ 164 u32 freq; /* Demod internal Frequency */
169 u32 srate; /* Demod internal Symbol rate */ 165 u32 srate; /* Demod internal Symbol rate */
170 enum stb0899_fec fecrate; /* Demod internal FEC rate */ 166 enum stb0899_fec fecrate; /* Demod internal FEC rate */
171 u32 srch_range; /* Demod internal Search Range */ 167 s32 srch_range; /* Demod internal Search Range */
172 u32 sub_range; /* Demod current sub range (Hz) */ 168 s32 sub_range; /* Demod current sub range (Hz) */
173 u32 tuner_step; /* Tuner step (Hz) */ 169 s32 tuner_step; /* Tuner step (Hz) */
174 u32 tuner_offst; /* Relative offset to carrier (Hz) */ 170 s32 tuner_offst; /* Relative offset to carrier (Hz) */
175 u32 tuner_bw; /* Current bandwidth of the tuner (Hz) */ 171 u32 tuner_bw; /* Current bandwidth of the tuner (Hz) */
176 172
177 s32 mclk; /* Masterclock Divider factor (binary) */ 173 s32 mclk; /* Masterclock Divider factor (binary) */
diff --git a/drivers/media/dvb/frontends/stb6100.c b/drivers/media/dvb/frontends/stb6100.c
index ff39275ab49c..1ed5a7db4c5e 100644
--- a/drivers/media/dvb/frontends/stb6100.c
+++ b/drivers/media/dvb/frontends/stb6100.c
@@ -427,11 +427,11 @@ static int stb6100_init(struct dvb_frontend *fe)
427 status->refclock = 27000000; /* Hz */ 427 status->refclock = 27000000; /* Hz */
428 status->iqsense = 1; 428 status->iqsense = 1;
429 status->bandwidth = 36000; /* kHz */ 429 status->bandwidth = 36000; /* kHz */
430 state->bandwidth = status->bandwidth * 1000; /* MHz */ 430 state->bandwidth = status->bandwidth * 1000; /* Hz */
431 state->reference = status->refclock / 1000; /* kHz */ 431 state->reference = status->refclock / 1000; /* kHz */
432 432
433 /* Set default bandwidth. */ 433 /* Set default bandwidth. */
434 return stb6100_set_bandwidth(fe, status->bandwidth); 434 return stb6100_set_bandwidth(fe, state->bandwidth);
435} 435}
436 436
437static int stb6100_get_state(struct dvb_frontend *fe, 437static int stb6100_get_state(struct dvb_frontend *fe,
diff --git a/drivers/media/dvb/frontends/zl10353.c b/drivers/media/dvb/frontends/zl10353.c
index 170720b02815..b150ed306696 100644
--- a/drivers/media/dvb/frontends/zl10353.c
+++ b/drivers/media/dvb/frontends/zl10353.c
@@ -590,7 +590,7 @@ static int zl10353_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
590 struct zl10353_state *state = fe->demodulator_priv; 590 struct zl10353_state *state = fe->demodulator_priv;
591 u8 val = 0x0a; 591 u8 val = 0x0a;
592 592
593 if (state->config.no_tuner) { 593 if (state->config.disable_i2c_gate_ctrl) {
594 /* No tuner attached to the internal I2C bus */ 594 /* No tuner attached to the internal I2C bus */
595 /* If set enable I2C bridge, the main I2C bus stopped hardly */ 595 /* If set enable I2C bridge, the main I2C bus stopped hardly */
596 return 0; 596 return 0;
diff --git a/drivers/media/dvb/frontends/zl10353.h b/drivers/media/dvb/frontends/zl10353.h
index fdbb88ff75fe..2287bac46243 100644
--- a/drivers/media/dvb/frontends/zl10353.h
+++ b/drivers/media/dvb/frontends/zl10353.h
@@ -38,6 +38,9 @@ struct zl10353_config
38 38
39 /* set if parallel ts output is required */ 39 /* set if parallel ts output is required */
40 int parallel_ts; 40 int parallel_ts;
41
42 /* set if i2c_gate_ctrl disable is required */
43 u8 disable_i2c_gate_ctrl:1;
41}; 44};
42 45
43#if defined(CONFIG_DVB_ZL10353) || (defined(CONFIG_DVB_ZL10353_MODULE) && defined(MODULE)) 46#if defined(CONFIG_DVB_ZL10353) || (defined(CONFIG_DVB_ZL10353_MODULE) && defined(MODULE))