Merge tag 'staging-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[linux-2.6-block.git] / drivers / media / dvb-frontends / ts2020.h
CommitLineData
74ba9207 1/* SPDX-License-Identifier: GPL-2.0-or-later */
6fef4fc7
KD
2/*
3 Montage Technology TS2020 - Silicon Tuner driver
4 Copyright (C) 2009-2012 Konstantin Dimitrov <kosio.dimitrov@gmail.com>
5
6 Copyright (C) 2009-2012 TurboSight.com
7
6fef4fc7
KD
8 */
9
10#ifndef TS2020_H
11#define TS2020_H
12
13#include <linux/dvb/frontend.h>
14
15struct ts2020_config {
16 u8 tuner_address;
03a67279 17 u32 frequency_div;
abd9025b
AP
18
19 /*
20 * RF loop-through
21 */
0f20baad 22 bool loop_through:1;
abd9025b
AP
23
24 /*
25 * clock output
26 */
27#define TS2020_CLK_OUT_DISABLED 0
28#define TS2020_CLK_OUT_ENABLED 1
29#define TS2020_CLK_OUT_ENABLED_XTALOUT 2
30 u8 clk_out:2;
31
32 /*
33 * clock output divider
34 * 1 - 31
35 */
36 u8 clk_out_div:5;
37
c7275ae1
DH
38 /* Set to true to suppress stat polling */
39 bool dont_poll:1;
40
abd9025b
AP
41 /*
42 * pointer to DVB frontend
43 */
44 struct dvb_frontend *fe;
e6ad9ce3
AP
45
46 /*
47 * driver private, do not set value
48 */
49 u8 attach_in_use:1;
0f91c9d6
DH
50
51 /* Operation to be called by the ts2020 driver to get the value of the
52 * AGC PWM tuner input as theoretically output by the demodulator.
53 */
54 int (*get_agc_pwm)(struct dvb_frontend *fe, u8 *_agc_pwm);
6fef4fc7
KD
55};
56
e6ad9ce3 57/* Do not add new ts2020_attach() users! Use I2C bindings instead. */
9b174527 58#if IS_REACHABLE(CONFIG_DVB_TS2020)
6fef4fc7
KD
59extern struct dvb_frontend *ts2020_attach(
60 struct dvb_frontend *fe,
61 const struct ts2020_config *config,
62 struct i2c_adapter *i2c);
63#else
64static inline struct dvb_frontend *ts2020_attach(
65 struct dvb_frontend *fe,
66 const struct ts2020_config *config,
67 struct i2c_adapter *i2c)
68{
69 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
70 return NULL;
71}
72#endif
73
74#endif /* TS2020_H */