static int atomisp_suspend(struct device *dev)
{
	struct atomisp_device *isp = (struct atomisp_device *)
		dev_get_drvdata(dev);
	int ret;

	/*
	 * FIXME: Suspend is not supported by sensors. Abort if any video
	 * node was opened.
	 */
	if (isp->sw_contex.init == true)
		return -EBUSY;

	if (isp->sw_contex.isp_streaming) {
		v4l2_err(&atomisp_dev,
			    "atomisp cannot suspend at this time.\n");
		return -EINVAL;
	}

	/* save IUnit context */
	atomisp_save_iunit_reg(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");
	else
		pm_qos_update_request(&isp->pm_qos, PM_QOS_DEFAULT_VALUE);

	return ret;
}
static int atomisp_runtime_suspend(struct device *dev)
{
	struct atomisp_device *isp = (struct atomisp_device *)
		dev_get_drvdata(dev);
	int ret;

	/* save IUnit context */
	atomisp_save_iunit_reg(isp);

	/*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;
}
Esempio n. 3
0
static void atomisp_pci_shutdown(struct pci_dev *dev)
{
	struct atomisp_device *isp = (struct atomisp_device *)
		pci_get_drvdata(dev);

	if (IS_ISP2400 && atomisp_mrfld_pre_power_down(isp))
		return;

	/*Turn off the ISP d-phy*/
	if (atomisp_ospm_dphy_down(isp))
		return;

	pm_qos_update_request(&isp->pm_qos, PM_QOS_DEFAULT_VALUE);
	if (intel_mid_identify_cpu() == INTEL_MID_CPU_CHIP_VALLEYVIEW2)
		pmu_nc_set_power_state(TNG_ISP_ISLAND, OSPM_ISLAND_DOWN,
					MRFLD_ISPSSPM0);
};
Esempio n. 4
0
static int atomisp_suspend(struct device *dev)
{
	struct atomisp_device *isp = (struct atomisp_device *)
		dev_get_drvdata(dev);
	unsigned long flags;
	int ret;
	/* FIXME: currently only use subdev[0] in single stream mode */
	struct atomisp_sub_device *isp_subdev = &isp->isp_subdev[0];

	/*
	 * FIXME: Suspend is not supported by sensors. Abort if any video
	 * node was opened.
	 */
	if (atomisp_dev_users(isp))
		return -EBUSY;

	spin_lock_irqsave(&isp->lock, flags);
	if (isp_subdev->streaming != ATOMISP_DEVICE_STREAMING_DISABLED) {
		spin_unlock_irqrestore(&isp->lock, flags);
		v4l2_err(&atomisp_dev,
			    "atomisp cannot suspend at this time.\n");
		return -EINVAL;
	}
	spin_unlock_irqrestore(&isp->lock, flags);

	/* Prepare for MRFLD IUNIT power down */
	if (IS_ISP2400) {
		ret = atomisp_mrfld_pre_power_down(isp);
		if (ret)
			return ret;
	}

	/*Turn off the ISP d-phy */
	ret = atomisp_ospm_dphy_down(isp);
	if (ret) {
		dev_err(isp->dev, "fail to power off ISP\n");
		return ret;
	}
	pm_qos_update_request(&isp->pm_qos, PM_QOS_DEFAULT_VALUE);
	if (intel_mid_identify_cpu() == INTEL_MID_CPU_CHIP_VALLEYVIEW2)
		ret = pmu_nc_set_power_state(TNG_ISP_ISLAND, OSPM_ISLAND_DOWN,
					MRFLD_ISPSSPM0);
	return ret;
}
Esempio n. 5
0
static int atomisp_runtime_suspend(struct device *dev)
{
	struct atomisp_device *isp = (struct atomisp_device *)
		dev_get_drvdata(dev);
	int ret;

	if (IS_ISP2400) {
		ret = atomisp_mrfld_pre_power_down(isp);
		if (ret)
			return ret;
	}

	/*Turn off the ISP d-phy*/
	ret = atomisp_ospm_dphy_down(isp);
	if (ret)
		return ret;
	pm_qos_update_request(&isp->pm_qos, PM_QOS_DEFAULT_VALUE);
	if (intel_mid_identify_cpu() == INTEL_MID_CPU_CHIP_VALLEYVIEW2)
		ret = pmu_nc_set_power_state(TNG_ISP_ISLAND, OSPM_ISLAND_DOWN,
					MRFLD_ISPSSPM0);
	return ret;
}