static struct dvb_frontend_ops tda10071_ops;
/* write multiple registers */
-static int tda10071_wr_regs(struct tda10071_priv *priv, u8 reg, u8 *val,
+static int tda10071_wr_regs(struct tda10071_dev *dev, u8 reg, u8 *val,
int len)
{
- struct i2c_client *client = priv->client;
+ struct i2c_client *client = dev->client;
int ret;
u8 buf[MAX_XFER_SIZE];
struct i2c_msg msg[1] = {
}
/* read multiple registers */
-static int tda10071_rd_regs(struct tda10071_priv *priv, u8 reg, u8 *val,
+static int tda10071_rd_regs(struct tda10071_dev *dev, u8 reg, u8 *val,
int len)
{
- struct i2c_client *client = priv->client;
+ struct i2c_client *client = dev->client;
int ret;
u8 buf[MAX_XFER_SIZE];
struct i2c_msg msg[2] = {
}
/* write single register */
-static int tda10071_wr_reg(struct tda10071_priv *priv, u8 reg, u8 val)
+static int tda10071_wr_reg(struct tda10071_dev *dev, u8 reg, u8 val)
{
- return tda10071_wr_regs(priv, reg, &val, 1);
+ return tda10071_wr_regs(dev, reg, &val, 1);
}
/* read single register */
-static int tda10071_rd_reg(struct tda10071_priv *priv, u8 reg, u8 *val)
+static int tda10071_rd_reg(struct tda10071_dev *dev, u8 reg, u8 *val)
{
- return tda10071_rd_regs(priv, reg, val, 1);
+ return tda10071_rd_regs(dev, reg, val, 1);
}
/* write single register with mask */
-static int tda10071_wr_reg_mask(struct tda10071_priv *priv,
+static int tda10071_wr_reg_mask(struct tda10071_dev *dev,
u8 reg, u8 val, u8 mask)
{
int ret;
/* no need for read if whole reg is written */
if (mask != 0xff) {
- ret = tda10071_rd_regs(priv, reg, &tmp, 1);
+ ret = tda10071_rd_regs(dev, reg, &tmp, 1);
if (ret)
return ret;
val |= tmp;
}
- return tda10071_wr_regs(priv, reg, &val, 1);
+ return tda10071_wr_regs(dev, reg, &val, 1);
}
/* read single register with mask */
-static int tda10071_rd_reg_mask(struct tda10071_priv *priv,
+static int tda10071_rd_reg_mask(struct tda10071_dev *dev,
u8 reg, u8 *val, u8 mask)
{
int ret, i;
u8 tmp;
- ret = tda10071_rd_regs(priv, reg, &tmp, 1);
+ ret = tda10071_rd_regs(dev, reg, &tmp, 1);
if (ret)
return ret;
}
/* execute firmware command */
-static int tda10071_cmd_execute(struct tda10071_priv *priv,
+static int tda10071_cmd_execute(struct tda10071_dev *dev,
struct tda10071_cmd *cmd)
{
- struct i2c_client *client = priv->client;
+ struct i2c_client *client = dev->client;
int ret, i;
u8 tmp;
- if (!priv->warm) {
+ if (!dev->warm) {
ret = -EFAULT;
goto error;
}
/* write cmd and args for firmware */
- ret = tda10071_wr_regs(priv, 0x00, cmd->args, cmd->len);
+ ret = tda10071_wr_regs(dev, 0x00, cmd->args, cmd->len);
if (ret)
goto error;
/* start cmd execution */
- ret = tda10071_wr_reg(priv, 0x1f, 1);
+ ret = tda10071_wr_reg(dev, 0x1f, 1);
if (ret)
goto error;
/* wait cmd execution terminate */
for (i = 1000, tmp = 1; i && tmp; i--) {
- ret = tda10071_rd_reg(priv, 0x1f, &tmp);
+ ret = tda10071_rd_reg(dev, 0x1f, &tmp);
if (ret)
goto error;
static int tda10071_set_tone(struct dvb_frontend *fe,
enum fe_sec_tone_mode fe_sec_tone_mode)
{
- struct tda10071_priv *priv = fe->demodulator_priv;
- struct i2c_client *client = priv->client;
+ struct tda10071_dev *dev = fe->demodulator_priv;
+ struct i2c_client *client = dev->client;
struct tda10071_cmd cmd;
int ret;
u8 tone;
- if (!priv->warm) {
+ if (!dev->warm) {
ret = -EFAULT;
goto error;
}
cmd.args[3] = 0x00;
cmd.args[4] = tone;
cmd.len = 5;
- ret = tda10071_cmd_execute(priv, &cmd);
+ ret = tda10071_cmd_execute(dev, &cmd);
if (ret)
goto error;
static int tda10071_set_voltage(struct dvb_frontend *fe,
enum fe_sec_voltage fe_sec_voltage)
{
- struct tda10071_priv *priv = fe->demodulator_priv;
- struct i2c_client *client = priv->client;
+ struct tda10071_dev *dev = fe->demodulator_priv;
+ struct i2c_client *client = dev->client;
struct tda10071_cmd cmd;
int ret;
u8 voltage;
- if (!priv->warm) {
+ if (!dev->warm) {
ret = -EFAULT;
goto error;
}
cmd.args[1] = 0;
cmd.args[2] = voltage;
cmd.len = 3;
- ret = tda10071_cmd_execute(priv, &cmd);
+ ret = tda10071_cmd_execute(dev, &cmd);
if (ret)
goto error;
static int tda10071_diseqc_send_master_cmd(struct dvb_frontend *fe,
struct dvb_diseqc_master_cmd *diseqc_cmd)
{
- struct tda10071_priv *priv = fe->demodulator_priv;
- struct i2c_client *client = priv->client;
+ struct tda10071_dev *dev = fe->demodulator_priv;
+ struct i2c_client *client = dev->client;
struct tda10071_cmd cmd;
int ret, i;
u8 tmp;
- if (!priv->warm) {
+ if (!dev->warm) {
ret = -EFAULT;
goto error;
}
/* wait LNB TX */
for (i = 500, tmp = 0; i && !tmp; i--) {
- ret = tda10071_rd_reg_mask(priv, 0x47, &tmp, 0x01);
+ ret = tda10071_rd_reg_mask(dev, 0x47, &tmp, 0x01);
if (ret)
goto error;
goto error;
}
- ret = tda10071_wr_reg_mask(priv, 0x47, 0x00, 0x01);
+ ret = tda10071_wr_reg_mask(dev, 0x47, 0x00, 0x01);
if (ret)
goto error;
cmd.args[6] = diseqc_cmd->msg_len;
memcpy(&cmd.args[7], diseqc_cmd->msg, diseqc_cmd->msg_len);
cmd.len = 7 + diseqc_cmd->msg_len;
- ret = tda10071_cmd_execute(priv, &cmd);
+ ret = tda10071_cmd_execute(dev, &cmd);
if (ret)
goto error;
static int tda10071_diseqc_recv_slave_reply(struct dvb_frontend *fe,
struct dvb_diseqc_slave_reply *reply)
{
- struct tda10071_priv *priv = fe->demodulator_priv;
- struct i2c_client *client = priv->client;
+ struct tda10071_dev *dev = fe->demodulator_priv;
+ struct i2c_client *client = dev->client;
struct tda10071_cmd cmd;
int ret, i;
u8 tmp;
- if (!priv->warm) {
+ if (!dev->warm) {
ret = -EFAULT;
goto error;
}
/* wait LNB RX */
for (i = 500, tmp = 0; i && !tmp; i--) {
- ret = tda10071_rd_reg_mask(priv, 0x47, &tmp, 0x02);
+ ret = tda10071_rd_reg_mask(dev, 0x47, &tmp, 0x02);
if (ret)
goto error;
}
/* reply len */
- ret = tda10071_rd_reg(priv, 0x46, &tmp);
+ ret = tda10071_rd_reg(dev, 0x46, &tmp);
if (ret)
goto error;
cmd.args[0] = CMD_LNB_UPDATE_REPLY;
cmd.args[1] = 0;
cmd.len = 2;
- ret = tda10071_cmd_execute(priv, &cmd);
+ ret = tda10071_cmd_execute(dev, &cmd);
if (ret)
goto error;
- ret = tda10071_rd_regs(priv, cmd.len, reply->msg, reply->msg_len);
+ ret = tda10071_rd_regs(dev, cmd.len, reply->msg, reply->msg_len);
if (ret)
goto error;
static int tda10071_diseqc_send_burst(struct dvb_frontend *fe,
enum fe_sec_mini_cmd fe_sec_mini_cmd)
{
- struct tda10071_priv *priv = fe->demodulator_priv;
- struct i2c_client *client = priv->client;
+ struct tda10071_dev *dev = fe->demodulator_priv;
+ struct i2c_client *client = dev->client;
struct tda10071_cmd cmd;
int ret, i;
u8 tmp, burst;
- if (!priv->warm) {
+ if (!dev->warm) {
ret = -EFAULT;
goto error;
}
/* wait LNB TX */
for (i = 500, tmp = 0; i && !tmp; i--) {
- ret = tda10071_rd_reg_mask(priv, 0x47, &tmp, 0x01);
+ ret = tda10071_rd_reg_mask(dev, 0x47, &tmp, 0x01);
if (ret)
goto error;
goto error;
}
- ret = tda10071_wr_reg_mask(priv, 0x47, 0x00, 0x01);
+ ret = tda10071_wr_reg_mask(dev, 0x47, 0x00, 0x01);
if (ret)
goto error;
cmd.args[1] = 0;
cmd.args[2] = burst;
cmd.len = 3;
- ret = tda10071_cmd_execute(priv, &cmd);
+ ret = tda10071_cmd_execute(dev, &cmd);
if (ret)
goto error;
static int tda10071_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
- struct tda10071_priv *priv = fe->demodulator_priv;
- struct i2c_client *client = priv->client;
+ struct tda10071_dev *dev = fe->demodulator_priv;
+ struct i2c_client *client = dev->client;
int ret;
u8 tmp;
*status = 0;
- if (!priv->warm) {
+ if (!dev->warm) {
ret = 0;
goto error;
}
- ret = tda10071_rd_reg(priv, 0x39, &tmp);
+ ret = tda10071_rd_reg(dev, 0x39, &tmp);
if (ret)
goto error;
if (tmp & 0x08) /* RS or BCH */
*status |= FE_HAS_SYNC | FE_HAS_LOCK;
- priv->fe_status = *status;
+ dev->fe_status = *status;
return ret;
error:
static int tda10071_read_snr(struct dvb_frontend *fe, u16 *snr)
{
- struct tda10071_priv *priv = fe->demodulator_priv;
- struct i2c_client *client = priv->client;
+ struct tda10071_dev *dev = fe->demodulator_priv;
+ struct i2c_client *client = dev->client;
int ret;
u8 buf[2];
- if (!priv->warm || !(priv->fe_status & FE_HAS_LOCK)) {
+ if (!dev->warm || !(dev->fe_status & FE_HAS_LOCK)) {
*snr = 0;
ret = 0;
goto error;
}
- ret = tda10071_rd_regs(priv, 0x3a, buf, 2);
+ ret = tda10071_rd_regs(dev, 0x3a, buf, 2);
if (ret)
goto error;
static int tda10071_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
{
- struct tda10071_priv *priv = fe->demodulator_priv;
- struct i2c_client *client = priv->client;
+ struct tda10071_dev *dev = fe->demodulator_priv;
+ struct i2c_client *client = dev->client;
struct tda10071_cmd cmd;
int ret;
u8 tmp;
- if (!priv->warm || !(priv->fe_status & FE_HAS_LOCK)) {
+ if (!dev->warm || !(dev->fe_status & FE_HAS_LOCK)) {
*strength = 0;
ret = 0;
goto error;
cmd.args[0] = CMD_GET_AGCACC;
cmd.args[1] = 0;
cmd.len = 2;
- ret = tda10071_cmd_execute(priv, &cmd);
+ ret = tda10071_cmd_execute(dev, &cmd);
if (ret)
goto error;
/* input power estimate dBm */
- ret = tda10071_rd_reg(priv, 0x50, &tmp);
+ ret = tda10071_rd_reg(dev, 0x50, &tmp);
if (ret)
goto error;
static int tda10071_read_ber(struct dvb_frontend *fe, u32 *ber)
{
- struct tda10071_priv *priv = fe->demodulator_priv;
- struct i2c_client *client = priv->client;
+ struct tda10071_dev *dev = fe->demodulator_priv;
+ struct i2c_client *client = dev->client;
struct tda10071_cmd cmd;
int ret, i, len;
u8 tmp, reg, buf[8];
- if (!priv->warm || !(priv->fe_status & FE_HAS_LOCK)) {
- *ber = priv->ber = 0;
+ if (!dev->warm || !(dev->fe_status & FE_HAS_LOCK)) {
+ *ber = dev->ber = 0;
ret = 0;
goto error;
}
- switch (priv->delivery_system) {
+ switch (dev->delivery_system) {
case SYS_DVBS:
reg = 0x4c;
len = 8;
i = 0;
break;
default:
- *ber = priv->ber = 0;
+ *ber = dev->ber = 0;
return 0;
}
- ret = tda10071_rd_reg(priv, reg, &tmp);
+ ret = tda10071_rd_reg(dev, reg, &tmp);
if (ret)
goto error;
- if (priv->meas_count[i] == tmp) {
+ if (dev->meas_count[i] == tmp) {
dev_dbg(&client->dev, "meas not ready=%02x\n", tmp);
- *ber = priv->ber;
+ *ber = dev->ber;
return 0;
} else {
- priv->meas_count[i] = tmp;
+ dev->meas_count[i] = tmp;
}
cmd.args[0] = CMD_BER_UPDATE_COUNTERS;
cmd.args[1] = 0;
cmd.args[2] = i;
cmd.len = 3;
- ret = tda10071_cmd_execute(priv, &cmd);
+ ret = tda10071_cmd_execute(dev, &cmd);
if (ret)
goto error;
- ret = tda10071_rd_regs(priv, cmd.len, buf, len);
+ ret = tda10071_rd_regs(dev, cmd.len, buf, len);
if (ret)
goto error;
- if (priv->delivery_system == SYS_DVBS) {
+ if (dev->delivery_system == SYS_DVBS) {
*ber = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
- priv->ucb += (buf[4] << 8) | buf[5];
+ dev->ucb += (buf[4] << 8) | buf[5];
} else {
*ber = (buf[0] << 8) | buf[1];
}
- priv->ber = *ber;
+ dev->ber = *ber;
return ret;
error:
static int tda10071_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
{
- struct tda10071_priv *priv = fe->demodulator_priv;
- struct i2c_client *client = priv->client;
+ struct tda10071_dev *dev = fe->demodulator_priv;
+ struct i2c_client *client = dev->client;
int ret = 0;
- if (!priv->warm || !(priv->fe_status & FE_HAS_LOCK)) {
+ if (!dev->warm || !(dev->fe_status & FE_HAS_LOCK)) {
*ucblocks = 0;
goto error;
}
/* UCB is updated when BER is read. Assume BER is read anyway. */
- *ucblocks = priv->ucb;
+ *ucblocks = dev->ucb;
return ret;
error:
static int tda10071_set_frontend(struct dvb_frontend *fe)
{
- struct tda10071_priv *priv = fe->demodulator_priv;
- struct i2c_client *client = priv->client;
+ struct tda10071_dev *dev = fe->demodulator_priv;
+ struct i2c_client *client = dev->client;
struct tda10071_cmd cmd;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret, i;
c->delivery_system, c->modulation, c->frequency, c->symbol_rate,
c->inversion, c->pilot, c->rolloff);
- priv->delivery_system = SYS_UNDEFINED;
+ dev->delivery_system = SYS_UNDEFINED;
- if (!priv->warm) {
+ if (!dev->warm) {
ret = -EFAULT;
goto error;
}
else
div = 4;
- ret = tda10071_wr_reg(priv, 0x81, div);
+ ret = tda10071_wr_reg(dev, 0x81, div);
if (ret)
goto error;
- ret = tda10071_wr_reg(priv, 0xe3, div);
+ ret = tda10071_wr_reg(dev, 0xe3, div);
if (ret)
goto error;
cmd.args[13] = 0x00;
cmd.args[14] = 0x00;
cmd.len = 15;
- ret = tda10071_cmd_execute(priv, &cmd);
+ ret = tda10071_cmd_execute(dev, &cmd);
if (ret)
goto error;
- priv->delivery_system = c->delivery_system;
+ dev->delivery_system = c->delivery_system;
return ret;
error:
static int tda10071_get_frontend(struct dvb_frontend *fe)
{
- struct tda10071_priv *priv = fe->demodulator_priv;
- struct i2c_client *client = priv->client;
+ struct tda10071_dev *dev = fe->demodulator_priv;
+ struct i2c_client *client = dev->client;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret, i;
u8 buf[5], tmp;
- if (!priv->warm || !(priv->fe_status & FE_HAS_LOCK)) {
+ if (!dev->warm || !(dev->fe_status & FE_HAS_LOCK)) {
ret = -EFAULT;
goto error;
}
- ret = tda10071_rd_regs(priv, 0x30, buf, 5);
+ ret = tda10071_rd_regs(dev, 0x30, buf, 5);
if (ret)
goto error;
c->frequency = (buf[2] << 16) | (buf[3] << 8) | (buf[4] << 0);
- ret = tda10071_rd_regs(priv, 0x52, buf, 3);
+ ret = tda10071_rd_regs(dev, 0x52, buf, 3);
if (ret)
goto error;
static int tda10071_init(struct dvb_frontend *fe)
{
- struct tda10071_priv *priv = fe->demodulator_priv;
- struct i2c_client *client = priv->client;
+ struct tda10071_dev *dev = fe->demodulator_priv;
+ struct i2c_client *client = dev->client;
struct tda10071_cmd cmd;
int ret, i, len, remaining, fw_size;
const struct firmware *fw;
};
struct tda10071_reg_val_mask tab2[] = {
{ 0xf1, 0x70, 0xff },
- { 0x88, priv->pll_multiplier, 0x3f },
+ { 0x88, dev->pll_multiplier, 0x3f },
{ 0x89, 0x00, 0x10 },
{ 0x89, 0x10, 0x10 },
{ 0xc0, 0x01, 0x01 },
{ 0xd5, 0x03, 0x03 },
};
- if (priv->warm) {
+ if (dev->warm) {
/* warm state - wake up device from sleep */
for (i = 0; i < ARRAY_SIZE(tab); i++) {
- ret = tda10071_wr_reg_mask(priv, tab[i].reg,
+ ret = tda10071_wr_reg_mask(dev, tab[i].reg,
tab[i].val, tab[i].mask);
if (ret)
goto error;
cmd.args[1] = 0;
cmd.args[2] = 0;
cmd.len = 3;
- ret = tda10071_cmd_execute(priv, &cmd);
+ ret = tda10071_cmd_execute(dev, &cmd);
if (ret)
goto error;
} else {
/* init */
for (i = 0; i < ARRAY_SIZE(tab2); i++) {
- ret = tda10071_wr_reg_mask(priv, tab2[i].reg,
+ ret = tda10071_wr_reg_mask(dev, tab2[i].reg,
tab2[i].val, tab2[i].mask);
if (ret)
goto error_release_firmware;
}
/* download firmware */
- ret = tda10071_wr_reg(priv, 0xe0, 0x7f);
+ ret = tda10071_wr_reg(dev, 0xe0, 0x7f);
if (ret)
goto error_release_firmware;
- ret = tda10071_wr_reg(priv, 0xf7, 0x81);
+ ret = tda10071_wr_reg(dev, 0xf7, 0x81);
if (ret)
goto error_release_firmware;
- ret = tda10071_wr_reg(priv, 0xf8, 0x00);
+ ret = tda10071_wr_reg(dev, 0xf8, 0x00);
if (ret)
goto error_release_firmware;
- ret = tda10071_wr_reg(priv, 0xf9, 0x00);
+ ret = tda10071_wr_reg(dev, 0xf9, 0x00);
if (ret)
goto error_release_firmware;
fw_size = fw->size - 1;
for (remaining = fw_size; remaining > 0;
- remaining -= (priv->i2c_wr_max - 1)) {
+ remaining -= (dev->i2c_wr_max - 1)) {
len = remaining;
- if (len > (priv->i2c_wr_max - 1))
- len = (priv->i2c_wr_max - 1);
+ if (len > (dev->i2c_wr_max - 1))
+ len = (dev->i2c_wr_max - 1);
- ret = tda10071_wr_regs(priv, 0xfa,
+ ret = tda10071_wr_regs(dev, 0xfa,
(u8 *) &fw->data[fw_size - remaining], len);
if (ret) {
dev_err(&client->dev,
}
release_firmware(fw);
- ret = tda10071_wr_reg(priv, 0xf7, 0x0c);
+ ret = tda10071_wr_reg(dev, 0xf7, 0x0c);
if (ret)
goto error;
- ret = tda10071_wr_reg(priv, 0xe0, 0x00);
+ ret = tda10071_wr_reg(dev, 0xe0, 0x00);
if (ret)
goto error;
msleep(250);
/* firmware status */
- ret = tda10071_rd_reg(priv, 0x51, &tmp);
+ ret = tda10071_rd_reg(dev, 0x51, &tmp);
if (ret)
goto error;
ret = -EFAULT;
goto error;
} else {
- priv->warm = true;
+ dev->warm = true;
}
cmd.args[0] = CMD_GET_FW_VERSION;
cmd.len = 1;
- ret = tda10071_cmd_execute(priv, &cmd);
+ ret = tda10071_cmd_execute(dev, &cmd);
if (ret)
goto error;
- ret = tda10071_rd_regs(priv, cmd.len, buf, 4);
+ ret = tda10071_rd_regs(dev, cmd.len, buf, 4);
if (ret)
goto error;
dev_info(&client->dev, "found a '%s' in warm state\n",
tda10071_ops.info.name);
- ret = tda10071_rd_regs(priv, 0x81, buf, 2);
+ ret = tda10071_rd_regs(dev, 0x81, buf, 2);
if (ret)
goto error;
cmd.args[0] = CMD_DEMOD_INIT;
- cmd.args[1] = ((priv->clk / 1000) >> 8) & 0xff;
- cmd.args[2] = ((priv->clk / 1000) >> 0) & 0xff;
+ cmd.args[1] = ((dev->clk / 1000) >> 8) & 0xff;
+ cmd.args[2] = ((dev->clk / 1000) >> 0) & 0xff;
cmd.args[3] = buf[0];
cmd.args[4] = buf[1];
- cmd.args[5] = priv->pll_multiplier;
- cmd.args[6] = priv->spec_inv;
+ cmd.args[5] = dev->pll_multiplier;
+ cmd.args[6] = dev->spec_inv;
cmd.args[7] = 0x00;
cmd.len = 8;
- ret = tda10071_cmd_execute(priv, &cmd);
+ ret = tda10071_cmd_execute(dev, &cmd);
if (ret)
goto error;
- if (priv->tuner_i2c_addr)
- tmp = priv->tuner_i2c_addr;
+ if (dev->tuner_i2c_addr)
+ tmp = dev->tuner_i2c_addr;
else
tmp = 0x14;
cmd.args[13] = 0x00;
cmd.args[14] = 0x00;
cmd.len = 15;
- ret = tda10071_cmd_execute(priv, &cmd);
+ ret = tda10071_cmd_execute(dev, &cmd);
if (ret)
goto error;
cmd.args[0] = CMD_MPEG_CONFIG;
cmd.args[1] = 0;
- cmd.args[2] = priv->ts_mode;
+ cmd.args[2] = dev->ts_mode;
cmd.args[3] = 0x00;
cmd.args[4] = 0x04;
cmd.args[5] = 0x00;
cmd.len = 6;
- ret = tda10071_cmd_execute(priv, &cmd);
+ ret = tda10071_cmd_execute(dev, &cmd);
if (ret)
goto error;
- ret = tda10071_wr_reg_mask(priv, 0xf0, 0x01, 0x01);
+ ret = tda10071_wr_reg_mask(dev, 0xf0, 0x01, 0x01);
if (ret)
goto error;
cmd.args[9] = 30;
cmd.args[10] = 30;
cmd.len = 11;
- ret = tda10071_cmd_execute(priv, &cmd);
+ ret = tda10071_cmd_execute(dev, &cmd);
if (ret)
goto error;
cmd.args[2] = 14;
cmd.args[3] = 14;
cmd.len = 4;
- ret = tda10071_cmd_execute(priv, &cmd);
+ ret = tda10071_cmd_execute(dev, &cmd);
if (ret)
goto error;
}
static int tda10071_sleep(struct dvb_frontend *fe)
{
- struct tda10071_priv *priv = fe->demodulator_priv;
- struct i2c_client *client = priv->client;
+ struct tda10071_dev *dev = fe->demodulator_priv;
+ struct i2c_client *client = dev->client;
struct tda10071_cmd cmd;
int ret, i;
struct tda10071_reg_val_mask tab[] = {
{ 0xce, 0x10, 0x10 },
};
- if (!priv->warm) {
+ if (!dev->warm) {
ret = -EFAULT;
goto error;
}
cmd.args[1] = 0;
cmd.args[2] = 1;
cmd.len = 3;
- ret = tda10071_cmd_execute(priv, &cmd);
+ ret = tda10071_cmd_execute(dev, &cmd);
if (ret)
goto error;
for (i = 0; i < ARRAY_SIZE(tab); i++) {
- ret = tda10071_wr_reg_mask(priv, tab[i].reg, tab[i].val,
+ ret = tda10071_wr_reg_mask(dev, tab[i].reg, tab[i].val,
tab[i].mask);
if (ret)
goto error;
static struct dvb_frontend *tda10071_get_dvb_frontend(struct i2c_client *client)
{
- struct tda10071_priv *dev = i2c_get_clientdata(client);
+ struct tda10071_dev *dev = i2c_get_clientdata(client);
dev_dbg(&client->dev, "\n");
static int tda10071_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
- struct tda10071_priv *dev;
+ struct tda10071_dev *dev;
struct tda10071_platform_data *pdata = client->dev.platform_data;
int ret;
u8 u8tmp;