ARM: OMAP2+: PM: clean up omap_set_pwrdm_state()
authorPaul Walmsley <paul@pwsan.com>
Mon, 30 Jan 2012 09:47:24 +0000 (02:47 -0700)
committerGrazvydas Ignotas <notasas@gmail.com>
Fri, 27 Apr 2012 16:43:25 +0000 (19:43 +0300)
commitf789a6266bd01d9d263ff59673aa3b2b9a0335ab
tree10bdcdb76036fc1e288da62a6442ec40c76748d2
parent46fe6c29d7e67d4962a7c815ca30ee34bc839b80
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>
arch/arm/mach-omap2/pm.c