xref: /linux/drivers/media/dvb-frontends/lnbh29.h (revision 3eb66e91a25497065c5322b1268cbc3953642227)
1*1b09dd9fSKatsuhiro Suzuki /* SPDX-License-Identifier: GPL-2.0 */
2*1b09dd9fSKatsuhiro Suzuki /*
3*1b09dd9fSKatsuhiro Suzuki  * Driver for LNB supply and control IC STMicroelectronics LNBH29
4*1b09dd9fSKatsuhiro Suzuki  *
5*1b09dd9fSKatsuhiro Suzuki  * Copyright (c) 2018 Socionext Inc.
6*1b09dd9fSKatsuhiro Suzuki  */
7*1b09dd9fSKatsuhiro Suzuki 
8*1b09dd9fSKatsuhiro Suzuki #ifndef LNBH29_H
9*1b09dd9fSKatsuhiro Suzuki #define LNBH29_H
10*1b09dd9fSKatsuhiro Suzuki 
11*1b09dd9fSKatsuhiro Suzuki #include <linux/i2c.h>
12*1b09dd9fSKatsuhiro Suzuki #include <linux/dvb/frontend.h>
13*1b09dd9fSKatsuhiro Suzuki 
14*1b09dd9fSKatsuhiro Suzuki /* Using very low E.S.R. capacitors or ceramic caps */
15*1b09dd9fSKatsuhiro Suzuki #define LNBH29_DATA_COMP    BIT(3)
16*1b09dd9fSKatsuhiro Suzuki 
17*1b09dd9fSKatsuhiro Suzuki struct lnbh29_config {
18*1b09dd9fSKatsuhiro Suzuki 	u8 i2c_address;
19*1b09dd9fSKatsuhiro Suzuki 	u8 data_config;
20*1b09dd9fSKatsuhiro Suzuki };
21*1b09dd9fSKatsuhiro Suzuki 
22*1b09dd9fSKatsuhiro Suzuki #if IS_REACHABLE(CONFIG_DVB_LNBH29)
23*1b09dd9fSKatsuhiro Suzuki struct dvb_frontend *lnbh29_attach(struct dvb_frontend *fe,
24*1b09dd9fSKatsuhiro Suzuki 				   struct lnbh29_config *cfg,
25*1b09dd9fSKatsuhiro Suzuki 				   struct i2c_adapter *i2c);
26*1b09dd9fSKatsuhiro Suzuki #else
lnbh29_attach(struct dvb_frontend * fe,struct lnbh29_config * cfg,struct i2c_adapter * i2c)27*1b09dd9fSKatsuhiro Suzuki static inline struct dvb_frontend *lnbh29_attach(struct dvb_frontend *fe,
28*1b09dd9fSKatsuhiro Suzuki 						 struct lnbh29_config *cfg,
29*1b09dd9fSKatsuhiro Suzuki 						 struct i2c_adapter *i2c)
30*1b09dd9fSKatsuhiro Suzuki {
31*1b09dd9fSKatsuhiro Suzuki 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
32*1b09dd9fSKatsuhiro Suzuki 	return NULL;
33*1b09dd9fSKatsuhiro Suzuki }
34*1b09dd9fSKatsuhiro Suzuki #endif
35*1b09dd9fSKatsuhiro Suzuki 
36*1b09dd9fSKatsuhiro Suzuki #endif
37