summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuper Liu <supercjliu@google.com>2023-04-25 08:15:01 +0000
committerYen-Chao Chen <davidycchen@google.com>2023-04-28 02:38:53 +0000
commit923e40672f5e30ef2fb33e6e42d5b07f91e9f217 (patch)
tree7e2e64e17181604dd7251b227e7c71dcf367b3b6
parentccfceebe1ed117b11eade0368cf67a796eed82c1 (diff)
downloadcommon-923e40672f5e30ef2fb33e6e42d5b07f91e9f217.tar.gz
gti: new API to get max touch report rate
Bug: 279546695 Test: Touch report rate changes correctly. Change-Id: I5d8b8628818f21132bb560754a2d2d89db0652dc Signed-off-by: Super Liu <supercjliu@google.com>
-rw-r--r--goog_touch_interface.c17
-rw-r--r--goog_touch_interface.h11
2 files changed, 22 insertions, 6 deletions
diff --git a/goog_touch_interface.c b/goog_touch_interface.c
index 5f2597c..551c73e 100644
--- a/goog_touch_interface.c
+++ b/goog_touch_interface.c
@@ -1656,6 +1656,21 @@ bool goog_check_spi_dma_enabled(struct spi_device *spi_dev)
}
EXPORT_SYMBOL(goog_check_spi_dma_enabled);
+int goog_get_max_touch_report_rate(struct goog_touch_interface *gti)
+{
+ int max_idx;
+
+ if (!gti ||
+ !gti->report_rate_table_size ||
+ !gti->touch_report_rate_table) {
+ return -EOPNOTSUPP;
+ }
+
+ max_idx = gti->report_rate_table_size - 1;
+ return gti->touch_report_rate_table[max_idx];
+}
+EXPORT_SYMBOL(goog_get_max_touch_report_rate);
+
int goog_get_panel_id(struct device_node *node)
{
int id = -1;
@@ -2311,7 +2326,7 @@ void goog_update_fw_settings(struct goog_touch_interface *gti)
error = goog_pm_wake_unlock_nosync(gti, GTI_PM_WAKELOCK_TYPE_FW_SETTINGS);
if (error < 0)
- GOOG_DBG(gti, "Error while releasing FW_SETTING wakelock: %d!\n", error);
+ GOOG_DBG(gti, "Error while releasing FW_SETTINGS wakelock: %d!\n", error);
}
static void goog_offload_set_running(struct goog_touch_interface *gti, bool running)
diff --git a/goog_touch_interface.h b/goog_touch_interface.h
index 6aa2716..db9b16e 100644
--- a/goog_touch_interface.h
+++ b/goog_touch_interface.h
@@ -753,15 +753,15 @@ struct goog_touch_interface *goog_touch_interface_probe(
int goog_touch_interface_remove(struct goog_touch_interface *gti);
int goog_pm_wake_lock_nosync(struct goog_touch_interface *gti,
- enum gti_pm_wakelock_type type, bool skip_pm_resume);
+ enum gti_pm_wakelock_type type, bool skip_pm_resume);
int goog_pm_wake_lock(struct goog_touch_interface *gti,
- enum gti_pm_wakelock_type type, bool skip_pm_resume);
+ enum gti_pm_wakelock_type type, bool skip_pm_resume);
int goog_pm_wake_unlock_nosync(struct goog_touch_interface *gti,
- enum gti_pm_wakelock_type type);
+ enum gti_pm_wakelock_type type);
int goog_pm_wake_unlock(struct goog_touch_interface *gti,
- enum gti_pm_wakelock_type type);
+ enum gti_pm_wakelock_type type);
bool goog_pm_wake_check_locked(struct goog_touch_interface *gti,
- enum gti_pm_wakelock_type type);
+ enum gti_pm_wakelock_type type);
u32 goog_pm_wake_get_locks(struct goog_touch_interface *gti);
int goog_pm_register_notification(struct goog_touch_interface *gti,
const struct dev_pm_ops* ops);
@@ -774,6 +774,7 @@ void gti_debug_input_dump(struct goog_touch_interface *gti);
int goog_get_lptw_triggered(struct goog_touch_interface *gti);
+int goog_get_max_touch_report_rate(struct goog_touch_interface *gti);
int goog_get_panel_id(struct device_node *node);
int goog_get_firmware_name(struct device_node *node, int id, char *name, size_t size);
int goog_get_config_name(struct device_node *node, int id, char *name, size_t size);