Merge tag 'regmap-fix-v5.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux/fpc-iii.git] / drivers / media / usb / as102 / as102_drv.h
blob4342c7ce340780a4045bbabe5eb5e43ff56186d9
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Abilis Systems Single DVB-T Receiver
4 * Copyright (C) 2008 Pierrick Hascoet <pierrick.hascoet@abilis.com>
5 */
7 #ifndef _AS102_DRV_H
8 #define _AS102_DRV_H
9 #include <linux/usb.h>
10 #include <media/dvb_demux.h>
11 #include <media/dvb_frontend.h>
12 #include <media/dmxdev.h>
13 #include "as10x_handle.h"
14 #include "as10x_cmd.h"
15 #include "as102_usb_drv.h"
17 #define DRIVER_FULL_NAME "Abilis Systems as10x usb driver"
18 #define DRIVER_NAME "as10x_usb"
20 #define debug as102_debug
21 extern struct usb_driver as102_usb_driver;
22 extern int elna_enable;
24 #define AS102_DEVICE_MAJOR 192
26 #define AS102_USB_BUF_SIZE 512
27 #define MAX_STREAM_URB 32
29 struct as10x_bus_adapter_t {
30 struct usb_device *usb_dev;
31 /* bus token lock */
32 struct mutex lock;
33 /* low level interface for bus adapter */
34 union as10x_bus_token_t {
35 /* usb token */
36 struct as10x_usb_token_cmd_t usb;
37 } token;
39 /* token cmd xfer id */
40 uint16_t cmd_xid;
42 /* as10x command and response for dvb interface*/
43 struct as10x_cmd_t *cmd, *rsp;
45 /* bus adapter private ops callback */
46 const struct as102_priv_ops_t *ops;
49 struct as102_dev_t {
50 const char *name;
51 struct as10x_bus_adapter_t bus_adap;
52 struct list_head device_entry;
53 struct kref kref;
54 uint8_t elna_cfg;
56 struct dvb_adapter dvb_adap;
57 struct dvb_frontend *dvb_fe;
58 struct dvb_demux dvb_dmx;
59 struct dmxdev dvb_dmxdev;
61 /* timer handle to trig ts stream download */
62 struct timer_list timer_handle;
64 struct mutex sem;
65 dma_addr_t dma_addr;
66 void *stream;
67 int streaming;
68 struct urb *stream_urb[MAX_STREAM_URB];
71 int as102_dvb_register(struct as102_dev_t *dev);
72 void as102_dvb_unregister(struct as102_dev_t *dev);
74 #endif