Commit graph

14 commits

Author SHA1 Message Date
Kevin Hilman
b666b4767d OMAP3+: VP: combine setting init voltage into common function
combine VPCONFIG init voltage setup into common function and use from
both vp_enable and from vp_forceupdate_scale().

NOTE: this patch changes the sequence of when the initVDD bit is
cleared.  The bit is now cleared immediately after it was written.
Since only the rising edge of this bit has any affect according to the
TRM, the exact timing of clearing of this bit should not have any
effect.

Signed-off-by: Kevin Hilman <khilman@ti.com>
2011-09-15 12:09:08 -07:00
Kevin Hilman
cc6962dbab OMAP3+: VP: remove unused omap_vp_get_curr_volt()
Signed-off-by: Kevin Hilman <khilman@ti.com>
2011-09-15 12:09:08 -07:00
Kevin Hilman
8798c4ab56 OMAP3+: VP: update_errorgain(): return error if VP
Add check for valid VP in omap_vp_update_errorgain()

Signed-off-by: Kevin Hilman <khilman@ti.com>
2011-09-15 12:09:08 -07:00
Todd Poynor
bea30ed65f OMAP: VP: Explicitly mask VPVOLTAGE field
Reading the VPVOLTAGE field of PRM_VP_*_VOLTAGE registers currently
relies on a u32 -> u8 conversion to mask off the FORCEUPDATEWAIT field
in the upper bits.  Make this explicit using the mask symbol
already defined, added as a new field in struct omap_vp_common.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2011-09-15 12:09:08 -07:00
Kevin Hilman
667216d6a4 OMAP3+: VP: remove omap_vp_runtime_data
Remove the "runtime" VP data in favor of direct programming of VP registers.
The VP is in the PRM, which is in the wakeup powerdomain, so there is no
need to keep the state dynamically.

Fixes to original version from Nishanth Menon <nm@ti.com>

Signed-off-by: Kevin Hilman <khilman@ti.com>
2011-09-15 12:09:08 -07:00
Kevin Hilman
76ea7424f8 OMAP3+: VP: create VP helper function for updating error gain
Create new helper function in VP layer for updating VP error gain.
Currently used during pre-scale for VP force update and VC bypass.

TODO: determine if this can be removed from the pre-scale path and
moved to VP enable path.

Signed-off-by: Kevin Hilman <khilman@ti.com>
2011-09-15 12:09:08 -07:00
Kevin Hilman
6f56727383 OMAP3+: VP: move timing calculation/config into VP init
Move VP timing calcluation (based on sys clock) and register programming
into VP init.

Signed-off-by: Kevin Hilman <khilman@ti.com>
2011-09-15 12:09:08 -07:00
Kevin Hilman
0ec3041e91 OMAP3+: VP: struct omap_vp_common: replace shift with __ffs(mask)
In struct omap_vp_common, the shift value can be derived from the mask
value by using __ffs(), so remove the shift value for the various
VPCONFIG bitfields, and use __ffs() in the code for the shift value.

While here, rename field names in kerneldoc comment to match actual
field names in structure.  Also, cleanup indendentaion for other VP
register accesses in omap_vp_init().

No functional changes.

Signed-off-by: Kevin Hilman <khilman@ti.com>
2011-09-15 12:09:07 -07:00
Kevin Hilman
633ef8b747 OMAP3+: voltage: remove unneeded debugfs interface
Remove read-only debugfs interface to VP values.  Most of the values
are init-time only and never change.  Current voltage value should be
retreived from the (eventual) regulator framework interface to the
voltage domain.

Fixes to original version provided by Nishanth Menon <nm@ti.com>

Signed-off-by: Kevin Hilman <khilman@ti.com>
2011-09-15 12:09:07 -07:00
Kevin Hilman
b7ea803e55 OMAP3+: VP: cleanup: move VP instance into voltdm, misc. renames
- move VP instance struct from vdd_info into struct voltage domain
- remove _data suffix from structure name
- rename vp_ prefix from vp_common field: accesses are now vp->common
- move vp_enabled bool from vdd_info into VP instance
- remove remaining references to omap_vdd_info

No functional changes.

Signed-off-by: Kevin Hilman <khilman@ti.com>
2011-09-15 12:09:07 -07:00
Kevin Hilman
ce8ebe0dfb OMAP3+: voltage domain: move PMIC struct from vdd_info into struct voltagedomain
Move structure containing PMIC configurable settings into struct
voltagedomain.  In the process, rename from omap_volt_pmic_info to
omap_voltdm_pmic (_info suffix is not helpful.)

No functional changes.

Signed-off-by: Kevin Hilman <khilman@ti.com>
2011-09-15 12:08:57 -07:00
Kevin Hilman
4bcc475ebd OMAP3+: voltage: convert to PRM register access functions
Convert VC/VP register access to use PRM VC/VP accessor functions.  In
the process, move the read/write function pointers from vdd_info into
struct voltagedomain.

No functional changes.

Additional cleanup:
- remove prm_mod field from  VC/VP data structures, the PRM register
  access functions know which PRM module to use.

Signed-off-by: Kevin Hilman <khilman@ti.com>
2011-09-15 12:02:08 -07:00
Kevin Hilman
842ec22852 OMAP3+ VP: replace transaction done check/clear with VP ops
Replace the VP tranxdone check/clear with helper functions from the
PRM layer.

In the process, remove prm_irqst_* voltage structure fields for IRQ
status checking which are no longer needed.

Since these reads/writes of the IRQ status bits were the only PRM
accesses that were not to VC/VP registers, this allows the rest of the
register accesses in the VC/VP code to use VC/VP specific register
access functions (done in the following patch.)

Signed-off-by: Kevin Hilman <khilman@ti.com>
2011-09-15 12:02:07 -07:00
Kevin Hilman
01f48d308d OMAP2+: voltage: split out voltage processor (VP) code into new layer
This patch is primarily a move of VP specific code from voltage.c into
its own code in vp.c and adds prototypes to vp.h

No functional changes, except debugfs...

VP debugfs moved to 'vp' subdir of <debugfs>/voltage/ and 'vp_'
prefixes removed from all debugfs filenames.

Signed-off-by: Kevin Hilman <khilman@ti.com>
2011-09-15 11:39:11 -07:00