Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331054
b: refs/heads/master
c: 298efdd
h: refs/heads/master
v: v3
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Sep 23, 2012
1 parent cb8a263 commit 0749405
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 49 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: e6211c7c99ad9e13b28698d4258763b5bb7420e1
refs/heads/master: 298efdd3765dfdfb92976d3bb7113061f8b0a92a
64 changes: 32 additions & 32 deletions trunk/drivers/media/dvb-frontends/rtl2832.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ static int rtl2832_wr(struct rtl2832_priv *priv, u8 reg, u8 *val, int len)
if (ret == 1) {
ret = 0;
} else {
warn("i2c wr failed=%d reg=%02x len=%d", ret, reg, len);
dev_warn(&priv->i2c->dev, "%s: i2c wr failed=%d reg=%02x " \
"len=%d\n", KBUILD_MODNAME, ret, reg, len);
ret = -EREMOTEIO;
}
return ret;
Expand Down Expand Up @@ -207,10 +208,11 @@ static int rtl2832_rd(struct rtl2832_priv *priv, u8 reg, u8 *val, int len)
if (ret == 2) {
ret = 0;
} else {
warn("i2c rd failed=%d reg=%02x len=%d", ret, reg, len);
dev_warn(&priv->i2c->dev, "%s: i2c rd failed=%d reg=%02x " \
"len=%d\n", KBUILD_MODNAME, ret, reg, len);
ret = -EREMOTEIO;
}
return ret;
}
return ret;
}

/* write multiple registers */
Expand All @@ -219,7 +221,6 @@ static int rtl2832_wr_regs(struct rtl2832_priv *priv, u8 reg, u8 page, u8 *val,
{
int ret;


/* switch bank if needed */
if (page != priv->page) {
ret = rtl2832_wr(priv, 0x00, &page, 1);
Expand Down Expand Up @@ -299,7 +300,7 @@ int rtl2832_rd_demod_reg(struct rtl2832_priv *priv, int reg, u32 *val)
return ret;

err:
dbg("%s: failed=%d", __func__, ret);
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
return ret;

}
Expand Down Expand Up @@ -351,7 +352,7 @@ int rtl2832_wr_demod_reg(struct rtl2832_priv *priv, int reg, u32 val)
return ret;

err:
dbg("%s: failed=%d", __func__, ret);
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
return ret;

}
Expand All @@ -361,7 +362,7 @@ static int rtl2832_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
int ret;
struct rtl2832_priv *priv = fe->demodulator_priv;

dbg("%s: enable=%d", __func__, enable);
dev_dbg(&priv->i2c->dev, "%s: enable=%d\n", __func__, enable);

/* gate already open or close */
if (priv->i2c_gate_state == enable)
Expand All @@ -375,7 +376,7 @@ static int rtl2832_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)

return ret;
err:
dbg("%s: failed=%d", __func__, ret);
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}

Expand Down Expand Up @@ -434,7 +435,7 @@ static int rtl2832_init(struct dvb_frontend *fe)
{DVBT_SPEC_INV, 0x0},
};

dbg("%s", __func__);
dev_dbg(&priv->i2c->dev, "%s:\n", __func__);

en_bbin = (priv->cfg.if_dvbt == 0 ? 0x1 : 0x0);

Expand All @@ -455,7 +456,8 @@ static int rtl2832_init(struct dvb_frontend *fe)
}

/* load tuner specific settings */
dbg("%s: load settings for tuner=%02x", __func__, priv->cfg.tuner);
dev_dbg(&priv->i2c->dev, "%s: load settings for tuner=%02x\n",
__func__, priv->cfg.tuner);
switch (priv->cfg.tuner) {
case RTL2832_TUNER_FC0012:
case RTL2832_TUNER_FC0013:
Expand Down Expand Up @@ -491,23 +493,25 @@ static int rtl2832_init(struct dvb_frontend *fe)
return ret;

err:
dbg("%s: failed=%d", __func__, ret);
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}

static int rtl2832_sleep(struct dvb_frontend *fe)
{
struct rtl2832_priv *priv = fe->demodulator_priv;

dbg("%s", __func__);
dev_dbg(&priv->i2c->dev, "%s:\n", __func__);
priv->sleeping = true;
return 0;
}

