Lines Matching +full:bcm63268 +full:- +full:timer +full:- +full:clocks

1 // SPDX-License-Identifier: GPL-2.0
3 * BCM63268 Timer Clock and Reset Controller Driver
8 #include <linux/clk-provider.h>
14 #include <linux/reset-controller.h>
17 #include <dt-bindings/clock/bcm63268-clock.h>
90 spin_lock_irqsave(&reset->lock, flags); in bcm63268_timer_reset_update()
91 val = __raw_readl(reset->regs); in bcm63268_timer_reset_update()
96 __raw_writel(val, reset->regs); in bcm63268_timer_reset_update()
97 spin_unlock_irqrestore(&reset->lock, flags); in bcm63268_timer_reset_update()
138 return !(__raw_readl(reset->regs) & BIT(id)); in bcm63268_timer_reset_status()
150 struct device *dev = &pdev->dev; in bcm63268_tclk_probe()
157 for (entry = bcm63268_timer_clocks; entry->name; entry++) in bcm63268_tclk_probe()
158 maxbit = max(maxbit, entry->bit); in bcm63268_tclk_probe()
161 hw = devm_kzalloc(&pdev->dev, struct_size(hw, data.hws, maxbit), in bcm63268_tclk_probe()
164 return -ENOMEM; in bcm63268_tclk_probe()
168 spin_lock_init(&hw->lock); in bcm63268_tclk_probe()
170 hw->data.num = maxbit; in bcm63268_tclk_probe()
172 hw->data.hws[i] = ERR_PTR(-ENODEV); in bcm63268_tclk_probe()
174 hw->regs = devm_platform_ioremap_resource(pdev, 0); in bcm63268_tclk_probe()
175 if (IS_ERR(hw->regs)) in bcm63268_tclk_probe()
176 return PTR_ERR(hw->regs); in bcm63268_tclk_probe()
178 for (entry = bcm63268_timer_clocks; entry->name; entry++) { in bcm63268_tclk_probe()
179 clk = devm_clk_hw_register_gate(dev, entry->name, NULL, 0, in bcm63268_tclk_probe()
180 hw->regs, entry->bit, in bcm63268_tclk_probe()
182 &hw->lock); in bcm63268_tclk_probe()
186 hw->data.hws[entry->bit] = clk; in bcm63268_tclk_probe()
190 &hw->data); in bcm63268_tclk_probe()
194 hw->rcdev.of_node = dev->of_node; in bcm63268_tclk_probe()
195 hw->rcdev.ops = &bcm63268_timer_reset_ops; in bcm63268_tclk_probe()
197 ret = devm_reset_controller_register(dev, &hw->rcdev); in bcm63268_tclk_probe()
205 { .compatible = "brcm,bcm63268-timer-clocks" },
212 .name = "bcm63268-timer-clock",