History log of /arch/arm/mach-omap2/pm.c
Revision Date Author Comments
335aece5c502672fd0eb26ede5427ab14f4f7948 29-Mar-2012 Govindraj.R <govindraj.raja@ti.com> ARM: OMAP: pm: fix compilation break

Fix the compilation break observed on latest mainline caused
by 9f97da78 (Disintegrate asm/system.h for ARM):

arch/arm/mach-omap1/pm.c: In function 'omap_pm_prepare':
arch/arm/mach-omap1/pm.c:587: error: implicit declaration of function 'disable_hlt'
arch/arm/mach-omap1/pm.c: In function 'omap_pm_finish':
arch/arm/mach-omap1/pm.c:624: error: implicit declaration of function 'enable_hlt'
arch/arm/mach-omap1/pm.c: In function 'omap_pm_init':
arch/arm/mach-omap1/pm.c:681: error: 'arm_pm_idle' undeclared (first use in this function)
...

arch/arm/mach-omap2/pm.c: In function 'omap_pm_begin':
arch/arm/mach-omap2/pm.c:239: error: implicit declaration of function 'disable_hlt'
arch/arm/mach-omap2/pm.c: In function 'omap_pm_end':
arch/arm/mach-omap2/pm.c:247: error: implicit declaration of function 'enable_hlt'

Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
Acked-by: Kevin Hilman <khilman@ti.com>
[tony@atomide.com: updated to fix omap1 too]
Signed-off-by: Tony Lindgren <tony@atomide.com>
1f3b372b3c1018fad960015cbfdf8de9251d14db 06-Mar-2012 Kevin Hilman <khilman@ti.com> ARM: OMAP2+: PM: fix section mismatch with omap2_init_processor_devices()

Fix the below warning by making omap2_init_processor_devices() __init.
It is called by an __init function and calls only __init functions, so
it should also be init.

WARNING: arch/arm/mach-omap2/built-in.o(.text+0x183c): Section mismatch in reference from the function omap2_init_processor_devices() to the function .init.text:_init_omap_device()
The function omap2_init_processor_devices() references
the function __init _init_omap_device().
This is often because omap2_init_processor_devices lacks a __init
annotation or the annotation of _init_omap_device is wrong.

Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
1416408d31236dc2a80d269aa23ffa93aa01e833 02-Feb-2012 Paul Walmsley <paul@pwsan.com> ARM: OMAP2+: PM: share some suspend-related functions across OMAP2, 3, 4

The platform_suspend_ops can be shared across OMAP2, 3, and 4, along
with all of the functions referenced in that structure. This patch
shares them. It also removes the suspend_state file-scoped variable
in the OMAP2 and 3 PM code; it does not appear to be actually needed
by anything.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
[khilman@ti.com: minor rework needed due to rebase/merge with conflicting changes]
Signed-off-by: Kevin Hilman <khilman@ti.com>
92206fd292da7632c039f6c4054bdaac08b030c0 02-Feb-2012 Paul Walmsley <paul@pwsan.com> ARM: OMAP2+: PM: share clkdms_setup() across OMAP2, 3, 4

clkdms_setup() is identical across OMAP2, 3, and 4, so share it.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
e68e8093ed570f9272665112d13d4c5811536680 30-Jan-2012 Paul Walmsley <paul@pwsan.com> ARM: OMAP2+: PM: clean up omap_set_pwrdm_state()

Clean up a few different parts of omap_set_pwrdm_state():

- Remove a superfluous call to pwrdm_state_switch(). Not needed
unless LOWPOWERSTATECHANGE is used, because the state switch code is
called by either clkdm_sleep() or clkdm_allow_idle().

- Add code to wait for the power state transition in the OMAP4+ low
power state change. This is speculative, so I would particularly
appreciate feedback on this part.

- Remove a superfluous call to pwrdm_read_pwrst().

- Update variable names to be more meaningful (hopefully) and precise.

- Fix an error path bug that would not place the clockdomain back into
hardware-supervised idle or sleep mode if the power state could not
be programmed.

The documentation for this function still needs major improvements;
that's left for a later patch.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Tested-by: Tero Kristo <t-kristo@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
9cf793f9b8b1ba9414e2a7591b2e911885f85a27 20-Feb-2012 Kevin Hilman <khilman@ti.com> ARM: OMAP: convert omap_device_build() and callers to __init

