#include <linux/uaccess.h>
#include <linux/debugfs.h>
#include <linux/pm_runtime.h>
+#include <linux/iopoll.h>
#include <linux/rockchip/cru.h>
#include <linux/rockchip/pmu.h>
{
struct vpu_subdev_data *data = platform_get_drvdata(pdev);
struct vpu_service_info *pservice = data->pservice;
+ int val;
+ int ret;
dev_info(&pdev->dev, "vcodec shutdown");
atomic_set(&pservice->service_on, 0);
mutex_unlock(&pservice->shutdown_lock);
+ ret = readx_poll_timeout(atomic_read,
+ &pservice->total_running,
+ val, val == 0, 20000, 200000);
+ if (ret == -ETIMEDOUT)
+ dev_err(&pdev->dev, "wait total running time out\n");
+
vcodec_exit_mode(data);
vpu_service_power_on(data, pservice);