xref: /linux/drivers/media/dvb-frontends/mxl5xx.h (revision 204b1434)
1 /*
2  * Driver for the MaxLinear MxL5xx family of tuners/demods
3  *
4  * Copyright (C) 2014-2015 Ralph Metzler <rjkm@metzlerbros.de>
5  *                         Marcus Metzler <mocm@metzlerbros.de>
6  *                         developed for Digital Devices GmbH
7  *
8  * based on code:
9  * Copyright (c) 2011-2013 MaxLinear, Inc. All rights reserved
10  * which was released under GPL V2
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * version 2, as published by the Free Software Foundation.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  */
21 
22 #ifndef _MXL5XX_H_
23 #define _MXL5XX_H_
24 
25 #include <linux/types.h>
26 #include <linux/i2c.h>
27 
28 #include <media/dvb_frontend.h>
29 
30 struct mxl5xx_cfg {
31 	u8   adr;
32 	u8   type;
33 	u32  cap;
34 	u32  clk;
35 	u32  ts_clk;
36 
37 	u8  *fw;
38 	u32  fw_len;
39 
40 	int (*fw_read)(void *priv, u8 *buf, u32 len);
41 	void *fw_priv;
42 };
43 
44 #if IS_REACHABLE(CONFIG_DVB_MXL5XX)
45 
46 extern struct dvb_frontend *mxl5xx_attach(struct i2c_adapter *i2c,
47 	struct mxl5xx_cfg *cfg, u32 demod, u32 tuner,
48 	int (**fn_set_input)(struct dvb_frontend *, int));
49 
50 #else
51 
52 static inline struct dvb_frontend *mxl5xx_attach(struct i2c_adapter *i2c,
53 	struct mxl5xx_cfg *cfg, u32 demod, u32 tuner,
54 	int (**fn_set_input)(struct dvb_frontend *, int))
55 {
56 	pr_warn("%s: driver disabled by Kconfig\n", __func__);
57 	return NULL;
58 }
59 
60 #endif /* CONFIG_DVB_MXL5XX */
61 
62 #endif /* _MXL5XX_H_ */
63