Merge tag 'locks-v3.16-2' of git://git.samba.org/jlayton/linux
[linux/fpc-iii.git] / arch / arm / mach-omap2 / clkt2xxx_dpll.c
blob82572e277b970b64ab32ff4130def01a91242905
1 /*
2 * OMAP2-specific DPLL control functions
4 * Copyright (C) 2011 Nokia Corporation
5 * Paul Walmsley
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #include <linux/kernel.h>
13 #include <linux/errno.h>
14 #include <linux/clk.h>
15 #include <linux/io.h>
17 #include "clock.h"
18 #include "cm2xxx.h"
19 #include "cm-regbits-24xx.h"
21 /* Private functions */
23 /**
24 * _allow_idle - enable DPLL autoidle bits
25 * @clk: struct clk * of the DPLL to operate on
27 * Enable DPLL automatic idle control. The DPLL will enter low-power
28 * stop when its downstream clocks are gated. No return value.
29 * REVISIT: DPLL can optionally enter low-power bypass by writing 0x1
30 * instead. Add some mechanism to optionally enter this mode.
32 static void _allow_idle(struct clk_hw_omap *clk)
34 if (!clk || !clk->dpll_data)
35 return;
37 omap2xxx_cm_set_dpll_auto_low_power_stop();
40 /**
41 * _deny_idle - prevent DPLL from automatically idling
42 * @clk: struct clk * of the DPLL to operate on
44 * Disable DPLL automatic idle control. No return value.
46 static void _deny_idle(struct clk_hw_omap *clk)
48 if (!clk || !clk->dpll_data)
49 return;
51 omap2xxx_cm_set_dpll_disable_autoidle();
55 /* Public data */
56 const struct clk_hw_omap_ops clkhwops_omap2xxx_dpll = {
57 .allow_idle = _allow_idle,
58 .deny_idle = _deny_idle,