Building omap_devices should only be done at init time, and since
omap_device_build() is using early_platform calls which are also
__init, this ensures that omap_device isn't trying to use functions
that disappear.

Signed-off-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
506d81ef31ece39c760e8c2b2071e6aa3b983b72 08-Dec-2011 Benoit Cousson <b-cousson@ti.com> ARM: OMAP2+: pm: Do not init statically the SR and voltage layer with DT

In the case of DT, the PMIC and SR initialization will be done using
a completely different mechanism.

Disable this part if a DT blob is available.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Acked-by: Kevin Hilman <khilman@ti.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
6369fd41fc6075a547394d95608ca7ff0e878698 09-Jan-2012 NeilBrown <neilb@suse.de> ARM: OMAP: add RCU locking to omap2_set_init_voltage.

opp_find_freq_ceil and opp_get_voltage are documented as requiring
rcu_lock to be held. So hold it.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Kevin Hilman <khilman@ti.com>
46232a3622c6e33605906ee6690dfef372925f53 23-Nov-2011 Kevin Hilman <khilman@ti.com> ARM: OMAP: PM: only register TWL with voltage layer when device is present

Current code registers voltage layer details for TWL PMIC even when a TWL
has not been registered. Fix this to only register the TWL with voltage
layer when the TWL PMIC is initialized by board-level code.

Signed-off-by: Kevin Hilman <khilman@ti.com>
Cc: stable@vger.kernel.org
Signed-off-by: Tony Lindgren <tony@atomide.com>
4e65331c6bb4a777bd61a4dac0daa9fc47777b63 10-Nov-2011 Tony Lindgren <tony@atomide.com> ARM: 7159/1: OMAP: Introduce local common.h files

As suggested by Russell King - ARM Linux <linux@arm.linux.org.uk>,
there's no need to keep local prototypes in non-local headers.

Add mach-omap1/common.h and mach-omap2/common.h and move the
local prototypes there from plat/common.h and mach/omap4-common.h.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
dc28094b905a872f8884f1f1c48ca86b3b78583a 31-Jul-2011 Paul Gortmaker <paul.gortmaker@windriver.com> arm: Add export.h to ARM specific files as required.

These files all make use of one of the EXPORT_SYMBOL variants
or the THIS_MODULE macro. So they will need <linux/export.h>

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
476b679a5d785d1244f6b43ad26877acf278cd18 16-Aug-2011 Benoit Cousson <b-cousson@ti.com> arm/dts: OMAP3+: Add mpu, dsp and iva nodes

Add nodes for devices used by PM code (mpu, dsp, iva).

Add a cpus node as well as recommended in the DT spec.

Remove mpu, dsp, iva devices init if is populated.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Kevin Hilman <khilman@ti.com>
766e7afc38754e4bdcbf948fa523af8999a6296f 16-Aug-2011 Benoit Cousson <b-cousson@ti.com> ARM: OMAP2+: pm: Remove static devices variable for mpu, dsp, iva and l3 PM

Since the device pointer is now retrieved using the hwmod name, remove
the static variables used to store the device pointers for DSP, MPU, IVA
and L3 devices for PM/DVFS usage.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
0f7aa005c85917f114c376e937d88f5d941fb389 16-Aug-2011 Benoit Cousson <b-cousson@ti.com> ARM: OMAP2+: pm: Use hwmod name instead of dev pointer

Replace the struct device parameter of omap2_set_init_voltage
by the hwmod name. It will avoid having to store explicitely
the device pointer into a static variable.

Moreover, it will be a little bit more scalable if we introduce
new DVFS devices.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
3528c58eb9e818b7821501afa2916eb12131994a 21-Jul-2011 Kevin Hilman <khilman@ti.com> OMAP: omap_device: when building return platform_device instead of omap_device

All of the device init and device driver interaction with omap_device
is done using platform_device pointers. To make this more explicit,
have omap_device return a platform_device pointer instead of an
omap_device pointer.

All current users of the omap_device pointer were only using it to get
at the platform_device pointer or struct device pointer, so fixing all
of the users was trivial.

This also makes it more difficult for device init code to directly
access members of struct omap_device, and allows for easier changing
of omap_device internals.

Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
5e5651be29d8bd08d0cc2bc617c43acff95e2229 06-Apr-2011 Kevin Hilman <khilman@ti.com> OMAP3+: voltage: rename scale and reset functions using voltdm_ prefix

