static int hdmi_runtime_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct s5p_hdmi_platdata *pdata = pdev->dev.platform_data; struct v4l2_subdev *sd = dev_get_drvdata(dev); struct hdmi_device *hdev = sd_to_hdmi_dev(sd); struct hdmi_resources *res = &hdev->res; int ret = 0; dev_dbg(dev, "%s\n", __func__); if (hdev->probe_state == HDMI_PROBING) return 0; /* power-on hdmiphy */ if (pdata->hdmiphy_enable) pdata->hdmiphy_enable(pdev, 1); clk_enable(res->sclk_hdmi); if (is_ip_ver_5a || is_ip_ver_5s) { hdmiphy_set_power(hdev, 1); } else { ret = v4l2_subdev_call(hdev->phy_sd, core, s_power, 1); if (ret) { dev_err(dev, "failed to turn on hdmiphy\n"); goto fail; } } hdmi_sw_reset(hdev); hdmi_phy_sw_reset(hdev); ret = hdmi_conf_apply(hdev); if (ret) goto fail; dev_dbg(dev, "poweron succeed\n"); return 0; fail: clk_disable(res->sclk_hdmi); v4l2_subdev_call(hdev->phy_sd, core, s_power, 0); if (pdata->hdmiphy_enable) pdata->hdmiphy_enable(pdev, 0); dev_err(dev, "poweron failed\n"); return ret; }
static int hdmi_runtime_resume(struct device *dev) { struct v4l2_subdev *sd = dev_get_drvdata(dev); struct hdmi_device *hdev = sd_to_hdmi_dev(sd); struct hdmi_resources *res = &hdev->res; int ret = 0; dev_dbg(dev, "%s\n", __func__); hdmiphy_set_isolation(hdev, 1); hdmiphy_set_conf(hdev, 1); clk_prepare_enable(res->hdmiphy); clk_prepare_enable(res->hdmi); hdmiphy_set_power(hdev, 1); hdmi_clock_set(hdev, 1); hdmi_sw_reset(hdev); hdmi_phy_sw_reset(hdev); ret = hdmi_conf_apply(hdev); if (ret) goto fail; dev_dbg(dev, "poweron succeed\n"); return 0; fail: clk_disable_unprepare(res->hdmi); clk_disable_unprepare(res->hdmiphy); hdmiphy_set_isolation(hdev, 0); dev_err(dev, "poweron failed\n"); return ret; }