18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Abilis Systems Single DVB-T Receiver
48c2ecf20Sopenharmony_ci * Copyright (C) 2008 Pierrick Hascoet <pierrick.hascoet@abilis.com>
58c2ecf20Sopenharmony_ci */
68c2ecf20Sopenharmony_ci#ifndef _AS10X_HANDLE_H
78c2ecf20Sopenharmony_ci#define _AS10X_HANDLE_H
88c2ecf20Sopenharmony_cistruct as10x_bus_adapter_t;
98c2ecf20Sopenharmony_cistruct as102_dev_t;
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include "as10x_cmd.h"
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci/* values for "mode" field */
148c2ecf20Sopenharmony_ci#define REGMODE8	8
158c2ecf20Sopenharmony_ci#define REGMODE16	16
168c2ecf20Sopenharmony_ci#define REGMODE32	32
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_cistruct as102_priv_ops_t {
198c2ecf20Sopenharmony_ci	int (*upload_fw_pkt)(struct as10x_bus_adapter_t *bus_adap,
208c2ecf20Sopenharmony_ci			      unsigned char *buf, int buflen, int swap32);
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci	int (*send_cmd)(struct as10x_bus_adapter_t *bus_adap,
238c2ecf20Sopenharmony_ci			 unsigned char *buf, int buflen);
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci	int (*xfer_cmd)(struct as10x_bus_adapter_t *bus_adap,
268c2ecf20Sopenharmony_ci			 unsigned char *send_buf, int send_buf_len,
278c2ecf20Sopenharmony_ci			 unsigned char *recv_buf, int recv_buf_len);
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci	int (*start_stream)(struct as102_dev_t *dev);
308c2ecf20Sopenharmony_ci	void (*stop_stream)(struct as102_dev_t *dev);
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci	int (*reset_target)(struct as10x_bus_adapter_t *bus_adap);
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci	int (*read_write)(struct as10x_bus_adapter_t *bus_adap, uint8_t mode,
358c2ecf20Sopenharmony_ci			  uint32_t rd_addr, uint16_t rd_len,
368c2ecf20Sopenharmony_ci			  uint32_t wr_addr, uint16_t wr_len);
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci	int (*as102_read_ep2)(struct as10x_bus_adapter_t *bus_adap,
398c2ecf20Sopenharmony_ci			       unsigned char *recv_buf,
408c2ecf20Sopenharmony_ci			       int recv_buf_len);
418c2ecf20Sopenharmony_ci};
428c2ecf20Sopenharmony_ci#endif
43