Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  *    Support for LGDT3302 and LGDT3303 - VSB/QAM
0004  *
0005  *    Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net>
0006  */
0007 
0008 #ifndef LGDT330X_H
0009 #define LGDT330X_H
0010 
0011 #include <linux/dvb/frontend.h>
0012 
0013 typedef enum lg_chip_t {
0014         UNDEFINED,
0015         LGDT3302,
0016         LGDT3303
0017 }lg_chip_type;
0018 
0019 /**
0020  * struct lgdt330x_config - contains lgdt330x configuration
0021  *
0022  * @demod_chip:     LG demodulator chip LGDT3302 or LGDT3303
0023  * @serial_mpeg:    MPEG hardware interface - 0:parallel 1:serial
0024  * @pll_rf_set:     Callback function to set PLL interface
0025  * @set_ts_params:  Callback function to set device param for start_dma
0026  * @clock_polarity_flip:
0027  *  Flip the polarity of the mpeg data transfer clock using alternate
0028  *  init data.
0029  *  This option applies ONLY to LGDT3303 - 0:disabled (default) 1:enabled
0030  * @get_dvb_frontend:
0031  *  returns the frontend associated with this I2C client.
0032  *  Filled by the driver.
0033  */
0034 struct lgdt330x_config
0035 {
0036     lg_chip_type demod_chip;
0037     int serial_mpeg;
0038     int (*pll_rf_set) (struct dvb_frontend* fe, int index);
0039     int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured);
0040     int clock_polarity_flip;
0041 
0042     struct dvb_frontend* (*get_dvb_frontend)(struct i2c_client *);
0043 };
0044 
0045 #if IS_REACHABLE(CONFIG_DVB_LGDT330X)
0046 struct dvb_frontend *lgdt330x_attach(const struct lgdt330x_config *config,
0047                      u8 demod_address,
0048                      struct i2c_adapter *i2c);
0049 #else
0050 static inline
0051 struct dvb_frontend *lgdt330x_attach(const struct lgdt330x_config *config,
0052                      u8 demod_address,
0053                      struct i2c_adapter *i2c)
0054 {
0055     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0056     return NULL;
0057 }
0058 #endif // CONFIG_DVB_LGDT330X
0059 
0060 #endif /* LGDT330X_H */