xref: /linux/drivers/usb/serial/cypress_m8.h (revision 4b4193256c8d3bc3a5397b5cd9494c2ad386317d)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
21da177e4SLinus Torvalds #ifndef CYPRESS_M8_H
31da177e4SLinus Torvalds #define CYPRESS_M8_H
41da177e4SLinus Torvalds 
5995834ebSGreg Kroah-Hartman /*
6995834ebSGreg Kroah-Hartman  * definitions and function prototypes used for the cypress USB to Serial
7995834ebSGreg Kroah-Hartman  * controller
8995834ebSGreg Kroah-Hartman  */
91da177e4SLinus Torvalds 
10995834ebSGreg Kroah-Hartman /*
11995834ebSGreg Kroah-Hartman  * For sending our feature buffer - controlling serial communication states.
12995834ebSGreg Kroah-Hartman  * Linux HID has no support for serial devices so we do this through the driver
13995834ebSGreg Kroah-Hartman  */
141da177e4SLinus Torvalds #define HID_REQ_GET_REPORT	0x01
151da177e4SLinus Torvalds #define HID_REQ_SET_REPORT	0x09
161da177e4SLinus Torvalds 
171da177e4SLinus Torvalds /* List other cypress USB to Serial devices here, and add them to the id_table */
181da177e4SLinus Torvalds 
191da177e4SLinus Torvalds /* DeLorme Earthmate USB - a GPS device */
201da177e4SLinus Torvalds #define VENDOR_ID_DELORME		0x1163
211da177e4SLinus Torvalds #define PRODUCT_ID_EARTHMATEUSB		0x0100
2225b6f08eSLonnie Mendez #define PRODUCT_ID_EARTHMATEUSB_LT20	0x0200
231da177e4SLinus Torvalds 
241da177e4SLinus Torvalds /* Cypress HID->COM RS232 Adapter */
251da177e4SLinus Torvalds #define VENDOR_ID_CYPRESS		0x04b4
261da177e4SLinus Torvalds #define PRODUCT_ID_CYPHIDCOM		0x5500
27a5c44e29SLonnie Mendez 
28*5c45d04cSJames Hilliard /* Simply Automated HID->COM UPB PIM (using Cypress PID 0x5500) */
29*5c45d04cSJames Hilliard #define VENDOR_ID_SAI			0x17dd
30*5c45d04cSJames Hilliard 
316529591eSRobert Butora /* FRWD Dongle - a GPS sports watch */
326529591eSRobert Butora #define VENDOR_ID_FRWD			0x6737
336529591eSRobert Butora #define PRODUCT_ID_CYPHIDCOM_FRWD	0x0001
346529591eSRobert Butora 
356f6f06eeSDmitry Shapin /* Powercom UPS, chip CY7C63723 */
366f6f06eeSDmitry Shapin #define VENDOR_ID_POWERCOM		0x0d9f
376f6f06eeSDmitry Shapin #define PRODUCT_ID_UPS			0x0002
386f6f06eeSDmitry Shapin 
39a5c44e29SLonnie Mendez /* Nokia CA-42 USB to serial cable */
40a5c44e29SLonnie Mendez #define VENDOR_ID_DAZZLE		0x07d0
41a5c44e29SLonnie Mendez #define PRODUCT_ID_CA42			0x4101
421da177e4SLinus Torvalds /* End of device listing */
431da177e4SLinus Torvalds 
441da177e4SLinus Torvalds /* Used for setting / requesting serial line settings */
451da177e4SLinus Torvalds #define CYPRESS_SET_CONFIG	0x01
461da177e4SLinus Torvalds #define CYPRESS_GET_CONFIG	0x02
471da177e4SLinus Torvalds 
481da177e4SLinus Torvalds /* Used for throttle control */
491da177e4SLinus Torvalds #define THROTTLED		0x1
501da177e4SLinus Torvalds #define ACTUALLY_THROTTLED	0x2
511da177e4SLinus Torvalds 
52995834ebSGreg Kroah-Hartman /*
53995834ebSGreg Kroah-Hartman  * chiptypes - used in case firmware differs from the generic form ... offering
541da177e4SLinus Torvalds  * different baud speeds/etc.
551da177e4SLinus Torvalds  */
561da177e4SLinus Torvalds #define CT_EARTHMATE	0x01
571da177e4SLinus Torvalds #define CT_CYPHIDCOM	0x02
58a5c44e29SLonnie Mendez #define CT_CA42V2	0x03
591da177e4SLinus Torvalds #define CT_GENERIC	0x0F
601da177e4SLinus Torvalds /* End of chiptype definitions */
611da177e4SLinus Torvalds 
622534be34SJohan Hovold /*
632534be34SJohan Hovold  * RS-232 serial data communication protocol definitions.
642534be34SJohan Hovold  *
652534be34SJohan Hovold  * These are sent / read at byte 0 of the input/output hid reports.
662534be34SJohan Hovold  * You can find these values defined in the CY4601 USB to Serial design notes.
672534be34SJohan Hovold  */
681da177e4SLinus Torvalds 
692534be34SJohan Hovold #define CONTROL_DTR	0x20	/* data terminal ready */
702534be34SJohan Hovold #define CONTROL_RTS	0x10	/* request to send */
712534be34SJohan Hovold #define CONTROL_RESET	0x08	/* sent with output report */
722534be34SJohan Hovold 
737603381eSJohan Hovold #define UART_MSR_MASK	0xf0
742534be34SJohan Hovold #define UART_RI		0x80	/* ring indicator */
752534be34SJohan Hovold #define UART_CD		0x40	/* carrier detect */
762534be34SJohan Hovold #define UART_DSR	0x20	/* data set ready */
772534be34SJohan Hovold #define UART_CTS	0x10	/* clear to send */
782534be34SJohan Hovold #define CYP_ERROR	0x08	/* received from input report */
791da177e4SLinus Torvalds 
801da177e4SLinus Torvalds /* End of RS-232 protocol definitions */
811da177e4SLinus Torvalds 
821da177e4SLinus Torvalds #endif /* CYPRESS_M8_H */
83