summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/common/pll.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/mediatek/common/pll.c')
-rw-r--r--src/soc/mediatek/common/pll.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/soc/mediatek/common/pll.c b/src/soc/mediatek/common/pll.c
index 35b03d845e..539d82cafe 100644
--- a/src/soc/mediatek/common/pll.c
+++ b/src/soc/mediatek/common/pll.c
@@ -12,9 +12,15 @@ void mux_set_sel(const struct mux *mux, u32 sel)
u32 mask = GENMASK(mux->mux_width - 1, 0);
u32 val = read32(mux->reg);
- val &= ~(mask << mux->mux_shift);
- val |= (sel & mask) << mux->mux_shift;
- write32(mux->reg, val);
+ if (mux->set_reg && mux->clr_reg) {
+ write32(mux->clr_reg, mask << mux->mux_shift);
+ write32(mux->set_reg, sel << mux->mux_shift);
+ } else {
+ val &= ~(mask << mux->mux_shift);
+ val |= (sel & mask) << mux->mux_shift;
+ write32(mux->reg, val);
+ }
+
if (mux->upd_reg)
write32(mux->upd_reg, 1 << mux->upd_shift);
}