Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285243
b: refs/heads/master
c: 13d723b
h: refs/heads/master
i:
  285241: 96e14a0
  285239: b68a847
v: v3
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Nov 24, 2011
1 parent 94efc17 commit 057e3fc
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fda23faaff3b28a987c22da5f3a17b9f3d4acef8
refs/heads/master: 13d723ba98545c451bb40711e718087d28985b0f
40 changes: 20 additions & 20 deletions trunk/drivers/media/dvb/frontends/cxd2820r_t.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int cxd2820r_set_frontend_t(struct dvb_frontend *fe,
{
struct cxd2820r_priv *priv = fe->demodulator_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret, i;
int ret, i, bw_i;
u32 if_freq, if_ctl;
u64 num;
u8 buf[3], bw_param;
Expand Down Expand Up @@ -57,6 +57,23 @@ int cxd2820r_set_frontend_t(struct dvb_frontend *fe,

dbg("%s: RF=%d BW=%d", __func__, c->frequency, c->bandwidth_hz);

switch (c->bandwidth_hz) {
case 6000000:
bw_i = 0;
bw_param = 2;
break;
case 7000000:
bw_i = 1;
bw_param = 1;
break;
case 8000000:
bw_i = 2;
bw_param = 0;
break;
default:
return -EINVAL;
}

/* update GPIOs */
ret = cxd2820r_gpio(fe);
if (ret)
Expand All @@ -78,23 +95,6 @@ int cxd2820r_set_frontend_t(struct dvb_frontend *fe,
priv->delivery_system = SYS_DVBT;
priv->ber_running = 0; /* tune stops BER counter */

switch (c->bandwidth_hz) {
case 6000000:
i = 0;
bw_param = 2;
break;
case 7000000:
i = 1;
bw_param = 1;
break;
case 8000000:
i = 2;
bw_param = 0;
break;
default:
return -EINVAL;
}

/* program IF frequency */
if (fe->ops.tuner_ops.get_if_frequency) {
ret = fe->ops.tuner_ops.get_if_frequency(fe, &if_freq);
Expand All @@ -116,15 +116,15 @@ int cxd2820r_set_frontend_t(struct dvb_frontend *fe,
if (ret)
goto error;

ret = cxd2820r_wr_regs(priv, 0x0009f, bw_params1[i], 5);
ret = cxd2820r_wr_regs(priv, 0x0009f, bw_params1[bw_i], 5);
if (ret)
goto error;

ret = cxd2820r_wr_reg_mask(priv, 0x000d7, bw_param << 6, 0xc0);
if (ret)
goto error;

ret = cxd2820r_wr_regs(priv, 0x000d9, bw_params2[i], 2);
ret = cxd2820r_wr_regs(priv, 0x000d9, bw_params2[bw_i], 2);
if (ret)
goto error;

Expand Down
46 changes: 23 additions & 23 deletions trunk/drivers/media/dvb/frontends/cxd2820r_t2.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe,
{
struct cxd2820r_priv *priv = fe->demodulator_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret, i;
int ret, i, bw_i;
u32 if_freq, if_ctl;
u64 num;
u8 buf[3], bw_param;
Expand Down Expand Up @@ -71,6 +71,27 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe,

dbg("%s: RF=%d BW=%d", __func__, c->frequency, c->bandwidth_hz);

switch (c->bandwidth_hz) {
case 5000000:
bw_i = 0;
bw_param = 3;
break;
case 6000000:
bw_i = 1;
bw_param = 2;
break;
case 7000000:
bw_i = 2;
bw_param = 1;
break;
case 8000000:
bw_i = 3;
bw_param = 0;
break;
default:
return -EINVAL;
}

/* update GPIOs */
ret = cxd2820r_gpio(fe);
if (ret)
Expand All @@ -91,27 +112,6 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe,

priv->delivery_system = SYS_DVBT2;

switch (c->bandwidth_hz) {
case 5000000:
i = 0;
bw_param = 3;
break;
case 6000000:
i = 1;
bw_param = 2;
break;
case 7000000:
i = 2;
bw_param = 1;
break;
case 8000000:
i = 3;
bw_param = 0;
break;
default:
return -EINVAL;
}

/* program IF frequency */
if (fe->ops.tuner_ops.get_if_frequency) {
ret = fe->ops.tuner_ops.get_if_frequency(fe, &if_freq);
Expand All @@ -133,7 +133,7 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe,
if (ret)
goto error;

ret = cxd2820r_wr_regs(priv, 0x0209f, bw_params1[i], 5);
ret = cxd2820r_wr_regs(priv, 0x0209f, bw_params1[bw_i], 5);
if (ret)
goto error;

Expand Down

0 comments on commit 057e3fc

Please sign in to comment.