From 6ee16346b77f60e04cc89136d460f565b4b3a1a2 Mon Sep 17 00:00:00 2001 From: Swetha Chintavatla Date: Wed, 16 Oct 2024 14:30:30 +0530 Subject: [PATCH] interconnect: qcom: icc-rpmh: enable support for no secondary display Add support for No Secondary display by marking necessary ICC nodes, BCMs and voters as disabled based on fuses read during the probe. Initlialize the providers based on the disabled nodes, so that multimedia providers are probed successfully. Change-Id: Ia4eed5498c0c2c9346946b41703c1c2784b9c9b3 Signed-off-by: Swetha Chintavatla --- drivers/interconnect/qcom/icc-rpmh.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpmh.c b/drivers/interconnect/qcom/icc-rpmh.c index 9fca90a41489..08a3f4387082 100644 --- a/drivers/interconnect/qcom/icc-rpmh.c +++ b/drivers/interconnect/qcom/icc-rpmh.c @@ -322,8 +322,8 @@ static struct regmap *qcom_icc_rpmh_map(struct platform_device *pdev, static bool is_voter_disabled(char *voter) { - if ((strnstr(voter, "disp", strlen(voter)) && - (socinfo_get_part_info(PART_DISPLAY) || socinfo_get_part_info(PART_DISPLAY1))) || + if ((!strcmp(voter, "disp") && socinfo_get_part_info(PART_DISPLAY)) || + (!strcmp(voter, "disp2") && socinfo_get_part_info(PART_DISPLAY1)) || (strnstr(voter, "cam", strlen(voter)) && socinfo_get_part_info(PART_CAMERA))) return true; @@ -357,7 +357,12 @@ static int qcom_icc_init_disabled_parts(struct qcom_icc_provider *qp) if (!qn) continue; - if (strnstr(qn->name, voter_name, strlen(qn->name))) + /* + * Find the ICC node to be disabled by comparing voter_name in + * node name string, adjust the start position accordingly + */ + if (!strcmp(qn->name + (strlen(qn->name) - strlen(voter_name)), + voter_name)) qn->disabled = true; } }