Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: sunxi-ng: Support separately grouped PLL lock status register

On the Allwinner A80 SoC, the PLL lock status indicators are grouped
together in a separate register, as opposed to being scattered in each
PLL's configuration register.

Add a flag to support this.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

authored by

Chen-Yu Tsai and committed by
Maxime Ripard
3de64bf1 82aab516

+9 -2
+7 -2
drivers/clk/sunxi-ng/ccu_common.c
··· 25 25 26 26 void ccu_helper_wait_for_lock(struct ccu_common *common, u32 lock) 27 27 { 28 + void __iomem *addr; 28 29 u32 reg; 29 30 30 31 if (!lock) 31 32 return; 32 33 33 - WARN_ON(readl_relaxed_poll_timeout(common->base + common->reg, reg, 34 - reg & lock, 100, 70000)); 34 + if (common->features & CCU_FEATURE_LOCK_REG) 35 + addr = common->base + common->lock_reg; 36 + else 37 + addr = common->base + common->reg; 38 + 39 + WARN_ON(readl_relaxed_poll_timeout(addr, reg, reg & lock, 100, 70000)); 35 40 } 36 41 37 42 int sunxi_ccu_probe(struct device_node *node, void __iomem *reg,
+2
drivers/clk/sunxi-ng/ccu_common.h
··· 22 22 #define CCU_FEATURE_FIXED_PREDIV BIT(2) 23 23 #define CCU_FEATURE_FIXED_POSTDIV BIT(3) 24 24 #define CCU_FEATURE_ALL_PREDIV BIT(4) 25 + #define CCU_FEATURE_LOCK_REG BIT(5) 25 26 26 27 struct device_node; 27 28 ··· 58 57 struct ccu_common { 59 58 void __iomem *base; 60 59 u16 reg; 60 + u16 lock_reg; 61 61 u32 prediv; 62 62 63 63 unsigned long features;