Rename voltage scaling related functions to use voltdm_ prefix intead
of omap_voltage_, and cleanup kerneldoc comments in the process.

s/omap_voltage_scale_vdd/voltdm_scale/
s/omap_voltage_reset/voltdm_reset/

Also, in voltdm_reset() s/target_uvdc/target_volt/ to be consistent with
naming throughout the file.

No functional changes.

Signed-off-by: Kevin Hilman <khilman@ti.com>
280a72750535aaf69833bda13ab8912aa5eb71e3 23-Mar-2011 Kevin Hilman <khilman@ti.com> OMAP3: voltage: rename "mpu" voltagedomain to "mpu_iva"

This voltage domain (a.k.a. VDD1) contains both the MPU and the IVA, so
rename appropriately.

Also fixup any users of the "mpu" name to use "mpu_iva"

Signed-off-by: Kevin Hilman <khilman@ti.com>
81a604823797ddb3aaf2a78cc1c6a1fa8f4d200c 16-Mar-2011 Kevin Hilman <khilman@ti.com> OMAP2+: voltage: start towards a new voltagedomain layer

Start cleaning up the voltage layer to have a voltage domain layer
that resembles the structure of the existing clock and power domain
layers. To that end:

- move the 'struct voltagedomain' out of 'struct omap_vdd_info' to
become the primary data structure.

- convert any functions taking a pointer to struct omap_vdd_info into
functions taking a struct voltagedomain pointer.

- convert the register & initialize of voltage domains to look like
that of powerdomains

- convert omap_voltage_domain_lookup() to voltdm_lookup(), modeled
after the current powerdomain and clockdomain lookup functions.

- omap_voltage_late_init(): only configure VDD info when
the vdd_info struct is non-NULL

Signed-off-by: Kevin Hilman <khilman@ti.com>
e9a5190aa30d9d9eeead10a978609f46869bfe50 30-Aug-2011 Johan Hovold <jhovold@gmail.com> OMAP2+: PM: clean up error messages: replace printk with pr_err.

Also, clean up error messages by adding missing whitespace, fixing
capitalisations, removing double newlines, and reducing verbosity.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
[khilman@ti.com: minor changelog/subject edits]
Signed-off-by: Kevin Hilman <khilman@ti.com>
1e2d2df32b6902376bc79faf99f264273be056ce 30-Aug-2011 Johan Hovold <jhovold@gmail.com> OMAP2+: PM: fix typos in misc. comment and error messages

Fix misc. typos in various comment and error message.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
[khilman@ti.com: minor changelog/subject edits]
Signed-off-by: Kevin Hilman <khilman@ti.com>
b1cbdb00da2ac00eb67fe277e563ff1f5093b4ba 20-Aug-2011 Santosh Shilimkar <santosh.shilimkar@ti.com> OMAP: clockdomain: Wait for powerdomain to be ON when using clockdomain force wakeup

While using clockdomain force wakeup method, not waiting for powerdomain
to be effectively ON may end up locking the clockdomain FSM until a
next wakeup event occurs.

One such issue was seen on OMAP4430, where L4_PER was periodically
getting stuck in in-transition state when transitioning from from OSWR to ON.

This issue was reported and investigated by Patrick Titiano <p-titiano@ti.com>

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Reported-by: Patrick Titiano <p-titiano@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
[paul@pwsan.com: updated to apply; added transition wait on clkdm_deny_idle();
remove two superfluous pwrdm_wait_transition() calls]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
b86cfb52a145d8ddad66b98c39c6764f3883cd5a 10-Jul-2011 Rajendra Nayak <rnayak@ti.com> OMAP2+: PM: idle clkdms only if already in idle

The omap_set_pwrdm_state function forces clockdomains
to idle, without checking the existing idle state
programmed, instead based solely on the HW capability
of the clockdomain to support idle.
This is wrong and the clockdomains should be idled
post a state_switch *only* if idle transitions on the
clockdomain were already enabled.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Acked-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
6349b96b439515e1100cd98f27ff55a262f558a3 10-Jul-2011 Rajendra Nayak <rnayak@ti.com> OMAP2+: PM: Initialise sleep_switch to a non-valid value

sleep_switch which is initialised to 0 in omap_set_pwrdm_state
happens to be a valid sleep_switch type (FORCEWAKEUP_SWITCH)
which are defined as:

#define FORCEWAKEUP_SWITCH 0
#define LOWPOWERSTATE_SWITCH 1

