OMAP: omap_device: API to modify SYSCONFIG register
Subsystems (4)
cover OMAP: omap_device: API to modify SYSCONFIG register
Certain peripherals require autoidle bits to be disabled before performing some operations. This patch series provides APIs in omap_device layer to modify the SYSCONFIG register.
Since current implementation of PM run time framework does not support changing sysconfig settings during middle of the on going operation, these APIs will support the same.
For e.g McBSP 2 and 3 in OMAP3 has sidetone feature which requires autoidle to be disabled before starting the sidetone.
McBSP also requires the SYSCONFIG to be in NOIDLE when ELEMENTSYNCH mode is selected for DMA operation.
Created on top of linux OMAP master (linux-omap-2.6 :master) Tested on OMAP4430 and OMAP3430 SDP boards. Verified that this patch series does not break the OMAP1 build.
Highlihgts:
* Creates 3 separate API's to change the idle mode to NOIDLE, SMARTIDLE and FORCEIDLE and one more API to change the idlemode to default value based on the hwmod flag. This change is done to align with the discussion on [3]
* Added hwmod mutex in omap hwmod APIs that modifies SYSCONFIG register.
* omap_hwmod_set_slave_idlemode() is not modified to take true/false kind-of argument since 3 states are associated with SIDLE bits (force, no and smart).
These changes were made to align with Benoit's and Paul's comments for a similar patch written by Manjunath [1] for changing MSTANDBY bits.
The discussions that happened for the RFC patch can be found at [2]
[1]: http://www.mail-archive.com/[email protected]/msg39647.html
[2]: https://patchwork.kernel.org/patch/134371/
[3]: http://www.mail-archive.com/[email protected]/msg39615.html
Kishon Vijay Abraham I (2):
OMAP: hwmod: API to handle autoidle mode
OMAP: omap_device: API to modify AUTOIDLE and SMARTIDLE bits
arch/arm/mach-omap2/omap_hwmod.c | 35 +++++++ arch/arm/plat-omap/include/plat/omap_device.h | 4 + arch/arm/plat-omap/include/plat/omap_hwmod.h | 1 + arch/arm/plat-omap/omap_device.c | 118 +++++++++++++++++++++++++ 4 files changed, 158 insertions(+), 0 deletions(-)
PATCH 1/2 OMAP: hwmod: API to handle autoidle mode
Create a new API that forms a wrapper to _set_module_autoidle() to modify the AUTOIDLE bit.
This API is intended to be used by drivers that requires direct manipulation of the AUTOIDLE bits in SYSCONFIG register. McBSP driver requires autoidle bit to be enabled/disabled while using sidetone feature.
--- arch/arm/mach-omap2/omap_hwmod.c | 35 ++++++++++++++++++++++++++ arch/arm/plat-omap/include/plat/omap_hwmod.h | 1 + 2 files changed, 36 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +35 -0
@@ -1251,6 +1251,41 @@ int _omap_hwmod_idle(struct omap_hwmod *oh) }/** +* omap_hwmod_set_slave_autoidle - set the hwmod's OCP slave autoidle +* @oh: struct omap_hwmod * +* @autoidle: desired AUTOIDLE bitfield value (0 or 1) +* +* Sets the IP block's OCP slave autoidle in hardware, and updates our +* local copy. Intended to be used by drivers that requires +* direct manipulation of the AUTOIDLE bits. +* Returns -EINVAL if @oh is null, or passes along the return value +* from _set_module_autoidle(). +* +* Any users of this function should be scrutinized carefully. +*/ +int omap_hwmod_set_slave_autoidle (struct omap_hwmod *oh,u8 autoidle) +{ +u32 v; +int retval =0 ; + +if (!oh) +return -EINVAL ; + +mutex_lock (&omap_hwmod_mutex); + + v = oh->_sysc_cache; + + retval =_set_module_autoidle (oh, autoidle, &v); + +if (!retval) +_write_sysconfig (v, oh); + +mutex_unlock (&omap_hwmod_mutex); + +return retval; +} + +/** * _shutdown - shutdown an omap_hwmod * @oh: struct omap_hwmod * *
arch/arm/plat-omap/include/plat/omap_hwmod.h +1 -0
@@ -525,6 +525,7 @@ int omap_hwmod_enable_clocks(struct omap_hwmod *oh);int omap_hwmod_disable_clocks (struct omap_hwmod *oh);int omap_hwmod_set_slave_idlemode (struct omap_hwmod *oh,u8 idlemode); +int omap_hwmod_set_slave_autoidle (struct omap_hwmod *oh,u8 autoidle);int omap_hwmod_reset (struct omap_hwmod *oh);void omap_hwmod_ocp_barrier (struct omap_hwmod *oh);
Signature · 1 line
1.7.0.4
PATCH 2/2 OMAP: omap_device: API to modify AUTOIDLE and SMARTIDLE bits
In reply to Kishon Vijay Abraham IProvide APIs to be used by the driver in order to modify AUTOIDLE and SIDLE bits. These APIs in turn call hwmod APIs to modify the SYSCONFIG register.
--- arch/arm/plat-omap/include/plat/omap_device.h | 6 + arch/arm/plat-omap/omap_device.c | 176 +++++++++++++++++++++++++ 2 files changed, 182 insertions(+), 0 deletions(-)
arch/arm/plat-omap/include/plat/omap_device.h +6 -0
@@ -109,6 +109,12 @@ int omap_device_align_pm_lat(struct platform_device *pdev,struct powerdomain *omap_device_get_pwrdm (struct omap_device *od);/* Other */ +int omap_device_noidle (struct omap_device *od); +int omap_device_smartidle (struct omap_device *od); +int omap_device_forceidle (struct omap_device *od); +int omap_device_default_idle (struct omap_device *od); +int omap_device_enable_autoidle (struct omap_device *od); +int omap_device_disable_autoidle (struct omap_device *od);int omap_device_idle_hwmods (struct omap_device *od);int omap_device_enable_hwmods (struct omap_device *od);
arch/arm/plat-omap/omap_device.c +176 -0
182 lines not on this page · raw message
Signature · 1 line
1.7.0.4