Thomas Gleixner | c942fdd | 2019-05-27 08:55:06 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
David Wong | f15da16 | 2009-04-01 04:35:10 -0300 | [diff] [blame] | 2 | /* |
David Wong | b80dc1c | 2009-06-17 01:38:10 -0300 | [diff] [blame] | 3 | * Support for Legend Silicon GB20600 (a.k.a DMB-TH) demodulator |
| 4 | * LGS8913, LGS8GL5, LGS8G75 |
David Wong | f15da16 | 2009-04-01 04:35:10 -0300 | [diff] [blame] | 5 | * experimental support LGS8G42, LGS8G52 |
| 6 | * |
David Wong | b80dc1c | 2009-06-17 01:38:10 -0300 | [diff] [blame] | 7 | * Copyright (C) 2007-2009 David T.L. Wong <davidtlwong@gmail.com> |
David Wong | f15da16 | 2009-04-01 04:35:10 -0300 | [diff] [blame] | 8 | * Copyright (C) 2008 Sirius International (Hong Kong) Limited |
| 9 | * Timothy Lee <timothy.lee@siriushk.com> (for initial work on LGS8GL5) |
David Wong | f15da16 | 2009-04-01 04:35:10 -0300 | [diff] [blame] | 10 | */ |
| 11 | |
| 12 | #ifndef __LGS8GXX_H__ |
| 13 | #define __LGS8GXX_H__ |
| 14 | |
| 15 | #include <linux/dvb/frontend.h> |
| 16 | #include <linux/i2c.h> |
| 17 | |
| 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 |
David Wong | b80dc1c | 2009-06-17 01:38:10 -0300 | [diff] [blame] | 23 | #define LGS8GXX_PROD_LGS8G75 6 |
David Wong | f15da16 | 2009-04-01 04:35:10 -0300 | [diff] [blame] | 24 | |
| 25 | struct lgs8gxx_config { |
| 26 | |
| 27 | /* product type */ |
| 28 | u8 prod; |
| 29 | |
| 30 | /* the demodulator's i2c address */ |
| 31 | u8 demod_address; |
| 32 | |
| 33 | /* parallel or serial transport stream */ |
| 34 | u8 serial_ts; |
| 35 | |
| 36 | /* transport stream polarity*/ |
| 37 | u8 ts_clk_pol; |
| 38 | |
| 39 | /* transport stream clock gated by ts_valid */ |
| 40 | u8 ts_clk_gated; |
| 41 | |
| 42 | /* A/D Clock frequency */ |
| 43 | u32 if_clk_freq; /* in kHz */ |
| 44 | |
| 45 | /* IF frequency */ |
| 46 | u32 if_freq; /* in kHz */ |
| 47 | |
| 48 | /*Use External ADC*/ |
| 49 | u8 ext_adc; |
| 50 | |
| 51 | /*External ADC output two's complement*/ |
| 52 | u8 adc_signed; |
| 53 | |
| 54 | /*Sample IF data at falling edge of IF_CLK*/ |
| 55 | u8 if_neg_edge; |
| 56 | |
| 57 | /*IF use Negative center frequency*/ |
| 58 | u8 if_neg_center; |
| 59 | |
David Wong | b80dc1c | 2009-06-17 01:38:10 -0300 | [diff] [blame] | 60 | /*8G75 internal ADC input range selection*/ |
| 61 | /*0: 0.8Vpp, 1: 1.0Vpp, 2: 1.6Vpp, 3: 2.0Vpp*/ |
| 62 | u8 adc_vpp; |
| 63 | |
David Wong | f15da16 | 2009-04-01 04:35:10 -0300 | [diff] [blame] | 64 | /* slave address and configuration of the tuner */ |
| 65 | u8 tuner_address; |
| 66 | }; |
| 67 | |
Arnd Bergmann | 9b17452 | 2015-02-18 14:12:42 -0300 | [diff] [blame] | 68 | #if IS_REACHABLE(CONFIG_DVB_LGS8GXX) |
David Wong | f15da16 | 2009-04-01 04:35:10 -0300 | [diff] [blame] | 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; |
| 77 | } |
| 78 | #endif /* CONFIG_DVB_LGS8GXX */ |
| 79 | |
| 80 | #endif /* __LGS8GXX_H__ */ |