aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@kernellabs.com>2009-09-28 02:13:49 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:40:24 -0500
commitc0faeee5a3b70c894a27fa81a0d98a3ab223aff0 (patch)
tree7cf6b96b1328854a2b1faebf91b5119e77a7b251 /drivers/media/common
parent3a6b49fef6cd18ce3de9de3db12bfbeacf39f9e9 (diff)
V4L/DVB (13112): tda18271: display some state information in debug output
Display i2c adapter id, address and master / slave role in debug output. Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common')
-rw-r--r--drivers/media/common/tuners/tda18271-maps.c1
-rw-r--r--drivers/media/common/tuners/tda18271-priv.h34
2 files changed, 23 insertions, 12 deletions
diff --git a/drivers/media/common/tuners/tda18271-maps.c b/drivers/media/common/tuners/tda18271-maps.c
index e21fdeff3ddf..e7f84c705da8 100644
--- a/drivers/media/common/tuners/tda18271-maps.c
+++ b/drivers/media/common/tuners/tda18271-maps.c
@@ -978,6 +978,7 @@ static struct tda18271_cid_target_map tda18271_cid_target[] = {
978int tda18271_lookup_cid_target(struct dvb_frontend *fe, 978int tda18271_lookup_cid_target(struct dvb_frontend *fe,
979 u32 *freq, u8 *cid_target, u16 *count_limit) 979 u32 *freq, u8 *cid_target, u16 *count_limit)
980{ 980{
981 struct tda18271_priv *priv = fe->tuner_priv;
981 int i = 0; 982 int i = 0;
982 983
983 while ((tda18271_cid_target[i].rfmax * 1000) < *freq) { 984 while ((tda18271_cid_target[i].rfmax * 1000) < *freq) {
diff --git a/drivers/media/common/tuners/tda18271-priv.h b/drivers/media/common/tuners/tda18271-priv.h
index 74075be4dea3..7047680cdbd1 100644
--- a/drivers/media/common/tuners/tda18271-priv.h
+++ b/drivers/media/common/tuners/tda18271-priv.h
@@ -136,27 +136,37 @@ extern int tda18271_debug;
136#define DBG_ADV 8 136#define DBG_ADV 8
137#define DBG_CAL 16 137#define DBG_CAL 16
138 138
139#define tda_printk(kern, fmt, arg...) \ 139#define tda_printk(st, kern, fmt, arg...) do {\
140 printk(kern "%s: " fmt, __func__, ##arg) 140 if (st) { \
141 141 struct tda18271_priv *state = st; \
142#define tda_dprintk(lvl, fmt, arg...) do {\ 142 printk(kern "%s: [%d-%04x|%s] " fmt, __func__, \
143 i2c_adapter_id(state->i2c_props.adap), \
144 state->i2c_props.addr, \
145 (state->role == TDA18271_MASTER) \
146 ? "M" : "S", ##arg); \
147 } else \
148 printk(kern "%s: " fmt, __func__, ##arg); \
149} while (0)
150
151#define tda_dprintk(st, lvl, fmt, arg...) do {\
143 if (tda18271_debug & lvl) \ 152 if (tda18271_debug & lvl) \
144 tda_printk(KERN_DEBUG, fmt, ##arg); } while (0) 153 tda_printk(st, KERN_DEBUG, fmt, ##arg); } while (0)
145 154
146#define tda_info(fmt, arg...) printk(KERN_INFO fmt, ##arg) 155#define tda_info(fmt, arg...) printk(KERN_INFO fmt, ##arg)
147#define tda_warn(fmt, arg...) tda_printk(KERN_WARNING, fmt, ##arg) 156#define tda_warn(fmt, arg...) tda_printk(priv, KERN_WARNING, fmt, ##arg)
148#define tda_err(fmt, arg...) tda_printk(KERN_ERR, fmt, ##arg) 157#define tda_err(fmt, arg...) tda_printk(priv, KERN_ERR, fmt, ##arg)
149#define tda_dbg(fmt, arg...) tda_dprintk(DBG_INFO, fmt, ##arg) 158#define tda_dbg(fmt, arg...) tda_dprintk(priv, DBG_INFO, fmt, ##arg)
150#define tda_map(fmt, arg...) tda_dprintk(DBG_MAP, fmt, ##arg) 159#define tda_map(fmt, arg...) tda_dprintk(priv, DBG_MAP, fmt, ##arg)
151#define tda_reg(fmt, arg...) tda_dprintk(DBG_REG, fmt, ##arg) 160#define tda_reg(fmt, arg...) tda_dprintk(priv, DBG_REG, fmt, ##arg)
152#define tda_cal(fmt, arg...) tda_dprintk(DBG_CAL, fmt, ##arg) 161#define tda_cal(fmt, arg...) tda_dprintk(priv, DBG_CAL, fmt, ##arg)
153 162
154#define tda_fail(ret) \ 163#define tda_fail(ret) \
155({ \ 164({ \
156 int __ret; \ 165 int __ret; \
157 __ret = (ret < 0); \ 166 __ret = (ret < 0); \
158 if (__ret) \ 167 if (__ret) \
159 tda_printk(KERN_ERR, "error %d on line %d\n", ret, __LINE__);\ 168 tda_printk(priv, KERN_ERR, \
169 "error %d on line %d\n", ret, __LINE__); \
160 __ret; \ 170 __ret; \
161}) 171})
162 172