Commit 47ae9ae8 authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

V4L/DVB (4867): Whitespace cleanup

- adhere to 80-column limit
- replace some spaces with tabs
Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent bc2e3913
...@@ -488,7 +488,8 @@ static int dvb_pll_sleep(struct dvb_frontend *fe) ...@@ -488,7 +488,8 @@ static int dvb_pll_sleep(struct dvb_frontend *fe)
struct dvb_pll_priv *priv = fe->tuner_priv; struct dvb_pll_priv *priv = fe->tuner_priv;
u8 buf[4]; u8 buf[4];
struct i2c_msg msg = struct i2c_msg msg =
{ .addr = priv->pll_i2c_address, .flags = 0, .buf = buf, .len = sizeof(buf) }; { .addr = priv->pll_i2c_address, .flags = 0,
.buf = buf, .len = sizeof(buf) };
int i; int i;
int result; int result;
...@@ -516,12 +517,14 @@ static int dvb_pll_sleep(struct dvb_frontend *fe) ...@@ -516,12 +517,14 @@ static int dvb_pll_sleep(struct dvb_frontend *fe)
return 0; return 0;
} }
static int dvb_pll_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) static int dvb_pll_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{ {
struct dvb_pll_priv *priv = fe->tuner_priv; struct dvb_pll_priv *priv = fe->tuner_priv;
u8 buf[4]; u8 buf[4];
struct i2c_msg msg = struct i2c_msg msg =
{ .addr = priv->pll_i2c_address, .flags = 0, .buf = buf, .len = sizeof(buf) }; { .addr = priv->pll_i2c_address, .flags = 0,
.buf = buf, .len = sizeof(buf) };
int result; int result;
u32 div; u32 div;
int i; int i;
...@@ -535,7 +538,8 @@ static int dvb_pll_set_params(struct dvb_frontend *fe, struct dvb_frontend_param ...@@ -535,7 +538,8 @@ static int dvb_pll_set_params(struct dvb_frontend *fe, struct dvb_frontend_param
bandwidth = params->u.ofdm.bandwidth; bandwidth = params->u.ofdm.bandwidth;
} }
if ((result = dvb_pll_configure(priv->pll_desc, buf, params->frequency, bandwidth)) != 0) if ((result = dvb_pll_configure(priv->pll_desc, buf, params->frequency,
bandwidth)) != 0)
return result; return result;
if (fe->ops.i2c_gate_ctrl) if (fe->ops.i2c_gate_ctrl)
...@@ -550,14 +554,18 @@ static int dvb_pll_set_params(struct dvb_frontend *fe, struct dvb_frontend_param ...@@ -550,14 +554,18 @@ static int dvb_pll_set_params(struct dvb_frontend *fe, struct dvb_frontend_param
continue; continue;
break; break;
} }
div = (params->frequency + priv->pll_desc->entries[i].offset) / priv->pll_desc->entries[i].stepsize; div = (params->frequency + priv->pll_desc->entries[i].offset) /
priv->frequency = (div * priv->pll_desc->entries[i].stepsize) - priv->pll_desc->entries[i].offset; priv->pll_desc->entries[i].stepsize;
priv->frequency = (div * priv->pll_desc->entries[i].stepsize) -
priv->pll_desc->entries[i].offset;
priv->bandwidth = bandwidth; priv->bandwidth = bandwidth;
return 0; return 0;
} }
static int dvb_pll_calc_regs(struct dvb_frontend *fe, struct dvb_frontend_parameters *params, u8 *buf, int buf_len) static int dvb_pll_calc_regs(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params,
u8 *buf, int buf_len)
{ {
struct dvb_pll_priv *priv = fe->tuner_priv; struct dvb_pll_priv *priv = fe->tuner_priv;
int result; int result;
...@@ -573,7 +581,8 @@ static int dvb_pll_calc_regs(struct dvb_frontend *fe, struct dvb_frontend_parame ...@@ -573,7 +581,8 @@ static int dvb_pll_calc_regs(struct dvb_frontend *fe, struct dvb_frontend_parame
bandwidth = params->u.ofdm.bandwidth; bandwidth = params->u.ofdm.bandwidth;
} }
if ((result = dvb_pll_configure(priv->pll_desc, buf+1, params->frequency, bandwidth)) != 0) if ((result = dvb_pll_configure(priv->pll_desc, buf+1,
params->frequency, bandwidth)) != 0)
return result; return result;
buf[0] = priv->pll_i2c_address; buf[0] = priv->pll_i2c_address;
...@@ -583,8 +592,10 @@ static int dvb_pll_calc_regs(struct dvb_frontend *fe, struct dvb_frontend_parame ...@@ -583,8 +592,10 @@ static int dvb_pll_calc_regs(struct dvb_frontend *fe, struct dvb_frontend_parame
continue; continue;
break; break;
} }
div = (params->frequency + priv->pll_desc->entries[i].offset) / priv->pll_desc->entries[i].stepsize; div = (params->frequency + priv->pll_desc->entries[i].offset) /
priv->frequency = (div * priv->pll_desc->entries[i].stepsize) - priv->pll_desc->entries[i].offset; priv->pll_desc->entries[i].stepsize;
priv->frequency = (div * priv->pll_desc->entries[i].stepsize) -
priv->pll_desc->entries[i].offset;
priv->bandwidth = bandwidth; priv->bandwidth = bandwidth;
return 5; return 5;
...@@ -613,10 +624,13 @@ static struct dvb_tuner_ops dvb_pll_tuner_ops = { ...@@ -613,10 +624,13 @@ static struct dvb_tuner_ops dvb_pll_tuner_ops = {
.get_bandwidth = dvb_pll_get_bandwidth, .get_bandwidth = dvb_pll_get_bandwidth,
}; };
struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2c, struct dvb_pll_desc *desc) struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr,
struct i2c_adapter *i2c,
struct dvb_pll_desc *desc)
{ {
u8 b1 [] = { 0 }; u8 b1 [] = { 0 };
struct i2c_msg msg = { .addr = pll_addr, .flags = I2C_M_RD, .buf = b1, .len = 1 }; struct i2c_msg msg = { .addr = pll_addr, .flags = I2C_M_RD,
.buf = b1, .len = 1 };
struct dvb_pll_priv *priv = NULL; struct dvb_pll_priv *priv = NULL;
int ret; int ret;
...@@ -639,7 +653,9 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struc ...@@ -639,7 +653,9 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struc
priv->i2c = i2c; priv->i2c = i2c;
priv->pll_desc = desc; priv->pll_desc = desc;
memcpy(&fe->ops.tuner_ops, &dvb_pll_tuner_ops, sizeof(struct dvb_tuner_ops)); memcpy(&fe->ops.tuner_ops, &dvb_pll_tuner_ops,
sizeof(struct dvb_tuner_ops));
strncpy(fe->ops.tuner_ops.info.name, desc->name, 128); strncpy(fe->ops.tuner_ops.info.name, desc->name, 128);
fe->ops.tuner_ops.info.frequency_min = desc->min; fe->ops.tuner_ops.info.frequency_min = desc->min;
fe->ops.tuner_ops.info.frequency_min = desc->max; fe->ops.tuner_ops.info.frequency_min = desc->max;
......
...@@ -48,7 +48,7 @@ extern struct dvb_pll_desc dvb_pll_philips_td1316; ...@@ -48,7 +48,7 @@ extern struct dvb_pll_desc dvb_pll_philips_td1316;
extern struct dvb_pll_desc dvb_pll_thomson_fe6600; extern struct dvb_pll_desc dvb_pll_thomson_fe6600;
extern int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf, extern int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf,
u32 freq, int bandwidth); u32 freq, int bandwidth);
/** /**
* Attach a dvb-pll to the supplied frontend structure. * Attach a dvb-pll to the supplied frontend structure.
...@@ -59,6 +59,9 @@ extern int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf, ...@@ -59,6 +59,9 @@ extern int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf,
* @param desc dvb_pll_desc to use. * @param desc dvb_pll_desc to use.
* @return Frontend pointer on success, NULL on failure * @return Frontend pointer on success, NULL on failure
*/ */
extern struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2c, struct dvb_pll_desc *desc); extern struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe,
int pll_addr,
struct i2c_adapter *i2c,
struct dvb_pll_desc *desc);
#endif #endif
...@@ -835,7 +835,7 @@ static int philips_sd1878_tda8261_tuner_set_params(struct dvb_frontend *fe, ...@@ -835,7 +835,7 @@ static int philips_sd1878_tda8261_tuner_set_params(struct dvb_frontend *fe,
return -EINVAL; return -EINVAL;
rc=dvb_pll_configure(&dvb_pll_philips_sd1878_tda8261, buf, rc=dvb_pll_configure(&dvb_pll_philips_sd1878_tda8261, buf,
params->frequency, 0); params->frequency, 0);
if(rc < 0) return rc; if(rc < 0) return rc;
if (fe->ops.i2c_gate_ctrl) if (fe->ops.i2c_gate_ctrl)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment