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 @@
int cxd2820r_set_frontend_c(struct dvb_frontend *fe)
{
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;
unsigned int utmp;
......@@ -47,8 +48,10 @@ int cxd2820r_set_frontend_c(struct dvb_frontend *fe)
{ 0x10071, !priv->ts_clk_inv << 4, 0x10 },
};
dev_dbg(&priv->i2c->dev, "%s: frequency=%d symbol_rate=%d\n", __func__,
c->frequency, c->symbol_rate);
dev_dbg(&client->dev,
"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 */
if (fe->ops.tuner_ops.set_params)
......@@ -71,8 +74,7 @@ int cxd2820r_set_frontend_c(struct dvb_frontend *fe)
ret = fe->ops.tuner_ops.get_if_frequency(fe, &if_frequency);
if (ret)
goto error;
dev_dbg(&priv->i2c->dev, "%s: if_frequency=%u\n", __func__,
if_frequency);
dev_dbg(&client->dev, "if_frequency=%u\n", if_frequency);
} else {
ret = -EINVAL;
goto error;
......@@ -95,7 +97,7 @@ int cxd2820r_set_frontend_c(struct dvb_frontend *fe)
return ret;
error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
......@@ -103,9 +105,12 @@ int cxd2820r_get_frontend_c(struct dvb_frontend *fe,
struct dtv_frontend_properties *c)
{
struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
int ret;
u8 buf[2];
dev_dbg(&client->dev, "\n");
ret = cxd2820r_rd_regs(priv, 0x1001a, buf, 2);
if (ret)
goto error;
......@@ -145,13 +150,14 @@ int cxd2820r_get_frontend_c(struct dvb_frontend *fe,
return ret;
error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
int cxd2820r_read_status_c(struct dvb_frontend *fe, enum fe_status *status)
{
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;
unsigned int utmp;
......@@ -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],
buf[1]);
dev_dbg(&client->dev, "lock=%*ph\n", 2, buf);
/* Signal strength */
if (*status & FE_HAS_SIGNAL) {
......@@ -275,28 +280,32 @@ int cxd2820r_read_status_c(struct dvb_frontend *fe, enum fe_status *status)
return ret;
error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
int cxd2820r_init_c(struct dvb_frontend *fe)
{
struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
int ret;
dev_dbg(&client->dev, "\n");
ret = cxd2820r_wr_reg(priv, 0x00085, 0x07);
if (ret)
goto error;
return ret;
error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
int cxd2820r_sleep_c(struct dvb_frontend *fe)
{
struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
int ret, i;
struct reg_val_mask tab[] = {
{ 0x000ff, 0x1f, 0xff },
......@@ -306,7 +315,7 @@ int cxd2820r_sleep_c(struct dvb_frontend *fe)
{ 0x00080, 0x00, 0xff },
};
dev_dbg(&priv->i2c->dev, "%s\n", __func__);
dev_dbg(&client->dev, "\n");
priv->delivery_system = SYS_UNDEFINED;
......@@ -319,7 +328,7 @@ int cxd2820r_sleep_c(struct dvb_frontend *fe)
return ret;
error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
......
This diff is collapsed.
......@@ -24,6 +24,7 @@
int cxd2820r_set_frontend_t(struct dvb_frontend *fe)
{
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;
unsigned int utmp;
......@@ -55,8 +56,10 @@ int cxd2820r_set_frontend_t(struct dvb_frontend *fe)
{ 0x00427, 0x41, 0xff },
};
dev_dbg(&priv->i2c->dev, "%s: frequency=%d bandwidth_hz=%d\n", __func__,
c->frequency, c->bandwidth_hz);
dev_dbg(&client->dev,
"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) {
case 6000000:
......@@ -96,8 +99,7 @@ int cxd2820r_set_frontend_t(struct dvb_frontend *fe)
ret = fe->ops.tuner_ops.get_if_frequency(fe, &if_frequency);
if (ret)
goto error;
dev_dbg(&priv->i2c->dev, "%s: if_frequency=%u\n", __func__,
if_frequency);
dev_dbg(&client->dev, "if_frequency=%u\n", if_frequency);
} else {
ret = -EINVAL;
goto error;
......@@ -133,7 +135,7 @@ int cxd2820r_set_frontend_t(struct dvb_frontend *fe)
return ret;
error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
......@@ -141,9 +143,12 @@ int cxd2820r_get_frontend_t(struct dvb_frontend *fe,
struct dtv_frontend_properties *c)
{
struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
int ret;
u8 buf[2];
dev_dbg(&client->dev, "\n");
ret = cxd2820r_rd_regs(priv, 0x0002f, buf, sizeof(buf));
if (ret)
goto error;
......@@ -250,13 +255,14 @@ int cxd2820r_get_frontend_t(struct dvb_frontend *fe,
return ret;
error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
int cxd2820r_read_status_t(struct dvb_frontend *fe, enum fe_status *status)
{
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;
unsigned int utmp;
......@@ -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 */
if (*status & FE_HAS_SIGNAL) {
......@@ -384,28 +390,32 @@ int cxd2820r_read_status_t(struct dvb_frontend *fe, enum fe_status *status)
return ret;
error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
int cxd2820r_init_t(struct dvb_frontend *fe)
{
struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
int ret;
dev_dbg(&client->dev, "\n");
ret = cxd2820r_wr_reg(priv, 0x00085, 0x07);
if (ret)
goto error;
return ret;
error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
int cxd2820r_sleep_t(struct dvb_frontend *fe)
{
struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
int ret, i;
struct reg_val_mask tab[] = {
{ 0x000ff, 0x1f, 0xff },
......@@ -415,7 +425,7 @@ int cxd2820r_sleep_t(struct dvb_frontend *fe)
{ 0x00080, 0x00, 0xff },
};
dev_dbg(&priv->i2c->dev, "%s\n", __func__);
dev_dbg(&client->dev, "\n");
priv->delivery_system = SYS_UNDEFINED;
......@@ -428,7 +438,7 @@ int cxd2820r_sleep_t(struct dvb_frontend *fe)
return ret;
error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
......
......@@ -23,8 +23,9 @@
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 i2c_client *client = priv->client[0];
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret, i, bw_i;
unsigned int utmp;
u32 if_frequency;
......@@ -69,8 +70,10 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe)
{ 0x027ef, 0x10, 0x18 },
};
dev_dbg(&priv->i2c->dev, "%s: frequency=%d bandwidth_hz=%d\n", __func__,
c->frequency, c->bandwidth_hz);
dev_dbg(&client->dev,
"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) {
case 5000000:
......@@ -113,8 +116,7 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe)
ret = fe->ops.tuner_ops.get_if_frequency(fe, &if_frequency);
if (ret)
goto error;
dev_dbg(&priv->i2c->dev, "%s: if_frequency=%u\n", __func__,
if_frequency);
dev_dbg(&client->dev, "if_frequency=%u\n", if_frequency);
} else {
ret = -EINVAL;
goto error;
......@@ -130,13 +132,12 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe)
/* PLP filtering */
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);
if (ret)
goto error;
} else {
dev_dbg(&priv->i2c->dev, "%s: Enable PLP filtering = %d\n", __func__,
c->stream_id);
dev_dbg(&client->dev, "enable PLP filtering\n");
ret = cxd2820r_wr_reg(priv, 0x023af , c->stream_id & 0xFF);
if (ret)
goto error;
......@@ -163,7 +164,7 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe)
return ret;
error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
......@@ -172,9 +173,12 @@ int cxd2820r_get_frontend_t2(struct dvb_frontend *fe,
struct dtv_frontend_properties *c)
{
struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
int ret;
u8 buf[2];
dev_dbg(&client->dev, "\n");
ret = cxd2820r_rd_regs(priv, 0x0205c, buf, 2);
if (ret)
goto error;
......@@ -279,7 +283,7 @@ int cxd2820r_get_frontend_t2(struct dvb_frontend *fe,
return ret;
error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
......@@ -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 dtv_frontend_properties *c = &fe->dtv_property_cache;
struct i2c_client *client = priv->client[0];
int ret;
unsigned int utmp;
u8 buf[4];
......@@ -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 */
if (*status & FE_HAS_SIGNAL) {
......@@ -383,13 +388,14 @@ int cxd2820r_read_status_t2(struct dvb_frontend *fe, enum fe_status *status)
return ret;
error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
int cxd2820r_sleep_t2(struct dvb_frontend *fe)
{
struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
int ret, i;
struct reg_val_mask tab[] = {
{ 0x000ff, 0x1f, 0xff },
......@@ -400,7 +406,7 @@ int cxd2820r_sleep_t2(struct dvb_frontend *fe)
{ 0x00080, 0x00, 0xff },
};
dev_dbg(&priv->i2c->dev, "%s\n", __func__);
dev_dbg(&client->dev, "\n");
for (i = 0; i < ARRAY_SIZE(tab); i++) {
ret = cxd2820r_wr_reg_mask(priv, tab[i].reg, tab[i].val,
......@@ -413,7 +419,7 @@ int cxd2820r_sleep_t2(struct dvb_frontend *fe)
return ret;
error:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
dev_dbg(&client->dev, "failed=%d\n", 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