1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#ifndef _LG2160_H_
23#define _LG2160_H_
24
25#include <linux/kconfig.h>
26#include <linux/i2c.h>
27#include "dvb_frontend.h"
28
29enum lg_chip_type {
30 LG2160 = 0,
31 LG2161 = 1,
32};
33
34#define LG2161_1019 LG2161
35#define LG2161_1040 LG2161
36
37enum lg2160_spi_clock {
38 LG2160_SPI_3_125_MHZ = 0,
39 LG2160_SPI_6_25_MHZ = 1,
40 LG2160_SPI_12_5_MHZ = 2,
41};
42
43#if 0
44enum lg2161_oif {
45 LG2161_OIF_EBI2_SLA = 1,
46 LG2161_OIF_SDIO_SLA = 2,
47 LG2161_OIF_SPI_SLA = 3,
48 LG2161_OIF_SPI_MAS = 4,
49 LG2161_OIF_SERIAL_TS = 7,
50};
51#endif
52
53struct lg2160_config {
54 u8 i2c_addr;
55
56
57 u16 if_khz;
58
59
60 unsigned int deny_i2c_rptr:1;
61
62
63 unsigned int spectral_inversion:1;
64
65 unsigned int output_if;
66 enum lg2160_spi_clock spi_clock;
67 enum lg_chip_type lg_chip;
68};
69
70#if IS_ENABLED(CONFIG_DVB_LG2160)
71extern
72struct dvb_frontend *lg2160_attach(const struct lg2160_config *config,
73 struct i2c_adapter *i2c_adap);
74#else
75static inline
76struct dvb_frontend *lg2160_attach(const struct lg2160_config *config,
77 struct i2c_adapter *i2c_adap)
78{
79 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
80 return NULL;
81}
82#endif
83
84#endif
85