#ifndef _AX88796C_SPI_H
#define _AX88796C_SPI_H
#include <linux/spi/spi.h>
#include <linux/types.h>
#define AX_SPICMD_WRITE_TXQ …
#define AX_SPICMD_READ_REG …
#define AX_SPICMD_READ_STATUS …
#define AX_SPICMD_READ_RXQ …
#define AX_SPICMD_BIDIR_WRQ …
#define AX_SPICMD_WRITE_REG …
#define AX_SPICMD_EXIT_PWD …
extern const u8 ax88796c_rx_cmd_buf[];
extern const u8 ax88796c_tx_cmd_buf[];
struct axspi_data { … };
struct spi_status { … };
int axspi_read_rxq(struct axspi_data *ax_spi, void *data, int len);
int axspi_write_txq(const struct axspi_data *ax_spi, void *data, int len);
u16 axspi_read_reg(struct axspi_data *ax_spi, u8 reg);
int axspi_write_reg(struct axspi_data *ax_spi, u8 reg, u16 value);
int axspi_read_status(struct axspi_data *ax_spi, struct spi_status *status);
int axspi_wakeup(struct axspi_data *ax_spi);
static inline u16 AX_READ(struct axspi_data *ax_spi, u8 offset)
{ … }
static inline int AX_WRITE(struct axspi_data *ax_spi, u16 value, u8 offset)
{ … }
static inline int AX_READ_STATUS(struct axspi_data *ax_spi,
struct spi_status *status)
{ … }
static inline int AX_WAKEUP(struct axspi_data *ax_spi)
{ … }
#endif