blob: 526df5ba042ddfd11a2bbe6441bccc6c1eb81f8d [file] [log] [blame]
Boris BREZILLON0ad61252013-12-02 15:07:02 +01001/*
2 * Copyright (C) 2013 Boris BREZILLON <b.brezillon@overkiz.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 */
10
11#include <linux/clk-provider.h>
12#include <linux/clkdev.h>
13#include <linux/clk/at91_pmc.h>
14#include <linux/of.h>
Boris Brezillon863a81c2014-09-05 09:54:13 +020015#include <linux/mfd/syscon.h>
Boris Brezillon1bdf0232014-09-07 08:14:29 +020016#include <linux/regmap.h>
Boris BREZILLON0ad61252013-12-02 15:07:02 +010017
18#include <asm/proc-fns.h>
19
20#include "pmc.h"
21
Boris BREZILLON0ad61252013-12-02 15:07:02 +010022int of_at91_get_clk_range(struct device_node *np, const char *propname,
23 struct clk_range *range)
24{
25 u32 min, max;
26 int ret;
27
28 ret = of_property_read_u32_index(np, propname, 0, &min);
29 if (ret)
30 return ret;
31
32 ret = of_property_read_u32_index(np, propname, 1, &max);
33 if (ret)
34 return ret;
35
36 if (range) {
37 range->min = min;
38 range->max = max;
39 }
40
41 return 0;
42}
43EXPORT_SYMBOL_GPL(of_at91_get_clk_range);