diff options
author | Nicholas Chin <nic.c3.14@gmail.com> | 2024-05-28 17:23:21 -0600 |
---|---|---|
committer | Felix Singer <service+coreboot-gerrit@felixsinger.de> | 2024-08-26 22:32:30 +0000 |
commit | 7c7e756185e596ed052146903c25805fa26f297f (patch) | |
tree | 36495ff41b5b13d3dd12474d717d6a6d2653c278 /src/ec/dell/mec5035/mec5035.c | |
parent | b8a1115f516874156814ffb6f8c2ccf86bce5ae2 (diff) |
ec/dell/mec5035: Replace defines with enums
Instead of using defines for command IDs and argument values, use enums
to provide more type safety. This also has the effect of moving the
command IDs to a more central location instead of defines spread out
throughout the header.
Change-Id: I788531e8b70e79541213853f177326d217235ef2
Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82998
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Diffstat (limited to 'src/ec/dell/mec5035/mec5035.c')
-rw-r--r-- | src/ec/dell/mec5035/mec5035.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ec/dell/mec5035/mec5035.c b/src/ec/dell/mec5035/mec5035.c index 68b6b2f7fb..dffbb7960c 100644 --- a/src/ec/dell/mec5035/mec5035.c +++ b/src/ec/dell/mec5035/mec5035.c @@ -66,17 +66,17 @@ static enum cb_err write_mailbox_regs(const u8 *data, u8 start, u8 count) return CB_SUCCESS; } -static void ec_command(u8 cmd) +static void ec_command(enum mec5035_cmd cmd) { outb(0, MAILBOX_INDEX); - outb(cmd, MAILBOX_DATA); + outb((u8)cmd, MAILBOX_DATA); wait_ec(); } -u8 mec5035_mouse_touchpad(u8 setting) +u8 mec5035_mouse_touchpad(enum ec_mouse_setting setting) { - u8 buf[15] = {0}; - write_mailbox_regs(&setting, 2, 1); + u8 buf[15] = {(u8)setting}; + write_mailbox_regs(buf, 2, 1); ec_command(CMD_MOUSE_TP); /* The vendor firmware reads 15 bytes starting at index 1, presumably to get some sort of return code. Though I don't know for sure if |