xref: /linux/drivers/media/dvb-frontends/ix2505v.h (revision 2f4c53349961c8ca480193e47da4d44fdb8335a8)
1*1802d0beSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
21ae2c589SMalcolm Priestley /**
31ae2c589SMalcolm Priestley  * Driver for Sharp IX2505V (marked B0017) DVB-S silicon tuner
41ae2c589SMalcolm Priestley  *
51ae2c589SMalcolm Priestley  * Copyright (C) 2010 Malcolm Priestley
61ae2c589SMalcolm Priestley  */
71ae2c589SMalcolm Priestley 
81ae2c589SMalcolm Priestley #ifndef DVB_IX2505V_H
91ae2c589SMalcolm Priestley #define DVB_IX2505V_H
101ae2c589SMalcolm Priestley 
111ae2c589SMalcolm Priestley #include <linux/i2c.h>
12fada1935SMauro Carvalho Chehab #include <media/dvb_frontend.h>
131ae2c589SMalcolm Priestley 
14be9b53c8SMauro Carvalho Chehab /**
15be9b53c8SMauro Carvalho Chehab  * struct ix2505v_config - ix2505 attachment configuration
16be9b53c8SMauro Carvalho Chehab  *
17be9b53c8SMauro Carvalho Chehab  * @tuner_address: tuner address
18be9b53c8SMauro Carvalho Chehab  * @tuner_gain: Baseband AMP gain control 0/1=0dB(default) 2=-2bB 3=-4dB
19be9b53c8SMauro Carvalho Chehab  * @tuner_chargepump: Charge pump output +/- 0=120 1=260 2=555 3=1200(default)
20be9b53c8SMauro Carvalho Chehab  * @min_delay_ms: delay after tune
21be9b53c8SMauro Carvalho Chehab  * @tuner_write_only: disables reads
22be9b53c8SMauro Carvalho Chehab  */
231ae2c589SMalcolm Priestley struct ix2505v_config {
241ae2c589SMalcolm Priestley 	u8 tuner_address;
251ae2c589SMalcolm Priestley 	u8 tuner_gain;
261ae2c589SMalcolm Priestley 	u8 tuner_chargepump;
271ae2c589SMalcolm Priestley 	int min_delay_ms;
281ae2c589SMalcolm Priestley 	u8 tuner_write_only;
291ae2c589SMalcolm Priestley 
301ae2c589SMalcolm Priestley };
311ae2c589SMalcolm Priestley 
329b174527SArnd Bergmann #if IS_REACHABLE(CONFIG_DVB_IX2505V)
33b95b0c98SMauro Carvalho Chehab /**
34b95b0c98SMauro Carvalho Chehab  * Attach a ix2505v tuner to the supplied frontend structure.
35b95b0c98SMauro Carvalho Chehab  *
36b95b0c98SMauro Carvalho Chehab  * @fe: Frontend to attach to.
37b95b0c98SMauro Carvalho Chehab  * @config: pointer to &struct ix2505v_config
38b95b0c98SMauro Carvalho Chehab  * @i2c: pointer to &struct i2c_adapter.
39b95b0c98SMauro Carvalho Chehab  *
40b95b0c98SMauro Carvalho Chehab  * return: FE pointer on success, NULL on failure.
41b95b0c98SMauro Carvalho Chehab  */
421ae2c589SMalcolm Priestley extern struct dvb_frontend *ix2505v_attach(struct dvb_frontend *fe,
431ae2c589SMalcolm Priestley 	const struct ix2505v_config *config, struct i2c_adapter *i2c);
441ae2c589SMalcolm Priestley #else
451ae2c589SMalcolm Priestley static inline struct dvb_frontend *ix2505v_attach(struct dvb_frontend *fe,
461ae2c589SMalcolm Priestley 	const struct ix2505v_config *config, struct i2c_adapter *i2c)
471ae2c589SMalcolm Priestley {
481ae2c589SMalcolm Priestley 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
491ae2c589SMalcolm Priestley 	return NULL;
501ae2c589SMalcolm Priestley }
511ae2c589SMalcolm Priestley #endif
521ae2c589SMalcolm Priestley 
531ae2c589SMalcolm Priestley #endif /* DVB_IX2505V_H */
54