WIP FPC-III support
[linux/fpc-iii.git] / drivers / media / dvb-frontends / lgdt3306a.h
blob407e74b5d195a03b59f7f67d86c00a0290f6f700
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Support for LGDT3306A - 8VSB/QAM-B
5 * Copyright (C) 2013,2014 Fred Richter <frichter@hauppauge.com>
6 * based on lgdt3305.[ch] by Michael Krufky
7 */
9 #ifndef _LGDT3306A_H_
10 #define _LGDT3306A_H_
12 #include <linux/i2c.h>
13 #include <media/dvb_frontend.h>
16 enum lgdt3306a_mpeg_mode {
17 LGDT3306A_MPEG_PARALLEL = 0,
18 LGDT3306A_MPEG_SERIAL = 1,
21 enum lgdt3306a_tp_clock_edge {
22 LGDT3306A_TPCLK_RISING_EDGE = 0,
23 LGDT3306A_TPCLK_FALLING_EDGE = 1,
26 enum lgdt3306a_tp_valid_polarity {
27 LGDT3306A_TP_VALID_LOW = 0,
28 LGDT3306A_TP_VALID_HIGH = 1,
31 struct lgdt3306a_config {
32 u8 i2c_addr;
34 /* user defined IF frequency in KHz */
35 u16 qam_if_khz;
36 u16 vsb_if_khz;
38 /* disable i2c repeater - 0:repeater enabled 1:repeater disabled */
39 unsigned int deny_i2c_rptr:1;
41 /* spectral inversion - 0:disabled 1:enabled */
42 unsigned int spectral_inversion:1;
44 enum lgdt3306a_mpeg_mode mpeg_mode;
45 enum lgdt3306a_tp_clock_edge tpclk_edge;
46 enum lgdt3306a_tp_valid_polarity tpvalid_polarity;
48 /* demod clock freq in MHz; 24 or 25 supported */
49 int xtalMHz;
51 /* returned by driver if using i2c bus multiplexing */
52 struct dvb_frontend **fe;
53 struct i2c_adapter **i2c_adapter;
56 #if IS_REACHABLE(CONFIG_DVB_LGDT3306A)
57 struct dvb_frontend *lgdt3306a_attach(const struct lgdt3306a_config *config,
58 struct i2c_adapter *i2c_adap);
59 #else
60 static inline
61 struct dvb_frontend *lgdt3306a_attach(const struct lgdt3306a_config *config,
62 struct i2c_adapter *i2c_adap)
64 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
65 return NULL;
67 #endif /* CONFIG_DVB_LGDT3306A */
69 #endif /* _LGDT3306A_H_ */