Boris BREZILLON | 0ad6125 | 2013-12-02 15:07:02 +0100 | [diff] [blame] | 1 | /* |
| 2 | * drivers/clk/at91/pmc.h |
| 3 | * |
| 4 | * Copyright (C) 2013 Boris BREZILLON <b.brezillon@overkiz.com> |
| 5 | * |
| 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. |
| 10 | */ |
| 11 | |
| 12 | #ifndef __PMC_H_ |
| 13 | #define __PMC_H_ |
| 14 | |
| 15 | #include <linux/io.h> |
| 16 | #include <linux/irqdomain.h> |
Boris Brezillon | 863a81c | 2014-09-05 09:54:13 +0200 | [diff] [blame] | 17 | #include <linux/regmap.h> |
Boris BREZILLON | 0ad6125 | 2013-12-02 15:07:02 +0100 | [diff] [blame] | 18 | #include <linux/spinlock.h> |
| 19 | |
Boris Brezillon | 1bdf023 | 2014-09-07 08:14:29 +0200 | [diff] [blame] | 20 | extern spinlock_t pmc_pcr_lock; |
| 21 | |
Boris BREZILLON | 0ad6125 | 2013-12-02 15:07:02 +0100 | [diff] [blame] | 22 | struct clk_range { |
| 23 | unsigned long min; |
| 24 | unsigned long max; |
| 25 | }; |
| 26 | |
| 27 | #define CLK_RANGE(MIN, MAX) {.min = MIN, .max = MAX,} |
| 28 | |
Boris BREZILLON | 0ad6125 | 2013-12-02 15:07:02 +0100 | [diff] [blame] | 29 | int of_at91_get_clk_range(struct device_node *np, const char *propname, |
| 30 | struct clk_range *range); |
| 31 | |
Alexandre Belloni | b3b02ea | 2017-06-08 02:36:47 +0200 | [diff] [blame] | 32 | #ifdef CONFIG_PM |
| 33 | void pmc_register_id(u8 id); |
| 34 | #else |
| 35 | static inline void pmc_register_id(u8 id) {} |
| 36 | #endif |
| 37 | |
Boris BREZILLON | 0ad6125 | 2013-12-02 15:07:02 +0100 | [diff] [blame] | 38 | #endif /* __PMC_H_ */ |