// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017, Linaro Ltd. All rights reserved. * * Author: Daniel Lezcano <[email protected]> */ #include <linux/clk.h> #include <linux/interrupt.h> #include <linux/of.h> #include <linux/of_address.h> #include <linux/of_irq.h> #include <linux/slab.h> #include "timer-of.h" /** * timer_of_irq_exit - Release the interrupt * @of_irq: an of_timer_irq structure pointer * * Free the irq resource */ static __init void timer_of_irq_exit(struct of_timer_irq *of_irq) { … } /** * timer_of_irq_init - Request the interrupt * @np: a device tree node pointer * @of_irq: an of_timer_irq structure pointer * * Get the interrupt number from the DT from its definition and * request it. The interrupt is gotten by falling back the following way: * * - Get interrupt number by name * - Get interrupt number by index * * When the interrupt is per CPU, 'request_percpu_irq()' is called, * otherwise 'request_irq()' is used. * * Returns 0 on success, < 0 otherwise */ static __init int timer_of_irq_init(struct device_node *np, struct of_timer_irq *of_irq) { … } /** * timer_of_clk_exit - Release the clock resources * @of_clk: a of_timer_clk structure pointer * * Disables and releases the refcount on the clk */ static __init void timer_of_clk_exit(struct of_timer_clk *of_clk) { … } /** * timer_of_clk_init - Initialize the clock resources * @np: a device tree node pointer * @of_clk: a of_timer_clk structure pointer * * Get the clock by name or by index, enable it and get the rate * * Returns 0 on success, < 0 otherwise */ static __init int timer_of_clk_init(struct device_node *np, struct of_timer_clk *of_clk) { … } static __init void timer_of_base_exit(struct of_timer_base *of_base) { … } static __init int timer_of_base_init(struct device_node *np, struct of_timer_base *of_base) { … } int __init timer_of_init(struct device_node *np, struct timer_of *to) { … } /** * timer_of_cleanup - release timer_of resources * @to: timer_of structure * * Release the resources that has been used in timer_of_init(). * This function should be called in init error cases */ void __init timer_of_cleanup(struct timer_of *to) { … }