This causes the function to wrongly program some clock domains
even when the Powerdomain is in ON state.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Acked-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
919686458fabc67a13ffa412f9e5a8fed46d10b8 26-Apr-2011 Shweta Gulati <shweta.gulati@ti.com> OMAP4: Intialize IVA Device in addition to DSP device.

OMAP4 has two different Devices IVA and DSP. DSP is bound
with IVA for DVFS. The registration of IVA dev in API
'omap2_init_processor_devices' was missing. Init dev for
'iva_dev' is added.

This also fixes the following error seen during boot as
omap2_set_init_voltage can now find the iva device

omap2_set_init_voltage: Invalid parameters!
omap2_set_init_voltage: Unable to put vdd_iva to its init voltage

Signed-off-by: Shweta Gulati <shweta.gulati@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2de0baefaa7f2fad221bba6049e389e39990e2f0 25-Feb-2011 Sanjeev Premi <premi@ti.com> OMAP3: PM: Initialize IVA only if available

IVA device is not present in many OMAP3 variants.

This patch ensures that initialization is tied to
the presence of IVA on the device.

Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
e1d6f4729e9fd46efa1029b6e806bb8b6c24e776 25-Feb-2011 Paul Walmsley <paul@pwsan.com> OMAP: voltage: move plat/voltage.h to mach-omap2/voltage.h

At this point in time, there's no reason for this header file to be in
plat-omap/include/plat/voltage.h. It should not be included by device
drivers, and the code that uses it is currently all under mach-omap2/.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
5cd1937b6d5990fe5d5287d925f05afd38e9fb02 26-Feb-2011 Rajendra Nayak <rnayak@ti.com> OMAP: clockdomain: Arch specific funcs for hwsup control of clkdm

Define the following architecture specific funtions for omap2/3/4
.clkdm_allow_idle
.clkdm_deny_idle

Convert the platform-independent framework to call these functions.
Also rename the api's by removing the omap2_ preamble.
Hence call omap2_clkdm_allow_idle as clkdm_allow_idle and
omap2_clkdm_deny_idle as clkdm_deny_idle.

Make the _clkdm_add_autodeps and _clkdm_del_autodeps as non-static
so they can be accessed from OMAP2/3 platform specific code.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
68b921ad7f35e0323ce0d9fe94e5701a112f257c 26-Feb-2011 Rajendra Nayak <rnayak@ti.com> OMAP: clockdomain: Arch specific funcs for sleep/wakeup of clkdm

Define the following architecture specific funtions for omap2/3/4
.clkdm_sleep
.clkdm_wakeup

Convert the platform-independent framework to call these functions.
Also rename the api's by removing the omap2_ preamble.
Hence call omap2_clkdm_wakeup as clkdm_wakeup and
omap2_clkdm_sleep as clkdm_sleep.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
[paul@pwsan.com: fixed omap3_clkdm_clear_all_sleepdeps() and
omap2_clkdm_clear_all_wkdeps() to test against the correct
loop termination condition; thanks to Kevin Hilman for finding and
helping fix]
Cc: Kevin Hilman <khilman@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
1376ee1d191b32d0be6d2956f1a6f3dd63251e2e 29-May-2010 Thara Gopinath <thara@ti.com> OMAP4: PM: Program correct init voltages for scalable VDDs

By default the system boots up at nominal voltage for every
voltage domain in the system. This patch puts vdd_mpu, vdd_iva
and vdd_core to the correct boot up voltage as per the opp tables
specified. This patch implements this by matching the rate of
the main clock of the voltage domain with the opp table and
picking up the correct voltage.

Signed-off-by: Thara Gopinath <thara@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
7bc3ed9ae632b9c94d3721d555d3452e24ca8ee3 10-Dec-2010 Thara Gopinath <thara@ti.com> OMAP4: Register voltage PMIC parameters with the voltage layer

TWL6030 is the power IC used along with OMAP4 in OMAP4 SDPs,
blaze boards and panda boards. This patch registers the OMAP4
PMIC specific information with the voltage layer.
This also involves implementing a different formula for
voltage to vsel and vsel to voltage calculations from
TWL4030.

Signed-off-by: Thara Gopinath <thara@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
1482d8be5525eccdec6286677d40af29da03a30c 29-May-2010 Thara Gopinath <thara@ti.com> OMAP3: PM: Program correct init voltages for VDD1 and VDD2

