Skip to content

Commit

Permalink
SYSLINK: ipu-pm ported changes specific for 2.6.38 vanilla l-o kernel.
Browse files Browse the repository at this point in the history
This patch adds vanilla l-o 2.6.38 specific changes. The patch might get
redundant once the OMAP_PM specific changes/ baseport changes go in.

Check the return value of kfifo_out ti avoid a warning

Do not use any constraint req/rel since the fwk is not
ready yet.

Signed-off-by: Miguel Vadillo <[email protected]>
Signed-off-by: Subramaniam C.A <[email protected]>
Signed-off-by: Cris Jansson <[email protected]>
  • Loading branch information
Subramaniam C.A authored and Thadeu Lima de Souza Cascardo committed Feb 8, 2017
1 parent 071de7f commit 3596507
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
6 changes: 4 additions & 2 deletions arch/arm/mach-omap2/ipu_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include <mach/irqs.h>
#include <plat/omap_hwmod.h>
#include <plat/common.h>
#include <plat/omap_device.h>
#include <plat/omap-pm.h>
#include <linux/platform_device.h>
Expand Down Expand Up @@ -89,7 +90,7 @@ inline int ipu_pm_module_set_rate(unsigned rsrc,
unsigned target_rsrc,
unsigned rate)
{
int ret;
int ret = 0;
unsigned target;
struct device *dp;
struct omap_ipupm_mod_platform_data *pd;
Expand All @@ -114,8 +115,9 @@ inline int ipu_pm_module_set_rate(unsigned rsrc,
} else
dp = pd[target].dev;
}

