Commit | Line | Data |
---|---|---|
c942fddf | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
b63b36fa FR |
2 | /* |
3 | * Support for LGDT3306A - 8VSB/QAM-B | |
4 | * | |
5 | * Copyright (C) 2013,2014 Fred Richter <frichter@hauppauge.com> | |
6 | * based on lgdt3305.[ch] by Michael Krufky | |
b63b36fa FR |
7 | */ |
8 | ||
9 | #ifndef _LGDT3306A_H_ | |
10 | #define _LGDT3306A_H_ | |
11 | ||
12 | #include <linux/i2c.h> | |
fada1935 | 13 | #include <media/dvb_frontend.h> |
b63b36fa FR |
14 | |
15 | ||
16 | enum lgdt3306a_mpeg_mode { | |
17 | LGDT3306A_MPEG_PARALLEL = 0, | |
18 | LGDT3306A_MPEG_SERIAL = 1, | |
19 | }; | |
20 | ||
21 | enum lgdt3306a_tp_clock_edge { | |
22 | LGDT3306A_TPCLK_RISING_EDGE = 0, | |
23 | LGDT3306A_TPCLK_FALLING_EDGE = 1, | |
24 | }; | |
25 | ||
26 | enum lgdt3306a_tp_valid_polarity { | |
27 | LGDT3306A_TP_VALID_LOW = 0, | |
28 | LGDT3306A_TP_VALID_HIGH = 1, | |
29 | }; | |
30 | ||
31 | struct lgdt3306a_config { | |
32 | u8 i2c_addr; | |
33 | ||
34 | /* user defined IF frequency in KHz */ | |
35 | u16 qam_if_khz; | |
36 | u16 vsb_if_khz; | |
37 | ||
38 | /* disable i2c repeater - 0:repeater enabled 1:repeater disabled */ | |
15c546e1 | 39 | unsigned int deny_i2c_rptr:1; |
b63b36fa FR |
40 | |
41 | /* spectral inversion - 0:disabled 1:enabled */ | |
15c546e1 | 42 | unsigned int spectral_inversion:1; |
b63b36fa FR |
43 | |
44 | enum lgdt3306a_mpeg_mode mpeg_mode; | |
45 | enum lgdt3306a_tp_clock_edge tpclk_edge; | |
46 | enum lgdt3306a_tp_valid_polarity tpvalid_polarity; | |
47 | ||
8e8cd34e MIK |
48 | /* demod clock freq in MHz; 24 or 25 supported */ |
49 | int xtalMHz; | |
4f751890 KC |
50 | |
51 | /* returned by driver if using i2c bus multiplexing */ | |
52 | struct dvb_frontend **fe; | |
53 | struct i2c_adapter **i2c_adapter; | |
b63b36fa FR |
54 | }; |
55 | ||
00c78a37 | 56 | #if IS_REACHABLE(CONFIG_DVB_LGDT3306A) |
b63b36fa | 57 | struct dvb_frontend *lgdt3306a_attach(const struct lgdt3306a_config *config, |
c43e6512 | 58 | struct i2c_adapter *i2c_adap); |
b63b36fa FR |
59 | #else |
60 | static inline | |
61 | struct dvb_frontend *lgdt3306a_attach(const struct lgdt3306a_config *config, | |
c43e6512 | 62 | struct i2c_adapter *i2c_adap) |
b63b36fa FR |
63 | { |
64 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | |
65 | return NULL; | |
66 | } | |
67 | #endif /* CONFIG_DVB_LGDT3306A */ | |
68 | ||
69 | #endif /* _LGDT3306A_H_ */ |