Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260671
b: refs/heads/master
c: 32a363c
h: refs/heads/master
i:
  260669: 4f4affc
  260667: e6675a8
  260663: 14f2653
  260655: 6d79184
  260639: 3bba9b9
  260607: aabc8f9
v: v3
  • Loading branch information
Paul Walmsley committed Jul 10, 2011
1 parent afc221d commit 578357a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 113a74137f5c85f2c7914e78350f70247ef9447c
refs/heads/master: 32a363c0f5b44cb4e9adfe238dfc4efa9270f7ae
30 changes: 28 additions & 2 deletions trunk/arch/arm/mach-omap2/clockdomain.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* OMAP2/3/4 clockdomain framework functions
*
* Copyright (C) 2008-2010 Texas Instruments, Inc.
* Copyright (C) 2008-2010 Nokia Corporation
* Copyright (C) 2008-2011 Texas Instruments, Inc.
* Copyright (C) 2008-2011 Nokia Corporation
*
* Written by Paul Walmsley and Jouni Högander
* Added OMAP4 specific support by Abhijit Pagare <abhijitpagare@ti.com>
Expand Down Expand Up @@ -704,6 +704,8 @@ int clkdm_sleep(struct clockdomain *clkdm)

pr_debug("clockdomain: forcing sleep on %s\n", clkdm->name);

clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED;

return arch_clkdm->clkdm_sleep(clkdm);
}

Expand Down Expand Up @@ -732,6 +734,8 @@ int clkdm_wakeup(struct clockdomain *clkdm)

pr_debug("clockdomain: forcing wakeup on %s\n", clkdm->name);

clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED;

return arch_clkdm->clkdm_wakeup(clkdm);
}

Expand Down Expand Up @@ -762,6 +766,8 @@ void clkdm_allow_idle(struct clockdomain *clkdm)
pr_debug("clockdomain: enabling automatic idle transitions for %s\n",
clkdm->name);

clkdm->_flags |= _CLKDM_FLAG_HWSUP_ENABLED;

arch_clkdm->clkdm_allow_idle(clkdm);
pwrdm_clkdm_state_switch(clkdm);
}
Expand Down Expand Up @@ -792,9 +798,29 @@ void clkdm_deny_idle(struct clockdomain *clkdm)
pr_debug("clockdomain: disabling automatic idle transitions for %s\n",
clkdm->name);

clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED;

arch_clkdm->clkdm_deny_idle(clkdm);
}

/**
* clkdm_in_hwsup - is clockdomain @clkdm have hardware-supervised idle enabled?
* @clkdm: struct clockdomain *
*
* Returns true if clockdomain @clkdm currently has
* hardware-supervised idle enabled, or false if it does not or if
* @clkdm is NULL. It is only valid to call this function after
* clkdm_init() has been called. This function does not actually read
* bits from the hardware; it instead tests an in-memory flag that is
* changed whenever the clockdomain code changes the auto-idle mode.
*/
bool clkdm_in_hwsup(struct clockdomain *clkdm)
{
if (!clkdm)
return false;

return (clkdm->_flags & _CLKDM_FLAG_HWSUP_ENABLED) ? true : false;
}

/* Clockdomain-to-clock/hwmod framework interface code */

Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/arm/mach-omap2/clockdomain.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,17 @@ struct clkdm_dep {
const struct omap_chip_id omap_chip;
};

/* Possible flags for struct clockdomain._flags */
#define _CLKDM_FLAG_HWSUP_ENABLED BIT(0)

/**
* struct clockdomain - OMAP clockdomain
* @name: clockdomain name
* @pwrdm: powerdomain containing this clockdomain
* @clktrctrl_reg: CLKSTCTRL reg for the given clock domain
* @clktrctrl_mask: CLKTRCTRL/AUTOSTATE field mask in CM_CLKSTCTRL reg
* @flags: Clockdomain capability flags
* @_flags: Flags for use only by internal clockdomain code
* @dep_bit: Bit shift of this clockdomain's PM_WKDEP/CM_SLEEPDEP bit
* @prcm_partition: (OMAP4 only) PRCM partition ID for this clkdm's registers
* @cm_inst: (OMAP4 only) CM instance register offset
Expand All @@ -114,6 +118,7 @@ struct clockdomain {
} pwrdm;
const u16 clktrctrl_mask;
const u8 flags;
u8 _flags;
const u8 dep_bit;
const u8 prcm_partition;
const s16 cm_inst;
Expand Down Expand Up @@ -178,6 +183,7 @@ int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm);

void clkdm_allow_idle(struct clockdomain *clkdm);
void clkdm_deny_idle(struct clockdomain *clkdm);
bool clkdm_in_hwsup(struct clockdomain *clkdm);

int clkdm_wakeup(struct clockdomain *clkdm);
int clkdm_sleep(struct clockdomain *clkdm);
Expand Down

0 comments on commit 578357a

Please sign in to comment.