1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * ZyDAS ZD1301 driver (demodulator)
5 * Copyright (C) 2015 Antti Palosaari <crope@iki.fi>
11 #include <linux/platform_device.h>
12 #include <linux/dvb/frontend.h>
13 #include <media/dvb_frontend.h>
16 * struct zd1301_demod_platform_data - Platform data for the zd1301_demod driver
17 * @reg_priv: First argument of reg_read and reg_write callbacks.
18 * @reg_read: Register read callback.
19 * @reg_write: Register write callback.
21 struct zd1301_demod_platform_data
{
23 int (*reg_read
)(void *, u16
, u8
*);
24 int (*reg_write
)(void *, u16
, u8
);
27 #if IS_REACHABLE(CONFIG_DVB_ZD1301_DEMOD)
29 * zd1301_demod_get_dvb_frontend() - Get pointer to DVB frontend
30 * @pdev: Pointer to platform device
32 * Return: Pointer to DVB frontend which given platform device owns.
34 struct dvb_frontend
*zd1301_demod_get_dvb_frontend(struct platform_device
*pdev
);
37 * zd1301_demod_get_i2c_adapter() - Get pointer to I2C adapter
38 * @pdev: Pointer to platform device
40 * Return: Pointer to I2C adapter which given platform device owns.
42 struct i2c_adapter
*zd1301_demod_get_i2c_adapter(struct platform_device
*pdev
);
47 * zd1301_demod_get_dvb_frontend() - Attach a zd1301 frontend
48 * @dev: Pointer to platform device
50 * Return: Pointer to %struct dvb_frontend or NULL if attach fails.
52 static inline struct dvb_frontend
*zd1301_demod_get_dvb_frontend(struct platform_device
*dev
)
54 printk(KERN_WARNING
"%s: driver disabled by Kconfig\n", __func__
);
58 static inline struct i2c_adapter
*zd1301_demod_get_i2c_adapter(struct platform_device
*dev
)
60 printk(KERN_WARNING
"%s: driver disabled by Kconfig\n", __func__
);
67 #endif /* ZD1301_DEMOD_H */