18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef	_CM4040_H_
38c2ecf20Sopenharmony_ci#define	_CM4040_H_
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#define	CM_MAX_DEV		4
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#define	DEVICE_NAME		"cmx"
88c2ecf20Sopenharmony_ci#define	MODULE_NAME		"cm4040_cs"
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#define REG_OFFSET_BULK_OUT      0
118c2ecf20Sopenharmony_ci#define REG_OFFSET_BULK_IN       0
128c2ecf20Sopenharmony_ci#define REG_OFFSET_BUFFER_STATUS 1
138c2ecf20Sopenharmony_ci#define REG_OFFSET_SYNC_CONTROL  2
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#define BSR_BULK_IN_FULL  0x02
168c2ecf20Sopenharmony_ci#define BSR_BULK_OUT_FULL 0x01
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#define SCR_HOST_TO_READER_START 0x80
198c2ecf20Sopenharmony_ci#define SCR_ABORT                0x40
208c2ecf20Sopenharmony_ci#define SCR_EN_NOTIFY            0x20
218c2ecf20Sopenharmony_ci#define SCR_ACK_NOTIFY           0x10
228c2ecf20Sopenharmony_ci#define SCR_READER_TO_HOST_DONE  0x08
238c2ecf20Sopenharmony_ci#define SCR_HOST_TO_READER_DONE  0x04
248c2ecf20Sopenharmony_ci#define SCR_PULSE_INTERRUPT      0x02
258c2ecf20Sopenharmony_ci#define SCR_POWER_DOWN           0x01
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci#define  CMD_PC_TO_RDR_ICCPOWERON       0x62
298c2ecf20Sopenharmony_ci#define  CMD_PC_TO_RDR_GETSLOTSTATUS    0x65
308c2ecf20Sopenharmony_ci#define  CMD_PC_TO_RDR_ICCPOWEROFF      0x63
318c2ecf20Sopenharmony_ci#define  CMD_PC_TO_RDR_SECURE           0x69
328c2ecf20Sopenharmony_ci#define  CMD_PC_TO_RDR_GETPARAMETERS    0x6C
338c2ecf20Sopenharmony_ci#define  CMD_PC_TO_RDR_RESETPARAMETERS  0x6D
348c2ecf20Sopenharmony_ci#define  CMD_PC_TO_RDR_SETPARAMETERS    0x61
358c2ecf20Sopenharmony_ci#define  CMD_PC_TO_RDR_XFRBLOCK         0x6F
368c2ecf20Sopenharmony_ci#define  CMD_PC_TO_RDR_ESCAPE           0x6B
378c2ecf20Sopenharmony_ci#define  CMD_PC_TO_RDR_ICCCLOCK         0x6E
388c2ecf20Sopenharmony_ci#define  CMD_PC_TO_RDR_TEST_SECURE      0x74
398c2ecf20Sopenharmony_ci#define  CMD_PC_TO_RDR_OK_SECURE        0x89
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#define  CMD_RDR_TO_PC_SLOTSTATUS         0x81
438c2ecf20Sopenharmony_ci#define  CMD_RDR_TO_PC_DATABLOCK          0x80
448c2ecf20Sopenharmony_ci#define  CMD_RDR_TO_PC_PARAMETERS         0x82
458c2ecf20Sopenharmony_ci#define  CMD_RDR_TO_PC_ESCAPE             0x83
468c2ecf20Sopenharmony_ci#define  CMD_RDR_TO_PC_OK_SECURE          0x89
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci#endif	/* _CM4040_H_ */
49