xref: /linux/drivers/media/dvb-frontends/mb86a20s.h (revision b064945517ee368bfb6343bf3fb4613d537c4bbb)
150acfb2bSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
29a0bf528SMauro Carvalho Chehab /*
39a0bf528SMauro Carvalho Chehab  *   Fujitsu mb86a20s driver
49a0bf528SMauro Carvalho Chehab  *
537e59f87SMauro Carvalho Chehab  *   Copyright (C) 2010 Mauro Carvalho Chehab
69a0bf528SMauro Carvalho Chehab  */
79a0bf528SMauro Carvalho Chehab 
89a0bf528SMauro Carvalho Chehab #ifndef MB86A20S_H
99a0bf528SMauro Carvalho Chehab #define MB86A20S_H
109a0bf528SMauro Carvalho Chehab 
119a0bf528SMauro Carvalho Chehab #include <linux/dvb/frontend.h>
129a0bf528SMauro Carvalho Chehab 
139a0bf528SMauro Carvalho Chehab /**
149a0bf528SMauro Carvalho Chehab  * struct mb86a20s_config - Define the per-device attributes of the frontend
159a0bf528SMauro Carvalho Chehab  *
160e4bbeddSMauro Carvalho Chehab  * @fclk:		Clock frequency. If zero, assumes the default
170e4bbeddSMauro Carvalho Chehab  *			(32.57142 Mhz)
189a0bf528SMauro Carvalho Chehab  * @demod_address:	the demodulator's i2c address
190e4bbeddSMauro Carvalho Chehab  * @is_serial:		if true, TS is serial. Otherwise, TS is parallel
209a0bf528SMauro Carvalho Chehab  */
219a0bf528SMauro Carvalho Chehab struct mb86a20s_config {
220e4bbeddSMauro Carvalho Chehab 	u32	fclk;
239a0bf528SMauro Carvalho Chehab 	u8	demod_address;
249a0bf528SMauro Carvalho Chehab 	bool	is_serial;
259a0bf528SMauro Carvalho Chehab };
269a0bf528SMauro Carvalho Chehab 
279b174527SArnd Bergmann #if IS_REACHABLE(CONFIG_DVB_MB86A20S)
28be9b53c8SMauro Carvalho Chehab /**
29*b0649455SMauro Carvalho Chehab  * mb86a20s_attach - Attach a mb86a20s demod
30be9b53c8SMauro Carvalho Chehab  *
31be9b53c8SMauro Carvalho Chehab  * @config: pointer to &struct mb86a20s_config with demod configuration.
32be9b53c8SMauro Carvalho Chehab  * @i2c: i2c adapter to use.
33be9b53c8SMauro Carvalho Chehab  *
34be9b53c8SMauro Carvalho Chehab  * return: FE pointer on success, NULL on failure.
35be9b53c8SMauro Carvalho Chehab  */
369a0bf528SMauro Carvalho Chehab extern struct dvb_frontend *mb86a20s_attach(const struct mb86a20s_config *config,
379a0bf528SMauro Carvalho Chehab 					   struct i2c_adapter *i2c);
38be9b53c8SMauro Carvalho Chehab 
399a0bf528SMauro Carvalho Chehab #else
409a0bf528SMauro Carvalho Chehab static inline struct dvb_frontend *mb86a20s_attach(
419a0bf528SMauro Carvalho Chehab 	const struct mb86a20s_config *config, struct i2c_adapter *i2c)
429a0bf528SMauro Carvalho Chehab {
439a0bf528SMauro Carvalho Chehab 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
449a0bf528SMauro Carvalho Chehab 	return NULL;
459a0bf528SMauro Carvalho Chehab }
469a0bf528SMauro Carvalho Chehab #endif
479a0bf528SMauro Carvalho Chehab 
489a0bf528SMauro Carvalho Chehab #endif /* MB86A20S */
49