Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003     TDA10021/TDA10023  - Single Chip Cable Channel Receiver driver module
0004              used on the the Siemens DVB-C cards
0005 
0006     Copyright (C) 1999 Convergence Integrated Media GmbH <ralph@convergence.de>
0007     Copyright (C) 2004 Markus Schulz <msc@antzsystem.de>
0008            Support for TDA10021
0009 
0010 */
0011 
0012 #ifndef TDA1002x_H
0013 #define TDA1002x_H
0014 
0015 #include <linux/dvb/frontend.h>
0016 
0017 struct tda1002x_config {
0018     /* the demodulator's i2c address */
0019     u8 demod_address;
0020     u8 invert;
0021 };
0022 
0023 enum tda10023_output_mode {
0024     TDA10023_OUTPUT_MODE_PARALLEL_A = 0xe0,
0025     TDA10023_OUTPUT_MODE_PARALLEL_B = 0xa1,
0026     TDA10023_OUTPUT_MODE_PARALLEL_C = 0xa0,
0027     TDA10023_OUTPUT_MODE_SERIAL, /* TODO: not implemented */
0028 };
0029 
0030 struct tda10023_config {
0031     /* the demodulator's i2c address */
0032     u8 demod_address;
0033     u8 invert;
0034 
0035     /* clock settings */
0036     u32 xtal; /* defaults: 28920000 */
0037     u8 pll_m; /* defaults: 8 */
0038     u8 pll_p; /* defaults: 4 */
0039     u8 pll_n; /* defaults: 1 */
0040 
0041     /* MPEG2 TS output mode */
0042     u8 output_mode;
0043 
0044     /* input freq offset + baseband conversion type */
0045     u16 deltaf;
0046 };
0047 
0048 #if IS_REACHABLE(CONFIG_DVB_TDA10021)
0049 extern struct dvb_frontend* tda10021_attach(const struct tda1002x_config* config,
0050                         struct i2c_adapter* i2c, u8 pwm);
0051 #else
0052 static inline struct dvb_frontend* tda10021_attach(const struct tda1002x_config* config,
0053                         struct i2c_adapter* i2c, u8 pwm)
0054 {
0055     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0056     return NULL;
0057 }
0058 #endif // CONFIG_DVB_TDA10021
0059 
0060 #if IS_REACHABLE(CONFIG_DVB_TDA10023)
0061 extern struct dvb_frontend *tda10023_attach(
0062     const struct tda10023_config *config,
0063     struct i2c_adapter *i2c, u8 pwm);
0064 #else
0065 static inline struct dvb_frontend *tda10023_attach(
0066     const struct tda10023_config *config,
0067     struct i2c_adapter *i2c, u8 pwm)
0068 {
0069     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0070     return NULL;
0071 }
0072 #endif // CONFIG_DVB_TDA10023
0073 
0074 #endif // TDA1002x_H