if (i == GFX_LSS_INDEX)
mid_pmu_cxt->display_off = (int)(state != PCI_D0);
- /*Update the Camera status per ISP Driver Suspended/Resumed */
- if (i == MFLD_ISP_POS)
+ /* Update the Camera status per ISP Driver Suspended/Resumed
+ * ISP power islands are also updated accordingly, otherwise Dx state
+ * in PMCSR refuses to change.
+ */
+ if (i == MFLD_ISP_POS) {
+ status = pmu_nc_set_power_state(APM_ISP_ISLAND | APM_IPH_ISLAND,
+ (state != PCI_D0) ?
+ OSPM_ISLAND_DOWN : OSPM_ISLAND_UP,
+ APM_REG_TYPE);
+ if (status)
+ goto unlock;
+
mid_pmu_cxt->camera_off = (int)(state != PCI_D0);
+ }
if (pmu_num == PMU_NUM_2) {
return 0;
}
-/*Turn off ISP power island*/
-int atomisp_ospm_power_island_down(struct atomisp_device *isp)
+/*Turn off ISP dphy */
+int atomisp_ospm_dphy_down(struct atomisp_device *isp)
{
u32 pwr_cnt = 0;
int timeout = 100;
pwr_cnt = atomisp_msg_read32(isp, IUNITPHY_PORT, CSI_CONTROL);
pwr_cnt |= 0x300;
atomisp_msg_write32(isp, IUNITPHY_PORT, CSI_CONTROL, pwr_cnt);
-
- /* Power down IPH/ISP */
- if (pmu_nc_set_power_state(APM_ISP_ISLAND | APM_IPH_ISLAND,
- OSPM_ISLAND_DOWN, APM_REG_TYPE))
- return -EINVAL;
-
isp->sw_contex.power_state = ATOM_ISP_POWER_DOWN;
+
return 0;
}
-/*Turn on ISP power island*/
-int atomisp_ospm_power_island_up(struct atomisp_device *isp)
+/*Turn on ISP dphy */
+int atomisp_ospm_dphy_up(struct atomisp_device *isp)
{
u32 pwr_cnt = 0;
- /* Power up IPH/ISP */
- if (pmu_nc_set_power_state(APM_ISP_ISLAND | APM_IPH_ISLAND,
- OSPM_ISLAND_UP, APM_REG_TYPE))
- return -EINVAL;
-
/* power on DPHY */
pwr_cnt = atomisp_msg_read32(isp, IUNITPHY_PORT, CSI_CONTROL);
pwr_cnt &= ~0x300;
atomisp_msg_write32(isp, IUNITPHY_PORT, CSI_CONTROL, pwr_cnt);
isp->sw_contex.power_state = ATOM_ISP_POWER_UP;
+
return 0;
}
int atomisp_save_iunit_reg(struct atomisp_device *isp);
int atomisp_restore_iunit_reg(struct atomisp_device *isp);
-int atomisp_ospm_power_island_down(struct atomisp_device *isp);
-int atomisp_ospm_power_island_up(struct atomisp_device *isp);
+int atomisp_ospm_dphy_down(struct atomisp_device *isp);
+int atomisp_ospm_dphy_up(struct atomisp_device *isp);
int atomisp_exif_makernote(struct atomisp_device *isp,
void *config);
/* save IUnit context */
atomisp_save_iunit_reg(isp);
- /*Turn off the ISP power island*/
- ret = atomisp_ospm_power_island_down(isp);
+ /*Turn off the ISP d-phy*/
+ ret = atomisp_ospm_dphy_down(isp);
return ret;
}
int ret;
if (isp->sw_contex.power_state == ATOM_ISP_POWER_DOWN) {
- /*Turn on ISP power island*/
- ret = atomisp_ospm_power_island_up(isp);
+ /*Turn on ISP d-phy */
+ ret = atomisp_ospm_dphy_up(isp);
if (ret) {
v4l2_err(&atomisp_dev,
"Failed to power up ISP!.\n");
/* save IUnit context */
atomisp_save_iunit_reg(isp);
- /*Turn off the ISP power island*/
- ret = atomisp_ospm_power_island_down(isp);
+ /*Turn off the ISP d-phy */
+ ret = atomisp_ospm_dphy_down(isp);
if (ret)
v4l2_err(&atomisp_dev,
"fail to power off ISP\n");
dev_get_drvdata(dev);
int ret;
- /*Turn on ISP power island*/
- ret = atomisp_ospm_power_island_up(isp);
+ /*Turn on ISP d-phy */
+ ret = atomisp_ospm_dphy_up(isp);
if (ret) {
v4l2_err(&atomisp_dev,
"Failed to power up ISP!.\n");