xref: /linux/drivers/media/dvb-frontends/lnbp21.h (revision 6fdcba32711044c35c0e1b094cbd8f3f0b4472c9)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * lnbp21.h - driver for lnb supply and control ic lnbp21
4  *
5  * Copyright (C) 2006 Oliver Endriss
6  *
7  * the project's page is at https://linuxtv.org
8  */
9 
10 #ifndef _LNBP21_H
11 #define _LNBP21_H
12 
13 /* system register bits */
14 /* [RO] 0=OK; 1=over current limit flag */
15 #define LNBP21_OLF	0x01
16 /* [RO] 0=OK; 1=over temperature flag (150 C) */
17 #define LNBP21_OTF	0x02
18 /* [RW] 0=disable LNB power, enable loopthrough
19 	1=enable LNB power, disable loopthrough */
20 #define LNBP21_EN	0x04
21 /* [RW] 0=low voltage (13/14V, vert pol)
22 	1=high voltage (18/19V,horiz pol) */
23 #define LNBP21_VSEL	0x08
24 /* [RW] increase LNB voltage by 1V:
25 	0=13/18V; 1=14/19V */
26 #define LNBP21_LLC	0x10
27 /* [RW] 0=tone controlled by DSQIN pin
28 	1=tone enable, disable DSQIN */
29 #define LNBP21_TEN	0x20
30 /* [RW] current limit select:
31 	0:Iout=500-650mA Isc=300mA
32 	1:Iout=400-550mA Isc=200mA */
33 #define LNBP21_ISEL	0x40
34 /* [RW] short-circuit protect:
35 	0=pulsed (dynamic) curr limiting
36 	1=static curr limiting */
37 #define LNBP21_PCL	0x80
38 
39 #include <linux/dvb/frontend.h>
40 
41 #if IS_REACHABLE(CONFIG_DVB_LNBP21)
42 /* override_set and override_clear control which
43  system register bits (above) to always set & clear */
44 extern struct dvb_frontend *lnbp21_attach(struct dvb_frontend *fe,
45 				struct i2c_adapter *i2c, u8 override_set,
46 				u8 override_clear);
47 #else
48 static inline struct dvb_frontend *lnbp21_attach(struct dvb_frontend *fe,
49 				struct i2c_adapter *i2c, u8 override_set,
50 				u8 override_clear)
51 {
52 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
53 	return NULL;
54 }
55 #endif
56 
57 #endif
58