xref: /linux/drivers/media/dvb-frontends/ts2020.h (revision 9b174527e7b756cda9f5d9e541f87b7fec9cfdf0)
16fef4fc7SKonstantin Dimitrov /*
26fef4fc7SKonstantin Dimitrov     Montage Technology TS2020 - Silicon Tuner driver
36fef4fc7SKonstantin Dimitrov     Copyright (C) 2009-2012 Konstantin Dimitrov <kosio.dimitrov@gmail.com>
46fef4fc7SKonstantin Dimitrov 
56fef4fc7SKonstantin Dimitrov     Copyright (C) 2009-2012 TurboSight.com
66fef4fc7SKonstantin Dimitrov 
76fef4fc7SKonstantin Dimitrov     This program is free software; you can redistribute it and/or modify
86fef4fc7SKonstantin Dimitrov     it under the terms of the GNU General Public License as published by
96fef4fc7SKonstantin Dimitrov     the Free Software Foundation; either version 2 of the License, or
106fef4fc7SKonstantin Dimitrov     (at your option) any later version.
116fef4fc7SKonstantin Dimitrov 
126fef4fc7SKonstantin Dimitrov     This program is distributed in the hope that it will be useful,
136fef4fc7SKonstantin Dimitrov     but WITHOUT ANY WARRANTY; without even the implied warranty of
146fef4fc7SKonstantin Dimitrov     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
156fef4fc7SKonstantin Dimitrov     GNU General Public License for more details.
166fef4fc7SKonstantin Dimitrov 
176fef4fc7SKonstantin Dimitrov     You should have received a copy of the GNU General Public License
186fef4fc7SKonstantin Dimitrov     along with this program; if not, write to the Free Software
196fef4fc7SKonstantin Dimitrov     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
206fef4fc7SKonstantin Dimitrov  */
216fef4fc7SKonstantin Dimitrov 
226fef4fc7SKonstantin Dimitrov #ifndef TS2020_H
236fef4fc7SKonstantin Dimitrov #define TS2020_H
246fef4fc7SKonstantin Dimitrov 
25782d8b74SMauro Carvalho Chehab #include <linux/kconfig.h>
266fef4fc7SKonstantin Dimitrov #include <linux/dvb/frontend.h>
276fef4fc7SKonstantin Dimitrov 
286fef4fc7SKonstantin Dimitrov struct ts2020_config {
296fef4fc7SKonstantin Dimitrov 	u8 tuner_address;
3003a67279SJohn Horan 	u32 frequency_div;
31abd9025bSAntti Palosaari 
32abd9025bSAntti Palosaari 	/*
33abd9025bSAntti Palosaari 	 * RF loop-through
34abd9025bSAntti Palosaari 	 */
35abd9025bSAntti Palosaari 	u8 loop_through:1;
36abd9025bSAntti Palosaari 
37abd9025bSAntti Palosaari 	/*
38abd9025bSAntti Palosaari 	 * clock output
39abd9025bSAntti Palosaari 	 */
40abd9025bSAntti Palosaari #define TS2020_CLK_OUT_DISABLED        0
41abd9025bSAntti Palosaari #define TS2020_CLK_OUT_ENABLED         1
42abd9025bSAntti Palosaari #define TS2020_CLK_OUT_ENABLED_XTALOUT 2
43abd9025bSAntti Palosaari 	u8 clk_out:2;
44abd9025bSAntti Palosaari 
45abd9025bSAntti Palosaari 	/*
46abd9025bSAntti Palosaari 	 * clock output divider
47abd9025bSAntti Palosaari 	 * 1 - 31
48abd9025bSAntti Palosaari 	 */
49abd9025bSAntti Palosaari 	u8 clk_out_div:5;
50abd9025bSAntti Palosaari 
51abd9025bSAntti Palosaari 	/*
52abd9025bSAntti Palosaari 	 * pointer to DVB frontend
53abd9025bSAntti Palosaari 	 */
54abd9025bSAntti Palosaari 	struct dvb_frontend *fe;
556fef4fc7SKonstantin Dimitrov };
566fef4fc7SKonstantin Dimitrov 
57*9b174527SArnd Bergmann #if IS_REACHABLE(CONFIG_DVB_TS2020)
586fef4fc7SKonstantin Dimitrov 
596fef4fc7SKonstantin Dimitrov extern struct dvb_frontend *ts2020_attach(
606fef4fc7SKonstantin Dimitrov 	struct dvb_frontend *fe,
616fef4fc7SKonstantin Dimitrov 	const struct ts2020_config *config,
626fef4fc7SKonstantin Dimitrov 	struct i2c_adapter *i2c);
636fef4fc7SKonstantin Dimitrov #else
646fef4fc7SKonstantin Dimitrov static inline struct dvb_frontend *ts2020_attach(
656fef4fc7SKonstantin Dimitrov 	struct dvb_frontend *fe,
666fef4fc7SKonstantin Dimitrov 	const struct ts2020_config *config,
676fef4fc7SKonstantin Dimitrov 	struct i2c_adapter *i2c)
686fef4fc7SKonstantin Dimitrov {
696fef4fc7SKonstantin Dimitrov 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
706fef4fc7SKonstantin Dimitrov 	return NULL;
716fef4fc7SKonstantin Dimitrov }
726fef4fc7SKonstantin Dimitrov #endif
736fef4fc7SKonstantin Dimitrov 
746fef4fc7SKonstantin Dimitrov #endif /* TS2020_H */
75