By default the system boots up at nominal voltage for every
voltage domain in the system. This patch puts VDD1 and VDD2
to the correct boot up voltage as per the opp tables specified.
This patch implements this by matching the rate of the main clock
of the voltage domain with the opp table and picking up the correct
voltage.

Signed-off-by: Thara Gopinath <thara@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
fbc319f67660ede23cc22f3af5df559693f8062e 10-Dec-2010 Thara Gopinath <thara@ti.com> OMAP3: PM: Register TWL4030 pmic info with the voltage driver.

This patch registers the TWL4030 PMIC specific informtion
with the voltage driver. Failing this patch the voltage driver
is unware of the formula to use for vsel to voltage and vice versa
conversion and lot of other PMIC dependent parameters.

This file is based on the arch/arm/plat-omap opp_twl_tpl.c file
by Paul Walmsley. The original file is replaced by this file.

Signed-off-by: Thara Gopinath <thara@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
0c0a5d61ed9319e7e666990a7888f3b00868ac20 29-May-2010 Thara Gopinath <thara@ti.com> OMAP3: PM: Adding smartreflex device file.

This patch adds support for device registration of various
smartreflex module present in the system. This patch introduces
the platform data for smartreflex devices which include
the efused n-target vaules, a parameter to indicate
whether smartreflex autocompensation needs to be
enabled on init or not. An API
omap_enable_smartreflex_on_init is provided for the
board files to enable smartreflex autocompensation during
system boot up.

Signed-off-by: Thara Gopinath <thara@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2f34ce81b8c05c900e45bd88595cc154f7bb5957 29-May-2010 Thara Gopinath <thara@ti.com> OMAP3: PM: Adding voltage driver support.

This patch adds voltage driver support for OMAP3. The driver
allows configuring the voltage controller and voltage
processors during init and exports APIs to enable/disable
voltage processors, scale voltage and reset voltage.
The driver maintains the global voltage table on a per
VDD basis which contains the various voltages supported by the
VDD along with per voltage dependent data like smartreflex
efuse offset, errminlimit and voltage processor errorgain.
The driver also allows the voltage parameters dependent on the
PMIC to be passed from the PMIC file through an API.
The driver allows scaling of VDD voltages either through
"vc bypass method" or through "vp forceupdate method" the
choice being configurable through the board file.

This patch contains code originally in linux omap pm branch
smartreflex driver. Major contributors to this driver are
Lesly A M, Rajendra Nayak, Kalle Jokiniemi, Paul Walmsley,
Nishant Menon, Kevin Hilman. The separation of PMIC parameters
into a separate structure which can be populated from
the PMIC file is based on the work of Lun Chang from Motorola
in an internal tree.

Signed-off-by: Thara Gopinath <thara@ti.com>
[khilman: fixed link error for OMAP2-only defconfig]
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
33de32b3ebcb4f7f77f10a1b42493352f00c6a30 22-Dec-2010 Rajendra Nayak <rnayak@ti.com> OMAP4: PM: Do not assume clkdm supports hw transitions

omap_set_pwrdm_state today assumes a clkdm supports hw_auto
transitions and hence leaves some which do not support this
in sw wkup state preventing low power transitions.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Benoit Cousson <b-cousson@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
71a488dbcc4acbc9b845491a368b30ecd7484089 22-Dec-2010 Rajendra Nayak <rnayak@ti.com> OMAP4: PM: Use the low-power state change feature on OMAP4

For pwrdm's which support LOWPOWERSTATECHANGE, do not try waking
up the domain to put it back to deeper sleep state.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Benoit Cousson <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
72e06d087204f3bc9acf281717b90ebf0b9731f7 22-Dec-2010 Paul Walmsley <paul@pwsan.com> OMAP2+: powerdomain: move header file from plat-omap to mach-omap2

The OMAP powerdomain code and data is all OMAP2+-specific. This seems
unlikely to change any time soon. Move plat-omap/include/plat/powerdomain.h
to mach-omap2/powerdomain.h. The primary point of doing this is to remove
the temptation for unrelated upper-layer code to access powerdomain code
and data directly.

