kernel-brax3-ubuntu-touch/drivers/misc/mediatek/apusys/power/2.5/inc/apu_io.h
erascape f319b992b1 kernel-5.15: Initial import brax3 UT kernel
* halium configs enabled

Signed-off-by: erascape <erascape@proton.me>
2025-09-23 15:17:10 +00:00

38 lines
755 B
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2020 MediaTek Inc.
*/
#include <linux/io.h>
#include <linux/bitops.h>
#define POLL_INTERVAL 10 /* us */
#define POLL_TIMEOUT 50 /* us */
#define MASK(x) (x - 1)
static inline void apu_writel(const unsigned int val,
void __force __iomem *regs)
{
writel(val, regs);
/* make sure all the write instructions are done */
wmb();
}
static inline u32 apu_readl(void __force __iomem *regs)
{
return readl(regs);
}
static inline void apu_setl(const unsigned int val,
void __force __iomem *regs)
{
apu_writel((readl(regs) | val), regs);
}
static inline void apu_clearl(const unsigned int val,
void __force __iomem *regs)
{
apu_writel((readl(regs) & ~val), regs);
}