コード例 #1
0
static int _od_suspend_noirq(struct device *dev)
{
	struct platform_device *pdev = to_platform_device(dev);
	struct omap_device *od = to_omap_device(pdev);
	int ret;

	/* Don't attempt late suspend on a driver that is not bound */
	if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER)
		return 0;

	ret = pm_generic_suspend_noirq(dev);

	if (!ret && !pm_runtime_status_suspended(dev)) {
		if (pm_generic_runtime_suspend(dev) == 0) {
			if (!pm_runtime_suspended(dev)) {
				/* NOTE: *might* indicate driver race */
				dev_dbg(dev, "%s: Force suspending\n",
					__func__);
				pm_runtime_set_suspended(dev);
				od->flags |= OMAP_DEVICE_SUSPEND_FORCED;
			}
			omap_device_idle(pdev);
			od->flags |= OMAP_DEVICE_SUSPENDED;
		}
	}

	return ret;
}
コード例 #2
0
ファイル: runtime.c プロジェクト: 1DeMaCr/Codina_Kernel-3.x
static int ux500_pd_amba_suspend_noirq(struct device *dev)
{
	struct pm_runtime_data *prd = __to_prd(dev);
	int (*callback)(struct device *) = NULL;
	int ret = 0;
	bool is_suspended = pm_runtime_status_suspended(dev);

	dev_vdbg(dev, "%s()\n", __func__);

	/*
	 * Do not bypass AMBA bus pm functions by calling generic
	 * pm directly. A future fix could be to implement a
	 * "pm_bus_generic_*" API which we can use instead.
	 */
	if (dev->bus && dev->bus->pm)
		callback = dev->bus->pm->suspend_noirq;

	if (callback)
		ret = callback(dev);
	else
		ret = pm_generic_suspend_noirq(dev);

	if (!ret && !is_suspended)
		ux500_pd_disable(prd);

	return ret;
}
コード例 #3
0
ファイル: omap_device.c プロジェクト: D-Roch/linux
static int _od_suspend_noirq(struct device *dev)
{
	struct platform_device *pdev = to_platform_device(dev);
	struct omap_device *od = to_omap_device(pdev);
	int ret;

	if (od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND)
		return pm_generic_suspend_noirq(dev);

	ret = pm_generic_suspend_noirq(dev);

	if (!ret && !pm_runtime_status_suspended(dev)) {
		if (pm_generic_runtime_suspend(dev) == 0) {
			omap_device_idle(pdev);
			od->flags |= OMAP_DEVICE_SUSPENDED;
		}
	}

	return ret;
}
コード例 #4
0
ファイル: omap_device.c プロジェクト: Camedpuffer/linux
static int _od_suspend_noirq(struct device *dev)
{
	struct platform_device *pdev = to_platform_device(dev);
	struct omap_device *od = to_omap_device(pdev);
	int ret;

	/* Don't attempt late suspend on a driver that is not bound */
	if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER)
		return 0;

	ret = pm_generic_suspend_noirq(dev);

	if (!ret && !pm_runtime_status_suspended(dev)) {
		if (pm_generic_runtime_suspend(dev) == 0) {
			omap_device_idle(pdev);
			od->flags |= OMAP_DEVICE_SUSPENDED;
		}
	}

	return ret;
}