|
|
|
#ifndef __VXB_SM2130_SPI_DEV_H
|
|
|
|
#define __VXB_SM2130_SPI_DEV_H
|
|
|
|
|
|
|
|
#define SPI_DEV_SM2130 "SM2130"
|
|
|
|
|
|
|
|
#define SM2130_DEV_NAME "/sm2130"
|
|
|
|
|
|
|
|
#define __SM2130__IOC_MAGIC ('S' << 16)
|
|
|
|
|
|
|
|
#define XFER_TYPE_WR (1)
|
|
|
|
#define XFER_TYPE_RD (2)
|
|
|
|
|
|
|
|
#define FIOC_SM2130_WR (__SM2130__IOC_MAGIC | XFER_TYPE_WR)
|
|
|
|
#define FIOC_SM2130_RD (__SM2130__IOC_MAGIC | XFER_TYPE_RD)
|
|
|
|
#define FIOC_SM2130_MEM (__SM2130__IOC_MAGIC | (XFER_TYPE_WR + XFER_TYPE_RD))
|
|
|
|
|
|
|
|
struct sm2130_xfer {
|
|
|
|
UINT8 reg;
|
|
|
|
UINT16 val;
|
|
|
|
};
|
|
|
|
typedef struct sm2130_xfer SM2130_XFER;
|
|
|
|
|
|
|
|
struct sm2130_xfer_mem {
|
|
|
|
int type;
|
|
|
|
int count;
|
|
|
|
UINT8 *regbuf;
|
|
|
|
UINT16 *membuf;
|
|
|
|
};
|
|
|
|
typedef struct sm2130_xfer_mem SM2130_MEM_XFER;
|
|
|
|
|
|
|
|
typedef struct _spi_1553b_drv_ctrl {
|
|
|
|
VXB_DEVICE_ID pDev;
|
|
|
|
|
|
|
|
int cs;
|
|
|
|
int mode;
|
|
|
|
char name[16];
|
|
|
|
unsigned int freq;
|
|
|
|
|
|
|
|
const char *devName;
|
|
|
|
|
|
|
|
int refcount;
|
|
|
|
|
|
|
|
void *devHandle;
|
|
|
|
int (*reqIsr)(void *data, void (*isr)(void *data));
|
|
|
|
|
|
|
|
INT32 (*read)(VXB_DEVICE_ID pDev, UINT8 cmd);
|
|
|
|
STATUS (*write)(VXB_DEVICE_ID pDev, UINT8 cmd, UINT16 var);
|
|
|
|
|
|
|
|
SEM_ID muteSem; /* operation semaphore */
|
|
|
|
VXB_SPI_MAST_SPEC *specialInfo;
|
|
|
|
} SM2130_SPI_DEV;
|
|
|
|
|
|
|
|
#endif
|