Lines Matching refs:inv_clock
36 struct rockchip_inv_clock *inv_clock = to_inv_clock(hw); in rockchip_inv_get_phase() local
39 val = readl(inv_clock->reg) >> inv_clock->shift; in rockchip_inv_get_phase()
46 struct rockchip_inv_clock *inv_clock = to_inv_clock(hw); in rockchip_inv_set_phase() local
57 if (inv_clock->flags & ROCKCHIP_INVERTER_HIWORD_MASK) { in rockchip_inv_set_phase()
58 writel(HIWORD_UPDATE(val, INVERTER_MASK, inv_clock->shift), in rockchip_inv_set_phase()
59 inv_clock->reg); in rockchip_inv_set_phase()
64 spin_lock_irqsave(inv_clock->lock, flags); in rockchip_inv_set_phase()
66 reg = readl(inv_clock->reg); in rockchip_inv_set_phase()
67 reg &= ~BIT(inv_clock->shift); in rockchip_inv_set_phase()
69 writel(reg, inv_clock->reg); in rockchip_inv_set_phase()
71 spin_unlock_irqrestore(inv_clock->lock, flags); in rockchip_inv_set_phase()
88 struct rockchip_inv_clock *inv_clock; in rockchip_clk_register_inverter() local
91 inv_clock = kmalloc(sizeof(*inv_clock), GFP_KERNEL); in rockchip_clk_register_inverter()
92 if (!inv_clock) in rockchip_clk_register_inverter()
101 inv_clock->hw.init = &init; in rockchip_clk_register_inverter()
102 inv_clock->reg = reg; in rockchip_clk_register_inverter()
103 inv_clock->shift = shift; in rockchip_clk_register_inverter()
104 inv_clock->flags = flags; in rockchip_clk_register_inverter()
105 inv_clock->lock = lock; in rockchip_clk_register_inverter()
107 clk = clk_register(NULL, &inv_clock->hw); in rockchip_clk_register_inverter()
109 kfree(inv_clock); in rockchip_clk_register_inverter()