xref: /linux/drivers/media/usb/as102/as10x_handle.h (revision 58e16d792a6a8c6b750f637a4649967fcac853dc)
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  */
6 #ifndef _AS10X_HANDLE_H
7 #define _AS10X_HANDLE_H
8 struct as10x_bus_adapter_t;
9 struct as102_dev_t;
10 
11 #include "as10x_cmd.h"
12 
13 /* values for "mode" field */
14 #define REGMODE8	8
15 #define REGMODE16	16
16 #define REGMODE32	32
17 
18 struct as102_priv_ops_t {
19 	int (*upload_fw_pkt)(struct as10x_bus_adapter_t *bus_adap,
20 			      unsigned char *buf, int buflen, int swap32);
21 
22 	int (*send_cmd)(struct as10x_bus_adapter_t *bus_adap,
23 			 unsigned char *buf, int buflen);
24 
25 	int (*xfer_cmd)(struct as10x_bus_adapter_t *bus_adap,
26 			 unsigned char *send_buf, int send_buf_len,
27 			 unsigned char *recv_buf, int recv_buf_len);
28 
29 	int (*start_stream)(struct as102_dev_t *dev);
30 	void (*stop_stream)(struct as102_dev_t *dev);
31 
32 	int (*reset_target)(struct as10x_bus_adapter_t *bus_adap);
33 
34 	int (*read_write)(struct as10x_bus_adapter_t *bus_adap, uint8_t mode,
35 			  uint32_t rd_addr, uint16_t rd_len,
36 			  uint32_t wr_addr, uint16_t wr_len);
37 
38 	int (*as102_read_ep2)(struct as10x_bus_adapter_t *bus_adap,
39 			       unsigned char *recv_buf,
40 			       int recv_buf_len);
41 };
42 #endif
43