Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux/fpc-iii.git] / drivers / media / dvb-frontends / atbm8830.h
blob8e0ac98f8d0832a357caf6788220be58d4a06ae2
1 /*
2 * Support for AltoBeam GB20600 (a.k.a DMB-TH) demodulator
3 * ATBM8830, ATBM8831
5 * Copyright (C) 2009 David T.L. Wong <davidtlwong@gmail.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef __ATBM8830_H__
23 #define __ATBM8830_H__
25 #include <linux/kconfig.h>
26 #include <linux/dvb/frontend.h>
27 #include <linux/i2c.h>
29 #define ATBM8830_PROD_8830 0
30 #define ATBM8830_PROD_8831 1
32 struct atbm8830_config {
34 /* product type */
35 u8 prod;
37 /* the demodulator's i2c address */
38 u8 demod_address;
40 /* parallel or serial transport stream */
41 u8 serial_ts;
43 /* transport stream clock output only when receiving valid stream */
44 u8 ts_clk_gated;
46 /* Decoder sample TS data at rising edge of clock */
47 u8 ts_sampling_edge;
49 /* Oscillator clock frequency */
50 u32 osc_clk_freq; /* in kHz */
52 /* IF frequency */
53 u32 if_freq; /* in kHz */
55 /* Swap I/Q for zero IF */
56 u8 zif_swap_iq;
58 /* Tuner AGC settings */
59 u8 agc_min;
60 u8 agc_max;
61 u8 agc_hold_loop;
64 #if IS_ENABLED(CONFIG_DVB_ATBM8830)
65 extern struct dvb_frontend *atbm8830_attach(const struct atbm8830_config *config,
66 struct i2c_adapter *i2c);
67 #else
68 static inline
69 struct dvb_frontend *atbm8830_attach(const struct atbm8830_config *config,
70 struct i2c_adapter *i2c) {
71 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
72 return NULL;
74 #endif /* CONFIG_DVB_ATBM8830 */
76 #endif /* __ATBM8830_H__ */