2011-10-31 23:24:39 +08:00
|
|
|
/*
|
|
|
|
* Abilis Systems Single DVB-T Receiver
|
|
|
|
* Copyright (C) 2008 Pierrick Hascoet <pierrick.hascoet@abilis.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*/
|
|
|
|
|
2014-08-13 05:50:22 +08:00
|
|
|
#ifndef _AS102_DRV_H
|
|
|
|
#define _AS102_DRV_H
|
2011-10-31 23:24:39 +08:00
|
|
|
#include <linux/usb.h>
|
2017-12-29 02:03:51 +08:00
|
|
|
#include <media/dvb_demux.h>
|
|
|
|
#include <media/dvb_frontend.h>
|
|
|
|
#include <media/dmxdev.h>
|
2014-08-13 05:50:22 +08:00
|
|
|
#include "as10x_handle.h"
|
2011-11-07 03:31:40 +08:00
|
|
|
#include "as10x_cmd.h"
|
|
|
|
#include "as102_usb_drv.h"
|
2011-10-31 23:24:39 +08:00
|
|
|
|
|
|
|
#define DRIVER_FULL_NAME "Abilis Systems as10x usb driver"
|
|
|
|
#define DRIVER_NAME "as10x_usb"
|
|
|
|
|
2011-11-17 10:17:03 +08:00
|
|
|
#define debug as102_debug
|
2011-11-07 03:31:40 +08:00
|
|
|
extern struct usb_driver as102_usb_driver;
|
2011-11-07 03:31:48 +08:00
|
|
|
extern int elna_enable;
|
2011-10-31 23:24:39 +08:00
|
|
|
|
|
|
|
#define AS102_DEVICE_MAJOR 192
|
|
|
|
|
|
|
|
#define AS102_USB_BUF_SIZE 512
|
|
|
|
#define MAX_STREAM_URB 32
|
|
|
|
|
2011-11-07 03:31:50 +08:00
|
|
|
struct as10x_bus_adapter_t {
|
2011-10-31 23:24:39 +08:00
|
|
|
struct usb_device *usb_dev;
|
|
|
|
/* bus token lock */
|
|
|
|
struct mutex lock;
|
|
|
|
/* low level interface for bus adapter */
|
|
|
|
union as10x_bus_token_t {
|
|
|
|
/* usb token */
|
|
|
|
struct as10x_usb_token_cmd_t usb;
|
|
|
|
} token;
|
|
|
|
|
|
|
|
/* token cmd xfer id */
|
|
|
|
uint16_t cmd_xid;
|
|
|
|
|
|
|
|
/* as10x command and response for dvb interface*/
|
|
|
|
struct as10x_cmd_t *cmd, *rsp;
|
|
|
|
|
|
|
|
/* bus adapter private ops callback */
|
2015-12-06 23:51:38 +08:00
|
|
|
const struct as102_priv_ops_t *ops;
|
2011-10-31 23:24:39 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct as102_dev_t {
|
2011-10-31 23:24:48 +08:00
|
|
|
const char *name;
|
2011-11-07 03:31:50 +08:00
|
|
|
struct as10x_bus_adapter_t bus_adap;
|
2011-10-31 23:24:39 +08:00
|
|
|
struct list_head device_entry;
|
|
|
|
struct kref kref;
|
2012-03-06 20:47:46 +08:00
|
|
|
uint8_t elna_cfg;
|
2011-10-31 23:24:39 +08:00
|
|
|
|
|
|
|
struct dvb_adapter dvb_adap;
|
2014-08-13 05:50:19 +08:00
|
|
|
struct dvb_frontend *dvb_fe;
|
2011-10-31 23:24:39 +08:00
|
|
|
struct dvb_demux dvb_dmx;
|
|
|
|
struct dmxdev dvb_dmxdev;
|
|
|
|
|
|
|
|
/* timer handle to trig ts stream download */
|
|
|
|
struct timer_list timer_handle;
|
|
|
|
|
|
|
|
struct mutex sem;
|
|
|
|
dma_addr_t dma_addr;
|
|
|
|
void *stream;
|
|
|
|
int streaming;
|
|
|
|
struct urb *stream_urb[MAX_STREAM_URB];
|
|
|
|
};
|
|
|
|
|
|
|
|
int as102_dvb_register(struct as102_dev_t *dev);
|
|
|
|
void as102_dvb_unregister(struct as102_dev_t *dev);
|
|
|
|
|
2014-09-24 20:59:02 +08:00
|
|
|
#endif
|