Exemplo n.º 1
0
static int fimg2d_runtime_suspend(struct device *dev)
{
	fimg2d_debug("runtime suspend... done\n");
	if (ip_is_g2d_5h() || ip_is_g2d_5hp())
		exynos5433_fimg2d_clk_set_osc(ctrl);
	return 0;
}
Exemplo n.º 2
0
void fimg2d_power_control(struct fimg2d_control *ctrl, enum fimg2d_pw_status status)
{
	if (status == FIMG2D_PW_ON) {
		if (ip_is_g2d_5h() || ip_is_g2d_5hp() || ip_is_g2d_7i()) {
			pm_runtime_get_sync(ctrl->dev);
			fimg2d_debug("Done pm_runtime_get_sync()\n");
		}
	} else if (status == FIMG2D_PW_OFF) {
		if (ip_is_g2d_5h() || ip_is_g2d_5hp())
			exynos5433_fimg2d_clk_set_osc(ctrl);
		if (ip_is_g2d_5h() || ip_is_g2d_5hp() || ip_is_g2d_7i()){
			pm_runtime_put_sync(ctrl->dev);
			fimg2d_debug("Done pm_runtime_put_sync()\n");
		}
	} else
		fimg2d_debug("status failed : %d\n", status);
}
Exemplo n.º 3
0
static int fimg2d_suspend(struct device *dev)
{
	unsigned long flags;
	int retry = POLL_RETRY;

	g2d_spin_lock(&ctrl->bltlock, flags);
	atomic_set(&ctrl->suspended, 1);
	g2d_spin_unlock(&ctrl->bltlock, flags);
	while (retry--) {
		if (fimg2d_queue_is_empty(&ctrl->cmd_q))
			break;
		mdelay(POLL_TIMEOUT);
	}
	if (ip_is_g2d_5h() || ip_is_g2d_5hp())
		exynos5433_fimg2d_clk_set_osc(ctrl);
	fimg2d_info("suspend... done\n");
	return 0;
}
Exemplo n.º 4
0
static int fimg2d_runtime_resume(struct device *dev)
{
	int ret = 0;

	if (ip_is_g2d_5r()) {
		ret = fimg2d_clk_set_gate(ctrl);
		if (ret) {
			fimg2d_err("failed to fimg2d_clk_set_gate()\n");
			ret = -ENOENT;
		}
	} else if (ip_is_g2d_5h() || ip_is_g2d_5hp()) {
		ret = exynos5430_fimg2d_clk_set(ctrl);
		if (ret) {
			fimg2d_err("failed to exynos5430_fimg2d_clk_set()\n");
			ret = -ENOENT;
		}
	}

	fimg2d_debug("runtime resume... done\n");
	return ret;
}
Exemplo n.º 5
0
static int fimg2d_resume(struct device *dev)
{
	unsigned long flags;
	int ret = 0;

	g2d_spin_lock(&ctrl->bltlock, flags);
	atomic_set(&ctrl->suspended, 0);
	g2d_spin_unlock(&ctrl->bltlock, flags);
	/* G2D clk gating mask */
	if (ip_is_g2d_5ar2()) {
		fimg2d_clk_on(ctrl);
		fimg2d_clk_off(ctrl);
	} else if (ip_is_g2d_5hp()) {
		ret = exynos5430_fimg2d_clk_set(ctrl);
		if (ret) {
			fimg2d_err("failed to exynos5430_fimg2d_clk_set()\n");
			return -ENOENT;
		}
	}
	fimg2d_info("resume... done\n");
	return ret;
}