0001
0002
0003
0004
0005
0006
0007
0008 #ifndef _LG2160_H_
0009 #define _LG2160_H_
0010
0011 #include <linux/i2c.h>
0012 #include <media/dvb_frontend.h>
0013
0014 enum lg_chip_type {
0015 LG2160 = 0,
0016 LG2161 = 1,
0017 };
0018
0019 #define LG2161_1019 LG2161
0020 #define LG2161_1040 LG2161
0021
0022 enum lg2160_spi_clock {
0023 LG2160_SPI_3_125_MHZ = 0,
0024 LG2160_SPI_6_25_MHZ = 1,
0025 LG2160_SPI_12_5_MHZ = 2,
0026 };
0027
0028 #if 0
0029 enum lg2161_oif {
0030 LG2161_OIF_EBI2_SLA = 1,
0031 LG2161_OIF_SDIO_SLA = 2,
0032 LG2161_OIF_SPI_SLA = 3,
0033 LG2161_OIF_SPI_MAS = 4,
0034 LG2161_OIF_SERIAL_TS = 7,
0035 };
0036 #endif
0037
0038 struct lg2160_config {
0039 u8 i2c_addr;
0040
0041
0042 u16 if_khz;
0043
0044
0045 unsigned int deny_i2c_rptr:1;
0046
0047
0048 unsigned int spectral_inversion:1;
0049
0050 unsigned int output_if;
0051 enum lg2160_spi_clock spi_clock;
0052 enum lg_chip_type lg_chip;
0053 };
0054
0055 #if IS_REACHABLE(CONFIG_DVB_LG2160)
0056 extern
0057 struct dvb_frontend *lg2160_attach(const struct lg2160_config *config,
0058 struct i2c_adapter *i2c_adap);
0059 #else
0060 static inline
0061 struct dvb_frontend *lg2160_attach(const struct lg2160_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
0068
0069 #endif