Lines Matching +full:interrupt +full:- +full:clk
1 // SPDX-License-Identifier: GPL-2.0-only
8 #include <linux/interrupt.h>
16 #include "../clk.h"
24 /* interrupt node enable */
26 /* interrupt control register */
28 /* interrupt capture register */
76 int timer = irq - irqres[0].start; in timer_irq_handler()
95 static int gptu_enable(struct clk *clk) in gptu_enable() argument
97 int ret = request_irq(irqres[clk->bits].start, timer_irq_handler, in gptu_enable()
105 GPTU_CON(clk->bits)); in gptu_enable()
106 gptu_w32(1, GPTU_RLD(clk->bits)); in gptu_enable()
107 gptu_w32(gptu_r32(GPTU_IRNEN) | BIT(clk->bits), GPTU_IRNEN); in gptu_enable()
108 gptu_w32(RUN_SEN | RUN_RL, GPTU_RUN(clk->bits)); in gptu_enable()
112 static void gptu_disable(struct clk *clk) in gptu_disable() argument
114 gptu_w32(0, GPTU_RUN(clk->bits)); in gptu_disable()
115 gptu_w32(0, GPTU_CON(clk->bits)); in gptu_disable()
116 gptu_w32(0, GPTU_RLD(clk->bits)); in gptu_disable()
117 gptu_w32(gptu_r32(GPTU_IRNEN) & ~BIT(clk->bits), GPTU_IRNEN); in gptu_disable()
118 free_irq(irqres[clk->bits].start, NULL); in gptu_disable()
124 struct clk *clk = kzalloc(sizeof(struct clk), GFP_KERNEL); in clkdev_add_gptu() local
126 if (!clk) in clkdev_add_gptu()
128 clk->cl.dev_id = dev_name(dev); in clkdev_add_gptu()
129 clk->cl.con_id = con; in clkdev_add_gptu()
130 clk->cl.clk = clk; in clkdev_add_gptu()
131 clk->enable = gptu_enable; in clkdev_add_gptu()
132 clk->disable = gptu_disable; in clkdev_add_gptu()
133 clk->bits = timer; in clkdev_add_gptu()
134 clkdev_add(&clk->cl); in clkdev_add_gptu()
139 struct clk *clk; in gptu_probe() local
141 if (of_irq_to_resource_table(pdev->dev.of_node, irqres, 6) != 6) { in gptu_probe()
142 dev_err(&pdev->dev, "Failed to get IRQ list\n"); in gptu_probe()
143 return -EINVAL; in gptu_probe()
152 clk = clk_get(&pdev->dev, NULL); in gptu_probe()
153 if (IS_ERR(clk)) { in gptu_probe()
154 dev_err(&pdev->dev, "Failed to get clock\n"); in gptu_probe()
155 return -ENOENT; in gptu_probe()
157 clk_enable(clk); in gptu_probe()
164 dev_err(&pdev->dev, "Failed to find magic\n"); in gptu_probe()
166 clk_disable(clk); in gptu_probe()
167 clk_put(clk); in gptu_probe()
168 return -ENAVAIL; in gptu_probe()
172 clkdev_add_gptu(&pdev->dev, "timer1a", TIMER1A); in gptu_probe()
173 clkdev_add_gptu(&pdev->dev, "timer1b", TIMER1B); in gptu_probe()
174 clkdev_add_gptu(&pdev->dev, "timer2a", TIMER2A); in gptu_probe()
175 clkdev_add_gptu(&pdev->dev, "timer2b", TIMER2B); in gptu_probe()
176 clkdev_add_gptu(&pdev->dev, "timer3a", TIMER3A); in gptu_probe()
177 clkdev_add_gptu(&pdev->dev, "timer3b", TIMER3B); in gptu_probe()
179 dev_info(&pdev->dev, "gptu: 6 timers loaded\n"); in gptu_probe()
185 { .compatible = "lantiq,gptu-xway" },
192 .name = "gptu-xway",