Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / media / dvb-frontends / lgs8gxx.h
blob5b2f13a8be216a7f6584dc9b8f178309c93aff0c
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Support for Legend Silicon GB20600 (a.k.a DMB-TH) demodulator
4 * LGS8913, LGS8GL5, LGS8G75
5 * experimental support LGS8G42, LGS8G52
7 * Copyright (C) 2007-2009 David T.L. Wong <davidtlwong@gmail.com>
8 * Copyright (C) 2008 Sirius International (Hong Kong) Limited
9 * Timothy Lee <timothy.lee@siriushk.com> (for initial work on LGS8GL5)
12 #ifndef __LGS8GXX_H__
13 #define __LGS8GXX_H__
15 #include <linux/dvb/frontend.h>
16 #include <linux/i2c.h>
18 #define LGS8GXX_PROD_LGS8913 0
19 #define LGS8GXX_PROD_LGS8GL5 1
20 #define LGS8GXX_PROD_LGS8G42 3
21 #define LGS8GXX_PROD_LGS8G52 4
22 #define LGS8GXX_PROD_LGS8G54 5
23 #define LGS8GXX_PROD_LGS8G75 6
25 struct lgs8gxx_config {
27 /* product type */
28 u8 prod;
30 /* the demodulator's i2c address */
31 u8 demod_address;
33 /* parallel or serial transport stream */
34 u8 serial_ts;
36 /* transport stream polarity*/
37 u8 ts_clk_pol;
39 /* transport stream clock gated by ts_valid */
40 u8 ts_clk_gated;
42 /* A/D Clock frequency */
43 u32 if_clk_freq; /* in kHz */
45 /* IF frequency */
46 u32 if_freq; /* in kHz */
48 /*Use External ADC*/
49 u8 ext_adc;
51 /*External ADC output two's complement*/
52 u8 adc_signed;
54 /*Sample IF data at falling edge of IF_CLK*/
55 u8 if_neg_edge;
57 /*IF use Negative center frequency*/
58 u8 if_neg_center;
60 /*8G75 internal ADC input range selection*/
61 /*0: 0.8Vpp, 1: 1.0Vpp, 2: 1.6Vpp, 3: 2.0Vpp*/
62 u8 adc_vpp;
64 /* slave address and configuration of the tuner */
65 u8 tuner_address;
68 #if IS_REACHABLE(CONFIG_DVB_LGS8GXX)
69 extern struct dvb_frontend *lgs8gxx_attach(const struct lgs8gxx_config *config,
70 struct i2c_adapter *i2c);
71 #else
72 static inline
73 struct dvb_frontend *lgs8gxx_attach(const struct lgs8gxx_config *config,
74 struct i2c_adapter *i2c) {
75 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
76 return NULL;
78 #endif /* CONFIG_DVB_LGS8GXX */
80 #endif /* __LGS8GXX_H__ */