summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends/tda18271-priv.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-12-28 00:32:41 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-12-28 00:32:41 -0200
commitf2f3421c456e70d7e97826073459bf00b78a9847 (patch)
tree04e42587ea8010521440faf109ce53e93f016432 /linux/drivers/media/dvb/frontends/tda18271-priv.h
parent040488857bec11048bf6486b2fa04e5e1b0315d0 (diff)
parent0a4d76c92d1a6dc610b0c4bb02d16bd3847d9d8f (diff)
downloadmediapointer-dvb-s2-f2f3421c456e70d7e97826073459bf00b78a9847.tar.gz
mediapointer-dvb-s2-f2f3421c456e70d7e97826073459bf00b78a9847.tar.bz2
merge: http://linuxtv.org/hg/~mkrufky/cx23885
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/dvb/frontends/tda18271-priv.h')
-rw-r--r--linux/drivers/media/dvb/frontends/tda18271-priv.h68
1 files changed, 52 insertions, 16 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda18271-priv.h b/linux/drivers/media/dvb/frontends/tda18271-priv.h
index e1fa9a467..912b81e0c 100644
--- a/linux/drivers/media/dvb/frontends/tda18271-priv.h
+++ b/linux/drivers/media/dvb/frontends/tda18271-priv.h
@@ -23,6 +23,7 @@
#include <linux/kernel.h>
#include <linux/types.h>
+#include "tda18271.h"
#define R_ID 0x00 /* ID byte */
#define R_TM 0x01 /* Thermo byte */
@@ -66,31 +67,66 @@
#define TDA18271_NUM_REGS 39
-extern int tda18271_debug;
+/*---------------------------------------------------------------------*/
+
+enum tda18271_mode {
+ TDA18271_ANALOG,
+ TDA18271_DIGITAL,
+};
+
+struct tda18271_priv {
+ u8 i2c_addr;
+ struct i2c_adapter *i2c_adap;
+ unsigned char tda18271_regs[TDA18271_NUM_REGS];
+
+ enum tda18271_mode mode;
+ enum tda18271_i2c_gate gate;
+
+ u32 frequency;
+ u32 bandwidth;
+};
-#define dprintk(level, fmt, arg...) do {\
- if (tda18271_debug & level) \
- printk(KERN_DEBUG "%s: " fmt, __FUNCTION__, ##arg); } while (0)
+/*---------------------------------------------------------------------*/
+
+extern int tda18271_debug;
#define DBG_INFO 1
#define DBG_MAP 2
#define DBG_REG 4
-#define dbg_info(fmt, arg...) dprintk(DBG_INFO, fmt, ##arg)
-#define dbg_map(fmt, arg...) dprintk(DBG_MAP, fmt, ##arg)
-#define dbg_reg(fmt, arg...) dprintk(DBG_REG, fmt, ##arg)
+#define tda_printk(kern, fmt, arg...) \
+ printk(kern "%s: " fmt, __FUNCTION__, ##arg)
-/*---------------------------------------------------------------------*/
+#define dprintk(kern, lvl, fmt, arg...) do {\
+ if (tda18271_debug & lvl) \
+ tda_printk(kern, fmt, ##arg); } while (0)
+
+#define tda_info(fmt, arg...) printk(KERN_INFO fmt, ##arg)
+#define tda_warn(fmt, arg...) tda_printk(KERN_WARNING, fmt, ##arg)
+#define tda_err(fmt, arg...) tda_printk(KERN_ERR, fmt, ##arg)
+#define tda_dbg(fmt, arg...) dprintk(KERN_DEBUG, DBG_INFO, fmt, ##arg)
+#define tda_map(fmt, arg...) dprintk(KERN_DEBUG, DBG_MAP, fmt, ##arg)
+#define tda_reg(fmt, arg...) dprintk(KERN_DEBUG, DBG_REG, fmt, ##arg)
-extern void tda18271_lookup_cal_pll(u32 *freq, u8 *post_div, u8 *div);
-extern void tda18271_lookup_main_pll(u32 *freq, u8 *post_div, u8 *div);
+/*---------------------------------------------------------------------*/
-extern void tda18271_lookup_bp_filter(u32 *freq, u8 *val);
-extern void tda18271_lookup_km(u32 *freq, u8 *val);
-extern void tda18271_lookup_rf_band(u32 *freq, u8 *val);
-extern void tda18271_lookup_gain_taper(u32 *freq, u8 *val);
-extern void tda18271_lookup_rf_cal(u32 *freq, u8 *val);
-extern void tda18271_lookup_ir_measure(u32 *freq, u8 *val);
+enum tda18271_map_type {
+ /* tda18271_pll_map */
+ MAIN_PLL,
+ CAL_PLL,
+ /* tda18271_map */
+ RF_CAL,
+ RF_CAL_KMCO,
+ BP_FILTER,
+ RF_BAND,
+ GAIN_TAPER,
+ IR_MEASURE,
+};
+
+extern int tda18271_lookup_pll_map(enum tda18271_map_type map_type,
+ u32 *freq, u8 *post_div, u8 *div);
+extern int tda18271_lookup_map(enum tda18271_map_type map_type,
+ u32 *freq, u8 *val);
#endif /* __TDA18271_PRIV_H__ */