Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / media / dvb-frontends / lgdt3305.h
blob3718cf8235606f3a4c133da1c121d359553b925b
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Support for LG Electronics LGDT3304 and LGDT3305 - VSB/QAM
5 * Copyright (C) 2008, 2009, 2010 Michael Krufky <mkrufky@linuxtv.org>
6 */
8 #ifndef _LGDT3305_H_
9 #define _LGDT3305_H_
11 #include <linux/i2c.h>
12 #include <media/dvb_frontend.h>
15 enum lgdt3305_mpeg_mode {
16 LGDT3305_MPEG_PARALLEL = 0,
17 LGDT3305_MPEG_SERIAL = 1,
20 enum lgdt3305_tp_clock_edge {
21 LGDT3305_TPCLK_RISING_EDGE = 0,
22 LGDT3305_TPCLK_FALLING_EDGE = 1,
25 enum lgdt3305_tp_clock_mode {
26 LGDT3305_TPCLK_GATED = 0,
27 LGDT3305_TPCLK_FIXED = 1,
30 enum lgdt3305_tp_valid_polarity {
31 LGDT3305_TP_VALID_LOW = 0,
32 LGDT3305_TP_VALID_HIGH = 1,
35 enum lgdt_demod_chip_type {
36 LGDT3305 = 0,
37 LGDT3304 = 1,
40 struct lgdt3305_config {
41 u8 i2c_addr;
43 /* user defined IF frequency in KHz */
44 u16 qam_if_khz;
45 u16 vsb_if_khz;
47 /* AGC Power reference - defaults are used if left unset */
48 u16 usref_8vsb; /* default: 0x32c4 */
49 u16 usref_qam64; /* default: 0x5400 */
50 u16 usref_qam256; /* default: 0x2a80 */
52 /* disable i2c repeater - 0:repeater enabled 1:repeater disabled */
53 unsigned int deny_i2c_rptr:1;
55 /* spectral inversion - 0:disabled 1:enabled */
56 unsigned int spectral_inversion:1;
58 /* use RF AGC loop - 0:disabled 1:enabled */
59 unsigned int rf_agc_loop:1;
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;
68 #if IS_REACHABLE(CONFIG_DVB_LGDT3305)
69 extern
70 struct dvb_frontend *lgdt3305_attach(const struct lgdt3305_config *config,
71 struct i2c_adapter *i2c_adap);
72 #else
73 static inline
74 struct dvb_frontend *lgdt3305_attach(const struct lgdt3305_config *config,
75 struct i2c_adapter *i2c_adap)
77 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
78 return NULL;
80 #endif /* CONFIG_DVB_LGDT3305 */
82 #endif /* _LGDT3305_H_ */