^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) #ifndef CYPRESS_M8_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define CYPRESS_M8_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * definitions and function prototypes used for the cypress USB to Serial
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * controller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * For sending our feature buffer - controlling serial communication states.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * Linux HID has no support for serial devices so we do this through the driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define HID_REQ_GET_REPORT 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define HID_REQ_SET_REPORT 0x09
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) /* List other cypress USB to Serial devices here, and add them to the id_table */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) /* DeLorme Earthmate USB - a GPS device */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define VENDOR_ID_DELORME 0x1163
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define PRODUCT_ID_EARTHMATEUSB 0x0100
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #define PRODUCT_ID_EARTHMATEUSB_LT20 0x0200
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) /* Cypress HID->COM RS232 Adapter */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #define VENDOR_ID_CYPRESS 0x04b4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define PRODUCT_ID_CYPHIDCOM 0x5500
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) /* Simply Automated HID->COM UPB PIM (using Cypress PID 0x5500) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #define VENDOR_ID_SAI 0x17dd
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) /* FRWD Dongle - a GPS sports watch */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #define VENDOR_ID_FRWD 0x6737
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #define PRODUCT_ID_CYPHIDCOM_FRWD 0x0001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) /* Powercom UPS, chip CY7C63723 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #define VENDOR_ID_POWERCOM 0x0d9f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #define PRODUCT_ID_UPS 0x0002
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) /* Nokia CA-42 USB to serial cable */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #define VENDOR_ID_DAZZLE 0x07d0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #define PRODUCT_ID_CA42 0x4101
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) /* End of device listing */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) /* Used for setting / requesting serial line settings */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #define CYPRESS_SET_CONFIG 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #define CYPRESS_GET_CONFIG 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) /* Used for throttle control */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #define THROTTLED 0x1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) #define ACTUALLY_THROTTLED 0x2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) * chiptypes - used in case firmware differs from the generic form ... offering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) * different baud speeds/etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #define CT_EARTHMATE 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #define CT_CYPHIDCOM 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) #define CT_CA42V2 0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #define CT_GENERIC 0x0F
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) /* End of chiptype definitions */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) * RS-232 serial data communication protocol definitions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) * These are sent / read at byte 0 of the input/output hid reports.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) * You can find these values defined in the CY4601 USB to Serial design notes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) #define CONTROL_DTR 0x20 /* data terminal ready */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) #define CONTROL_RTS 0x10 /* request to send */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) #define CONTROL_RESET 0x08 /* sent with output report */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) #define UART_MSR_MASK 0xf0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) #define UART_RI 0x80 /* ring indicator */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) #define UART_CD 0x40 /* carrier detect */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) #define UART_DSR 0x20 /* data set ready */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) #define UART_CTS 0x10 /* clear to send */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) #define CYP_ERROR 0x08 /* received from input report */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) /* End of RS-232 protocol definitions */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) #endif /* CYPRESS_M8_H */