Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0+ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Definitions for Belkin USB Serial Adapter Driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *  Copyright (C) 2000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *      William Greathouse (wgreathouse@smva.com)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *  This program is largely derived from work by the linux-usb group
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  *  and associated source files.  Please see the usb/serial files for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  *  individual credits and copyrights.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12)  * See Documentation/usb/usb-serial.rst for more information on using this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)  * driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15)  * 12-Mar-2001 gkh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)  *	Added GoHubs GO-COM232 device id.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)  * 06-Nov-2000 gkh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)  *	Added old Belkin and Peracom device ids, which this driver supports
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  * 12-Oct-2000 William Greathouse
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  *    First cut at supporting Belkin USB Serial Adapter F5U103
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)  *    I did not have a copy of the original work to support this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)  *    adapter, so pardon any stupid mistakes.  All of the information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)  *    I am using to write this driver was acquired by using a modified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)  *    UsbSnoop on Windows2000.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) #ifndef __LINUX_USB_SERIAL_BSA_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #define __LINUX_USB_SERIAL_BSA_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) #define BELKIN_DOCKSTATION_VID	0x050d	/* Vendor Id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) #define BELKIN_DOCKSTATION_PID	0x1203	/* Product Id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) #define BELKIN_SA_VID	0x050d	/* Vendor Id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) #define BELKIN_SA_PID	0x0103	/* Product Id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) #define BELKIN_OLD_VID	0x056c	/* Belkin's "old" vendor id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) #define BELKIN_OLD_PID	0x8007	/* Belkin's "old" single port serial converter's id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) #define PERACOM_VID	0x0565	/* Peracom's vendor id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) #define PERACOM_PID	0x0001	/* Peracom's single port serial converter's id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) #define GOHUBS_VID	0x0921	/* GoHubs vendor id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) #define GOHUBS_PID	0x1000	/* GoHubs single port serial converter's id (identical to the Peracom device) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) #define HANDYLINK_PID	0x1200	/* HandyLink USB's id (identical to the Peracom device) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) /* Vendor Request Interface */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) #define BELKIN_SA_SET_BAUDRATE_REQUEST	0  /* Set baud rate */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) #define BELKIN_SA_SET_STOP_BITS_REQUEST	1  /* Set stop bits (1,2) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) #define BELKIN_SA_SET_DATA_BITS_REQUEST	2  /* Set data bits (5,6,7,8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) #define BELKIN_SA_SET_PARITY_REQUEST	3  /* Set parity (None, Even, Odd) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) #define BELKIN_SA_SET_DTR_REQUEST	10 /* Set DTR state */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) #define BELKIN_SA_SET_RTS_REQUEST	11 /* Set RTS state */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) #define BELKIN_SA_SET_BREAK_REQUEST	12 /* Set BREAK state */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) #define BELKIN_SA_SET_FLOW_CTRL_REQUEST	16 /* Set flow control mode */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) #ifdef WHEN_I_LEARN_THIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) #define BELKIN_SA_SET_MAGIC_REQUEST	17 /* I don't know, possibly flush */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 					   /* (always in Wininit sequence before flow control) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) #define BELKIN_SA_RESET			xx /* Reset the port */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) #define BELKIN_SA_GET_MODEM_STATUS	xx /* Force return of modem status register */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) #define BELKIN_SA_SET_REQUEST_TYPE	0x40
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) #define BELKIN_SA_BAUD(b)		(230400/b)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) #define BELKIN_SA_STOP_BITS(b)		(b-1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) #define BELKIN_SA_DATA_BITS(b)		(b-5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) #define BELKIN_SA_PARITY_NONE		0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) #define BELKIN_SA_PARITY_EVEN		1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) #define BELKIN_SA_PARITY_ODD		2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) #define BELKIN_SA_PARITY_MARK		3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) #define BELKIN_SA_PARITY_SPACE		4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) #define BELKIN_SA_FLOW_NONE		0x0000	/* No flow control */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) #define BELKIN_SA_FLOW_OCTS		0x0001	/* use CTS input to throttle output */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) #define BELKIN_SA_FLOW_ODSR		0x0002	/* use DSR input to throttle output */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) #define BELKIN_SA_FLOW_IDSR		0x0004	/* use DSR input to enable receive */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) #define BELKIN_SA_FLOW_IDTR		0x0008	/* use DTR output for input flow control */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) #define BELKIN_SA_FLOW_IRTS		0x0010	/* use RTS output for input flow control */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) #define BELKIN_SA_FLOW_ORTS		0x0020	/* use RTS to indicate data available to send */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) #define BELKIN_SA_FLOW_ERRSUB		0x0040	/* ???? guess ???? substitute inline errors */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) #define BELKIN_SA_FLOW_OXON		0x0080	/* use XON/XOFF for output flow control */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) #define BELKIN_SA_FLOW_IXON		0x0100	/* use XON/XOFF for input flow control */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)  * It seems that the interrupt pipe is closely modelled after the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96)  * 16550 register layout.  This is probably because the adapter can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97)  * be used in a "DOS" environment to simulate a standard hardware port.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) #define BELKIN_SA_LSR_INDEX		2	/*     Line Status Register */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) #define BELKIN_SA_LSR_RDR		0x01	/* receive data ready */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) #define BELKIN_SA_LSR_OE		0x02	/* overrun error */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) #define BELKIN_SA_LSR_PE		0x04	/* parity error */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) #define BELKIN_SA_LSR_FE		0x08	/* framing error */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) #define BELKIN_SA_LSR_BI		0x10	/* break indicator */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) #define BELKIN_SA_LSR_THE		0x20	/* tx holding register empty */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) #define BELKIN_SA_LSR_TE		0x40	/* transmit register empty */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) #define BELKIN_SA_LSR_ERR		0x80	/* OE | PE | FE | BI */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) #define BELKIN_SA_MSR_INDEX		3	/*     Modem Status Register */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) #define BELKIN_SA_MSR_DCTS		0x01	/* Delta CTS */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) #define BELKIN_SA_MSR_DDSR		0x02	/* Delta DSR */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) #define BELKIN_SA_MSR_DRI		0x04	/* Delta RI */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) #define BELKIN_SA_MSR_DCD		0x08	/* Delta CD */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) #define BELKIN_SA_MSR_CTS		0x10	/* Current CTS */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) #define BELKIN_SA_MSR_DSR		0x20	/* Current DSR */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) #define BELKIN_SA_MSR_RI		0x40	/* Current RI */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) #define BELKIN_SA_MSR_CD		0x80	/* Current CD */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) #endif /* __LINUX_USB_SERIAL_BSA_H */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)