summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2019-04-16 12:43:58 -0600
committerchrome-bot <chrome-bot@chromium.org>2019-04-24 15:51:09 -0700
commitbd4012d9abbb7b79f537e7adba9627bcd4a50a72 (patch)
tree137776675c25c27a1925936e6ef9d8af15fc07cb /driver
parentd6cc4f14205a00b6d17d22fb7e74a0c8b063ec85 (diff)
downloadchrome-ec-bd4012d9abbb7b79f537e7adba9627bcd4a50a72.tar.gz
tasks: convert TASK_EVENT_CUSTOM macro to bit
We should ensure that all custom task definition are non-zero and fit with the globally defined events. Add compile time check and change semantics to specify bit number (instead of making all callers use the BIT macro). This also fixes an error with TASK_EVENT_PHY_TX_DONE for ITE being 0. The bug that made that happen hasn't landed on any firmware branches that use it though. BRANCH=none BUG=none TEST=builds Cq-Depend:chrome-internal:1178968,chrome-internal:1178952 Change-Id: I5e1d1312382d200280c548e9128e53f4eddd3e61 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1570607 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Diffstat (limited to 'driver')
-rw-r--r--driver/tcpm/it83xx_pd.h2
-rw-r--r--driver/touchpad_elan.c2
-rw-r--r--driver/touchpad_st.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/driver/tcpm/it83xx_pd.h b/driver/tcpm/it83xx_pd.h
index 73c613ff0e..4a74d8ae7f 100644
--- a/driver/tcpm/it83xx_pd.h
+++ b/driver/tcpm/it83xx_pd.h
@@ -14,7 +14,7 @@
*/
#define IT83XX_USBPD_CC_PIN_CONFIG 0x86
-#define TASK_EVENT_PHY_TX_DONE TASK_EVENT_CUSTOM(BIT(17))
+#define TASK_EVENT_PHY_TX_DONE TASK_EVENT_CUSTOM_BIT(PD_EVENT_FIRST_FREE_BIT)
#define SET_MASK(reg, bit_mask) ((reg) |= (bit_mask))
#define CLEAR_MASK(reg, bit_mask) ((reg) &= (~(bit_mask)))
diff --git a/driver/touchpad_elan.c b/driver/touchpad_elan.c
index 848985109e..10a2038158 100644
--- a/driver/touchpad_elan.c
+++ b/driver/touchpad_elan.c
@@ -25,7 +25,7 @@
#define CPRINTF(format, args...) cprintf(CC_TOUCHPAD, format, ## args)
#define CPRINTS(format, args...) cprints(CC_TOUCHPAD, format, ## args)
-#define TASK_EVENT_POWER TASK_EVENT_CUSTOM(1)
+#define TASK_EVENT_POWER TASK_EVENT_CUSTOM_BIT(0)
/******************************************************************************/
/* How to talk to the controller */
diff --git a/driver/touchpad_st.c b/driver/touchpad_st.c
index e4327a2054..5fbeeb45ea 100644
--- a/driver/touchpad_st.c
+++ b/driver/touchpad_st.c
@@ -31,8 +31,8 @@
#define CPRINTF(format, args...) cprintf(CC_TOUCHPAD, format, ## args)
#define CPRINTS(format, args...) cprints(CC_TOUCHPAD, format, ## args)
-#define TASK_EVENT_POWER TASK_EVENT_CUSTOM(1)
-#define TASK_EVENT_TP_UPDATED TASK_EVENT_CUSTOM(2)
+#define TASK_EVENT_POWER TASK_EVENT_CUSTOM_BIT(0)
+#define TASK_EVENT_TP_UPDATED TASK_EVENT_CUSTOM_BIT(1)
#define SPI (&(spi_devices[SPI_ST_TP_DEVICE_ID]))