media: cxusb: implement Medion MD95700 digital / analog coexistence
This patch prepares cxusb driver for supporting the analog part of Medion 95700 (previously only the digital - DVB - mode was supported). Specifically, it adds support for: * switching the device between analog and digital modes of operation, * enforcing that only one mode is active at the same time due to hardware limitations. Actual implementation of the analog mode will be provided by the next commit. Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:

committed by
Mauro Carvalho Chehab

parent
65efeca0a6
commit
d525e5c2f1
@@ -2,6 +2,9 @@
|
||||
#ifndef _DVB_USB_CXUSB_H_
|
||||
#define _DVB_USB_CXUSB_H_
|
||||
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
#define DVB_USB_LOG_PREFIX "cxusb"
|
||||
#include "dvb-usb.h"
|
||||
|
||||
@@ -34,6 +37,7 @@
|
||||
|
||||
struct cxusb_state {
|
||||
u8 gpio_write_state[3];
|
||||
bool gpio_write_refresh[3];
|
||||
struct i2c_client *i2c_client_demod;
|
||||
struct i2c_client *i2c_client_tuner;
|
||||
|
||||
@@ -45,4 +49,48 @@ struct cxusb_state {
|
||||
enum fe_status *status);
|
||||
};
|
||||
|
||||
enum cxusb_open_type {
|
||||
CXUSB_OPEN_INIT, CXUSB_OPEN_NONE,
|
||||
CXUSB_OPEN_ANALOG, CXUSB_OPEN_DIGITAL
|
||||
};
|
||||
|
||||
struct cxusb_medion_dev {
|
||||
/* has to be the first one */
|
||||
struct cxusb_state state;
|
||||
|
||||
struct dvb_usb_device *dvbdev;
|
||||
|
||||
enum cxusb_open_type open_type;
|
||||
unsigned int open_ctr;
|
||||
struct mutex open_lock;
|
||||
};
|
||||
|
||||
/* defines for "debug" module parameter */
|
||||
#define CXUSB_DBG_RC BIT(0)
|
||||
#define CXUSB_DBG_I2C BIT(1)
|
||||
#define CXUSB_DBG_MISC BIT(2)
|
||||
|
||||
extern int dvb_usb_cxusb_debug;
|
||||
|
||||
int cxusb_ctrl_msg(struct dvb_usb_device *d,
|
||||
u8 cmd, const u8 *wbuf, int wlen, u8 *rbuf, int rlen);
|
||||
|
||||
static inline int cxusb_medion_analog_init(struct dvb_usb_device *dvbdev)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline int cxusb_medion_register_analog(struct dvb_usb_device *dvbdev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void cxusb_medion_unregister_analog(struct dvb_usb_device *dvbdev)
|
||||
{
|
||||
}
|
||||
|
||||
int cxusb_medion_get(struct dvb_usb_device *dvbdev,
|
||||
enum cxusb_open_type open_type);
|
||||
void cxusb_medion_put(struct dvb_usb_device *dvbdev);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user