As part of this process, remove the references to powerdomain data
from the GPIO "driver" and the OMAP PM no-op layer, both in plat-omap.
Change the DSPBridge code to point to the new location for the
powerdomain headers. The DSPBridge code should not be including the
powerdomain headers; these should be removed.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
Cc: Felipe Contreras <felipe.contreras@gmail.com>
Cc: Greg Kroah-Hartman <greg@kroah.com>
1540f214065982e6cbc6b8da1fe65a15e358f7c5 22-Dec-2010 Paul Walmsley <paul@pwsan.com> OMAP2+: clockdomain: move header file from plat-omap to mach-omap2

The OMAP clockdomain code and data is all OMAP2+-specific. This seems
unlikely to change any time soon. Move plat-omap/include/plat/clockdomain.h
to mach-omap2/clockdomain.h. The primary point of doing this is to remove
the temptation for unrelated upper-layer code to access clockdomain code
and data directly.

DSPBridge also uses the clockdomain headers for some reason, so,
modify it also. The DSPBridge code should not be including the
clockdomain headers; these should be removed.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
Cc: Felipe Contreras <felipe.contreras@gmail.com>
Cc: Greg Kroah-Hartman <greg@kroah.com>
Tested-by: Rajendra Nayak <rnayak@ti.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
1cbbe37ac5c78fb59ce02f639d6c4f69b610cf5e 20-Dec-2010 Thara Gopinath <thara@ti.com> OMAP: pm.c correct the initcall for an early init.

omap2_common_pm_init is the API where generic system devices like
mpu, l3 etc get initialized. This has to happen really early on
during the boot and not at a later time. This is especially important
with the new opp changes as these devices need to be built before the
opp tables init happen. Today both are device initcalls and it works
just because of the order of compilation. Making this postcore_initcall
is ideal because the omap device layer init happens as a core_initcall
and typically rest of the driver/device inits are arch_initcall or
something lower.

Signed-off-by: Thara Gopinath <thara@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
cbf27660e692d8c74087c0ccb80225207d280af1 05-Aug-2010 Benoit Cousson <b-cousson@ti.com> OMAP4: pm: Change l3_main to l3_main_1 during bus device init

The OMAP4 L3 interconnect is split in 3 part for power saving reason.
Because of that there is no l3_main like on OMAP2 & 3 but 3 differentes
l3_main_X instances.

In the case of OMAP4, query only the l3_main_1 part. The clock and
voltage are shared across the 3 instances.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
eb6a2c7550560e6619eadb912ea8384ce27964b8 14-Sep-2010 Santosh Shilimkar <santosh.shilimkar@ti.com> omap: pm: Move set_pwrdm_state routine to common pm.c

The set_pwrdm_state() is needed on omap4 as well so move
this routine to common pm.c file so that it's available for omap3/4

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
b3294e2327718e9487e662d1392b36b39f07d70b 01-Sep-2010 Thara Gopinath <thara@ti.com> OMAP4: pm.c extensions for OMAP4 support

OMAP4 has an iva device and a dsp devcice where as OMAP2/3
has only an iva device. In this file the iva device in the
system is registered under the name dsp_dev and the API
to retrieve the iva device is omap2_get_dsp_device.
This patch renames the dsp_dev to iva_dev, renames
omap2_get_dsp_device to omap2_get_iva_device,
registers dsp_dev for OMAP4 and adds a new API
omap4_get_dsp_device to retrieve the dep_dev.

Signed-off-by: Thara Gopinath <thara@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
6f88e9bc21746be9b15f1d8dcacf7595807e8828 27-Jul-2010 Kevin Hilman <khilman@deeprootsystems.com> OMAP: PM: create omap_devices for MPU, DSP, L3

Create simple omap_devices for the main processors and busses.

This is required to support the forth-coming device-based OPP
approach, where OPPs are managed and tracked at the device level.

Also, move these common PM init functions into a common_pm_init call
that is called as a device_initcall(). The PM init is done at this level
to ensure that the driver core is initialized before initialized.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
[paul@pwsan.com: sparse warnings cleaned up; newly-created functions moved
from mach-omap2/io.c to mach-omap2/pm.c; newly-created functions renamed
to start with "omap2" rather than "omap"]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
8bd229492209c0c7d050e2f9a600c12f035d72f7 28-May-2009 Kevin Hilman <khilman@deeprootsystems.com> OMAP2/3: PM: push core PM code from linux-omap

This patch is to sync the core linux-omap PM code with mainline. This
code has evolved and been used for a while the linux-omap tree, but
the attempt here is to finally get this into mainline.

Following this will be a series of patches from the 'PM branch' of the
linux-omap tree to add full PM hardware support from the linux-omap
tree.

