blob: 5f34a2cd9b1d54afde95a7e164c13cf90ed8bdd6 [file] [log] [blame]
Avery Pennarun6e24c862013-09-16 23:38:03 -04001/*
2 * linux/arch/arm/mach-nomadik/clock.c
3 *
4 * Copyright (C) 2009 Alessandro Rubini
5 */
6#include <common.h>
7#include <errno.h>
8#include <linux/err.h>
9#include <linux/clk.h>
10#include <init.h>
11#include <linux/clkdev.h>
12
13#include "clock.h"
14
15/*
16 * The nomadik board uses generic clocks, but the serial pl011 file
17 * calls clk_enable(), clk_disable(), clk_get_rate(), so we provide them
18 */
19unsigned long clk_get_rate(struct clk *clk)
20{
21 return clk->rate;
22}
23EXPORT_SYMBOL(clk_get_rate);
24
25/* enable and disable do nothing */
26int clk_enable(struct clk *clk)
27{
28 return 0;
29}
30EXPORT_SYMBOL(clk_enable);
31
32void clk_disable(struct clk *clk)
33{
34}
35EXPORT_SYMBOL(clk_disable);
36
37/* Create a clock structure with the given name */
38int nmdk_clk_create(struct clk *clk, const char *dev_id)
39{
40 struct clk_lookup *clkdev;
41
42 clkdev = clkdev_alloc(clk, NULL, dev_id);
43 if (!clkdev)
44 return -ENOMEM;
45 clkdev_add(clkdev);
46 return 0;
47}