diff options
Diffstat (limited to 'drivers/media/common/tuners/tda18271-priv.h')
-rw-r--r-- | drivers/media/common/tuners/tda18271-priv.h | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/drivers/media/common/tuners/tda18271-priv.h b/drivers/media/common/tuners/tda18271-priv.h index 2bee229acd91..9589ab0576d2 100644 --- a/drivers/media/common/tuners/tda18271-priv.h +++ b/drivers/media/common/tuners/tda18271-priv.h | |||
@@ -80,10 +80,10 @@ struct tda18271_rf_tracking_filter_cal { | |||
80 | u32 rf1; | 80 | u32 rf1; |
81 | u32 rf2; | 81 | u32 rf2; |
82 | u32 rf3; | 82 | u32 rf3; |
83 | int rf_a1; | 83 | s32 rf_a1; |
84 | int rf_b1; | 84 | s32 rf_b1; |
85 | int rf_a2; | 85 | s32 rf_a2; |
86 | int rf_b2; | 86 | s32 rf_b2; |
87 | }; | 87 | }; |
88 | 88 | ||
89 | enum tda18271_pll { | 89 | enum tda18271_pll { |
@@ -109,11 +109,12 @@ struct tda18271_priv { | |||
109 | enum tda18271_i2c_gate gate; | 109 | enum tda18271_i2c_gate gate; |
110 | enum tda18271_ver id; | 110 | enum tda18271_ver id; |
111 | enum tda18271_output_options output_opt; | 111 | enum tda18271_output_options output_opt; |
112 | enum tda18271_small_i2c small_i2c; | ||
112 | 113 | ||
113 | unsigned int config; /* interface to saa713x / tda829x */ | 114 | unsigned int config; /* interface to saa713x / tda829x */ |
114 | unsigned int tm_rfcal; | ||
115 | unsigned int cal_initialized:1; | 115 | unsigned int cal_initialized:1; |
116 | unsigned int small_i2c:1; | 116 | |
117 | u8 tm_rfcal; | ||
117 | 118 | ||
118 | struct tda18271_map_layout *maps; | 119 | struct tda18271_map_layout *maps; |
119 | struct tda18271_std_map std; | 120 | struct tda18271_std_map std; |
@@ -135,27 +136,37 @@ extern int tda18271_debug; | |||
135 | #define DBG_ADV 8 | 136 | #define DBG_ADV 8 |
136 | #define DBG_CAL 16 | 137 | #define DBG_CAL 16 |
137 | 138 | ||
138 | #define tda_printk(kern, fmt, arg...) \ | 139 | #define tda_printk(st, kern, fmt, arg...) do {\ |
139 | printk(kern "%s: " fmt, __func__, ##arg) | 140 | if (st) { \ |
140 | 141 | struct tda18271_priv *state = st; \ | |
141 | #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 {\ | ||
142 | if (tda18271_debug & lvl) \ | 152 | if (tda18271_debug & lvl) \ |
143 | tda_printk(KERN_DEBUG, fmt, ##arg); } while (0) | 153 | tda_printk(st, KERN_DEBUG, fmt, ##arg); } while (0) |
144 | 154 | ||
145 | #define tda_info(fmt, arg...) printk(KERN_INFO fmt, ##arg) | 155 | #define tda_info(fmt, arg...) printk(KERN_INFO fmt, ##arg) |
146 | #define tda_warn(fmt, arg...) tda_printk(KERN_WARNING, fmt, ##arg) | 156 | #define tda_warn(fmt, arg...) tda_printk(priv, KERN_WARNING, fmt, ##arg) |
147 | #define tda_err(fmt, arg...) tda_printk(KERN_ERR, fmt, ##arg) | 157 | #define tda_err(fmt, arg...) tda_printk(priv, KERN_ERR, fmt, ##arg) |
148 | #define tda_dbg(fmt, arg...) tda_dprintk(DBG_INFO, fmt, ##arg) | 158 | #define tda_dbg(fmt, arg...) tda_dprintk(priv, DBG_INFO, fmt, ##arg) |
149 | #define tda_map(fmt, arg...) tda_dprintk(DBG_MAP, fmt, ##arg) | 159 | #define tda_map(fmt, arg...) tda_dprintk(priv, DBG_MAP, fmt, ##arg) |
150 | #define tda_reg(fmt, arg...) tda_dprintk(DBG_REG, fmt, ##arg) | 160 | #define tda_reg(fmt, arg...) tda_dprintk(priv, DBG_REG, fmt, ##arg) |
151 | #define tda_cal(fmt, arg...) tda_dprintk(DBG_CAL, fmt, ##arg) | 161 | #define tda_cal(fmt, arg...) tda_dprintk(priv, DBG_CAL, fmt, ##arg) |
152 | 162 | ||
153 | #define tda_fail(ret) \ | 163 | #define tda_fail(ret) \ |
154 | ({ \ | 164 | ({ \ |
155 | int __ret; \ | 165 | int __ret; \ |
156 | __ret = (ret < 0); \ | 166 | __ret = (ret < 0); \ |
157 | if (__ret) \ | 167 | if (__ret) \ |
158 | 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__); \ | ||
159 | __ret; \ | 170 | __ret; \ |
160 | }) | 171 | }) |
161 | 172 | ||