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