Commit c98975f9 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] cxd2820r: correct logging

Use correct device for logging functions as we now have it due to
proper I2C client bindings.
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 07fdf7d9
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
int cxd2820r_set_frontend_c(struct dvb_frontend *fe) int cxd2820r_set_frontend_c(struct dvb_frontend *fe)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret, i; int ret, i;
unsigned int utmp; unsigned int utmp;
...@@ -47,8 +48,10 @@ int cxd2820r_set_frontend_c(struct dvb_frontend *fe) ...@@ -47,8 +48,10 @@ int cxd2820r_set_frontend_c(struct dvb_frontend *fe)
{ 0x10071, !priv->ts_clk_inv << 4, 0x10 }, { 0x10071, !priv->ts_clk_inv << 4, 0x10 },
}; };
dev_dbg(&priv->i2c->dev, "%s: frequency=%d symbol_rate=%d\n", __func__, dev_dbg(&client->dev,
c->frequency, c->symbol_rate); "delivery_system=%d modulation=%d frequency=%u symbol_rate=%u inversion=%d\n",
c->delivery_system, c->modulation, c->frequency,
c->symbol_rate, c->inversion);
/* program tuner */ /* program tuner */
if (fe->ops.tuner_ops.set_params) if (fe->ops.tuner_ops.set_params)
...@@ -71,8 +74,7 @@ int cxd2820r_set_frontend_c(struct dvb_frontend *fe) ...@@ -71,8 +74,7 @@ int cxd2820r_set_frontend_c(struct dvb_frontend *fe)
ret = fe->ops.tuner_ops.get_if_frequency(fe, &if_frequency); ret = fe->ops.tuner_ops.get_if_frequency(fe, &if_frequency);
if (ret) if (ret)
goto error; goto error;
dev_dbg(&priv->i2c->dev, "%s: if_frequency=%u\n", __func__, dev_dbg(&client->dev, "if_frequency=%u\n", if_frequency);
if_frequency);
} else { } else {
ret = -EINVAL; ret = -EINVAL;
goto error; goto error;
...@@ -95,7 +97,7 @@ int cxd2820r_set_frontend_c(struct dvb_frontend *fe) ...@@ -95,7 +97,7 @@ int cxd2820r_set_frontend_c(struct dvb_frontend *fe)
return ret; return ret;
error: error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
...@@ -103,9 +105,12 @@ int cxd2820r_get_frontend_c(struct dvb_frontend *fe, ...@@ -103,9 +105,12 @@ int cxd2820r_get_frontend_c(struct dvb_frontend *fe,
struct dtv_frontend_properties *c) struct dtv_frontend_properties *c)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
int ret; int ret;
u8 buf[2]; u8 buf[2];
dev_dbg(&client->dev, "\n");
ret = cxd2820r_rd_regs(priv, 0x1001a, buf, 2); ret = cxd2820r_rd_regs(priv, 0x1001a, buf, 2);
if (ret) if (ret)
goto error; goto error;
...@@ -145,13 +150,14 @@ int cxd2820r_get_frontend_c(struct dvb_frontend *fe, ...@@ -145,13 +150,14 @@ int cxd2820r_get_frontend_c(struct dvb_frontend *fe,
return ret; return ret;
error: error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
int cxd2820r_read_status_c(struct dvb_frontend *fe, enum fe_status *status) int cxd2820r_read_status_c(struct dvb_frontend *fe, enum fe_status *status)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret; int ret;
unsigned int utmp; unsigned int utmp;
...@@ -172,8 +178,7 @@ int cxd2820r_read_status_c(struct dvb_frontend *fe, enum fe_status *status) ...@@ -172,8 +178,7 @@ int cxd2820r_read_status_c(struct dvb_frontend *fe, enum fe_status *status)
} }
} }
dev_dbg(&priv->i2c->dev, "%s: lock=%02x %02x\n", __func__, buf[0], dev_dbg(&client->dev, "lock=%*ph\n", 2, buf);
buf[1]);
/* Signal strength */ /* Signal strength */
if (*status & FE_HAS_SIGNAL) { if (*status & FE_HAS_SIGNAL) {
...@@ -275,28 +280,32 @@ int cxd2820r_read_status_c(struct dvb_frontend *fe, enum fe_status *status) ...@@ -275,28 +280,32 @@ int cxd2820r_read_status_c(struct dvb_frontend *fe, enum fe_status *status)
return ret; return ret;
error: error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
int cxd2820r_init_c(struct dvb_frontend *fe) int cxd2820r_init_c(struct dvb_frontend *fe)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
int ret; int ret;
dev_dbg(&client->dev, "\n");
ret = cxd2820r_wr_reg(priv, 0x00085, 0x07); ret = cxd2820r_wr_reg(priv, 0x00085, 0x07);
if (ret) if (ret)
goto error; goto error;
return ret; return ret;
error: error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
int cxd2820r_sleep_c(struct dvb_frontend *fe) int cxd2820r_sleep_c(struct dvb_frontend *fe)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
int ret, i; int ret, i;
struct reg_val_mask tab[] = { struct reg_val_mask tab[] = {
{ 0x000ff, 0x1f, 0xff }, { 0x000ff, 0x1f, 0xff },
...@@ -306,7 +315,7 @@ int cxd2820r_sleep_c(struct dvb_frontend *fe) ...@@ -306,7 +315,7 @@ int cxd2820r_sleep_c(struct dvb_frontend *fe)
{ 0x00080, 0x00, 0xff }, { 0x00080, 0x00, 0xff },
}; };
dev_dbg(&priv->i2c->dev, "%s\n", __func__); dev_dbg(&client->dev, "\n");
priv->delivery_system = SYS_UNDEFINED; priv->delivery_system = SYS_UNDEFINED;
...@@ -319,7 +328,7 @@ int cxd2820r_sleep_c(struct dvb_frontend *fe) ...@@ -319,7 +328,7 @@ int cxd2820r_sleep_c(struct dvb_frontend *fe)
return ret; return ret;
error: error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg, static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg,
u8 *val, int len) u8 *val, int len)
{ {
struct i2c_client *client = priv->client[0];
int ret; int ret;
u8 buf[MAX_XFER_SIZE]; u8 buf[MAX_XFER_SIZE];
struct i2c_msg msg[1] = { struct i2c_msg msg[1] = {
...@@ -40,9 +41,8 @@ static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg, ...@@ -40,9 +41,8 @@ static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg,
}; };
if (1 + len > sizeof(buf)) { if (1 + len > sizeof(buf)) {
dev_warn(&priv->i2c->dev, dev_warn(&client->dev, "i2c wr reg=%04x: len=%d is too big!\n",
"%s: i2c wr reg=%04x: len=%d is too big!\n", reg, len);
KBUILD_MODNAME, reg, len);
return -EINVAL; return -EINVAL;
} }
...@@ -53,8 +53,8 @@ static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg, ...@@ -53,8 +53,8 @@ static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg,
if (ret == 1) { if (ret == 1) {
ret = 0; ret = 0;
} else { } else {
dev_warn(&priv->i2c->dev, "%s: i2c wr failed=%d reg=%02x " \ dev_warn(&client->dev, "i2c wr failed=%d reg=%02x len=%d\n",
"len=%d\n", KBUILD_MODNAME, ret, reg, len); ret, reg, len);
ret = -EREMOTEIO; ret = -EREMOTEIO;
} }
return ret; return ret;
...@@ -64,6 +64,7 @@ static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg, ...@@ -64,6 +64,7 @@ static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg,
static int cxd2820r_rd_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg, static int cxd2820r_rd_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg,
u8 *val, int len) u8 *val, int len)
{ {
struct i2c_client *client = priv->client[0];
int ret; int ret;
u8 buf[MAX_XFER_SIZE]; u8 buf[MAX_XFER_SIZE];
struct i2c_msg msg[2] = { struct i2c_msg msg[2] = {
...@@ -81,9 +82,8 @@ static int cxd2820r_rd_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg, ...@@ -81,9 +82,8 @@ static int cxd2820r_rd_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg,
}; };
if (len > sizeof(buf)) { if (len > sizeof(buf)) {
dev_warn(&priv->i2c->dev, dev_warn(&client->dev, "i2c wr reg=%04x: len=%d is too big!\n",
"%s: i2c wr reg=%04x: len=%d is too big!\n", reg, len);
KBUILD_MODNAME, reg, len);
return -EINVAL; return -EINVAL;
} }
...@@ -92,8 +92,8 @@ static int cxd2820r_rd_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg, ...@@ -92,8 +92,8 @@ static int cxd2820r_rd_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg,
memcpy(val, buf, len); memcpy(val, buf, len);
ret = 0; ret = 0;
} else { } else {
dev_warn(&priv->i2c->dev, "%s: i2c rd failed=%d reg=%02x " \ dev_warn(&client->dev, "i2c rd failed=%d reg=%02x len=%d\n",
"len=%d\n", KBUILD_MODNAME, ret, reg, len); ret, reg, len);
ret = -EREMOTEIO; ret = -EREMOTEIO;
} }
...@@ -188,11 +188,12 @@ int cxd2820r_wr_reg_mask(struct cxd2820r_priv *priv, u32 reg, u8 val, ...@@ -188,11 +188,12 @@ int cxd2820r_wr_reg_mask(struct cxd2820r_priv *priv, u32 reg, u8 val,
int cxd2820r_gpio(struct dvb_frontend *fe, u8 *gpio) int cxd2820r_gpio(struct dvb_frontend *fe, u8 *gpio)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret, i; int ret, i;
u8 tmp0, tmp1; u8 tmp0, tmp1;
dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__, dev_dbg(&client->dev, "delivery_system=%d\n", c->delivery_system);
fe->dtv_property_cache.delivery_system);
/* update GPIOs only when needed */ /* update GPIOs only when needed */
if (!memcmp(gpio, priv->gpio, sizeof(priv->gpio))) if (!memcmp(gpio, priv->gpio, sizeof(priv->gpio)))
...@@ -219,12 +220,10 @@ int cxd2820r_gpio(struct dvb_frontend *fe, u8 *gpio) ...@@ -219,12 +220,10 @@ int cxd2820r_gpio(struct dvb_frontend *fe, u8 *gpio)
else else
tmp1 |= (0 << (0 + i)); tmp1 |= (0 << (0 + i));
dev_dbg(&priv->i2c->dev, "%s: gpio i=%d %02x %02x\n", __func__, dev_dbg(&client->dev, "gpio i=%d %02x %02x\n", i, tmp0, tmp1);
i, tmp0, tmp1);
} }
dev_dbg(&priv->i2c->dev, "%s: wr gpio=%02x %02x\n", __func__, tmp0, dev_dbg(&client->dev, "wr gpio=%02x %02x\n", tmp0, tmp1);
tmp1);
/* write bits [7:2] */ /* write bits [7:2] */
ret = cxd2820r_wr_reg_mask(priv, 0x00089, tmp0, 0xfc); ret = cxd2820r_wr_reg_mask(priv, 0x00089, tmp0, 0xfc);
...@@ -240,18 +239,18 @@ int cxd2820r_gpio(struct dvb_frontend *fe, u8 *gpio) ...@@ -240,18 +239,18 @@ int cxd2820r_gpio(struct dvb_frontend *fe, u8 *gpio)
return ret; return ret;
error: error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
static int cxd2820r_set_frontend(struct dvb_frontend *fe) static int cxd2820r_set_frontend(struct dvb_frontend *fe)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret; int ret;
dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__, dev_dbg(&client->dev, "delivery_system=%d\n", c->delivery_system);
fe->dtv_property_cache.delivery_system);
switch (c->delivery_system) { switch (c->delivery_system) {
case SYS_DVBT: case SYS_DVBT:
...@@ -279,8 +278,7 @@ static int cxd2820r_set_frontend(struct dvb_frontend *fe) ...@@ -279,8 +278,7 @@ static int cxd2820r_set_frontend(struct dvb_frontend *fe)
goto err; goto err;
break; break;
default: default:
dev_dbg(&priv->i2c->dev, "%s: error state=%d\n", __func__, dev_dbg(&client->dev, "invalid delivery_system\n");
fe->dtv_property_cache.delivery_system);
ret = -EINVAL; ret = -EINVAL;
break; break;
} }
...@@ -291,12 +289,13 @@ static int cxd2820r_set_frontend(struct dvb_frontend *fe) ...@@ -291,12 +289,13 @@ static int cxd2820r_set_frontend(struct dvb_frontend *fe)
static int cxd2820r_read_status(struct dvb_frontend *fe, enum fe_status *status) static int cxd2820r_read_status(struct dvb_frontend *fe, enum fe_status *status)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret; int ret;
dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__, dev_dbg(&client->dev, "delivery_system=%d\n", c->delivery_system);
fe->dtv_property_cache.delivery_system);
switch (fe->dtv_property_cache.delivery_system) { switch (c->delivery_system) {
case SYS_DVBT: case SYS_DVBT:
ret = cxd2820r_read_status_t(fe, status); ret = cxd2820r_read_status_t(fe, status);
break; break;
...@@ -317,15 +316,16 @@ static int cxd2820r_get_frontend(struct dvb_frontend *fe, ...@@ -317,15 +316,16 @@ static int cxd2820r_get_frontend(struct dvb_frontend *fe,
struct dtv_frontend_properties *p) struct dtv_frontend_properties *p)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret; int ret;
dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__, dev_dbg(&client->dev, "delivery_system=%d\n", c->delivery_system);
fe->dtv_property_cache.delivery_system);
if (priv->delivery_system == SYS_UNDEFINED) if (priv->delivery_system == SYS_UNDEFINED)
return 0; return 0;
switch (fe->dtv_property_cache.delivery_system) { switch (c->delivery_system) {
case SYS_DVBT: case SYS_DVBT:
ret = cxd2820r_get_frontend_t(fe, p); ret = cxd2820r_get_frontend_t(fe, p);
break; break;
...@@ -345,9 +345,10 @@ static int cxd2820r_get_frontend(struct dvb_frontend *fe, ...@@ -345,9 +345,10 @@ static int cxd2820r_get_frontend(struct dvb_frontend *fe,
static int cxd2820r_read_ber(struct dvb_frontend *fe, u32 *ber) static int cxd2820r_read_ber(struct dvb_frontend *fe, u32 *ber)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__, dev_dbg(&client->dev, "delivery_system=%d\n", c->delivery_system);
fe->dtv_property_cache.delivery_system);
*ber = (priv->post_bit_error - priv->post_bit_error_prev_dvbv3); *ber = (priv->post_bit_error - priv->post_bit_error_prev_dvbv3);
priv->post_bit_error_prev_dvbv3 = priv->post_bit_error; priv->post_bit_error_prev_dvbv3 = priv->post_bit_error;
...@@ -358,10 +359,10 @@ static int cxd2820r_read_ber(struct dvb_frontend *fe, u32 *ber) ...@@ -358,10 +359,10 @@ static int cxd2820r_read_ber(struct dvb_frontend *fe, u32 *ber)
static int cxd2820r_read_signal_strength(struct dvb_frontend *fe, u16 *strength) static int cxd2820r_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dtv_frontend_properties *c = &fe->dtv_property_cache;
dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__, dev_dbg(&client->dev, "delivery_system=%d\n", c->delivery_system);
fe->dtv_property_cache.delivery_system);
if (c->strength.stat[0].scale == FE_SCALE_RELATIVE) if (c->strength.stat[0].scale == FE_SCALE_RELATIVE)
*strength = c->strength.stat[0].uvalue; *strength = c->strength.stat[0].uvalue;
...@@ -374,10 +375,10 @@ static int cxd2820r_read_signal_strength(struct dvb_frontend *fe, u16 *strength) ...@@ -374,10 +375,10 @@ static int cxd2820r_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
static int cxd2820r_read_snr(struct dvb_frontend *fe, u16 *snr) static int cxd2820r_read_snr(struct dvb_frontend *fe, u16 *snr)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dtv_frontend_properties *c = &fe->dtv_property_cache;
dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__, dev_dbg(&client->dev, "delivery_system=%d\n", c->delivery_system);
fe->dtv_property_cache.delivery_system);
if (c->cnr.stat[0].scale == FE_SCALE_DECIBEL) if (c->cnr.stat[0].scale == FE_SCALE_DECIBEL)
*snr = div_s64(c->cnr.stat[0].svalue, 100); *snr = div_s64(c->cnr.stat[0].svalue, 100);
...@@ -390,9 +391,10 @@ static int cxd2820r_read_snr(struct dvb_frontend *fe, u16 *snr) ...@@ -390,9 +391,10 @@ static int cxd2820r_read_snr(struct dvb_frontend *fe, u16 *snr)
static int cxd2820r_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) static int cxd2820r_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__, dev_dbg(&client->dev, "delivery_system=%d\n", c->delivery_system);
fe->dtv_property_cache.delivery_system);
*ucblocks = 0; *ucblocks = 0;
...@@ -407,12 +409,13 @@ static int cxd2820r_init(struct dvb_frontend *fe) ...@@ -407,12 +409,13 @@ static int cxd2820r_init(struct dvb_frontend *fe)
static int cxd2820r_sleep(struct dvb_frontend *fe) static int cxd2820r_sleep(struct dvb_frontend *fe)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret; int ret;
dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__, dev_dbg(&client->dev, "delivery_system=%d\n", c->delivery_system);
fe->dtv_property_cache.delivery_system);
switch (fe->dtv_property_cache.delivery_system) { switch (c->delivery_system) {
case SYS_DVBT: case SYS_DVBT:
ret = cxd2820r_sleep_t(fe); ret = cxd2820r_sleep_t(fe);
break; break;
...@@ -433,12 +436,13 @@ static int cxd2820r_get_tune_settings(struct dvb_frontend *fe, ...@@ -433,12 +436,13 @@ static int cxd2820r_get_tune_settings(struct dvb_frontend *fe,
struct dvb_frontend_tune_settings *s) struct dvb_frontend_tune_settings *s)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret; int ret;
dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__, dev_dbg(&client->dev, "delivery_system=%d\n", c->delivery_system);
fe->dtv_property_cache.delivery_system);
switch (fe->dtv_property_cache.delivery_system) { switch (c->delivery_system) {
case SYS_DVBT: case SYS_DVBT:
ret = cxd2820r_get_tune_settings_t(fe, s); ret = cxd2820r_get_tune_settings_t(fe, s);
break; break;
...@@ -458,12 +462,12 @@ static int cxd2820r_get_tune_settings(struct dvb_frontend *fe, ...@@ -458,12 +462,12 @@ static int cxd2820r_get_tune_settings(struct dvb_frontend *fe,
static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe) static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret, i; int ret, i;
enum fe_status status = 0; enum fe_status status = 0;
dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__, dev_dbg(&client->dev, "delivery_system=%d\n", c->delivery_system);
fe->dtv_property_cache.delivery_system);
/* switch between DVB-T and DVB-T2 when tune fails */ /* switch between DVB-T and DVB-T2 when tune fails */
if (priv->last_tune_failed) { if (priv->last_tune_failed) {
...@@ -487,7 +491,6 @@ static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe) ...@@ -487,7 +491,6 @@ static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe)
if (ret) if (ret)
goto error; goto error;
/* frontend lock wait loop count */ /* frontend lock wait loop count */
switch (priv->delivery_system) { switch (priv->delivery_system) {
case SYS_DVBT: case SYS_DVBT:
...@@ -505,7 +508,7 @@ static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe) ...@@ -505,7 +508,7 @@ static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe)
/* wait frontend lock */ /* wait frontend lock */
for (; i > 0; i--) { for (; i > 0; i--) {
dev_dbg(&priv->i2c->dev, "%s: loop=%d\n", __func__, i); dev_dbg(&client->dev, "loop=%d\n", i);
msleep(50); msleep(50);
ret = cxd2820r_read_status(fe, &status); ret = cxd2820r_read_status(fe, &status);
if (ret) if (ret)
...@@ -525,7 +528,7 @@ static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe) ...@@ -525,7 +528,7 @@ static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe)
} }
error: error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return DVBFE_ALGO_SEARCH_ERROR; return DVBFE_ALGO_SEARCH_ERROR;
} }
...@@ -539,7 +542,7 @@ static void cxd2820r_release(struct dvb_frontend *fe) ...@@ -539,7 +542,7 @@ static void cxd2820r_release(struct dvb_frontend *fe)
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0]; struct i2c_client *client = priv->client[0];
dev_dbg(&priv->i2c->dev, "%s\n", __func__); dev_dbg(&client->dev, "\n");
i2c_unregister_device(client); i2c_unregister_device(client);
...@@ -549,8 +552,9 @@ static void cxd2820r_release(struct dvb_frontend *fe) ...@@ -549,8 +552,9 @@ static void cxd2820r_release(struct dvb_frontend *fe)
static int cxd2820r_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) static int cxd2820r_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
dev_dbg(&priv->i2c->dev, "%s: %d\n", __func__, enable); dev_dbg_ratelimited(&client->dev, "enable=%d\n", enable);
/* Bit 0 of reg 0xdb in bank 0x00 controls I2C repeater */ /* Bit 0 of reg 0xdb in bank 0x00 controls I2C repeater */
return cxd2820r_wr_reg_mask(priv, 0xdb, enable ? 1 : 0, 0x1); return cxd2820r_wr_reg_mask(priv, 0xdb, enable ? 1 : 0, 0x1);
...@@ -561,9 +565,10 @@ static int cxd2820r_gpio_direction_output(struct gpio_chip *chip, unsigned nr, ...@@ -561,9 +565,10 @@ static int cxd2820r_gpio_direction_output(struct gpio_chip *chip, unsigned nr,
int val) int val)
{ {
struct cxd2820r_priv *priv = gpiochip_get_data(chip); struct cxd2820r_priv *priv = gpiochip_get_data(chip);
struct i2c_client *client = priv->client[0];
u8 gpio[GPIO_COUNT]; u8 gpio[GPIO_COUNT];
dev_dbg(&priv->i2c->dev, "%s: nr=%d val=%d\n", __func__, nr, val); dev_dbg(&client->dev, "nr=%u val=%d\n", nr, val);
memcpy(gpio, priv->gpio, sizeof(gpio)); memcpy(gpio, priv->gpio, sizeof(gpio));
gpio[nr] = CXD2820R_GPIO_E | CXD2820R_GPIO_O | (val << 2); gpio[nr] = CXD2820R_GPIO_E | CXD2820R_GPIO_O | (val << 2);
...@@ -574,9 +579,10 @@ static int cxd2820r_gpio_direction_output(struct gpio_chip *chip, unsigned nr, ...@@ -574,9 +579,10 @@ static int cxd2820r_gpio_direction_output(struct gpio_chip *chip, unsigned nr,
static void cxd2820r_gpio_set(struct gpio_chip *chip, unsigned nr, int val) static void cxd2820r_gpio_set(struct gpio_chip *chip, unsigned nr, int val)
{ {
struct cxd2820r_priv *priv = gpiochip_get_data(chip); struct cxd2820r_priv *priv = gpiochip_get_data(chip);
struct i2c_client *client = priv->client[0];
u8 gpio[GPIO_COUNT]; u8 gpio[GPIO_COUNT];
dev_dbg(&priv->i2c->dev, "%s: nr=%d val=%d\n", __func__, nr, val); dev_dbg(&client->dev, "nr=%u val=%d\n", nr, val);
memcpy(gpio, priv->gpio, sizeof(gpio)); memcpy(gpio, priv->gpio, sizeof(gpio));
gpio[nr] = CXD2820R_GPIO_E | CXD2820R_GPIO_O | (val << 2); gpio[nr] = CXD2820R_GPIO_E | CXD2820R_GPIO_O | (val << 2);
...@@ -589,8 +595,9 @@ static void cxd2820r_gpio_set(struct gpio_chip *chip, unsigned nr, int val) ...@@ -589,8 +595,9 @@ static void cxd2820r_gpio_set(struct gpio_chip *chip, unsigned nr, int val)
static int cxd2820r_gpio_get(struct gpio_chip *chip, unsigned nr) static int cxd2820r_gpio_get(struct gpio_chip *chip, unsigned nr)
{ {
struct cxd2820r_priv *priv = gpiochip_get_data(chip); struct cxd2820r_priv *priv = gpiochip_get_data(chip);
struct i2c_client *client = priv->client[0];
dev_dbg(&priv->i2c->dev, "%s: nr=%d\n", __func__, nr); dev_dbg(&client->dev, "nr=%u\n", nr);
return (priv->gpio[nr] >> 2) & 0x01; return (priv->gpio[nr] >> 2) & 0x01;
} }
...@@ -738,7 +745,7 @@ static int cxd2820r_probe(struct i2c_client *client, ...@@ -738,7 +745,7 @@ static int cxd2820r_probe(struct i2c_client *client,
#ifdef CONFIG_GPIOLIB #ifdef CONFIG_GPIOLIB
/* Add GPIOs */ /* Add GPIOs */
priv->gpio_chip.label = KBUILD_MODNAME; priv->gpio_chip.label = KBUILD_MODNAME;
priv->gpio_chip.parent = &priv->i2c->dev; priv->gpio_chip.parent = &client->dev;
priv->gpio_chip.owner = THIS_MODULE; priv->gpio_chip.owner = THIS_MODULE;
priv->gpio_chip.direction_output = cxd2820r_gpio_direction_output; priv->gpio_chip.direction_output = cxd2820r_gpio_direction_output;
priv->gpio_chip.set = cxd2820r_gpio_set; priv->gpio_chip.set = cxd2820r_gpio_set;
...@@ -750,7 +757,7 @@ static int cxd2820r_probe(struct i2c_client *client, ...@@ -750,7 +757,7 @@ static int cxd2820r_probe(struct i2c_client *client,
if (ret) if (ret)
goto err_client_1_i2c_unregister_device; goto err_client_1_i2c_unregister_device;
dev_dbg(&priv->i2c->dev, "%s: gpio_chip.base=%d\n", __func__, dev_dbg(&client->dev, "gpio_chip.base=%d\n",
priv->gpio_chip.base); priv->gpio_chip.base);
*gpio_chip_base = priv->gpio_chip.base; *gpio_chip_base = priv->gpio_chip.base;
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
int cxd2820r_set_frontend_t(struct dvb_frontend *fe) int cxd2820r_set_frontend_t(struct dvb_frontend *fe)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret, i, bw_i; int ret, i, bw_i;
unsigned int utmp; unsigned int utmp;
...@@ -55,8 +56,10 @@ int cxd2820r_set_frontend_t(struct dvb_frontend *fe) ...@@ -55,8 +56,10 @@ int cxd2820r_set_frontend_t(struct dvb_frontend *fe)
{ 0x00427, 0x41, 0xff }, { 0x00427, 0x41, 0xff },
}; };
dev_dbg(&priv->i2c->dev, "%s: frequency=%d bandwidth_hz=%d\n", __func__, dev_dbg(&client->dev,
c->frequency, c->bandwidth_hz); "delivery_system=%d modulation=%d frequency=%u bandwidth_hz=%u inversion=%d\n",
c->delivery_system, c->modulation, c->frequency,
c->bandwidth_hz, c->inversion);
switch (c->bandwidth_hz) { switch (c->bandwidth_hz) {
case 6000000: case 6000000:
...@@ -96,8 +99,7 @@ int cxd2820r_set_frontend_t(struct dvb_frontend *fe) ...@@ -96,8 +99,7 @@ int cxd2820r_set_frontend_t(struct dvb_frontend *fe)
ret = fe->ops.tuner_ops.get_if_frequency(fe, &if_frequency); ret = fe->ops.tuner_ops.get_if_frequency(fe, &if_frequency);
if (ret) if (ret)
goto error; goto error;
dev_dbg(&priv->i2c->dev, "%s: if_frequency=%u\n", __func__, dev_dbg(&client->dev, "if_frequency=%u\n", if_frequency);
if_frequency);
} else { } else {
ret = -EINVAL; ret = -EINVAL;
goto error; goto error;
...@@ -133,7 +135,7 @@ int cxd2820r_set_frontend_t(struct dvb_frontend *fe) ...@@ -133,7 +135,7 @@ int cxd2820r_set_frontend_t(struct dvb_frontend *fe)
return ret; return ret;
error: error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
...@@ -141,9 +143,12 @@ int cxd2820r_get_frontend_t(struct dvb_frontend *fe, ...@@ -141,9 +143,12 @@ int cxd2820r_get_frontend_t(struct dvb_frontend *fe,
struct dtv_frontend_properties *c) struct dtv_frontend_properties *c)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
int ret; int ret;
u8 buf[2]; u8 buf[2];
dev_dbg(&client->dev, "\n");
ret = cxd2820r_rd_regs(priv, 0x0002f, buf, sizeof(buf)); ret = cxd2820r_rd_regs(priv, 0x0002f, buf, sizeof(buf));
if (ret) if (ret)
goto error; goto error;
...@@ -250,13 +255,14 @@ int cxd2820r_get_frontend_t(struct dvb_frontend *fe, ...@@ -250,13 +255,14 @@ int cxd2820r_get_frontend_t(struct dvb_frontend *fe,
return ret; return ret;
error: error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
int cxd2820r_read_status_t(struct dvb_frontend *fe, enum fe_status *status) int cxd2820r_read_status_t(struct dvb_frontend *fe, enum fe_status *status)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret; int ret;
unsigned int utmp; unsigned int utmp;
...@@ -294,7 +300,7 @@ int cxd2820r_read_status_t(struct dvb_frontend *fe, enum fe_status *status) ...@@ -294,7 +300,7 @@ int cxd2820r_read_status_t(struct dvb_frontend *fe, enum fe_status *status)
} }
} }
dev_dbg(&priv->i2c->dev, "%s: lock=%*ph\n", __func__, 4, buf); dev_dbg(&client->dev, "lock=%*ph\n", 4, buf);
/* Signal strength */ /* Signal strength */
if (*status & FE_HAS_SIGNAL) { if (*status & FE_HAS_SIGNAL) {
...@@ -384,28 +390,32 @@ int cxd2820r_read_status_t(struct dvb_frontend *fe, enum fe_status *status) ...@@ -384,28 +390,32 @@ int cxd2820r_read_status_t(struct dvb_frontend *fe, enum fe_status *status)
return ret; return ret;
error: error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
int cxd2820r_init_t(struct dvb_frontend *fe) int cxd2820r_init_t(struct dvb_frontend *fe)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
int ret; int ret;
dev_dbg(&client->dev, "\n");
ret = cxd2820r_wr_reg(priv, 0x00085, 0x07); ret = cxd2820r_wr_reg(priv, 0x00085, 0x07);
if (ret) if (ret)
goto error; goto error;
return ret; return ret;
error: error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
int cxd2820r_sleep_t(struct dvb_frontend *fe) int cxd2820r_sleep_t(struct dvb_frontend *fe)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
int ret, i; int ret, i;
struct reg_val_mask tab[] = { struct reg_val_mask tab[] = {
{ 0x000ff, 0x1f, 0xff }, { 0x000ff, 0x1f, 0xff },
...@@ -415,7 +425,7 @@ int cxd2820r_sleep_t(struct dvb_frontend *fe) ...@@ -415,7 +425,7 @@ int cxd2820r_sleep_t(struct dvb_frontend *fe)
{ 0x00080, 0x00, 0xff }, { 0x00080, 0x00, 0xff },
}; };
dev_dbg(&priv->i2c->dev, "%s\n", __func__); dev_dbg(&client->dev, "\n");
priv->delivery_system = SYS_UNDEFINED; priv->delivery_system = SYS_UNDEFINED;
...@@ -428,7 +438,7 @@ int cxd2820r_sleep_t(struct dvb_frontend *fe) ...@@ -428,7 +438,7 @@ int cxd2820r_sleep_t(struct dvb_frontend *fe)
return ret; return ret;
error: error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
......
...@@ -23,8 +23,9 @@ ...@@ -23,8 +23,9 @@
int cxd2820r_set_frontend_t2(struct dvb_frontend *fe) int cxd2820r_set_frontend_t2(struct dvb_frontend *fe)
{ {
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret, i, bw_i; int ret, i, bw_i;
unsigned int utmp; unsigned int utmp;
u32 if_frequency; u32 if_frequency;
...@@ -69,8 +70,10 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe) ...@@ -69,8 +70,10 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe)
{ 0x027ef, 0x10, 0x18 }, { 0x027ef, 0x10, 0x18 },
}; };
dev_dbg(&priv->i2c->dev, "%s: frequency=%d bandwidth_hz=%d\n", __func__, dev_dbg(&client->dev,
c->frequency, c->bandwidth_hz); "delivery_system=%d modulation=%d frequency=%u bandwidth_hz=%u inversion=%d stream_id=%u\n",
c->delivery_system, c->modulation, c->frequency,
c->bandwidth_hz, c->inversion, c->stream_id);
switch (c->bandwidth_hz) { switch (c->bandwidth_hz) {
case 5000000: case 5000000:
...@@ -113,8 +116,7 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe) ...@@ -113,8 +116,7 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe)
ret = fe->ops.tuner_ops.get_if_frequency(fe, &if_frequency); ret = fe->ops.tuner_ops.get_if_frequency(fe, &if_frequency);
if (ret) if (ret)
goto error; goto error;
dev_dbg(&priv->i2c->dev, "%s: if_frequency=%u\n", __func__, dev_dbg(&client->dev, "if_frequency=%u\n", if_frequency);
if_frequency);
} else { } else {
ret = -EINVAL; ret = -EINVAL;
goto error; goto error;
...@@ -130,13 +132,12 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe) ...@@ -130,13 +132,12 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe)
/* PLP filtering */ /* PLP filtering */
if (c->stream_id > 255) { if (c->stream_id > 255) {
dev_dbg(&priv->i2c->dev, "%s: Disable PLP filtering\n", __func__); dev_dbg(&client->dev, "disable PLP filtering\n");
ret = cxd2820r_wr_reg(priv, 0x023ad , 0); ret = cxd2820r_wr_reg(priv, 0x023ad , 0);
if (ret) if (ret)
goto error; goto error;
} else { } else {
dev_dbg(&priv->i2c->dev, "%s: Enable PLP filtering = %d\n", __func__, dev_dbg(&client->dev, "enable PLP filtering\n");
c->stream_id);
ret = cxd2820r_wr_reg(priv, 0x023af , c->stream_id & 0xFF); ret = cxd2820r_wr_reg(priv, 0x023af , c->stream_id & 0xFF);
if (ret) if (ret)
goto error; goto error;
...@@ -163,7 +164,7 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe) ...@@ -163,7 +164,7 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe)
return ret; return ret;
error: error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
...@@ -172,9 +173,12 @@ int cxd2820r_get_frontend_t2(struct dvb_frontend *fe, ...@@ -172,9 +173,12 @@ int cxd2820r_get_frontend_t2(struct dvb_frontend *fe,
struct dtv_frontend_properties *c) struct dtv_frontend_properties *c)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
int ret; int ret;
u8 buf[2]; u8 buf[2];
dev_dbg(&client->dev, "\n");
ret = cxd2820r_rd_regs(priv, 0x0205c, buf, 2); ret = cxd2820r_rd_regs(priv, 0x0205c, buf, 2);
if (ret) if (ret)
goto error; goto error;
...@@ -279,7 +283,7 @@ int cxd2820r_get_frontend_t2(struct dvb_frontend *fe, ...@@ -279,7 +283,7 @@ int cxd2820r_get_frontend_t2(struct dvb_frontend *fe,
return ret; return ret;
error: error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
...@@ -287,6 +291,7 @@ int cxd2820r_read_status_t2(struct dvb_frontend *fe, enum fe_status *status) ...@@ -287,6 +291,7 @@ int cxd2820r_read_status_t2(struct dvb_frontend *fe, enum fe_status *status)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct i2c_client *client = priv->client[0];
int ret; int ret;
unsigned int utmp; unsigned int utmp;
u8 buf[4]; u8 buf[4];
...@@ -306,7 +311,7 @@ int cxd2820r_read_status_t2(struct dvb_frontend *fe, enum fe_status *status) ...@@ -306,7 +311,7 @@ int cxd2820r_read_status_t2(struct dvb_frontend *fe, enum fe_status *status)
} }
} }
dev_dbg(&priv->i2c->dev, "%s: lock=%02x\n", __func__, buf[0]); dev_dbg(&client->dev, "lock=%*ph\n", 1, buf);
/* Signal strength */ /* Signal strength */
if (*status & FE_HAS_SIGNAL) { if (*status & FE_HAS_SIGNAL) {
...@@ -383,13 +388,14 @@ int cxd2820r_read_status_t2(struct dvb_frontend *fe, enum fe_status *status) ...@@ -383,13 +388,14 @@ int cxd2820r_read_status_t2(struct dvb_frontend *fe, enum fe_status *status)
return ret; return ret;
error: error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
int cxd2820r_sleep_t2(struct dvb_frontend *fe) int cxd2820r_sleep_t2(struct dvb_frontend *fe)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
int ret, i; int ret, i;
struct reg_val_mask tab[] = { struct reg_val_mask tab[] = {
{ 0x000ff, 0x1f, 0xff }, { 0x000ff, 0x1f, 0xff },
...@@ -400,7 +406,7 @@ int cxd2820r_sleep_t2(struct dvb_frontend *fe) ...@@ -400,7 +406,7 @@ int cxd2820r_sleep_t2(struct dvb_frontend *fe)
{ 0x00080, 0x00, 0xff }, { 0x00080, 0x00, 0xff },
}; };
dev_dbg(&priv->i2c->dev, "%s\n", __func__); dev_dbg(&client->dev, "\n");
for (i = 0; i < ARRAY_SIZE(tab); i++) { for (i = 0; i < ARRAY_SIZE(tab); i++) {
ret = cxd2820r_wr_reg_mask(priv, tab[i].reg, tab[i].val, ret = cxd2820r_wr_reg_mask(priv, tab[i].reg, tab[i].val,
...@@ -413,7 +419,7 @@ int cxd2820r_sleep_t2(struct dvb_frontend *fe) ...@@ -413,7 +419,7 @@ int cxd2820r_sleep_t2(struct dvb_frontend *fe)
return ret; return ret;
error: error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
......
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