1
2
3
4
5
6
7
8#ifndef _LGDT3305_H_
9#define _LGDT3305_H_
10
11#include <linux/i2c.h>
12#include <media/dvb_frontend.h>
13
14
15enum lgdt3305_mpeg_mode {
16 LGDT3305_MPEG_PARALLEL = 0,
17 LGDT3305_MPEG_SERIAL = 1,
18};
19
20enum lgdt3305_tp_clock_edge {
21 LGDT3305_TPCLK_RISING_EDGE = 0,
22 LGDT3305_TPCLK_FALLING_EDGE = 1,
23};
24
25enum lgdt3305_tp_clock_mode {
26 LGDT3305_TPCLK_GATED = 0,
27 LGDT3305_TPCLK_FIXED = 1,
28};
29
30enum lgdt3305_tp_valid_polarity {
31 LGDT3305_TP_VALID_LOW = 0,
32 LGDT3305_TP_VALID_HIGH = 1,
33};
34
35enum lgdt_demod_chip_type {
36 LGDT3305 = 0,
37 LGDT3304 = 1,
38};
39
40struct lgdt3305_config {
41 u8 i2c_addr;
42
43
44 u16 qam_if_khz;
45 u16 vsb_if_khz;
46
47
48 u16 usref_8vsb;
49 u16 usref_qam64;
50 u16 usref_qam256;
51
52
53 unsigned int deny_i2c_rptr:1;
54
55
56 unsigned int spectral_inversion:1;
57
58
59 unsigned int rf_agc_loop:1;
60
61 enum lgdt3305_mpeg_mode mpeg_mode;
62 enum lgdt3305_tp_clock_edge tpclk_edge;
63 enum lgdt3305_tp_clock_mode tpclk_mode;
64 enum lgdt3305_tp_valid_polarity tpvalid_polarity;
65 enum lgdt_demod_chip_type demod_chip;
66};
67
68#if IS_REACHABLE(CONFIG_DVB_LGDT3305)
69extern
70struct dvb_frontend *lgdt3305_attach(const struct lgdt3305_config *config,
71 struct i2c_adapter *i2c_adap);
72#else
73static inline
74struct dvb_frontend *lgdt3305_attach(const struct lgdt3305_config *config,
75 struct i2c_adapter *i2c_adap)
76{
77 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
78 return NULL;
79}
80#endif
81
82#endif
83