Documentation: Fix 'file_mapped' -> 'mapped_file'
[sfrench/cifs-2.6.git] / drivers / media / dvb-frontends / zd1301_demod.h
1 /*
2  * ZyDAS ZD1301 driver (demodulator)
3  *
4  * Copyright (C) 2015 Antti Palosaari <crope@iki.fi>
5  *
6  *    This program is free software; you can redistribute it and/or modify
7  *    it under the terms of the GNU General Public License as published by
8  *    the Free Software Foundation; either version 2 of the License, or
9  *    (at your option) any later version.
10  *
11  *    This program is distributed in the hope that it will be useful,
12  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *    GNU General Public License for more details.
15  */
16
17 #ifndef ZD1301_DEMOD_H
18 #define ZD1301_DEMOD_H
19
20 #include <linux/platform_device.h>
21 #include <linux/dvb/frontend.h>
22 #include "dvb_frontend.h"
23
24 /**
25  * struct zd1301_demod_platform_data - Platform data for the zd1301_demod driver
26  * @reg_priv: First argument of reg_read and reg_write callbacks.
27  * @reg_read: Register read callback.
28  * @reg_write: Register write callback.
29  */
30
31 struct zd1301_demod_platform_data {
32         void *reg_priv;
33         int (*reg_read)(void *, u16, u8 *);
34         int (*reg_write)(void *, u16, u8);
35 };
36
37 #if IS_REACHABLE(CONFIG_DVB_ZD1301_DEMOD)
38 /**
39  * zd1301_demod_get_dvb_frontend() - Get pointer to DVB frontend
40  * @pdev: Pointer to platform device
41  *
42  * Return: Pointer to DVB frontend which given platform device owns.
43  */
44
45 struct dvb_frontend *zd1301_demod_get_dvb_frontend(struct platform_device *);
46
47 /**
48  * zd1301_demod_get_i2c_adapter() - Get pointer to I2C adapter
49  * @pdev: Pointer to platform device
50  *
51  * Return: Pointer to I2C adapter which given platform device owns.
52  */
53
54 struct i2c_adapter *zd1301_demod_get_i2c_adapter(struct platform_device *);
55
56 #else
57
58 static inline struct dvb_frontend *zd1301_demod_get_dvb_frontend(struct platform_device *dev)
59 {
60         printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
61
62         return NULL;
63 }
64 static inline struct i2c_adapter *zd1301_demod_get_i2c_adapter(struct platform_device *dev)
65 {
66         printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
67
68         return NULL;
69 }
70
71 #endif
72
73 #endif /* ZD1301_DEMOD_H */