Much of this PM core code was written by Jouni Hogander with
significant contributions from Paul Walmsley as well as many others
from Nokia, Texas Instruments and linux-omap community.

Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
fecb494beef09e4caaa80313834af26f57091195 28-Jan-2009 Paul Walmsley <paul@pwsan.com> [ARM] OMAP: Fix sparse, checkpatch warnings in OMAP2/3 PRCM/PM code

Fix sparse & checkpatch warnings in OMAP2/3 PRCM & PM code. This mostly
consists of:

- converting pointer comparisons to integers in form similar to
(ptr == 0) to the standard idiom (!ptr)

- labeling a few non-static private functions as static

- adding prototypes for *_init() functions in the appropriate header
files, and getting rid of the corresponding open-coded extern
prototypes in other C files

- renaming the variable 'sclk' in mach-omap2/clock.c:omap2_get_apll_clkin
to avoid shadowing an earlier declaration

Clean up checkpatch issues. This mostly involves:

- converting some asm/ includes to linux/ includes

- cleaning up some whitespace

- getting rid of braces for conditionals with single following statements

Also take care of a few odds and ends, including:

- getting rid of unlikely() and likely() - none of this code is particularly
fast-path code, so the performance impact seems slim; and some of those
likely() and unlikely() indicators are probably not as accurate as the
ARM's branch predictor

- removing some superfluous casts

