summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/msm
diff options
context:
space:
mode:
authorNarender Ankam <nankam@codeaurora.org>2019-11-06 23:37:02 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2020-03-03 02:33:23 -0800
commit3399105cab52dd586f945d09c0bf56dcbf0f3b07 (patch)
tree9d813c3618cd73d0439abc2f87e0c4cbf66b99bc /drivers/video/fbdev/msm
parent4de2a3bb99f61afeada68c6e6372cad7f9097e12 (diff)
msm: mdss: hdmi: modify min_enc_level logic
Now display HAL will call hdcp library's min_enc_level sysfs entry instead of hdcp2p2's min_enc_level sysfs entry. This will make sure hdcp lib to have better control on content type transmission. hdcp lib will notify hdcp2p2 driver regarding new encryption level. Change-Id: Ibf3c51f7f8ad7db2520a434308361c31379c4948 Signed-off-by: Narender Ankam <nankam@codeaurora.org> Signed-off-by: Ramendra Kumar <ramendra@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev/msm')
-rw-r--r--drivers/video/fbdev/msm/mdss_hdmi_hdcp2p2.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/drivers/video/fbdev/msm/mdss_hdmi_hdcp2p2.c b/drivers/video/fbdev/msm/mdss_hdmi_hdcp2p2.c
index 46e289b6dbd3..b922662d25aa 100644
--- a/drivers/video/fbdev/msm/mdss_hdmi_hdcp2p2.c
+++ b/drivers/video/fbdev/msm/mdss_hdmi_hdcp2p2.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -393,31 +393,22 @@ exit:
return count;
}
-static ssize_t hdmi_hdcp2p2_sysfs_wta_min_level_change(struct device *dev,
- struct device_attribute *attr, const char *buf, size_t count)
+static void mdss_hdmi_hdcp2p2_min_level_change(void *client_ctx,
+ int min_enc_level)
{
struct hdmi_hdcp2p2_ctrl *ctrl =
- hdmi_get_featuredata_from_sysfs_dev(dev, HDMI_TX_FEAT_HDCP2P2);
+ (struct hdmi_hdcp2p2_ctrl *)client_ctx;
struct hdcp_lib_wakeup_data cdata = {
HDCP_LIB_WKUP_CMD_QUERY_STREAM_TYPE};
bool enc_notify = true;
enum hdcp_states enc_lvl;
- int min_enc_lvl;
- int rc;
if (!ctrl) {
pr_err("invalid input\n");
- rc = -EINVAL;
- goto exit;
- }
-
- rc = kstrtoint(buf, 10, &min_enc_lvl);
- if (rc) {
- DEV_ERR("%s: kstrtoint failed. rc=%d\n", __func__, rc);
- goto exit;
+ return;
}
- switch (min_enc_lvl) {
+ switch (min_enc_level) {
case 0:
enc_lvl = HDCP_STATE_AUTH_ENC_NONE;
break;
@@ -431,7 +422,7 @@ static ssize_t hdmi_hdcp2p2_sysfs_wta_min_level_change(struct device *dev,
enc_notify = false;
}
- pr_debug("enc level changed %d\n", min_enc_lvl);
+ pr_debug("enc level changed %d\n", min_enc_level);
cdata.context = ctrl->lib_ctx;
hdmi_hdcp2p2_wakeup_lib(ctrl, &cdata);
@@ -441,10 +432,6 @@ static ssize_t hdmi_hdcp2p2_sysfs_wta_min_level_change(struct device *dev,
if (enc_notify && ctrl->init_data.notify_status)
ctrl->init_data.notify_status(ctrl->init_data.cb_data, enc_lvl);
-
- rc = count;
-exit:
- return rc;
}
static void hdmi_hdcp2p2_auth_failed(struct hdmi_hdcp2p2_ctrl *ctrl)
@@ -584,13 +571,10 @@ static int hdmi_hdcp2p2_read_version(struct hdmi_hdcp2p2_ctrl *ctrl,
return rc;
}
-static DEVICE_ATTR(min_level_change, S_IWUSR, NULL,
- hdmi_hdcp2p2_sysfs_wta_min_level_change);
static DEVICE_ATTR(tethered, S_IRUGO | S_IWUSR, hdmi_hdcp2p2_sysfs_rda_tethered,
hdmi_hdcp2p2_sysfs_wta_tethered);
static struct attribute *hdmi_hdcp2p2_fs_attrs[] = {
- &dev_attr_min_level_change.attr,
&dev_attr_tethered.attr,
NULL,
};
@@ -1030,6 +1014,7 @@ void *hdmi_hdcp2p2_init(struct hdcp_init_data *init_data)
static struct hdcp_client_ops client_ops = {
.wakeup = hdmi_hdcp2p2_wakeup,
+ .notify_lvl_change = mdss_hdmi_hdcp2p2_min_level_change,
.srm_cb = hdmi_hdcp2p2_srm_cb,
};