xref: /OK3568_Linux_fs/kernel/drivers/media/dvb-frontends/ix2505v.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-only */
2*4882a593Smuzhiyun /**
3*4882a593Smuzhiyun  * Driver for Sharp IX2505V (marked B0017) DVB-S silicon tuner
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Copyright (C) 2010 Malcolm Priestley
6*4882a593Smuzhiyun  */
7*4882a593Smuzhiyun 
8*4882a593Smuzhiyun #ifndef DVB_IX2505V_H
9*4882a593Smuzhiyun #define DVB_IX2505V_H
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun #include <linux/i2c.h>
12*4882a593Smuzhiyun #include <media/dvb_frontend.h>
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun /**
15*4882a593Smuzhiyun  * struct ix2505v_config - ix2505 attachment configuration
16*4882a593Smuzhiyun  *
17*4882a593Smuzhiyun  * @tuner_address: tuner address
18*4882a593Smuzhiyun  * @tuner_gain: Baseband AMP gain control 0/1=0dB(default) 2=-2bB 3=-4dB
19*4882a593Smuzhiyun  * @tuner_chargepump: Charge pump output +/- 0=120 1=260 2=555 3=1200(default)
20*4882a593Smuzhiyun  * @min_delay_ms: delay after tune
21*4882a593Smuzhiyun  * @tuner_write_only: disables reads
22*4882a593Smuzhiyun  */
23*4882a593Smuzhiyun struct ix2505v_config {
24*4882a593Smuzhiyun 	u8 tuner_address;
25*4882a593Smuzhiyun 	u8 tuner_gain;
26*4882a593Smuzhiyun 	u8 tuner_chargepump;
27*4882a593Smuzhiyun 	int min_delay_ms;
28*4882a593Smuzhiyun 	u8 tuner_write_only;
29*4882a593Smuzhiyun 
30*4882a593Smuzhiyun };
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun #if IS_REACHABLE(CONFIG_DVB_IX2505V)
33*4882a593Smuzhiyun /**
34*4882a593Smuzhiyun  * Attach a ix2505v tuner to the supplied frontend structure.
35*4882a593Smuzhiyun  *
36*4882a593Smuzhiyun  * @fe: Frontend to attach to.
37*4882a593Smuzhiyun  * @config: pointer to &struct ix2505v_config
38*4882a593Smuzhiyun  * @i2c: pointer to &struct i2c_adapter.
39*4882a593Smuzhiyun  *
40*4882a593Smuzhiyun  * return: FE pointer on success, NULL on failure.
41*4882a593Smuzhiyun  */
42*4882a593Smuzhiyun extern struct dvb_frontend *ix2505v_attach(struct dvb_frontend *fe,
43*4882a593Smuzhiyun 	const struct ix2505v_config *config, struct i2c_adapter *i2c);
44*4882a593Smuzhiyun #else
ix2505v_attach(struct dvb_frontend * fe,const struct ix2505v_config * config,struct i2c_adapter * i2c)45*4882a593Smuzhiyun static inline struct dvb_frontend *ix2505v_attach(struct dvb_frontend *fe,
46*4882a593Smuzhiyun 	const struct ix2505v_config *config, struct i2c_adapter *i2c)
47*4882a593Smuzhiyun {
48*4882a593Smuzhiyun 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
49*4882a593Smuzhiyun 	return NULL;
50*4882a593Smuzhiyun }
51*4882a593Smuzhiyun #endif
52*4882a593Smuzhiyun 
53*4882a593Smuzhiyun #endif /* DVB_IX2505V_H */
54