Rajendra Nayak | 68b921a | 2011-02-25 16:06:47 -0700 | [diff] [blame] | 1 | /* |
| 2 | * OMAP4 clockdomain control |
| 3 | * |
| 4 | * Copyright (C) 2008-2010 Texas Instruments, Inc. |
| 5 | * Copyright (C) 2008-2010 Nokia Corporation |
| 6 | * |
| 7 | * Derived from mach-omap2/clockdomain.c written by Paul Walmsley |
| 8 | * Rajendra Nayak <rnayak@ti.com> |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License version 2 as |
| 12 | * published by the Free Software Foundation. |
| 13 | */ |
| 14 | |
| 15 | #include "clockdomain.h" |
| 16 | #include "cminst44xx.h" |
| 17 | |
| 18 | static int omap4_clkdm_sleep(struct clockdomain *clkdm) |
| 19 | { |
| 20 | omap4_cminst_clkdm_force_sleep(clkdm->prcm_partition, |
| 21 | clkdm->cm_inst, clkdm->clkdm_offs); |
| 22 | return 0; |
| 23 | } |
| 24 | |
| 25 | static int omap4_clkdm_wakeup(struct clockdomain *clkdm) |
| 26 | { |
| 27 | omap4_cminst_clkdm_force_wakeup(clkdm->prcm_partition, |
| 28 | clkdm->cm_inst, clkdm->clkdm_offs); |
| 29 | return 0; |
| 30 | } |
| 31 | |
Rajendra Nayak | 5cd1937 | 2011-02-25 16:06:48 -0700 | [diff] [blame^] | 32 | static void omap4_clkdm_allow_idle(struct clockdomain *clkdm) |
| 33 | { |
| 34 | omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition, |
| 35 | clkdm->cm_inst, clkdm->clkdm_offs); |
| 36 | } |
| 37 | |
| 38 | static void omap4_clkdm_deny_idle(struct clockdomain *clkdm) |
| 39 | { |
| 40 | omap4_cminst_clkdm_disable_hwsup(clkdm->prcm_partition, |
| 41 | clkdm->cm_inst, clkdm->clkdm_offs); |
| 42 | } |
| 43 | |
Rajendra Nayak | 68b921a | 2011-02-25 16:06:47 -0700 | [diff] [blame] | 44 | struct clkdm_ops omap4_clkdm_operations = { |
| 45 | .clkdm_sleep = omap4_clkdm_sleep, |
| 46 | .clkdm_wakeup = omap4_clkdm_wakeup, |
Rajendra Nayak | 5cd1937 | 2011-02-25 16:06:48 -0700 | [diff] [blame^] | 47 | .clkdm_allow_idle = omap4_clkdm_allow_idle, |
| 48 | .clkdm_deny_idle = omap4_clkdm_deny_idle, |
Rajendra Nayak | 68b921a | 2011-02-25 16:06:47 -0700 | [diff] [blame] | 49 | }; |