of: MSI: Simplify irqdomain lookup
[linux/fpc-iii.git] / drivers / clk / at91 / pmc.h
blobf65739272779d3677e74321d4c6ff89d31379adf
1 /*
2 * drivers/clk/at91/pmc.h
4 * Copyright (C) 2013 Boris BREZILLON <b.brezillon@overkiz.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
12 #ifndef __PMC_H_
13 #define __PMC_H_
15 #include <linux/io.h>
16 #include <linux/irqdomain.h>
17 #include <linux/spinlock.h>
19 struct clk_range {
20 unsigned long min;
21 unsigned long max;
24 #define CLK_RANGE(MIN, MAX) {.min = MIN, .max = MAX,}
26 struct at91_pmc_caps {
27 u32 available_irqs;
30 struct at91_pmc {
31 void __iomem *regbase;
32 int virq;
33 spinlock_t lock;
34 const struct at91_pmc_caps *caps;
35 struct irq_domain *irqdomain;
36 u32 imr;
39 static inline void pmc_lock(struct at91_pmc *pmc)
41 spin_lock(&pmc->lock);
44 static inline void pmc_unlock(struct at91_pmc *pmc)
46 spin_unlock(&pmc->lock);
49 static inline u32 pmc_read(struct at91_pmc *pmc, int offset)
51 return readl(pmc->regbase + offset);
54 static inline void pmc_write(struct at91_pmc *pmc, int offset, u32 value)
56 writel(value, pmc->regbase + offset);
59 int of_at91_get_clk_range(struct device_node *np, const char *propname,
60 struct clk_range *range);
62 void of_at91sam9260_clk_slow_setup(struct device_node *np,
63 struct at91_pmc *pmc);
65 void of_at91rm9200_clk_main_osc_setup(struct device_node *np,
66 struct at91_pmc *pmc);
67 void of_at91sam9x5_clk_main_rc_osc_setup(struct device_node *np,
68 struct at91_pmc *pmc);
69 void of_at91rm9200_clk_main_setup(struct device_node *np,
70 struct at91_pmc *pmc);
71 void of_at91sam9x5_clk_main_setup(struct device_node *np,
72 struct at91_pmc *pmc);
74 void of_at91rm9200_clk_pll_setup(struct device_node *np,
75 struct at91_pmc *pmc);
76 void of_at91sam9g45_clk_pll_setup(struct device_node *np,
77 struct at91_pmc *pmc);
78 void of_at91sam9g20_clk_pllb_setup(struct device_node *np,
79 struct at91_pmc *pmc);
80 void of_sama5d3_clk_pll_setup(struct device_node *np,
81 struct at91_pmc *pmc);
82 void of_at91sam9x5_clk_plldiv_setup(struct device_node *np,
83 struct at91_pmc *pmc);
85 void of_at91rm9200_clk_master_setup(struct device_node *np,
86 struct at91_pmc *pmc);
87 void of_at91sam9x5_clk_master_setup(struct device_node *np,
88 struct at91_pmc *pmc);
90 void of_at91rm9200_clk_sys_setup(struct device_node *np,
91 struct at91_pmc *pmc);
93 void of_at91rm9200_clk_periph_setup(struct device_node *np,
94 struct at91_pmc *pmc);
95 void of_at91sam9x5_clk_periph_setup(struct device_node *np,
96 struct at91_pmc *pmc);
98 void of_at91rm9200_clk_prog_setup(struct device_node *np,
99 struct at91_pmc *pmc);
100 void of_at91sam9g45_clk_prog_setup(struct device_node *np,
101 struct at91_pmc *pmc);
102 void of_at91sam9x5_clk_prog_setup(struct device_node *np,
103 struct at91_pmc *pmc);
105 void of_at91sam9x5_clk_utmi_setup(struct device_node *np,
106 struct at91_pmc *pmc);
108 void of_at91rm9200_clk_usb_setup(struct device_node *np,
109 struct at91_pmc *pmc);
110 void of_at91sam9x5_clk_usb_setup(struct device_node *np,
111 struct at91_pmc *pmc);
112 void of_at91sam9n12_clk_usb_setup(struct device_node *np,
113 struct at91_pmc *pmc);
115 void of_at91sam9x5_clk_smd_setup(struct device_node *np,
116 struct at91_pmc *pmc);
118 void of_sama5d4_clk_h32mx_setup(struct device_node *np,
119 struct at91_pmc *pmc);
121 void of_sama5d2_clk_generated_setup(struct device_node *np,
122 struct at91_pmc *pmc);
124 #endif /* __PMC_H_ */