Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Copyright (c) 2017, Linaro Ltd.  All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Author: Daniel Lezcano <daniel.lezcano@linaro.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #include <linux/clk.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <linux/interrupt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <linux/of.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <linux/of_address.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <linux/of_irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include "timer-of.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)  * timer_of_irq_exit - Release the interrupt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)  * @of_irq: an of_timer_irq structure pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)  * Free the irq resource
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) static void timer_of_irq_exit(struct of_timer_irq *of_irq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 	struct timer_of *to = container_of(of_irq, struct timer_of, of_irq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	struct clock_event_device *clkevt = &to->clkevt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 	if (of_irq->percpu)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 		free_percpu_irq(of_irq->irq, clkevt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 		free_irq(of_irq->irq, clkevt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35)  * timer_of_irq_init - Request the interrupt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)  * @np: a device tree node pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37)  * @of_irq: an of_timer_irq structure pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39)  * Get the interrupt number from the DT from its definition and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40)  * request it. The interrupt is gotten by falling back the following way:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)  * - Get interrupt number by name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)  * - Get interrupt number by index
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45)  * When the interrupt is per CPU, 'request_percpu_irq()' is called,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46)  * otherwise 'request_irq()' is used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48)  * Returns 0 on success, < 0 otherwise
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) static int timer_of_irq_init(struct device_node *np,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 				    struct of_timer_irq *of_irq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	struct timer_of *to = container_of(of_irq, struct timer_of, of_irq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	struct clock_event_device *clkevt = &to->clkevt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	if (of_irq->name) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 		of_irq->irq = ret = of_irq_get_byname(np, of_irq->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 		if (ret < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 			pr_err("Failed to get interrupt %s for %pOF\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 			       of_irq->name, np);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 			return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	} else	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 		of_irq->irq = irq_of_parse_and_map(np, of_irq->index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	if (!of_irq->irq) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 		pr_err("Failed to map interrupt for %pOF\n", np);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	ret = of_irq->percpu ?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 		request_percpu_irq(of_irq->irq, of_irq->handler,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 				   np->full_name, clkevt) :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 		request_irq(of_irq->irq, of_irq->handler,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 			    of_irq->flags ? of_irq->flags : IRQF_TIMER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 			    np->full_name, clkevt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	if (ret) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 		pr_err("Failed to request irq %d for %pOF\n", of_irq->irq, np);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 		return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	clkevt->irq = of_irq->irq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89)  * timer_of_clk_exit - Release the clock resources
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90)  * @of_clk: a of_timer_clk structure pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92)  * Disables and releases the refcount on the clk
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) static void timer_of_clk_exit(struct of_timer_clk *of_clk)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	of_clk->rate = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	clk_disable_unprepare(of_clk->clk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	clk_put(of_clk->clk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)  * timer_of_clk_init - Initialize the clock resources
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)  * @np: a device tree node pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)  * @of_clk: a of_timer_clk structure pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)  * Get the clock by name or by index, enable it and get the rate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)  * Returns 0 on success, < 0 otherwise
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) static int timer_of_clk_init(struct device_node *np,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 				    struct of_timer_clk *of_clk)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	of_clk->clk = of_clk->name ? of_clk_get_by_name(np, of_clk->name) :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 		of_clk_get(np, of_clk->index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	if (IS_ERR(of_clk->clk)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 		ret = PTR_ERR(of_clk->clk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 		if (ret != -EPROBE_DEFER)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 			pr_err("Failed to get clock for %pOF\n", np);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	ret = clk_prepare_enable(of_clk->clk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	if (ret) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 		pr_err("Failed for enable clock for %pOF\n", np);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 		goto out_clk_put;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	of_clk->rate = clk_get_rate(of_clk->clk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	if (!of_clk->rate) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 		ret = -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 		pr_err("Failed to get clock rate for %pOF\n", np);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 		goto out_clk_disable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	of_clk->period = DIV_ROUND_UP(of_clk->rate, HZ);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) out_clk_disable:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	clk_disable_unprepare(of_clk->clk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) out_clk_put:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	clk_put(of_clk->clk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) static void timer_of_base_exit(struct of_timer_base *of_base)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	iounmap(of_base->base);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) static int timer_of_base_init(struct device_node *np,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 				     struct of_timer_base *of_base)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	of_base->base = of_base->name ?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 		of_io_request_and_map(np, of_base->index, of_base->name) :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 		of_iomap(np, of_base->index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	if (IS_ERR_OR_NULL(of_base->base)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 		pr_err("Failed to iomap (%s:%s)\n", np->name, of_base->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 		return of_base->base ? PTR_ERR(of_base->base) : -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) int timer_of_init(struct device_node *np, struct timer_of *to)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	int ret = -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	int flags = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	if (to->flags & TIMER_OF_BASE) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 		ret = timer_of_base_init(np, &to->of_base);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 		if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 			goto out_fail;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 		flags |= TIMER_OF_BASE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	if (to->flags & TIMER_OF_CLOCK) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 		ret = timer_of_clk_init(np, &to->of_clk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 			goto out_fail;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 		flags |= TIMER_OF_CLOCK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	if (to->flags & TIMER_OF_IRQ) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 		ret = timer_of_irq_init(np, &to->of_irq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 		if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 			goto out_fail;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 		flags |= TIMER_OF_IRQ;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	if (!to->clkevt.name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 		to->clkevt.name = np->full_name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	to->np = np;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) out_fail:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	if (flags & TIMER_OF_IRQ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 		timer_of_irq_exit(&to->of_irq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	if (flags & TIMER_OF_CLOCK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 		timer_of_clk_exit(&to->of_clk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	if (flags & TIMER_OF_BASE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 		timer_of_base_exit(&to->of_base);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) EXPORT_SYMBOL_GPL(timer_of_init);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)  * timer_of_cleanup - release timer_of ressources
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)  * @to: timer_of structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218)  * Release the ressources that has been used in timer_of_init().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)  * This function should be called in init error cases
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) void timer_of_cleanup(struct timer_of *to)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	if (to->flags & TIMER_OF_IRQ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 		timer_of_irq_exit(&to->of_irq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	if (to->flags & TIMER_OF_CLOCK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 		timer_of_clk_exit(&to->of_clk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	if (to->flags & TIMER_OF_BASE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 		timer_of_base_exit(&to->of_base);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) }