* 02110-1301, USA.
*
*/
+#include <linux/pm_qos_params.h>
#include <linux/async.h>
#include "atomisp_ioctl.h"
#include "atomisp_cmd.h"
/*Turn off the ISP d-phy*/
ret = atomisp_ospm_dphy_down(isp);
+ if (!ret)
+ pm_qos_update_request(&isp->pm_qos, PM_QOS_DEFAULT_VALUE);
return ret;
}
dev_get_drvdata(dev);
int ret;
+ pm_qos_update_request(&isp->pm_qos, ATOMISP_MAX_ISR_LATENCY);
if (isp->sw_contex.power_state == ATOM_ISP_POWER_DOWN) {
/*Turn on ISP d-phy */
ret = atomisp_ospm_dphy_up(isp);
if (ret)
v4l2_err(&atomisp_dev,
"fail to power off ISP\n");
+ else
+ pm_qos_update_request(&isp->pm_qos, PM_QOS_DEFAULT_VALUE);
return ret;
}
dev_get_drvdata(dev);
int ret;
+ pm_qos_update_request(&isp->pm_qos, ATOMISP_MAX_ISR_LATENCY);
+
/*Turn on ISP d-phy */
ret = atomisp_ospm_dphy_up(isp);
if (ret) {
atomisp_msi_irq_init(isp, dev);
+ pm_qos_add_request(&isp->pm_qos, PM_QOS_CPU_DMA_LATENCY,
+ PM_QOS_DEFAULT_VALUE);
/*
* fixing me!
* MRFLD VP does not implement
pm_runtime_forbid(&dev->dev);
pm_runtime_get_noresume(&dev->dev);
+ pm_qos_remove_request(&isp->pm_qos);
atomisp_msi_irq_uninit(isp, dev);
free_irq(dev->irq, isp);
#ifndef ATOMISP_INTERNAL_H_
#define ATOMISP_INTERNAL_H_
+#include <linux/pm_qos_params.h>
#include <media/v4l2-dev.h>
#include <media/v4l2-device.h>
#include <media/v4l2-subdev.h>
#define ATOMISP_WDT_TIMEOUT (4 * MSEC_PER_SEC) /* msecs */
#define ATOMISP_WDT_MAX_TIMEOUTS 5
+/*
+ * Define how fast CPU should be able to serve ISP interrupts.
+ * The bigger the value, the higher risk that the ISP is not
+ * triggered sufficiently fast for it to process image during
+ * vertical blanking time, increasing risk of dropped frames.
+ * 1000 us is a reasonable value considering that the processing
+ * time is typically ~2000 us.
+ */
+#define ATOMISP_MAX_ISR_LATENCY 1000
+
int atomisp_video_init(struct atomisp_video_pipe *video, const char *name);
void atomisp_video_unregister(struct atomisp_video_pipe *video);
int atomisp_video_register(struct atomisp_video_pipe *video,
const struct firmware *firmware;
struct timer_list wdt;
+ struct pm_qos_request_list pm_qos;
+
struct sh_css_acc_fw *acc_fw[ATOMISP_ACC_FW_MAX];
unsigned int acc_fw_handle;
int acc_fw_count;