xref: /linux/drivers/media/dvb-frontends/isl6405.h (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * isl6405.h - driver for dual lnb supply and control ic ISL6405
4  *
5  * Copyright (C) 2008 Hartmut Hackmann
6  * Copyright (C) 2006 Oliver Endriss
7  *
8  * the project's page is at https://linuxtv.org
9  */
10 
11 #ifndef _ISL6405_H
12 #define _ISL6405_H
13 
14 #include <linux/dvb/frontend.h>
15 
16 /* system register bits */
17 
18 /* this bit selects register (control) 1 or 2
19    note that the bit maps are different */
20 
21 #define ISL6405_SR	0x80
22 
23 /* SR = 0 */
24 #define ISL6405_OLF1	0x01
25 #define ISL6405_EN1	0x02
26 #define ISL6405_VSEL1	0x04
27 #define ISL6405_LLC1	0x08
28 #define ISL6405_ENT1	0x10
29 #define ISL6405_ISEL1	0x20
30 #define ISL6405_DCL	0x40
31 
32 /* SR = 1 */
33 #define ISL6405_OLF2	0x01
34 #define ISL6405_OTF	0x02
35 #define ISL6405_EN2	0x04
36 #define ISL6405_VSEL2	0x08
37 #define ISL6405_LLC2	0x10
38 #define ISL6405_ENT2	0x20
39 #define ISL6405_ISEL2	0x40
40 
41 #if IS_REACHABLE(CONFIG_DVB_ISL6405)
42 /* override_set and override_clear control which system register bits (above)
43  * to always set & clear
44  */
45 extern struct dvb_frontend *isl6405_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c,
46 					   u8 i2c_addr, u8 override_set, u8 override_clear);
47 #else
48 static inline struct dvb_frontend *isl6405_attach(struct dvb_frontend *fe,
49 						  struct i2c_adapter *i2c, u8 i2c_addr,
50 						  u8 override_set, u8 override_clear)
51 {
52 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
53 	return NULL;
54 }
55 #endif /* CONFIG_DVB_ISL6405 */
56 
57 #endif
58