Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  *    Support for LGDT3306A - 8VSB/QAM-B
0004  *
0005  *    Copyright (C) 2013,2014 Fred Richter <frichter@hauppauge.com>
0006  *      based on lgdt3305.[ch] by Michael Krufky
0007  */
0008 
0009 #ifndef _LGDT3306A_H_
0010 #define _LGDT3306A_H_
0011 
0012 #include <linux/i2c.h>
0013 #include <media/dvb_frontend.h>
0014 
0015 
0016 enum lgdt3306a_mpeg_mode {
0017     LGDT3306A_MPEG_PARALLEL = 0,
0018     LGDT3306A_MPEG_SERIAL = 1,
0019 };
0020 
0021 enum lgdt3306a_tp_clock_edge {
0022     LGDT3306A_TPCLK_RISING_EDGE = 0,
0023     LGDT3306A_TPCLK_FALLING_EDGE = 1,
0024 };
0025 
0026 enum lgdt3306a_tp_valid_polarity {
0027     LGDT3306A_TP_VALID_LOW = 0,
0028     LGDT3306A_TP_VALID_HIGH = 1,
0029 };
0030 
0031 struct lgdt3306a_config {
0032     u8 i2c_addr;
0033 
0034     /* user defined IF frequency in KHz */
0035     u16 qam_if_khz;
0036     u16 vsb_if_khz;
0037 
0038     /* disable i2c repeater - 0:repeater enabled 1:repeater disabled */
0039     unsigned int deny_i2c_rptr:1;
0040 
0041     /* spectral inversion - 0:disabled 1:enabled */
0042     unsigned int spectral_inversion:1;
0043 
0044     enum lgdt3306a_mpeg_mode mpeg_mode;
0045     enum lgdt3306a_tp_clock_edge tpclk_edge;
0046     enum lgdt3306a_tp_valid_polarity tpvalid_polarity;
0047 
0048     /* demod clock freq in MHz; 24 or 25 supported */
0049     int  xtalMHz;
0050 
0051     /* returned by driver if using i2c bus multiplexing */
0052     struct dvb_frontend **fe;
0053     struct i2c_adapter **i2c_adapter;
0054 };
0055 
0056 #if IS_REACHABLE(CONFIG_DVB_LGDT3306A)
0057 struct dvb_frontend *lgdt3306a_attach(const struct lgdt3306a_config *config,
0058                       struct i2c_adapter *i2c_adap);
0059 #else
0060 static inline
0061 struct dvb_frontend *lgdt3306a_attach(const struct lgdt3306a_config *config,
0062                       struct i2c_adapter *i2c_adap)
0063 {
0064     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0065     return NULL;
0066 }
0067 #endif /* CONFIG_DVB_LGDT3306A */
0068 
0069 #endif /* _LGDT3306A_H_ */