summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2022-04-14 17:46:59 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-04-19 16:22:20 +0000
commit86e79d476bce53d2e9eec3db31f712478d5ea707 (patch)
tree43e7a799a3d58288550e02925965d45e3521cfd1 /driver
parent76ebe598c59acadd1e221cbd65bb4552411110d3 (diff)
downloadchrome-ec-86e79d476bce53d2e9eec3db31f712478d5ea707.tar.gz
is31fl3743b: Set and clear config register bits correctly
This patch makes is31fl3743b_enable set and clear the bits of the config register correctly. BUG=None BRANCH=None TEST=None Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: If5f24014f2ef15119b9ad5b0baab6413a9ee423b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3587154 Reviewed-by: Parth Malkan <parthmalkan@google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/led/is31fl3743b.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/driver/led/is31fl3743b.c b/driver/led/is31fl3743b.c
index 5539eee9b0..c62ca00b68 100644
--- a/driver/led/is31fl3743b.c
+++ b/driver/led/is31fl3743b.c
@@ -91,8 +91,10 @@ static int is31fl3743b_enable(struct rgbkbd *ctx, bool enable)
return rv;
}
- return is31fl3743b_write(ctx, IS31FL3743B_REG_CONFIG,
- u8 | BIT(3) | (enable ? BIT(0) : 0));
+ WRITE_BIT(u8, 3, 1);
+ WRITE_BIT(u8, 0, enable);
+
+ return is31fl3743b_write(ctx, IS31FL3743B_REG_CONFIG, u8);
}
static int is31fl3743b_set_color(struct rgbkbd *ctx, uint8_t offset,