xref: /openbmc/linux/drivers/clk/at91/pmc.h (revision b3b02eac)
10ad6125bSBoris BREZILLON /*
20ad6125bSBoris BREZILLON  * drivers/clk/at91/pmc.h
30ad6125bSBoris BREZILLON  *
40ad6125bSBoris BREZILLON  *  Copyright (C) 2013 Boris BREZILLON <b.brezillon@overkiz.com>
50ad6125bSBoris BREZILLON  *
60ad6125bSBoris BREZILLON  * This program is free software; you can redistribute it and/or modify
70ad6125bSBoris BREZILLON  * it under the terms of the GNU General Public License as published by
80ad6125bSBoris BREZILLON  * the Free Software Foundation; either version 2 of the License, or
90ad6125bSBoris BREZILLON  * (at your option) any later version.
100ad6125bSBoris BREZILLON  */
110ad6125bSBoris BREZILLON 
120ad6125bSBoris BREZILLON #ifndef __PMC_H_
130ad6125bSBoris BREZILLON #define __PMC_H_
140ad6125bSBoris BREZILLON 
150ad6125bSBoris BREZILLON #include <linux/io.h>
160ad6125bSBoris BREZILLON #include <linux/irqdomain.h>
17863a81c3SBoris Brezillon #include <linux/regmap.h>
180ad6125bSBoris BREZILLON #include <linux/spinlock.h>
190ad6125bSBoris BREZILLON 
201bdf0232SBoris Brezillon extern spinlock_t pmc_pcr_lock;
211bdf0232SBoris Brezillon 
220ad6125bSBoris BREZILLON struct clk_range {
230ad6125bSBoris BREZILLON 	unsigned long min;
240ad6125bSBoris BREZILLON 	unsigned long max;
250ad6125bSBoris BREZILLON };
260ad6125bSBoris BREZILLON 
270ad6125bSBoris BREZILLON #define CLK_RANGE(MIN, MAX) {.min = MIN, .max = MAX,}
280ad6125bSBoris BREZILLON 
290ad6125bSBoris BREZILLON int of_at91_get_clk_range(struct device_node *np, const char *propname,
300ad6125bSBoris BREZILLON 			  struct clk_range *range);
310ad6125bSBoris BREZILLON 
32b3b02eacSAlexandre Belloni #ifdef CONFIG_PM
33b3b02eacSAlexandre Belloni void pmc_register_id(u8 id);
34b3b02eacSAlexandre Belloni #else
35b3b02eacSAlexandre Belloni static inline void pmc_register_id(u8 id) {}
36b3b02eacSAlexandre Belloni #endif
37b3b02eacSAlexandre Belloni 
380ad6125bSBoris BREZILLON #endif /* __PMC_H_ */
39