Files
system76-embedded-controller/src/ec/ite/pmc.c
Tim Crawford e032c5f0f2 Update .clang-format and apply
Update .clang-format for LLVM 14.0, available on Ubuntu 22.04.

There is still plenty that clang-format sucks at or does wrong, so
either add some more blocks to disable it, or just put up with it.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-10 12:02:21 -07:00

35 lines
740 B
C

// SPDX-License-Identifier: GPL-3.0-only
#include <ec/pmc.h>
// clang-format off
#define PMC(NUM) { \
.status = &PM ## NUM ## STS, \
.data_out = &PM ## NUM ## DO, \
.data_in = &PM ## NUM ## DI, \
.control = &PM ## NUM ## CTL, \
}
// clang-format on
struct Pmc __code PMC_1 = PMC(1);
struct Pmc __code PMC_2 = PMC(2);
struct Pmc __code PMC_3 = PMC(3);
struct Pmc __code PMC_4 = PMC(4);
struct Pmc __code PMC_5 = PMC(5);
uint8_t pmc_status(struct Pmc *pmc) {
return *(pmc->status);
}
void pmc_set_status(struct Pmc *pmc, uint8_t status) {
*(pmc->status) = status;
}
uint8_t pmc_read(struct Pmc *pmc) {
return *(pmc->data_in);
}
void pmc_write(struct Pmc *pmc, uint8_t data) {
*(pmc->data_out) = data;
}