18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#define SUSBCRequest_SetBaudRateParityAndStopBits 1 38c2ecf20Sopenharmony_ci#define SUSBCR_SBR_MASK 0xFF00 48c2ecf20Sopenharmony_ci#define SUSBCR_SBR_1200 0x0100 58c2ecf20Sopenharmony_ci#define SUSBCR_SBR_9600 0x0200 68c2ecf20Sopenharmony_ci#define SUSBCR_SBR_19200 0x0400 78c2ecf20Sopenharmony_ci#define SUSBCR_SBR_28800 0x0800 88c2ecf20Sopenharmony_ci#define SUSBCR_SBR_38400 0x1000 98c2ecf20Sopenharmony_ci#define SUSBCR_SBR_57600 0x2000 108c2ecf20Sopenharmony_ci#define SUSBCR_SBR_115200 0x4000 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#define SUSBCR_SPASB_MASK 0x0070 138c2ecf20Sopenharmony_ci#define SUSBCR_SPASB_NoParity 0x0010 148c2ecf20Sopenharmony_ci#define SUSBCR_SPASB_OddParity 0x0020 158c2ecf20Sopenharmony_ci#define SUSBCR_SPASB_EvenParity 0x0040 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci#define SUSBCR_SPASB_STPMASK 0x0003 188c2ecf20Sopenharmony_ci#define SUSBCR_SPASB_1StopBit 0x0001 198c2ecf20Sopenharmony_ci#define SUSBCR_SPASB_2StopBits 0x0002 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci#define SUSBCRequest_SetStatusLinesOrQueues 2 228c2ecf20Sopenharmony_ci#define SUSBCR_SSL_SETRTS 0x0001 238c2ecf20Sopenharmony_ci#define SUSBCR_SSL_CLRRTS 0x0002 248c2ecf20Sopenharmony_ci#define SUSBCR_SSL_SETDTR 0x0004 258c2ecf20Sopenharmony_ci#define SUSBCR_SSL_CLRDTR 0x0010 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci/* Kill the pending/current writes to the comm port. */ 288c2ecf20Sopenharmony_ci#define SUSBCR_SSL_PURGE_TXABORT 0x0100 298c2ecf20Sopenharmony_ci/* Kill the pending/current reads to the comm port. */ 308c2ecf20Sopenharmony_ci#define SUSBCR_SSL_PURGE_RXABORT 0x0200 318c2ecf20Sopenharmony_ci/* Kill the transmit queue if there. */ 328c2ecf20Sopenharmony_ci#define SUSBCR_SSL_PURGE_TXCLEAR 0x0400 338c2ecf20Sopenharmony_ci/* Kill the typeahead buffer if there. */ 348c2ecf20Sopenharmony_ci#define SUSBCR_SSL_PURGE_RXCLEAR 0x0800 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci#define SUSBCRequest_GetStatusLineState 4 378c2ecf20Sopenharmony_ci/* Any Character received */ 388c2ecf20Sopenharmony_ci#define SUSBCR_GSL_RXCHAR 0x0001 398c2ecf20Sopenharmony_ci/* Transmitt Queue Empty */ 408c2ecf20Sopenharmony_ci#define SUSBCR_GSL_TXEMPTY 0x0004 418c2ecf20Sopenharmony_ci/* CTS changed state */ 428c2ecf20Sopenharmony_ci#define SUSBCR_GSL_CTS 0x0008 438c2ecf20Sopenharmony_ci/* DSR changed state */ 448c2ecf20Sopenharmony_ci#define SUSBCR_GSL_DSR 0x0010 458c2ecf20Sopenharmony_ci/* RLSD changed state */ 468c2ecf20Sopenharmony_ci#define SUSBCR_GSL_RLSD 0x0020 478c2ecf20Sopenharmony_ci/* BREAK received */ 488c2ecf20Sopenharmony_ci#define SUSBCR_GSL_BREAK 0x0040 498c2ecf20Sopenharmony_ci/* Line status error occurred */ 508c2ecf20Sopenharmony_ci#define SUSBCR_GSL_ERR 0x0080 518c2ecf20Sopenharmony_ci/* Ring signal detected */ 528c2ecf20Sopenharmony_ci#define SUSBCR_GSL_RING 0x0100 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_ci#define SUSBCRequest_Misc 8 558c2ecf20Sopenharmony_ci/* use a predefined reset sequence */ 568c2ecf20Sopenharmony_ci#define SUSBCR_MSC_ResetReader 0x0001 578c2ecf20Sopenharmony_ci/* use a predefined sequence to reset the internal queues */ 588c2ecf20Sopenharmony_ci#define SUSBCR_MSC_ResetAllQueues 0x0002 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci#define SUSBCRequest_GetMisc 0x10 618c2ecf20Sopenharmony_ci 628c2ecf20Sopenharmony_ci/* 638c2ecf20Sopenharmony_ci * get the firmware version from device, coded like this 0xHHLLBBPP with 648c2ecf20Sopenharmony_ci * HH = Firmware Version High Byte 658c2ecf20Sopenharmony_ci * LL = Firmware Version Low Byte 668c2ecf20Sopenharmony_ci * BB = Build Number 678c2ecf20Sopenharmony_ci * PP = Further Attributes 688c2ecf20Sopenharmony_ci */ 698c2ecf20Sopenharmony_ci#define SUSBCR_MSC_GetFWVersion 0x0001 708c2ecf20Sopenharmony_ci 718c2ecf20Sopenharmony_ci/* 728c2ecf20Sopenharmony_ci * get the hardware version from device coded like this 0xHHLLPPRR with 738c2ecf20Sopenharmony_ci * HH = Software Version High Byte 748c2ecf20Sopenharmony_ci * LL = Software Version Low Byte 758c2ecf20Sopenharmony_ci * PP = Further Attributes 768c2ecf20Sopenharmony_ci * RR = Reserved for the hardware ID 778c2ecf20Sopenharmony_ci */ 788c2ecf20Sopenharmony_ci#define SUSBCR_MSC_GetHWVersion 0x0002 79