Lines Matching full:pb
99 struct pic32_periph_clk *pb = clkhw_to_pbclk(hw); in pbclk_is_enabled() local
101 return readl(pb->ctrl_reg) & PB_DIV_ENABLE; in pbclk_is_enabled()
106 struct pic32_periph_clk *pb = clkhw_to_pbclk(hw); in pbclk_enable() local
108 writel(PB_DIV_ENABLE, PIC32_SET(pb->ctrl_reg)); in pbclk_enable()
114 struct pic32_periph_clk *pb = clkhw_to_pbclk(hw); in pbclk_disable() local
116 writel(PB_DIV_ENABLE, PIC32_CLR(pb->ctrl_reg)); in pbclk_disable()
145 static inline u32 pbclk_read_pbdiv(struct pic32_periph_clk *pb) in pbclk_read_pbdiv() argument
147 return ((readl(pb->ctrl_reg) >> PB_DIV_SHIFT) & PB_DIV_MASK) + 1; in pbclk_read_pbdiv()
153 struct pic32_periph_clk *pb = clkhw_to_pbclk(hw); in pbclk_recalc_rate() local
155 return parent_rate / pbclk_read_pbdiv(pb); in pbclk_recalc_rate()
168 struct pic32_periph_clk *pb = clkhw_to_pbclk(hw); in pbclk_set_rate() local
174 err = readl_poll_timeout(pb->ctrl_reg, v, v & PB_DIV_READY, in pbclk_set_rate()
182 spin_lock_irqsave(&pb->core->reg_lock, flags); in pbclk_set_rate()
185 v = readl(pb->ctrl_reg); in pbclk_set_rate()
191 writel(v, pb->ctrl_reg); in pbclk_set_rate()
193 spin_unlock_irqrestore(&pb->core->reg_lock, flags); in pbclk_set_rate()
196 err = readl_poll_timeout(pb->ctrl_reg, v, v & PB_DIV_READY, in pbclk_set_rate()
202 return (pbclk_read_pbdiv(pb) == div) ? 0 : -EBUSY; in pbclk_set_rate()