Linux 4.16.11
[linux/fpc-iii.git] / drivers / media / dvb-frontends / lgs8gxx.h
blobaa83ea46807bee262559ef34b8d1e0427a032ad0
1 /*
2 * Support for Legend Silicon GB20600 (a.k.a DMB-TH) demodulator
3 * LGS8913, LGS8GL5, LGS8G75
4 * experimental support LGS8G42, LGS8G52
6 * Copyright (C) 2007-2009 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)
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.
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.
22 #ifndef __LGS8GXX_H__
23 #define __LGS8GXX_H__
25 #include <linux/dvb/frontend.h>
26 #include <linux/i2c.h>
28 #define LGS8GXX_PROD_LGS8913 0
29 #define LGS8GXX_PROD_LGS8GL5 1
30 #define LGS8GXX_PROD_LGS8G42 3
31 #define LGS8GXX_PROD_LGS8G52 4
32 #define LGS8GXX_PROD_LGS8G54 5
33 #define LGS8GXX_PROD_LGS8G75 6
35 struct lgs8gxx_config {
37 /* product type */
38 u8 prod;
40 /* the demodulator's i2c address */
41 u8 demod_address;
43 /* parallel or serial transport stream */
44 u8 serial_ts;
46 /* transport stream polarity*/
47 u8 ts_clk_pol;
49 /* transport stream clock gated by ts_valid */
50 u8 ts_clk_gated;
52 /* A/D Clock frequency */
53 u32 if_clk_freq; /* in kHz */
55 /* IF frequency */
56 u32 if_freq; /* in kHz */
58 /*Use External ADC*/
59 u8 ext_adc;
61 /*External ADC output two's complement*/
62 u8 adc_signed;
64 /*Sample IF data at falling edge of IF_CLK*/
65 u8 if_neg_edge;
67 /*IF use Negative center frequency*/
68 u8 if_neg_center;
70 /*8G75 internal ADC input range selection*/
71 /*0: 0.8Vpp, 1: 1.0Vpp, 2: 1.6Vpp, 3: 2.0Vpp*/
72 u8 adc_vpp;
74 /* slave address and configuration of the tuner */
75 u8 tuner_address;
78 #if IS_REACHABLE(CONFIG_DVB_LGS8GXX)
79 extern struct dvb_frontend *lgs8gxx_attach(const struct lgs8gxx_config *config,
80 struct i2c_adapter *i2c);
81 #else
82 static inline
83 struct 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;
88 #endif /* CONFIG_DVB_LGS8GXX */
90 #endif /* __LGS8GXX_H__ */