#ifdef CONFIG_OMAP_PM
ret = omap_device_set_rate(pd[rsrc].dev, dp, rate);
#endif
if (ret)
pr_err("device set rate failed %s", pd[target_rsrc].oh_name);
err_ret:
Expand Down
2 changes: 1 addition & 1 deletion drivers/dsp/syslink/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ config SYSLINK_DUCATI_PM
config SYSLINK_IPU_SELF_HIBERNATION
bool "Enable IPU Self hibernation"
depends on SYSLINK_DUCATI_PM
default y
default n
help
IPU will hibernate by it self after a configurable time, this
controls the self hibernation, IPU will hibernate when a system
Expand Down
45 changes: 24 additions & 21 deletions drivers/dsp/syslink/ipu_pm/ipu_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ static char *aux_clk_name[NUM_AUX_CLK] = {

static char *aux_clk_source_name[] = {
"sys_clkin_ck",
"dpll_core_m3_ck",
"dpll_per_m3_ck",
"dpll_core_m3x2_ck",
"dpll_per_m3x2_ck",
NULL
} ;

Expand Down Expand Up @@ -627,9 +627,12 @@ static void ipu_pm_work(struct work_struct *work)
/* set retval for each iteration asumming error */
retval = PM_UNSUPPORTED;
spin_lock_irq(&handle->lock);
kfifo_out(&handle->fifo, &im, sizeof(im));
retval = kfifo_out(&handle->fifo, &im, sizeof(im));
spin_unlock_irq(&handle->lock);

if (retval == 0)
break;

/* Get the payload */
pm_msg.whole = im.pm_msg;
/* Get the rcb_num */
Expand Down Expand Up @@ -1425,9 +1428,9 @@ static inline int ipu_pm_get_iss(struct ipu_pm_object *handle,
* independent control this also duplicates the
* above call to avoid read modify write locking.
*/
cm_write_mod_reg((OPTFCLKEN | CAM_ENABLED),
/*cm_write_mod_reg((OPTFCLKEN | CAM_ENABLED),
OMAP4430_CM2_CAM_MOD,
OMAP4_CM_CAM_ISS_CLKCTRL_OFFSET);
OMAP4_CM_CAM_ISS_CLKCTRL_OFFSET);*/

#ifdef CONFIG_OMAP_PM
pr_debug("Request MPU wakeup latency\n");
Expand Down Expand Up @@ -1728,11 +1731,11 @@ static inline int ipu_pm_rel_fdif(struct ipu_pm_object *handle,

#ifdef SR_WA
/* Make sure the clock domain is in idle if not softreset */
if ((cm_read_mod_reg(OMAP4430_CM2_CAM_MOD,
/*if ((cm_read_mod_reg(OMAP4430_CM2_CAM_MOD,
OMAP4_CM_CAM_CLKSTCTRL_OFFSET)) & 0x400) {
__raw_writel(__raw_readl(fdifHandle + 0x10) | 0x1,
fdifHandle + 0x10);
}
}*/
#endif

params->pm_fdif_counter--;
Expand Down Expand Up @@ -1922,11 +1925,11 @@ static inline int ipu_pm_rel_iss(struct ipu_pm_object *handle,

#ifdef SR_WA
/* Make sure the clock domain is in idle if not softreset */
if ((cm_read_mod_reg(OMAP4430_CM2_CAM_MOD,
/*if ((cm_read_mod_reg(OMAP4430_CM2_CAM_MOD,
OMAP4_CM_CAM_CLKSTCTRL_OFFSET)) & 0x100) {
__raw_writel(__raw_readl(issHandle + 0x10) | 0x1,
issHandle + 0x10);
}
}*/
#endif

/* FIXME:
Expand All @@ -1935,9 +1938,9 @@ static inline int ipu_pm_rel_iss(struct ipu_pm_object *handle,
* independent control this also duplicates the
* above call to avoid read modify write locking
*/
cm_write_mod_reg(CAM_DISABLED,
/*cm_write_mod_reg(CAM_DISABLED,
OMAP4430_CM2_CAM_MOD,
OMAP4_CM_CAM_ISS_CLKCTRL_OFFSET);
OMAP4_CM_CAM_ISS_CLKCTRL_OFFSET);*/
params->pm_iss_counter--;
pr_debug("Release ISS\n");

Expand Down Expand Up @@ -2481,18 +2484,18 @@ int ipu_pm_save_ctx(int proc_id)
if (app_loaded) {
pr_info("Sleep APPM3\n");
retval = rproc_sleep(app_rproc);
cm_write_mod_reg(HW_AUTO,
/*cm_write_mod_reg(HW_AUTO,
OMAP4430_CM2_CORE_MOD,
OMAP4_CM_DUCATI_CLKSTCTRL_OFFSET);
OMAP4_CM_DUCATI_CLKSTCTRL_OFFSET);*/
if (retval)
goto error;
handle->rcb_table->state_flag |= APP_PROC_DOWN;
}
pr_info("Sleep SYSM3\n");
retval = rproc_sleep(sys_rproc);
cm_write_mod_reg(HW_AUTO,
/*cm_write_mod_reg(HW_AUTO,
OMAP4430_CM2_CORE_MOD,
OMAP4_CM_DUCATI_CLKSTCTRL_OFFSET);
OMAP4_CM_DUCATI_CLKSTCTRL_OFFSET);*/
if (retval)
goto error;
handle->rcb_table->state_flag |= SYS_PROC_DOWN;
Expand Down Expand Up @@ -2558,9 +2561,9 @@ int ipu_pm_restore_ctx(int proc_id)
pr_debug("hibernateAllowed=%d\n",
handle->rcb_table->pm_flags.hibernateAllowed);
first_time = 0;
cm_write_mod_reg(HW_AUTO,
/*cm_write_mod_reg(HW_AUTO,
OMAP4430_CM2_CORE_MOD,
OMAP4_CM_DUCATI_CLKSTCTRL_OFFSET);
OMAP4_CM_DUCATI_CLKSTCTRL_OFFSET);*/
#ifdef CONFIG_OMAP_PM
retval = omap_pm_set_max_sdma_lat(&pm_qos_handle_2,
IPU_PM_MM_MPU_LAT_CONSTRAINT);
Expand Down Expand Up @@ -2596,18 +2599,18 @@ int ipu_pm_restore_ctx(int proc_id)

pr_info("Wakeup SYSM3\n");
retval = rproc_wakeup(sys_rproc);
cm_write_mod_reg(HW_AUTO,
/*cm_write_mod_reg(HW_AUTO,
OMAP4430_CM2_CORE_MOD,
OMAP4_CM_DUCATI_CLKSTCTRL_OFFSET);
OMAP4_CM_DUCATI_CLKSTCTRL_OFFSET);*/
if (retval)
goto error;
handle->rcb_table->state_flag &= ~SYS_PROC_DOWN;
if (ipu_pm_get_state(proc_id) & APP_PROC_LOADED) {
pr_info("Wakeup APPM3\n");
retval = rproc_wakeup(app_rproc);
cm_write_mod_reg(HW_AUTO,
/*cm_write_mod_reg(HW_AUTO,
OMAP4430_CM2_CORE_MOD,
OMAP4_CM_DUCATI_CLKSTCTRL_OFFSET);
OMAP4_CM_DUCATI_CLKSTCTRL_OFFSET);*/
if (retval)
goto error;
handle->rcb_table->state_flag &= ~APP_PROC_DOWN;
Expand Down

0 comments on commit 3596507

Please sign in to comment.