diff options
author | davidycchen <davidycchen@google.com> | 2021-11-29 14:15:32 +0800 |
---|---|---|
committer | davidycchen <davidycchen@google.com> | 2021-11-29 15:26:40 +0800 |
commit | 139a185215e1e79ebcd1d33081985b2a6c30d0eb (patch) | |
tree | 678f5829256af54fb20d7305cd51977f92aab1bc /syna_tcm2.h | |
parent | 5985a3a19ebc1cd38a0eb67cc998acc343cb07b3 (diff) | |
download | synaptics_touch-139a185215e1e79ebcd1d33081985b2a6c30d0eb.tar.gz |
synaptics: update driver version to 0115
Update core lib. to 1.21
Bugs fixed.
Have a callback to handle unexpected identify report generated from
firmware.
Able to handle the extra CRC bytes.
Have the helper thread support.
- Enable 'ENABLE_HELPER' if willing to activate this feature.
- Have a sample code to start a helper task when an unexpected reset
is detected.
Set device into bootloader mode if failing to set up app fw.
Support custom 'fw status' report ($c2).
Add the implementations of custom gesture.
- 'ENABLE_WAKEUP_GESTURE' is disabled in default.
Enable if willing to enter LPWG mode in suspend.
Bug: 208162255
Signed-off-by: davidycchen <davidycchen@google.com>
Change-Id: Idfd45502293aa6fa42b8602a9bc663cb85301a45
Diffstat (limited to 'syna_tcm2.h')
-rw-r--r-- | syna_tcm2.h | 82 |
1 files changed, 72 insertions, 10 deletions
diff --git a/syna_tcm2.h b/syna_tcm2.h index 6dd568e..40273a3 100644 --- a/syna_tcm2.h +++ b/syna_tcm2.h @@ -54,7 +54,7 @@ #define SYNAPTICS_TCM_DRIVER_ID (1 << 0) #define SYNAPTICS_TCM_DRIVER_VERSION 1 -#define SYNAPTICS_TCM_DRIVER_SUBVER "2.2" +#define SYNAPTICS_TCM_DRIVER_SUBVER "2.3" /** * @section: Driver Configurations @@ -256,9 +256,17 @@ /* #define ENABLE_CUSTOM_TOUCH_ENTITY */ /** - * @section: Power States + * @brief ENABLE_HELPER + * Open if willing to do additional handling upon helper wokqueue * - * The below structure enumerates the power states of device + * Set "disable" in default + */ +/* #define ENABLE_HELPER */ + +/** + * @brief: Power States + * + * Enumerate the power states of device */ enum power_state { PWR_OFF = 0, @@ -278,12 +286,61 @@ enum { SYNA_BUS_REF_BUGREPORT = 0x0020, }; +#if defined(ENABLE_HELPER) +/** + * @brief: Tasks for helper + * + * Tasks being supported in the helper thread and the structure + */ +enum helper_task { + HELP_NONE = 0, + HELP_RESET_DETECTED, +}; + +struct syna_tcm_helper { + syna_pal_atomic_t task; + struct work_struct work; + struct workqueue_struct *workqueue; +}; +#endif + +/** + * @brief: Structure for $C2 report + * + * Enumerate the power states of device + */ +struct custom_fw_status { + union { + struct { + unsigned char b0_moisture:1; + unsigned char b1_noise_state:1; + unsigned char b2_freq_hopping:1; + unsigned char b3_grip:1; + unsigned char b4_palm:1; + unsigned char b5__7_reserved:3; + unsigned char reserved; + } __packed; + unsigned char data[2]; + }; +}; + /** * @brief: Custom Commands, Reports, or Events */ enum custom_report_type { REPORT_HEAT_MAP = 0xc1, + REPORT_FW_STATUS = 0xc2, +}; + +#if defined(ENABLE_WAKEUP_GESTURE) +/** + * @brief: Custom gesture type + */ +enum custom_gesture_type { + GESTURE_SINGLE_TAP = 6, + GESTURE_LONG_PRESS = 11, }; +#endif /** * @brief: context of the synaptics linux-based driver @@ -376,12 +433,17 @@ struct syna_tcm { bool is_panel_lp_mode; #endif - /* fifo to pass the report to userspace */ + /* fifo to pass the data to userspace */ unsigned int fifo_remaining_frame; struct list_head frame_fifo_queue; wait_queue_head_t wait_frame; unsigned char report_to_queue[REPORT_TYPES]; +#if defined(ENABLE_HELPER) + /* helper workqueue */ + struct syna_tcm_helper helper; +#endif + /* Specific function pointer to do device connection. * * This function will power on and identify the connected device. @@ -421,25 +483,25 @@ struct syna_tcm { */ int (*dev_set_up_app_fw)(struct syna_tcm *tcm); - /* Specific function pointer to enter normal sensing mode + /* Specific function pointer to resume the device from suspend state. * * @param - * [ in] tcm: tcm driver handle + * [ in] dev: an instance of device * * @return * on success, 0; otherwise, negative value on error. */ - int (*dev_set_normal_sensing)(struct syna_tcm *tcm); + int (*dev_resume)(struct device *dev); - /* Specific function pointer to enter power-saved sensing mode. + /* Specific function pointer to put device into suspend state. * * @param - * [ in] tcm: tcm driver handle + * [ in] dev: an instance of device * * @return * on success, 0; otherwise, negative value on error. */ - int (*dev_set_lowpwr_sensing)(struct syna_tcm *tcm); + int (*dev_suspend)(struct device *dev); }; /** |