1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 Driver for ST STV0299 demodulator
5 Copyright (C) 2001-2002 Convergence Integrated Media GmbH
6 <ralph@convergence.de>,
7 <holger@convergence.de>,
13 Copyright (C) 2002 by Peter Schildmann <peter.schildmann@web.de>
18 Copyright (C) 2002 Felix Domke <tmbinc@elitedvb.net>
19 & Andreas Oberritter <obi@linuxtv.org>
22 Support for Samsung TBMU24112IMB used on Technisat SkyStar2 rev. 2.6B
24 Copyright (C) 2003 Vadim Catana <skystar@moldova.cc>:
26 Support for Philips SU1278 on Technotrend hardware
28 Copyright (C) 2004 Andrew de Quincey <adq_dvb@lidskialf.net>
36 #include <linux/dvb/frontend.h>
37 #include <media/dvb_frontend.h>
39 #define STV0299_LOCKOUTPUT_0 0
40 #define STV0299_LOCKOUTPUT_1 1
41 #define STV0299_LOCKOUTPUT_CF 2
42 #define STV0299_LOCKOUTPUT_LK 3
44 #define STV0299_VOLT13_OP0 0
45 #define STV0299_VOLT13_OP1 1
49 /* the demodulator's i2c address */
52 /* inittab - array of pairs of values.
53 * First of each pair is the register, second is the value.
54 * List should be terminated with an 0xff, 0xff pair.
58 /* master clock to use */
61 /* does the inversion require inversion? */
64 /* Skip reinitialisation? */
67 /* LOCK OUTPUT setting */
70 /* Is 13v controlled by OP0 or OP1? */
76 /* minimum delay before retuning */
79 /* Set the symbol rate */
80 int (*set_symbol_rate)(struct dvb_frontend *fe, u32 srate, u32 ratio);
82 /* Set device param to start dma */
83 int (*set_ts_params)(struct dvb_frontend *fe, int is_punctured);
86 #if IS_REACHABLE(CONFIG_DVB_STV0299)
87 extern struct dvb_frontend *stv0299_attach(const struct stv0299_config *config,
88 struct i2c_adapter *i2c);
90 static inline struct dvb_frontend *stv0299_attach(const struct stv0299_config *config,
91 struct i2c_adapter *i2c)
93 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
96 #endif // CONFIG_DVB_STV0299
98 static inline int stv0299_writereg(struct dvb_frontend *fe, u8 reg, u8 val) {
100 u8 buf[] = {reg, val};
102 r = fe->ops.write(fe, buf, 2);