Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  *    Support for Legend Silicon GB20600 (a.k.a DMB-TH) demodulator
0004  *    LGS8913, LGS8GL5, LGS8G75
0005  *    experimental support LGS8G42, LGS8G52
0006  *
0007  *    Copyright (C) 2007-2009 David T.L. Wong <davidtlwong@gmail.com>
0008  *    Copyright (C) 2008 Sirius International (Hong Kong) Limited
0009  *    Timothy Lee <timothy.lee@siriushk.com> (for initial work on LGS8GL5)
0010  */
0011 
0012 #ifndef __LGS8GXX_H__
0013 #define __LGS8GXX_H__
0014 
0015 #include <linux/dvb/frontend.h>
0016 #include <linux/i2c.h>
0017 
0018 #define LGS8GXX_PROD_LGS8913 0
0019 #define LGS8GXX_PROD_LGS8GL5 1
0020 #define LGS8GXX_PROD_LGS8G42 3
0021 #define LGS8GXX_PROD_LGS8G52 4
0022 #define LGS8GXX_PROD_LGS8G54 5
0023 #define LGS8GXX_PROD_LGS8G75 6
0024 
0025 struct lgs8gxx_config {
0026 
0027     /* product type */
0028     u8 prod;
0029 
0030     /* the demodulator's i2c address */
0031     u8 demod_address;
0032 
0033     /* parallel or serial transport stream */
0034     u8 serial_ts;
0035 
0036     /* transport stream polarity*/
0037     u8 ts_clk_pol;
0038 
0039     /* transport stream clock gated by ts_valid */
0040     u8 ts_clk_gated;
0041 
0042     /* A/D Clock frequency */
0043     u32 if_clk_freq; /* in kHz */
0044 
0045     /* IF frequency */
0046     u32 if_freq; /* in kHz */
0047 
0048     /*Use External ADC*/
0049     u8 ext_adc;
0050 
0051     /*External ADC output two's complement*/
0052     u8 adc_signed;
0053 
0054     /*Sample IF data at falling edge of IF_CLK*/
0055     u8 if_neg_edge;
0056 
0057     /*IF use Negative center frequency*/
0058     u8 if_neg_center;
0059 
0060     /*8G75 internal ADC input range selection*/
0061     /*0: 0.8Vpp, 1: 1.0Vpp, 2: 1.6Vpp, 3: 2.0Vpp*/
0062     u8 adc_vpp;
0063 
0064     /* slave address and configuration of the tuner */
0065     u8 tuner_address;
0066 };
0067 
0068 #if IS_REACHABLE(CONFIG_DVB_LGS8GXX)
0069 extern struct dvb_frontend *lgs8gxx_attach(const struct lgs8gxx_config *config,
0070                        struct i2c_adapter *i2c);
0071 #else
0072 static inline
0073 struct dvb_frontend *lgs8gxx_attach(const struct lgs8gxx_config *config,
0074                     struct i2c_adapter *i2c) {
0075     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0076     return NULL;
0077 }
0078 #endif /* CONFIG_DVB_LGS8GXX */
0079 
0080 #endif /* __LGS8GXX_H__ */