summaryrefslogtreecommitdiff
path: root/baseboard
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dn@semihalf.com>2021-11-29 11:08:48 +0100
committerCommit Bot <commit-bot@chromium.org>2021-12-08 09:02:59 +0000
commit4f7cd7509d7a02b1d5f3f0fd3885202350b576f1 (patch)
treeaadf304662b4436fcdbe352fcc27c009967faf7c /baseboard
parentde14a76701c668270f19c8d6af41aaa321f1c8c2 (diff)
downloadchrome-ec-4f7cd7509d7a02b1d5f3f0fd3885202350b576f1.tar.gz
atomic: use atomic_t where it is possible
There are several places where atomic_t can be a type variables that are use with atomic_* operation, so use it. It sometimes has an impact on the asm code, but it is not significant. The change will be useful for incoming commits related to modifying atomic_t caused by a change in Zephyr upstream (atomic_t from int to long). BUG=b:207082842 TEST=make buildall && zmake testall BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I5c7fa6b74b84454b22074a2a00b5f10003ee9843 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3306358 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Dawid Niedzwiecki <dawidn@google.com>
Diffstat (limited to 'baseboard')
-rw-r--r--baseboard/dedede/baseboard.c2
-rw-r--r--baseboard/dedede/baseboard.h3
-rw-r--r--baseboard/hatch/baseboard.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/baseboard/dedede/baseboard.c b/baseboard/dedede/baseboard.c
index 54c7a6a24a..7b68b755ae 100644
--- a/baseboard/dedede/baseboard.c
+++ b/baseboard/dedede/baseboard.c
@@ -118,7 +118,7 @@ __override void board_check_extpower(void)
last_extpower_present = extpower_present;
}
-uint32_t pp3300_a_pgood;
+atomic_t pp3300_a_pgood;
__override int intel_x86_get_pg_ec_dsw_pwrok(void)
{
/*
diff --git a/baseboard/dedede/baseboard.h b/baseboard/dedede/baseboard.h
index 529e011f32..c17eee71fe 100644
--- a/baseboard/dedede/baseboard.h
+++ b/baseboard/dedede/baseboard.h
@@ -241,6 +241,7 @@
#ifndef __ASSEMBLER__
+#include "atomic_t.h"
#include "common.h"
#include "gpio_signal.h"
@@ -265,7 +266,7 @@ void board_reset_pd_mcu(void);
* Bit to indicate if the PP3000_A rail's power is good. Will be updated by ADC
* interrupt.
*/
-extern uint32_t pp3300_a_pgood;
+extern atomic_t pp3300_a_pgood;
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BASEBOARD_H */
diff --git a/baseboard/hatch/baseboard.c b/baseboard/hatch/baseboard.c
index 58ae6032eb..683df43251 100644
--- a/baseboard/hatch/baseboard.c
+++ b/baseboard/hatch/baseboard.c
@@ -384,7 +384,7 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
#ifdef USB_PD_PORT_TCPC_MST
void baseboard_mst_enable_control(enum mst_source src, int level)
{
- static uint32_t mst_input_levels;
+ static atomic_t mst_input_levels;
if (level)
atomic_or(&mst_input_levels, 1 << src);