aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/dib0090.h
diff options
context:
space:
mode:
authorOlivier Grenie <Olivier.Grenie@dibcom.fr>2009-12-04 11:27:57 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-15 21:18:16 -0500
commit03245a5ee69a5faa99b020fe1aca9bafe10c46a9 (patch)
tree0937b4966ff1f5e09bfcd38fd38bc55e7ac2abef /drivers/media/dvb/frontends/dib0090.h
parent20232c4791507189d4e9499f81632a1ce434f2a4 (diff)
V4L/DVB (13583): DiB8090: Add the DiB0090 tuner driver and STK8096GP-board
This patchs adds support for the DiBcom DiB0090 RF tuner and for DiBcom's reference design STK8096GP. Small extracts of the DiB0070 and the DiB8000-driver into a common codebase. Signed-off-by: Patrick Boettcher <pboettcher@kernellabs.com> Signed-off-by: Olivier Grenie <Olivier.Grenie@dibcom.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/dib0090.h')
-rw-r--r--drivers/media/dvb/frontends/dib0090.h114
1 files changed, 114 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/dib0090.h b/drivers/media/dvb/frontends/dib0090.h
new file mode 100644
index 00000000000..d72b7d758aa
--- /dev/null
+++ b/drivers/media/dvb/frontends/dib0090.h
@@ -0,0 +1,114 @@
1/*
2 * Linux-DVB Driver for DiBcom's DiB0090 base-band RF Tuner.
3 *
4 * Copyright (C) 2005-7 DiBcom (http://www.dibcom.fr/)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation, version 2.
9 */
10#ifndef DIB0090_H
11#define DIB0090_H
12
13struct dvb_frontend;
14struct i2c_adapter;
15
16#define DEFAULT_DIB0090_I2C_ADDRESS 0x60
17
18struct dib0090_io_config {
19 u32 clock_khz;
20
21 u8 pll_bypass:1;
22 u8 pll_range:1;
23 u8 pll_prediv:6;
24 u8 pll_loopdiv:6;
25
26 u8 adc_clock_ratio; /* valid is 8, 7 ,6 */
27 u16 pll_int_loop_filt; // internal loop filt value. If not fill in , default is 8165
28};
29
30struct dib0090_config {
31 struct dib0090_io_config io;
32 int (*reset) (struct dvb_frontend *, int);
33 int (*sleep) (struct dvb_frontend *, int);
34
35 /* offset in kHz */
36 int freq_offset_khz_uhf;
37 int freq_offset_khz_vhf;
38
39 int (*get_adc_power) (struct dvb_frontend *);
40
41 u8 clkouttobamse:1; /* activate or deactivate clock output */
42 u8 analog_output;
43
44 u8 i2c_address;
45 /* add drives and other things if necessary */
46 u16 wbd_vhf_offset;
47 u16 wbd_cband_offset;
48 u8 use_pwm_agc;
49 u8 clkoutdrive;
50};
51
52#if defined(CONFIG_DVB_TUNER_DIB0090) || (defined(CONFIG_DVB_TUNER_DIB0090_MODULE) && defined(MODULE))
53extern struct dvb_frontend *dib0090_register(struct dvb_frontend *fe, struct i2c_adapter *i2c, const struct dib0090_config *config);
54extern void dib0090_dcc_freq(struct dvb_frontend *fe, u8 fast);
55extern void dib0090_pwm_gain_reset(struct dvb_frontend *fe);
56extern u16 dib0090_get_wbd_offset(struct dvb_frontend *tuner);
57extern int dib0090_gain_control(struct dvb_frontend *fe);
58extern enum frontend_tune_state dib0090_get_tune_state(struct dvb_frontend *fe);
59extern int dib0090_set_tune_state(struct dvb_frontend *fe, enum frontend_tune_state tune_state);
60extern enum frontend_tune_state dib0090_get_tune_state(struct dvb_frontend *fe);
61extern void dib0090_get_current_gain(struct dvb_frontend *fe, u16 * rf, u16 * bb, u16 * rf_gain_limit, u16 * rflt);
62#else
63static inline struct dvb_frontend *dib0090_register(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0090_config *config)
64{
65 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
66 return NULL;
67}
68
69static inline void dib0090_dcc_freq(struct dvb_frontend *fe, u8 fast)
70{
71 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
72}
73
74static inline void dib0090_pwm_gain_reset(struct dvb_frontend *fe)
75{
76 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
77}
78
79static inline u16 dib0090_get_wbd_offset(struct dvb_frontend *tuner)
80{
81 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
82 return 0;
83}
84
85static inline int dib0090_gain_control(struct dvb_frontend *fe)
86{
87 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
88 return -ENODEV;
89}
90
91static inline enum frontend_tune_state dib0090_get_tune_state(struct dvb_frontend *fe)
92{
93 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
94 return CT_DONE;
95}
96
97static inline int dib0090_set_tune_state(struct dvb_frontend *fe, enum frontend_tune_state tune_state)
98{
99 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
100 return -ENODEV;
101}
102
103static inline num frontend_tune_state dib0090_get_tune_state(struct dvb_frontend *fe)
104{
105 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
106return CT_SHUTDOWN,}
107
108static inline void dib0090_get_current_gain(struct dvb_frontend *fe, u16 * rf, u16 * bb, u16 * rf_gain_limit, u16 * rflt)
109{
110 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
111}
112#endif
113
114#endif