From f3b698462975a5b23004affca45a6dd1a3ff46a6 Mon Sep 17 00:00:00 2001 From: Yidi Lin Date: Thu, 5 Sep 2024 17:10:33 +0800 Subject: soc/mediatek: Remove redundant struct pad_func and PAD_* definitions Clean up redundant `struct pad_func` and `PAD_*` definitions. This patch also refactors the PAD_* macros by, - Repurposing PAD_FUNC and dropping PAD_FUNC_SEL. - Adding PAD_FUNC_DOWN and PAD_FUNC_UP to avoid the implicit initialization. BUG=none TEST=emerge-{elm, kukui, asurada, cherry, corsola, geralt, rauru} coreboot Change-Id: I12b8f6749015bff52988208a7c3aa01e952612c6 Signed-off-by: Yidi Lin Reviewed-on: https://review.coreboot.org/c/coreboot/+/84222 Reviewed-by: Yu-Ping Wu Tested-by: build bot (Jenkins) --- src/soc/mediatek/mt8196/spi.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/soc/mediatek/mt8196/spi.c') diff --git a/src/soc/mediatek/mt8196/spi.c b/src/soc/mediatek/mt8196/spi.c index 09cd073f8a..770b5b0954 100644 --- a/src/soc/mediatek/mt8196/spi.c +++ b/src/soc/mediatek/mt8196/spi.c @@ -12,13 +12,11 @@ #include #include -#define PAD_FUNC_SEL(name, func, sel) {GPIO(name), PAD_##name##_FUNC_##func, sel} - -static const struct mtk_snfc_pad_func nor_pinmux[4] = { - PAD_FUNC_SEL(SDA10, SF_CK, GPIO_PULL_DOWN), - PAD_FUNC_SEL(SCL10, SF_CS, GPIO_PULL_UP), - PAD_FUNC_SEL(PERIPHERAL_EN5, SF_D0, GPIO_PULL_DOWN), - PAD_FUNC_SEL(PERIPHERAL_EN6, SF_D1, GPIO_PULL_DOWN), +static const struct pad_func nor_pinmux[4] = { + PAD_FUNC(SDA10, SF_CK, GPIO_PULL_DOWN), + PAD_FUNC(SCL10, SF_CS, GPIO_PULL_UP), + PAD_FUNC(PERIPHERAL_EN5, SF_D0, GPIO_PULL_DOWN), + PAD_FUNC(PERIPHERAL_EN6, SF_D1, GPIO_PULL_DOWN), }; void mtk_snfc_init(void) -- cgit v1.2.3