From patchwork Wed Sep 11 10:08:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Soutrik Mukhopadhyay X-Patchwork-Id: 13800160 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59F17153820; Wed, 11 Sep 2024 10:08:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726049324; cv=none; b=u9pir3wqvjKuI7WGFpDblUz9DcZHZIkmN4N/P0HrAjdlj4rkDYpc+ugb7Rb6ntzjWzffx8j4chz88j7Fl8+iIlN58boJUJ0oDS+dfs9olJ/sD+tOHO4/0e9V+/0YE0+yb8xjO7WMzrKCCZIGaQiOc2J5a3+e5Ks7ZgYf4Xjh6XE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726049324; c=relaxed/simple; bh=NuETh+8wFJDjoJUkC9uIeV6ZyHOYIfJ5RQDS4VQ4V1w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=ka5v3qjis1upkJypXqRttaqGmE8T9n103M/FAyIh36qb0z9qYjNsa03Y3Gkbo5GHyn3ulVzCnSOM1wqZlxfiR22n0Z7BnvxqZbIJUCSy7XQvK8xMOCQIPUlnWrvSWHiHJUwqFdxuWzakuYu9QVQtJa7utGD1UUWcWB+qYTKTP7Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=qualcomm.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=Nah/2Vru; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Nah/2Vru" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48B3OL88014687; Wed, 11 Sep 2024 10:08:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:date:from:in-reply-to:message-id:references:subject:to; s= qcppdkim1; bh=wrZtguuFdnaBHtOym5ObpMbAhAuOXUvWYAwHCaAEG60=; b=Na h/2VruJ209F3TTt+5u5B0lUoKjxN1PLFlo8cXLPddulUxf9Vnupe8vlEICSDA/nr /wHnmi3rcvOzkkbatctxarGEsSkV8urvEqOL8NV23f4yWY65rx069wIOrCGTX1Fj tWBQOa6uVN3lC2uj2Ux99FuPBHrrC8Gj00XhbDMPAzXh7Fbp0P6pARbeXRaQaWE3 FqKQilJF+33yrV1q8kpeDBM1xoLnF/WMBOc2EWbSykSVAEBr0JGZKlL9morKDVMo Dc3lC0nc3Mz+Ynzwpj74ylXZ13+CeL7hauNQYpp/M96D0/gGuEMezupU7kC/Hk5z Y/qLGcIPS9Pv+/R6ri7A== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41gy8p16p4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Sep 2024 10:08:25 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTP id 48BA8L75019431; Wed, 11 Sep 2024 10:08:21 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 41h168s1sx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 11 Sep 2024 10:08:21 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 48BA8KcI019408; Wed, 11 Sep 2024 10:08:20 GMT Received: from hu-maiyas-hyd.qualcomm.com (hu-mukhopad-hyd.qualcomm.com [10.147.244.250]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 48BA8Kvk019401; Wed, 11 Sep 2024 10:08:20 +0000 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 3978529) id 9253B5000AD; Wed, 11 Sep 2024 15:38:18 +0530 (+0530) From: Soutrik Mukhopadhyay To: vkoul@kernel.org, kishon@kernel.org, konradybcio@kernel.org, andersson@kernel.org, simona@ffwll.ch, dmitry.baryshkov@linaro.org, abel.vesa@linaro.org, robdclark@gmail.com, quic_abhinavk@quicinc.com, sean@poorly.run, marijn.suijten@somainline.org, airlied@gmail.com, daniel@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, quic_khsieh@quicinc.com, konrad.dybcio@linaro.org, quic_parellan@quicinc.com, quic_bjorande@quicinc.com Cc: Soutrik Mukhopadhyay , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, quic_riteshk@quicinc.com, quic_vproddut@quicinc.com Subject: [PATCH 2/5] phy: qcom: edp: Introduce aux_cfg array for version specific aux settings Date: Wed, 11 Sep 2024 15:38:10 +0530 Message-Id: <20240911100813.338-3-quic_mukhopad@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240911100813.338-1-quic_mukhopad@quicinc.com> References: <20240911100813.338-1-quic_mukhopad@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: OJOHVVcf000qcLm-NlQiM2Ccta3Vk16d X-Proofpoint-ORIG-GUID: OJOHVVcf000qcLm-NlQiM2Ccta3Vk16d X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 impostorscore=0 mlxscore=0 bulkscore=0 suspectscore=0 priorityscore=1501 mlxlogscore=999 lowpriorityscore=0 adultscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409110075 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: In order to support different HW versions, introduce aux_cfg array to move v4 specific aux configuration settings. Signed-off-by: Soutrik Mukhopadhyay --- drivers/phy/qualcomm/phy-qcom-edp.c | 34 +++++++++++++++++------------ 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-edp.c b/drivers/phy/qualcomm/phy-qcom-edp.c index da2b32fb5b45..0f860a807d1b 100644 --- a/drivers/phy/qualcomm/phy-qcom-edp.c +++ b/drivers/phy/qualcomm/phy-qcom-edp.c @@ -90,6 +90,7 @@ struct phy_ver_ops { struct qcom_edp_phy_cfg { bool is_edp; + u8 *aux_cfg; const struct qcom_edp_swing_pre_emph_cfg *swing_pre_emph_cfg; const struct phy_ver_ops *ver_ops; }; @@ -186,11 +187,14 @@ static const struct qcom_edp_swing_pre_emph_cfg edp_phy_swing_pre_emph_cfg = { .pre_emphasis_hbr3_hbr2 = &edp_pre_emp_hbr2_hbr3, }; +static u8 edp_phy_aux_cfg_v4[10] = { + 0x00, 0x13, 0x24, 0x00, 0x0a, 0x26, 0x0a, 0x03, 0x37, 0x03 +}; + static int qcom_edp_phy_init(struct phy *phy) { struct qcom_edp *edp = phy_get_drvdata(phy); int ret; - u8 cfg8; ret = regulator_bulk_enable(ARRAY_SIZE(edp->supplies), edp->supplies); if (ret) @@ -222,22 +226,20 @@ static int qcom_edp_phy_init(struct phy *phy) * even needed. */ if (edp->cfg->swing_pre_emph_cfg && !edp->is_edp) - cfg8 = 0xb7; - else - cfg8 = 0x37; + edp->cfg->aux_cfg[8] = 0xb7; writel(0xfc, edp->edp + DP_PHY_MODE); - writel(0x00, edp->edp + DP_PHY_AUX_CFG0); - writel(0x13, edp->edp + DP_PHY_AUX_CFG1); - writel(0x24, edp->edp + DP_PHY_AUX_CFG2); - writel(0x00, edp->edp + DP_PHY_AUX_CFG3); - writel(0x0a, edp->edp + DP_PHY_AUX_CFG4); - writel(0x26, edp->edp + DP_PHY_AUX_CFG5); - writel(0x0a, edp->edp + DP_PHY_AUX_CFG6); - writel(0x03, edp->edp + DP_PHY_AUX_CFG7); - writel(cfg8, edp->edp + DP_PHY_AUX_CFG8); - writel(0x03, edp->edp + DP_PHY_AUX_CFG9); + writel(edp->cfg->aux_cfg[0], edp->edp + DP_PHY_AUX_CFG0); + writel(edp->cfg->aux_cfg[1], edp->edp + DP_PHY_AUX_CFG1); + writel(edp->cfg->aux_cfg[2], edp->edp + DP_PHY_AUX_CFG2); + writel(edp->cfg->aux_cfg[3], edp->edp + DP_PHY_AUX_CFG3); + writel(edp->cfg->aux_cfg[4], edp->edp + DP_PHY_AUX_CFG4); + writel(edp->cfg->aux_cfg[5], edp->edp + DP_PHY_AUX_CFG5); + writel(edp->cfg->aux_cfg[6], edp->edp + DP_PHY_AUX_CFG6); + writel(edp->cfg->aux_cfg[7], edp->edp + DP_PHY_AUX_CFG7); + writel(edp->cfg->aux_cfg[8], edp->edp + DP_PHY_AUX_CFG8); + writel(edp->cfg->aux_cfg[9], edp->edp + DP_PHY_AUX_CFG9); writel(PHY_AUX_STOP_ERR_MASK | PHY_AUX_DEC_ERR_MASK | PHY_AUX_SYNC_ERR_MASK | PHY_AUX_ALIGN_ERR_MASK | @@ -519,16 +521,19 @@ static const struct phy_ver_ops qcom_edp_phy_ops_v4 = { }; static const struct qcom_edp_phy_cfg sc7280_dp_phy_cfg = { + .aux_cfg = edp_phy_aux_cfg_v4, .ver_ops = &qcom_edp_phy_ops_v4, }; static const struct qcom_edp_phy_cfg sc8280xp_dp_phy_cfg = { + .aux_cfg = edp_phy_aux_cfg_v4, .swing_pre_emph_cfg = &dp_phy_swing_pre_emph_cfg, .ver_ops = &qcom_edp_phy_ops_v4, }; static const struct qcom_edp_phy_cfg sc8280xp_edp_phy_cfg = { .is_edp = true, + .aux_cfg = edp_phy_aux_cfg_v4, .swing_pre_emph_cfg = &edp_phy_swing_pre_emph_cfg, .ver_ops = &qcom_edp_phy_ops_v4, }; @@ -707,6 +712,7 @@ static const struct phy_ver_ops qcom_edp_phy_ops_v6 = { }; static struct qcom_edp_phy_cfg x1e80100_phy_cfg = { + .aux_cfg = edp_phy_aux_cfg_v4, .swing_pre_emph_cfg = &dp_phy_swing_pre_emph_cfg, .ver_ops = &qcom_edp_phy_ops_v6, };