linux-omap source commit is 347df59f5d20fdf905afbc26b1328b0e28a8a01b.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
fced80c735941fa518ac67c0b61bbe153fb8c050 06-Sep-2008 Russell King <rmk@dyn-67.arm.linux.org.uk> [ARM] Convert asm/io.h to linux/io.h

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
a09e64fbc0094e3073dbb09c3b4bfe4ab669244b 05-Aug-2008 Russell King <rmk@dyn-67.arm.linux.org.uk> [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach

This just leaves include/asm-arm/plat-* to deal with.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
0f8469a54f7bd65f2c740a5480c56260dc8a7ae0 03-Aug-2008 Russell King <rmk@dyn-67.arm.linux.org.uk> [ARM] Eliminate useless includes of asm/mach-types.h

There are 43 includes of asm/mach-types.h by files that don't
reference anything from that file. Remove these unnecessary
includes.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
205bee6ad804d7034773b5978c74dde495df2301 20-Apr-2008 Russell King <rmk@dyn-67.arm.linux.org.uk> [ARM] dyntick: Remove obsolete and unused ARM dyntick support

dyntick is superseded by the clocksource/clockevent infrastructure,
using the NO_HZ configuration option. No one implements dyntick on
ARM anymore, so it's pointless keeping it around. Remove dyntick
support.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
b81ad56b078a5ee7c0061b117c7287e8987d6692 18-Mar-2008 Tony Lindgren <tony@atomide.com> ARM: OMAP2: Remove old 24xx PM code

This patch removes old 24xx PM code that does not really work for sleep
states, and uses old power management register access. Working PM code
will be added later.

Signed-off-by: Tony Lindgren <tony@atomide.com>
e6c5eb9541f2197a3ffab90b1c7a3250a9b51bf6 18-Oct-2007 Rafael J. Wysocki <rjw@sisk.pl> PM: Rework struct platform_suspend_ops

There is no reason why the .prepare() and .finish() methods in 'struct
platform_suspend_ops' should take any arguments, since architectures don't use
these methods' argument in any practically meaningful way (ie. either the
target system sleep state is conveyed to the platform by .set_target(), or
there is only one suspend state supported and it is indicated to the PM core
by .valid(), or .prepare() and .finish() aren't defined at all).  There also
is no reason why .finish() should return any result.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Len Brown <lenb@kernel.org>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
26398a70ea35f153feb799fa850c71685667712b 18-Oct-2007 Rafael J. Wysocki <rjw@sisk.pl> PM: Rename struct pm_ops and related things

The name of 'struct pm_ops' suggests that it is related to the power
management in general, but in fact it is only related to suspend.  Moreover,
its name should indicate what this structure is used for, so it seems
reasonable to change it to 'struct platform_suspend_ops'.  In that case, the
name of the global variable of this type used by the PM core and the names of
related functions should be changed accordingly.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Len Brown <lenb@kernel.org>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
95d9ffbe01fb21d524c86bf77871255066bc6e55 18-Oct-2007 Rafael J. Wysocki <rjw@sisk.pl> PM: Move definition of struct pm_ops to suspend.h

Move the definition of 'struct pm_ops' and related functions from <linux/pm.h>
to <linux/suspend.h> .

There are, at least, the following reasons to do that:
* 'struct pm_ops' is specifically related to suspend and not to the power
management in general.
* As long as 'struct pm_ops' is defined in <linux/pm.h>, any modification of it
causes the entire kernel to be recompiled, which is unnecessary and annoying.
* Some suspend-related features are already defined in <linux/suspend.h>, so it
is logical to move the definition of 'struct pm_ops' into there.
* 'struct hibernation_ops', being the hibernation-related counterpart of
'struct pm_ops', is defined in <linux/suspend.h> .

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Len Brown <lenb@kernel.org>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
e8c9c502690efd24b7055bf608e7a3c34216848b 01-May-2007 Johannes Berg <johannes@sipsolutions.net> power management: implement pm_ops.valid for everybody

Almost all users of pm_ops only support mem sleep, don't check in .valid and
don't reject any others in .prepare so users can be confused if they check
/sys/power/state, especially when new states are added (these would then
result in s-t-r although they're supposed to be something different).

This patch implements a generic pm_valid_only_mem function that is then
exported for users and puts it to use in almost all existing pm_ops.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: David Brownell <david-b@pacbell.net>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: linux-pm@lists.linux-foundation.org
Cc: Len Brown <lenb@kernel.org>
Acked-by: Russell King <rmk@arm.linux.org.uk>
Cc: Greg KH <greg@kroah.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fe0c935a6cbf25d72a27c7a345df8a2151de0b74 01-May-2007 Johannes Berg <johannes@sipsolutions.net> rework pm_ops pm_disk_mode, kill misuse

This patch series cleans up some misconceptions about pm_ops. Some users of
the pm_ops structure attempt to use it to stop the user from entering suspend
to disk, this, however, is not possible since the user can always use
"shutdown" in /sys/power/disk and then the pm_ops are never invoked. Also,
platforms that don't support suspend to disk simply should not allow
configuring SOFTWARE_SUSPEND (read the help text on it, it only selects
suspend to disk and nothing else, all the other stuff depends on PM).

The pm_ops structure is actually intended to provide a way to enter
platform-defined sleep states (currently supported states are "standby" and
"mem" (suspend to ram)) and additionally (if SOFTWARE_SUSPEND is configured)
allows a platform to support a platform specific way to enter low-power mode
once everything has been saved to disk. This is currently only used by ACPI
(S4).

This patch:

The pm_ops.pm_disk_mode is used in totally bogus ways since nobody really
seems to understand what it actually does.

This patch clarifies the pm_disk_mode description.

It also removes all the arm and sh users that think they can veto suspend to
disk via pm_ops; not so since the user can always do echo shutdown >
/sys/power/disk, they need to find a better way involving Kconfig or such.

ACPI is the only user left with a non-zero pm_disk_mode.

The patch also sets the default mode to shutdown again, but when a new pm_ops
is registered its pm_disk_mode is selected as default, that way the default
stays for ACPI where it is apparently required.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: David Brownell <david-b@pacbell.net>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: <linux-pm@lists.linux-foundation.org>
Cc: Len Brown <lenb@kernel.org>
Acked-by: Russell King <rmk@arm.linux.org.uk>
Cc: Greg KH <greg@kroah.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
22a16f39e36e62f7bd221e5b279ea02fb3c43425 27-Jun-2006 Tony Lindgren <tony@atomide.com> ARM: OMAP: Add initial 24xx suspend support

This patch adds support for omap24xx power domains and
allows suspend to work.

Please note that for some reason core power domain still
does not seem to idle.

Signed-off-by: Tony Lindgren <tony@atomide.com>
670c104ae8e7bcc28be0289a16dac2ddfb88b285 02-Apr-2006 Tony Lindgren <tony@atomide.com> [ARM] 3430/1: ARM: OMAP: 5/8 Update PM

Patch from Tony Lindgren

Update OMAP PM code from linux-omap tree:

- Move PM code from plat-omap to mach-omap1 and mach-omap2
by Tony Lindgren
- Add minimal PM support for omap24xx by Tony Lindgren and
Richard Woodruff
- Misc updates to omap1 PM code by Tuukka Tikkanen et al
- Updates to the SRAM code needed for PM and FB by Imre Deak

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>