2019-05-27 09:55:06 +03:00
/* SPDX-License-Identifier: GPL-2.0-or-later */
2015-07-24 00:43:06 +03:00
/*
* ZyDAS ZD1301 driver ( demodulator )
*
* Copyright ( C ) 2015 Antti Palosaari < crope @ iki . fi >
*/
# ifndef ZD1301_DEMOD_H
# define ZD1301_DEMOD_H
# include <linux/platform_device.h>
# include <linux/dvb/frontend.h>
2017-12-28 21:03:51 +03:00
# include <media/dvb_frontend.h>
2015-07-24 00:43:06 +03:00
/**
* struct zd1301_demod_platform_data - Platform data for the zd1301_demod driver
* @ reg_priv : First argument of reg_read and reg_write callbacks .
* @ reg_read : Register read callback .
* @ reg_write : Register write callback .
*/
struct zd1301_demod_platform_data {
void * reg_priv ;
int ( * reg_read ) ( void * , u16 , u8 * ) ;
int ( * reg_write ) ( void * , u16 , u8 ) ;
} ;
2017-02-07 16:01:41 +03:00
# if IS_REACHABLE(CONFIG_DVB_ZD1301_DEMOD)
2015-07-24 00:43:06 +03:00
/**
* zd1301_demod_get_dvb_frontend ( ) - Get pointer to DVB frontend
* @ pdev : Pointer to platform device
*
* Return : Pointer to DVB frontend which given platform device owns .
*/
2017-11-29 20:39:19 +03:00
struct dvb_frontend * zd1301_demod_get_dvb_frontend ( struct platform_device * pdev ) ;
2015-07-24 00:43:06 +03:00
/**
* zd1301_demod_get_i2c_adapter ( ) - Get pointer to I2C adapter
* @ pdev : Pointer to platform device
*
* Return : Pointer to I2C adapter which given platform device owns .
*/
2017-11-29 20:39:19 +03:00
struct i2c_adapter * zd1301_demod_get_i2c_adapter ( struct platform_device * pdev ) ;
2015-07-24 00:43:06 +03:00
2017-02-07 16:01:41 +03:00
# else
static inline struct dvb_frontend * zd1301_demod_get_dvb_frontend ( struct platform_device * dev )
{
printk ( KERN_WARNING " %s: driver disabled by Kconfig \n " , __func__ ) ;
return NULL ;
}
static inline struct i2c_adapter * zd1301_demod_get_i2c_adapter ( struct platform_device * dev )
{
printk ( KERN_WARNING " %s: driver disabled by Kconfig \n " , __func__ ) ;
return NULL ;
}
# endif
2015-07-24 00:43:06 +03:00
# endif /* ZD1301_DEMOD_H */