/* SPDX-License-Identifier: GPL-2.0+ */
/*
 *  aQsi serial driver
 *
 *  Copyright (C) 2022 Sergey Lyakhovich <lyakhovich@yandex.ru>
 *
 *  Based on max310x.c, by Alexander Shiyan <shc_work@mail.ru>
 */

#ifndef AQC_SPI_SERIAL_H
#define AQC_SPI_SERIAL_H
#include <linux/ioctl.h>

#define AQCSSER_IOCTL_BASE 0xACA5A601

struct aqc_spi_ser_pwr_ctrl {
	unsigned char update_rst;
	unsigned char rst_state;
	unsigned char update_pwr;
	unsigned char pwr_state;
};

struct aqc_spi_ser_wt_ctrl {
	unsigned char update_cwt;
	unsigned long cwt;
	unsigned char update_bwt;
	unsigned long bwt;
};

struct aqc_spi_ser_update {
	unsigned long update_size;
	unsigned char *update_buffer;
};

#define AQCSSER_IOCTL_PWR_CTRL                                                 \
	_IOW(AQCSSER_IOCTL_BASE, 0x00, struct aqc_spi_ser_pwr_ctrl)
#define AQCSSER_IOCTL_WT_CTRL                                                  \
	_IOW(AQCSSER_IOCTL_BASE, 0x01, struct aqc_spi_ser_wt_ctrl)
#define AQCSSER_IOCTL_UPDATE                                                   \
	_IOW(AQCSSER_IOCTL_BASE, 0x02, struct aqc_spi_ser_update)

#endif // AQC_SPI_SERIAL_H
