V4L/DVB (12231): gspca - main: Version change.
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / media / dvb / frontends / lgs8gxx.h
CommitLineData
f15da16d
DW
1/*
2 * Support for Legend Silicon DMB-TH demodulator
3 * LGS8913, LGS8GL5
4 * experimental support LGS8G42, LGS8G52
5 *
6 * Copyright (C) 2007,2008 David T.L. Wong <davidtlwong@gmail.com>
7 * Copyright (C) 2008 Sirius International (Hong Kong) Limited
8 * Timothy Lee <timothy.lee@siriushk.com> (for initial work on LGS8GL5)
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 */
25
26#ifndef __LGS8GXX_H__
27#define __LGS8GXX_H__
28
29#include <linux/dvb/frontend.h>
30#include <linux/i2c.h>
31
32#define LGS8GXX_PROD_LGS8913 0
33#define LGS8GXX_PROD_LGS8GL5 1
34#define LGS8GXX_PROD_LGS8G42 3
35#define LGS8GXX_PROD_LGS8G52 4
36#define LGS8GXX_PROD_LGS8G54 5
37
38struct lgs8gxx_config {
39
40 /* product type */
41 u8 prod;
42
43 /* the demodulator's i2c address */
44 u8 demod_address;
45
46 /* parallel or serial transport stream */
47 u8 serial_ts;
48
49 /* transport stream polarity*/
50 u8 ts_clk_pol;
51
52 /* transport stream clock gated by ts_valid */
53 u8 ts_clk_gated;
54
55 /* A/D Clock frequency */
56 u32 if_clk_freq; /* in kHz */
57
58 /* IF frequency */
59 u32 if_freq; /* in kHz */
60
61 /*Use External ADC*/
62 u8 ext_adc;
63
64 /*External ADC output two's complement*/
65 u8 adc_signed;
66
67 /*Sample IF data at falling edge of IF_CLK*/
68 u8 if_neg_edge;
69
70 /*IF use Negative center frequency*/
71 u8 if_neg_center;
72
73 /* slave address and configuration of the tuner */
74 u8 tuner_address;
75};
76
77#if defined(CONFIG_DVB_LGS8GXX) || \
78 (defined(CONFIG_DVB_LGS8GXX_MODULE) && defined(MODULE))
79extern struct dvb_frontend *lgs8gxx_attach(const struct lgs8gxx_config *config,
80 struct i2c_adapter *i2c);
81#else
82static inline
83struct dvb_frontend *lgs8gxx_attach(const struct lgs8gxx_config *config,
84 struct i2c_adapter *i2c) {
85 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
86 return NULL;
87}
88#endif /* CONFIG_DVB_LGS8GXX */
89
90#endif /* __LGS8GXX_H__ */