int rtl2832_get_tune_settings(struct dvb_frontend *fe,
struct dvb_frontend_tune_settings *s)
{
dbg("%s", __func__);
struct rtl2832_priv *priv = fe->demodulator_priv;

dev_dbg(&priv->i2c->dev, "%s:\n", __func__);
s->min_delay_ms = 1000;
s->step_size = fe->ops.info.frequency_stepsize * 2;
s->max_drift = (fe->ops.info.frequency_stepsize * 2) + 1;
Expand All @@ -521,8 +525,6 @@ static int rtl2832_set_frontend(struct dvb_frontend *fe)
int ret, i, j;
u64 bw_mode, num, num2;
u32 resamp_ratio, cfreq_off_ratio;


static u8 bw_params[3][32] = {
/* 6 MHz bandwidth */
{
Expand Down Expand Up @@ -550,15 +552,14 @@ static int rtl2832_set_frontend(struct dvb_frontend *fe)
};


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

dev_dbg(&priv->i2c->dev, "%s: frequency=%d bandwidth_hz=%d " \
"inversion=%d\n", __func__, c->frequency,
c->bandwidth_hz, c->inversion);

/* program tuner */
if (fe->ops.tuner_ops.set_params)
fe->ops.tuner_ops.set_params(fe);


switch (c->bandwidth_hz) {
case 6000000:
i = 0;
Expand All @@ -573,7 +574,7 @@ static int rtl2832_set_frontend(struct dvb_frontend *fe)
bw_mode = 64000000;
break;
default:
dbg("invalid bandwidth");
dev_dbg(&priv->i2c->dev, "%s: invalid bandwidth\n", __func__);
return -EINVAL;
}

Expand Down Expand Up @@ -620,7 +621,7 @@ static int rtl2832_set_frontend(struct dvb_frontend *fe)

return ret;
err:
info("%s: failed=%d", __func__, ret);
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}

Expand All @@ -642,7 +643,7 @@ static int rtl2832_get_frontend(struct dvb_frontend *fe)
if (ret)
goto err;

dbg("%s: TPS=%*ph", __func__, 3, buf);
dev_dbg(&priv->i2c->dev, "%s: TPS=%*ph\n", __func__, 3, buf);

switch ((buf[0] >> 2) & 3) {
case 0:
Expand Down Expand Up @@ -732,7 +733,7 @@ static int rtl2832_get_frontend(struct dvb_frontend *fe)

return 0;
err:
dbg("%s: failed=%d", __func__, ret);
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}

Expand All @@ -743,8 +744,7 @@ static int rtl2832_read_status(struct dvb_frontend *fe, fe_status_t *status)
u32 tmp;
*status = 0;


dbg("%s", __func__);
dev_dbg(&priv->i2c->dev, "%s:\n", __func__);
if (priv->sleeping)
return 0;

Expand All @@ -764,7 +764,7 @@ static int rtl2832_read_status(struct dvb_frontend *fe, fe_status_t *status)

return ret;
err:
info("%s: failed=%d", __func__, ret);
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}

Expand Down Expand Up @@ -810,7 +810,7 @@ static int rtl2832_read_snr(struct dvb_frontend *fe, u16 *snr)

return 0;
err:
dbg("%s: failed=%d", __func__, ret);
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}

Expand All @@ -828,7 +828,7 @@ static int rtl2832_read_ber(struct dvb_frontend *fe, u32 *ber)

return 0;
err:
dbg("%s: failed=%d", __func__, ret);
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}

Expand All @@ -838,7 +838,7 @@ static void rtl2832_release(struct dvb_frontend *fe)
{
struct rtl2832_priv *priv = fe->demodulator_priv;

dbg("%s", __func__);
dev_dbg(&priv->i2c->dev, "%s:\n", __func__);
kfree(priv);
}

Expand All @@ -849,7 +849,7 @@ struct dvb_frontend *rtl2832_attach(const struct rtl2832_config *cfg,
int ret = 0;
u8 tmp;

dbg("%s", __func__);
dev_dbg(&i2c->dev, "%s:\n", __func__);

/* allocate memory for the internal state */
priv = kzalloc(sizeof(struct rtl2832_priv), GFP_KERNEL);
Expand All @@ -875,7 +875,7 @@ struct dvb_frontend *rtl2832_attach(const struct rtl2832_config *cfg,

return &priv->fe;
err:
dbg("%s: failed=%d", __func__, ret);
dev_dbg(&i2c->dev, "%s: failed=%d\n", __func__, ret);
kfree(priv);
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/dvb-frontends/rtl2832.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static inline struct dvb_frontend *rtl2832_attach(
struct i2c_adapter *i2c
)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
pr_warn("%s: driver disabled by Kconfig\n", __func__);
return NULL;
}
#endif
Expand Down
15 changes: 0 additions & 15 deletions trunk/drivers/media/dvb-frontends/rtl2832_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,6 @@
#include "dvb_frontend.h"
#include "rtl2832.h"

#define LOG_PREFIX "rtl2832"

#undef dbg
#define dbg(f, arg...) \
do { \
if (rtl2832_debug) \
printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg); \
} while (0)
#undef err
#define err(f, arg...) printk(KERN_ERR LOG_PREFIX": " f "\n" , ## arg)
#undef info
#define info(f, arg...) printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg)
#undef warn
#define warn(f, arg...) printk(KERN_WARNING LOG_PREFIX": " f "\n" , ## arg)

struct rtl2832_priv {
struct i2c_adapter *i2c;
struct dvb_frontend fe;
Expand Down

0 comments on commit 0749405

Please sign in to comment.