xref: /linux/drivers/media/dvb-frontends/lnbp21.h (revision 307797159ac25fe5a2048bf5c6a5718298edca57)
1 /*
2  * lnbp21.h - driver for lnb supply and control ic lnbp21
3  *
4  * Copyright (C) 2006 Oliver Endriss
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * To obtain the license, point your browser to
18  * http://www.gnu.org/copyleft/gpl.html
19  *
20  *
21  * the project's page is at https://linuxtv.org
22  */
23 
24 #ifndef _LNBP21_H
25 #define _LNBP21_H
26 
27 /* system register bits */
28 /* [RO] 0=OK; 1=over current limit flag */
29 #define LNBP21_OLF	0x01
30 /* [RO] 0=OK; 1=over temperature flag (150 C) */
31 #define LNBP21_OTF	0x02
32 /* [RW] 0=disable LNB power, enable loopthrough
33 	1=enable LNB power, disable loopthrough */
34 #define LNBP21_EN	0x04
35 /* [RW] 0=low voltage (13/14V, vert pol)
36 	1=high voltage (18/19V,horiz pol) */
37 #define LNBP21_VSEL	0x08
38 /* [RW] increase LNB voltage by 1V:
39 	0=13/18V; 1=14/19V */
40 #define LNBP21_LLC	0x10
41 /* [RW] 0=tone controlled by DSQIN pin
42 	1=tone enable, disable DSQIN */
43 #define LNBP21_TEN	0x20
44 /* [RW] current limit select:
45 	0:Iout=500-650mA Isc=300mA
46 	1:Iout=400-550mA Isc=200mA */
47 #define LNBP21_ISEL	0x40
48 /* [RW] short-circuit protect:
49 	0=pulsed (dynamic) curr limiting
50 	1=static curr limiting */
51 #define LNBP21_PCL	0x80
52 
53 #include <linux/dvb/frontend.h>
54 
55 #if IS_REACHABLE(CONFIG_DVB_LNBP21)
56 /* override_set and override_clear control which
57  system register bits (above) to always set & clear */
58 extern struct dvb_frontend *lnbp21_attach(struct dvb_frontend *fe,
59 				struct i2c_adapter *i2c, u8 override_set,
60 				u8 override_clear);
61 #else
62 static inline struct dvb_frontend *lnbp21_attach(struct dvb_frontend *fe,
63 				struct i2c_adapter *i2c, u8 override_set,
64 				u8 override_clear)
65 {
66 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
67 	return NULL;
68 }
69 #endif
70 
71 #endif
72