18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef CYPRESS_M8_H
38c2ecf20Sopenharmony_ci#define CYPRESS_M8_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci/*
68c2ecf20Sopenharmony_ci * definitions and function prototypes used for the cypress USB to Serial
78c2ecf20Sopenharmony_ci * controller
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci/*
118c2ecf20Sopenharmony_ci * For sending our feature buffer - controlling serial communication states.
128c2ecf20Sopenharmony_ci * Linux HID has no support for serial devices so we do this through the driver
138c2ecf20Sopenharmony_ci */
148c2ecf20Sopenharmony_ci#define HID_REQ_GET_REPORT	0x01
158c2ecf20Sopenharmony_ci#define HID_REQ_SET_REPORT	0x09
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci/* List other cypress USB to Serial devices here, and add them to the id_table */
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci/* DeLorme Earthmate USB - a GPS device */
208c2ecf20Sopenharmony_ci#define VENDOR_ID_DELORME		0x1163
218c2ecf20Sopenharmony_ci#define PRODUCT_ID_EARTHMATEUSB		0x0100
228c2ecf20Sopenharmony_ci#define PRODUCT_ID_EARTHMATEUSB_LT20	0x0200
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci/* Cypress HID->COM RS232 Adapter */
258c2ecf20Sopenharmony_ci#define VENDOR_ID_CYPRESS		0x04b4
268c2ecf20Sopenharmony_ci#define PRODUCT_ID_CYPHIDCOM		0x5500
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci/* Simply Automated HID->COM UPB PIM (using Cypress PID 0x5500) */
298c2ecf20Sopenharmony_ci#define VENDOR_ID_SAI			0x17dd
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci/* FRWD Dongle - a GPS sports watch */
328c2ecf20Sopenharmony_ci#define VENDOR_ID_FRWD			0x6737
338c2ecf20Sopenharmony_ci#define PRODUCT_ID_CYPHIDCOM_FRWD	0x0001
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci/* Powercom UPS, chip CY7C63723 */
368c2ecf20Sopenharmony_ci#define VENDOR_ID_POWERCOM		0x0d9f
378c2ecf20Sopenharmony_ci#define PRODUCT_ID_UPS			0x0002
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci/* Nokia CA-42 USB to serial cable */
408c2ecf20Sopenharmony_ci#define VENDOR_ID_DAZZLE		0x07d0
418c2ecf20Sopenharmony_ci#define PRODUCT_ID_CA42			0x4101
428c2ecf20Sopenharmony_ci/* End of device listing */
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci/* Used for setting / requesting serial line settings */
458c2ecf20Sopenharmony_ci#define CYPRESS_SET_CONFIG	0x01
468c2ecf20Sopenharmony_ci#define CYPRESS_GET_CONFIG	0x02
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci/* Used for throttle control */
498c2ecf20Sopenharmony_ci#define THROTTLED		0x1
508c2ecf20Sopenharmony_ci#define ACTUALLY_THROTTLED	0x2
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci/*
538c2ecf20Sopenharmony_ci * chiptypes - used in case firmware differs from the generic form ... offering
548c2ecf20Sopenharmony_ci * different baud speeds/etc.
558c2ecf20Sopenharmony_ci */
568c2ecf20Sopenharmony_ci#define CT_EARTHMATE	0x01
578c2ecf20Sopenharmony_ci#define CT_CYPHIDCOM	0x02
588c2ecf20Sopenharmony_ci#define CT_CA42V2	0x03
598c2ecf20Sopenharmony_ci#define CT_GENERIC	0x0F
608c2ecf20Sopenharmony_ci/* End of chiptype definitions */
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci/*
638c2ecf20Sopenharmony_ci * RS-232 serial data communication protocol definitions.
648c2ecf20Sopenharmony_ci *
658c2ecf20Sopenharmony_ci * These are sent / read at byte 0 of the input/output hid reports.
668c2ecf20Sopenharmony_ci * You can find these values defined in the CY4601 USB to Serial design notes.
678c2ecf20Sopenharmony_ci */
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci#define CONTROL_DTR	0x20	/* data terminal ready */
708c2ecf20Sopenharmony_ci#define CONTROL_RTS	0x10	/* request to send */
718c2ecf20Sopenharmony_ci#define CONTROL_RESET	0x08	/* sent with output report */
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci#define UART_MSR_MASK	0xf0
748c2ecf20Sopenharmony_ci#define UART_RI		0x80	/* ring indicator */
758c2ecf20Sopenharmony_ci#define UART_CD		0x40	/* carrier detect */
768c2ecf20Sopenharmony_ci#define UART_DSR	0x20	/* data set ready */
778c2ecf20Sopenharmony_ci#define UART_CTS	0x10	/* clear to send */
788c2ecf20Sopenharmony_ci#define CYP_ERROR	0x08	/* received from input report */
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci/* End of RS-232 protocol definitions */
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci#endif /* CYPRESS_M8_H */
83