162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef CYPRESS_M8_H
362306a36Sopenharmony_ci#define CYPRESS_M8_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci/*
662306a36Sopenharmony_ci * definitions and function prototypes used for the cypress USB to Serial
762306a36Sopenharmony_ci * controller
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci/*
1162306a36Sopenharmony_ci * For sending our feature buffer - controlling serial communication states.
1262306a36Sopenharmony_ci * Linux HID has no support for serial devices so we do this through the driver
1362306a36Sopenharmony_ci */
1462306a36Sopenharmony_ci#define HID_REQ_GET_REPORT	0x01
1562306a36Sopenharmony_ci#define HID_REQ_SET_REPORT	0x09
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci/* List other cypress USB to Serial devices here, and add them to the id_table */
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci/* DeLorme Earthmate USB - a GPS device */
2062306a36Sopenharmony_ci#define VENDOR_ID_DELORME		0x1163
2162306a36Sopenharmony_ci#define PRODUCT_ID_EARTHMATEUSB		0x0100
2262306a36Sopenharmony_ci#define PRODUCT_ID_EARTHMATEUSB_LT20	0x0200
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci/* Cypress HID->COM RS232 Adapter */
2562306a36Sopenharmony_ci#define VENDOR_ID_CYPRESS		0x04b4
2662306a36Sopenharmony_ci#define PRODUCT_ID_CYPHIDCOM		0x5500
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci/* Simply Automated HID->COM UPB PIM (using Cypress PID 0x5500) */
2962306a36Sopenharmony_ci#define VENDOR_ID_SAI			0x17dd
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci/* FRWD Dongle - a GPS sports watch */
3262306a36Sopenharmony_ci#define VENDOR_ID_FRWD			0x6737
3362306a36Sopenharmony_ci#define PRODUCT_ID_CYPHIDCOM_FRWD	0x0001
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci/* Powercom UPS, chip CY7C63723 */
3662306a36Sopenharmony_ci#define VENDOR_ID_POWERCOM		0x0d9f
3762306a36Sopenharmony_ci#define PRODUCT_ID_UPS			0x0002
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci/* Nokia CA-42 USB to serial cable */
4062306a36Sopenharmony_ci#define VENDOR_ID_DAZZLE		0x07d0
4162306a36Sopenharmony_ci#define PRODUCT_ID_CA42			0x4101
4262306a36Sopenharmony_ci/* End of device listing */
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci/* Used for setting / requesting serial line settings */
4562306a36Sopenharmony_ci#define CYPRESS_SET_CONFIG	0x01
4662306a36Sopenharmony_ci#define CYPRESS_GET_CONFIG	0x02
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci/* Used for throttle control */
4962306a36Sopenharmony_ci#define THROTTLED		0x1
5062306a36Sopenharmony_ci#define ACTUALLY_THROTTLED	0x2
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci/*
5362306a36Sopenharmony_ci * chiptypes - used in case firmware differs from the generic form ... offering
5462306a36Sopenharmony_ci * different baud speeds/etc.
5562306a36Sopenharmony_ci */
5662306a36Sopenharmony_ci#define CT_EARTHMATE	0x01
5762306a36Sopenharmony_ci#define CT_CYPHIDCOM	0x02
5862306a36Sopenharmony_ci#define CT_CA42V2	0x03
5962306a36Sopenharmony_ci#define CT_GENERIC	0x0F
6062306a36Sopenharmony_ci/* End of chiptype definitions */
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci/*
6362306a36Sopenharmony_ci * RS-232 serial data communication protocol definitions.
6462306a36Sopenharmony_ci *
6562306a36Sopenharmony_ci * These are sent / read at byte 0 of the input/output hid reports.
6662306a36Sopenharmony_ci * You can find these values defined in the CY4601 USB to Serial design notes.
6762306a36Sopenharmony_ci */
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ci#define CONTROL_DTR	0x20	/* data terminal ready */
7062306a36Sopenharmony_ci#define CONTROL_RTS	0x10	/* request to send */
7162306a36Sopenharmony_ci#define CONTROL_RESET	0x08	/* sent with output report */
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci#define UART_MSR_MASK	0xf0
7462306a36Sopenharmony_ci#define UART_RI		0x80	/* ring indicator */
7562306a36Sopenharmony_ci#define UART_CD		0x40	/* carrier detect */
7662306a36Sopenharmony_ci#define UART_DSR	0x20	/* data set ready */
7762306a36Sopenharmony_ci#define UART_CTS	0x10	/* clear to send */
7862306a36Sopenharmony_ci#define CYP_ERROR	0x08	/* received from input report */
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ci/* End of RS-232 protocol definitions */
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ci#endif /* CYPRESS_M8_H */
83