int hdmi_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) { struct hdmi_device *hdev = sd_to_hdmi_dev(sd); struct device *dev = hdev->dev; if (!pm_runtime_suspended(hdev->dev) && !hdev->hpd_user_checked) ctrl->value = hdmi_hpd_status(hdev); else ctrl->value = atomic_read(&hdev->hpd_state); dev_dbg(dev, "HDMI cable is %s\n", ctrl->value ? "connected" : "disconnected"); return 0; }
int platform_ap_hdmi_hdcp_auth(struct sii8240_data *sii8240) { int ret = 0; if (!sii8240->ap_hdcp_success) { if (!hdmi_hpd_status()) { pr_info("sii8240: HDMI hpd is low\n"); return 0; } sii8240->mhl_ddc_bypass(true); hdcp_ctrl_global->hdcp_state = HDCP_STATE_AUTHENTICATING; ret = hdmi_hdcp_authentication_part1(hdcp_ctrl_global); sii8240->mhl_ddc_bypass(false); if (ret) { pr_err("%s: HDMI HDCP Auth Part I failed\n", __func__); return ret; } hdcp_ctrl_global->hdcp_state = HDCP_STATE_AUTHENTICATED; sii8240->ap_hdcp_success = true; msleep(100); } return ret; }
bool platform_hdmi_hpd_status(void) { return hdmi_hpd_status(); }