162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#define SUSBCRequest_SetBaudRateParityAndStopBits       1
362306a36Sopenharmony_ci#define SUSBCR_SBR_MASK				0xFF00
462306a36Sopenharmony_ci#define SUSBCR_SBR_1200				0x0100
562306a36Sopenharmony_ci#define SUSBCR_SBR_9600				0x0200
662306a36Sopenharmony_ci#define SUSBCR_SBR_19200			0x0400
762306a36Sopenharmony_ci#define SUSBCR_SBR_28800			0x0800
862306a36Sopenharmony_ci#define SUSBCR_SBR_38400			0x1000
962306a36Sopenharmony_ci#define SUSBCR_SBR_57600			0x2000
1062306a36Sopenharmony_ci#define SUSBCR_SBR_115200			0x4000
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#define SUSBCR_SPASB_MASK			0x0070
1362306a36Sopenharmony_ci#define SUSBCR_SPASB_NoParity			0x0010
1462306a36Sopenharmony_ci#define SUSBCR_SPASB_OddParity			0x0020
1562306a36Sopenharmony_ci#define SUSBCR_SPASB_EvenParity			0x0040
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci#define SUSBCR_SPASB_STPMASK			0x0003
1862306a36Sopenharmony_ci#define SUSBCR_SPASB_1StopBit			0x0001
1962306a36Sopenharmony_ci#define SUSBCR_SPASB_2StopBits			0x0002
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci#define SUSBCRequest_SetStatusLinesOrQueues	2
2262306a36Sopenharmony_ci#define SUSBCR_SSL_SETRTS			0x0001
2362306a36Sopenharmony_ci#define SUSBCR_SSL_CLRRTS			0x0002
2462306a36Sopenharmony_ci#define SUSBCR_SSL_SETDTR			0x0004
2562306a36Sopenharmony_ci#define SUSBCR_SSL_CLRDTR			0x0010
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci/* Kill the pending/current writes to the comm port. */
2862306a36Sopenharmony_ci#define SUSBCR_SSL_PURGE_TXABORT		0x0100
2962306a36Sopenharmony_ci/* Kill the pending/current reads to the comm port. */
3062306a36Sopenharmony_ci#define SUSBCR_SSL_PURGE_RXABORT		0x0200
3162306a36Sopenharmony_ci/* Kill the transmit queue if there. */
3262306a36Sopenharmony_ci#define SUSBCR_SSL_PURGE_TXCLEAR		0x0400
3362306a36Sopenharmony_ci/* Kill the typeahead buffer if there. */
3462306a36Sopenharmony_ci#define SUSBCR_SSL_PURGE_RXCLEAR		0x0800
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci#define SUSBCRequest_GetStatusLineState		4
3762306a36Sopenharmony_ci/* Any Character received */
3862306a36Sopenharmony_ci#define SUSBCR_GSL_RXCHAR			0x0001
3962306a36Sopenharmony_ci/* Transmitt Queue Empty */
4062306a36Sopenharmony_ci#define SUSBCR_GSL_TXEMPTY			0x0004
4162306a36Sopenharmony_ci/* CTS changed state */
4262306a36Sopenharmony_ci#define SUSBCR_GSL_CTS				0x0008
4362306a36Sopenharmony_ci/* DSR changed state */
4462306a36Sopenharmony_ci#define SUSBCR_GSL_DSR				0x0010
4562306a36Sopenharmony_ci/* RLSD changed state */
4662306a36Sopenharmony_ci#define SUSBCR_GSL_RLSD				0x0020
4762306a36Sopenharmony_ci/* BREAK received */
4862306a36Sopenharmony_ci#define SUSBCR_GSL_BREAK			0x0040
4962306a36Sopenharmony_ci/* Line status error occurred */
5062306a36Sopenharmony_ci#define SUSBCR_GSL_ERR				0x0080
5162306a36Sopenharmony_ci/* Ring signal detected */
5262306a36Sopenharmony_ci#define SUSBCR_GSL_RING				0x0100
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ci#define SUSBCRequest_Misc			8
5562306a36Sopenharmony_ci/* use a predefined reset sequence */
5662306a36Sopenharmony_ci#define SUSBCR_MSC_ResetReader			0x0001
5762306a36Sopenharmony_ci/* use a predefined sequence to reset the internal queues */
5862306a36Sopenharmony_ci#define SUSBCR_MSC_ResetAllQueues		0x0002
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ci#define SUSBCRequest_GetMisc			0x10
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci/*
6362306a36Sopenharmony_ci * get the firmware version from device, coded like this 0xHHLLBBPP with
6462306a36Sopenharmony_ci * HH = Firmware Version High Byte
6562306a36Sopenharmony_ci * LL = Firmware Version Low Byte
6662306a36Sopenharmony_ci * BB = Build Number
6762306a36Sopenharmony_ci * PP = Further Attributes
6862306a36Sopenharmony_ci */
6962306a36Sopenharmony_ci#define SUSBCR_MSC_GetFWVersion			0x0001
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci/*
7262306a36Sopenharmony_ci * get the hardware version from device coded like this 0xHHLLPPRR with
7362306a36Sopenharmony_ci * HH = Software Version High Byte
7462306a36Sopenharmony_ci * LL = Software Version Low Byte
7562306a36Sopenharmony_ci * PP = Further Attributes
7662306a36Sopenharmony_ci * RR = Reserved for the hardware ID
7762306a36Sopenharmony_ci */
7862306a36Sopenharmony_ci#define SUSBCR_MSC_GetHWVersion			0x0002
79