From nobody Sun Nov 24 12:27:10 2024 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 41E991DC07B; Wed, 6 Nov 2024 09:52:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730886762; cv=none; b=SAdMS/E4KoQ2POURgEP1HSojwvdyyMMzm7LWggv+ovse0RLQGk35Fqow6lHHF9aZHO64t/Yp6Jfu/ORKPBsjoRjkqioK6jc49DOURAo0prt7fjQjrRONeKrQydqcxqU6vJBJ0xaQjUg19alS9HTMvscmb0LqXrBeEd4A2v6AcSg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730886762; c=relaxed/simple; bh=ZdjyTGC4f4VTMZfmbKoc1rBO5zaFTnHKa8tiNZw1wCc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=oxhbYrX9HeZ2SN9CNBjtd4Sjih8n7J+B/PXQleMlcGYHQHOzPbhGtg98+9xgGxP8w7VdVuCeNskNM3zVASbec38WLpOIeP/rze1DPx2aQqG0RppoODRDaXLSFzh3kxyeGxK9ldLpOhVN9ppHGNr9f+Nzp+pq1+T1cDgy6a3XCuU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=fTRgibn+; arc=none smtp.client-ip=205.220.168.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=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="fTRgibn+" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A5Mqi8N004338; Wed, 6 Nov 2024 09:52:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= SA9wpcLuR/wdge41A3NXCiE42nMCyR8fBFmKZW9HP1k=; b=fTRgibn+8ShR9RsH ucYrEmKdNVSOudQILT6zf/7KHp3wTaRC0WGJxcME521ii3QGPhfOH7UGmqNEwgwF JcDCanqEMNQSBCxqSzv9wjU7T66SDnklmPZZcgPc0T+mDnpjxS4IAo0zHN9aRY5J eOKWhzdRAC0vAxwVhGiSq11MDwlAiKm8p9mJ7NmqcXYCzuSo1yGY94GnxKI5ufzk 5vKoOePug2GlhSeDU6uSi8kKg+DRBfxFcAZj0cLXLKtQlTQezJuJmSnxTYPOSAXX ZhUJW3eEzLZ+hvxDQR1LSMWoDuTXOAbWmQ6sG1y13fiTZeLnDZZDoXPspq4SjjJn /aDH2g== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42qvhd1e3t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Nov 2024 09:52:37 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 4A69qax8030716 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 6 Nov 2024 09:52:36 GMT Received: from hu-imrashai-hyd.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 6 Nov 2024 01:52:32 -0800 From: Imran Shaik Date: Wed, 6 Nov 2024 15:21:59 +0530 Subject: [PATCH v3 4/6] clk: qcom: Add support for Camera Clock Controller on QCS8300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20241106-qcs8300-mm-patches-v3-4-f611a8f87f15@quicinc.com> References: <20241106-qcs8300-mm-patches-v3-0-f611a8f87f15@quicinc.com> In-Reply-To: <20241106-qcs8300-mm-patches-v3-0-f611a8f87f15@quicinc.com> To: Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: Ajit Pandey , Taniya Das , Jagadeesh Kona , Satya Priya Kakitapalli , , , , , Imran Shaik , Dmitry Baryshkov X-Mailer: b4 0.14.1 X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: YjoIKqJSpnLQZddy_uQpNufTw63vT505 X-Proofpoint-GUID: YjoIKqJSpnLQZddy_uQpNufTw63vT505 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 mlxlogscore=999 suspectscore=0 adultscore=0 clxscore=1015 mlxscore=0 spamscore=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 malwarescore=0 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2411060080 Add support to the QCS8300 Camera clock controller by extending the SA8775P Camera clock controller, which is mostly identical but QCS8300 has few additional clocks and few other differences. Reviewed-by: Dmitry Baryshkov Signed-off-by: Imran Shaik --- drivers/clk/qcom/camcc-sa8775p.c | 101 +++++++++++++++++++++++++++++++++++= ++-- 1 file changed, 96 insertions(+), 5 deletions(-) diff --git a/drivers/clk/qcom/camcc-sa8775p.c b/drivers/clk/qcom/camcc-sa87= 75p.c index c04801a5af35..bf0befb53a60 100644 --- a/drivers/clk/qcom/camcc-sa8775p.c +++ b/drivers/clk/qcom/camcc-sa8775p.c @@ -11,7 +11,7 @@ #include #include =20 -#include +#include =20 #include "clk-alpha-pll.h" #include "clk-branch.h" @@ -1682,6 +1682,24 @@ static struct clk_branch cam_cc_sm_obs_clk =3D { }, }; =20 +static struct clk_branch cam_cc_titan_top_accu_shift_clk =3D { + .halt_reg =3D 0x131f0, + .halt_check =3D BRANCH_HALT_VOTED, + .clkr =3D { + .enable_reg =3D 0x131f0, + .enable_mask =3D BIT(0), + .hw.init =3D &(const struct clk_init_data) { + .name =3D "cam_cc_titan_top_accu_shift_clk", + .parent_hws =3D (const struct clk_hw*[]) { + &cam_cc_xo_clk_src.clkr.hw, + }, + .num_parents =3D 1, + .flags =3D CLK_SET_RATE_PARENT, + .ops =3D &clk_branch2_ops, + }, + }, +}; + static struct gdsc cam_cc_titan_top_gdsc =3D { .gdscr =3D 0x131bc, .en_rest_wait_val =3D 0x2, @@ -1776,6 +1794,7 @@ static struct clk_regmap *cam_cc_sa8775p_clocks[] =3D= { [CAM_CC_SLEEP_CLK_SRC] =3D &cam_cc_sleep_clk_src.clkr, [CAM_CC_SLOW_AHB_CLK_SRC] =3D &cam_cc_slow_ahb_clk_src.clkr, [CAM_CC_SM_OBS_CLK] =3D &cam_cc_sm_obs_clk.clkr, + [CAM_CC_TITAN_TOP_ACCU_SHIFT_CLK] =3D NULL, [CAM_CC_XO_CLK_SRC] =3D &cam_cc_xo_clk_src.clkr, [CAM_CC_QDSS_DEBUG_XO_CLK] =3D &cam_cc_qdss_debug_xo_clk.clkr, }; @@ -1812,6 +1831,7 @@ static struct qcom_cc_desc cam_cc_sa8775p_desc =3D { }; =20 static const struct of_device_id cam_cc_sa8775p_match_table[] =3D { + { .compatible =3D "qcom,qcs8300-camcc" }, { .compatible =3D "qcom,sa8775p-camcc" }, { } }; @@ -1842,10 +1862,81 @@ static int cam_cc_sa8775p_probe(struct platform_dev= ice *pdev) clk_lucid_evo_pll_configure(&cam_cc_pll4, regmap, &cam_cc_pll4_config); clk_lucid_evo_pll_configure(&cam_cc_pll5, regmap, &cam_cc_pll5_config); =20 - /* Keep some clocks always enabled */ - qcom_branch_set_clk_en(regmap, 0x13194); /* CAM_CC_CAMNOC_XO_CLK */ - qcom_branch_set_clk_en(regmap, 0x131ec); /* CAM_CC_GDSC_CLK */ - qcom_branch_set_clk_en(regmap, 0x13208); /* CAM_CC_SLEEP_CLK */ + if (of_device_is_compatible(pdev->dev.of_node, "qcom,qcs8300-camcc")) { + cam_cc_camnoc_axi_clk_src.cmd_rcgr =3D 0x13154; + cam_cc_camnoc_axi_clk.halt_reg =3D 0x1316c; + cam_cc_camnoc_axi_clk.clkr.enable_reg =3D 0x1316c; + cam_cc_camnoc_dcd_xo_clk.halt_reg =3D 0x13174; + cam_cc_camnoc_dcd_xo_clk.clkr.enable_reg =3D 0x13174; + + cam_cc_csi0phytimer_clk_src.cmd_rcgr =3D 0x15054; + cam_cc_csi1phytimer_clk_src.cmd_rcgr =3D 0x15078; + cam_cc_csi2phytimer_clk_src.cmd_rcgr =3D 0x15098; + cam_cc_csid_clk_src.cmd_rcgr =3D 0x13134; + + cam_cc_mclk0_clk_src.cmd_rcgr =3D 0x15000; + cam_cc_mclk1_clk_src.cmd_rcgr =3D 0x1501c; + cam_cc_mclk2_clk_src.cmd_rcgr =3D 0x15038; + + cam_cc_fast_ahb_clk_src.cmd_rcgr =3D 0x13104; + cam_cc_slow_ahb_clk_src.cmd_rcgr =3D 0x1311c; + cam_cc_xo_clk_src.cmd_rcgr =3D 0x131b8; + cam_cc_sleep_clk_src.cmd_rcgr =3D 0x131d4; + + cam_cc_core_ahb_clk.halt_reg =3D 0x131b4; + cam_cc_core_ahb_clk.clkr.enable_reg =3D 0x131b4; + + cam_cc_cpas_ahb_clk.halt_reg =3D 0x130f4; + cam_cc_cpas_ahb_clk.clkr.enable_reg =3D 0x130f4; + cam_cc_cpas_fast_ahb_clk.halt_reg =3D 0x130fc; + cam_cc_cpas_fast_ahb_clk.clkr.enable_reg =3D 0x130fc; + + cam_cc_csi0phytimer_clk.halt_reg =3D 0x1506c; + cam_cc_csi0phytimer_clk.clkr.enable_reg =3D 0x1506c; + cam_cc_csi1phytimer_clk.halt_reg =3D 0x15090; + cam_cc_csi1phytimer_clk.clkr.enable_reg =3D 0x15090; + cam_cc_csi2phytimer_clk.halt_reg =3D 0x150b0; + cam_cc_csi2phytimer_clk.clkr.enable_reg =3D 0x150b0; + cam_cc_csid_clk.halt_reg =3D 0x1314c; + cam_cc_csid_clk.clkr.enable_reg =3D 0x1314c; + cam_cc_csid_csiphy_rx_clk.halt_reg =3D 0x15074; + cam_cc_csid_csiphy_rx_clk.clkr.enable_reg =3D 0x15074; + cam_cc_csiphy0_clk.halt_reg =3D 0x15070; + cam_cc_csiphy0_clk.clkr.enable_reg =3D 0x15070; + cam_cc_csiphy1_clk.halt_reg =3D 0x15094; + cam_cc_csiphy1_clk.clkr.enable_reg =3D 0x15094; + cam_cc_csiphy2_clk.halt_reg =3D 0x150b4; + cam_cc_csiphy2_clk.clkr.enable_reg =3D 0x150b4; + + cam_cc_mclk0_clk.halt_reg =3D 0x15018; + cam_cc_mclk0_clk.clkr.enable_reg =3D 0x15018; + cam_cc_mclk1_clk.halt_reg =3D 0x15034; + cam_cc_mclk1_clk.clkr.enable_reg =3D 0x15034; + cam_cc_mclk2_clk.halt_reg =3D 0x15050; + cam_cc_mclk2_clk.clkr.enable_reg =3D 0x15050; + + cam_cc_titan_top_gdsc.gdscr =3D 0x131a0; + + cam_cc_sa8775p_clocks[CAM_CC_CCI_3_CLK] =3D NULL; + cam_cc_sa8775p_clocks[CAM_CC_CCI_3_CLK_SRC] =3D NULL; + cam_cc_sa8775p_clocks[CAM_CC_CSI3PHYTIMER_CLK] =3D NULL; + cam_cc_sa8775p_clocks[CAM_CC_CSI3PHYTIMER_CLK_SRC] =3D NULL; + cam_cc_sa8775p_clocks[CAM_CC_CSIPHY3_CLK] =3D NULL; + cam_cc_sa8775p_clocks[CAM_CC_MCLK3_CLK] =3D NULL; + cam_cc_sa8775p_clocks[CAM_CC_MCLK3_CLK_SRC] =3D NULL; + cam_cc_sa8775p_clocks[CAM_CC_TITAN_TOP_ACCU_SHIFT_CLK] =3D + &cam_cc_titan_top_accu_shift_clk.clkr; + + /* Keep some clocks always enabled */ + qcom_branch_set_clk_en(regmap, 0x13178); /* CAM_CC_CAMNOC_XO_CLK */ + qcom_branch_set_clk_en(regmap, 0x131d0); /* CAM_CC_GDSC_CLK */ + qcom_branch_set_clk_en(regmap, 0x131ec); /* CAM_CC_SLEEP_CLK */ + } else { + /* Keep some clocks always enabled */ + qcom_branch_set_clk_en(regmap, 0x13194); /* CAM_CC_CAMNOC_XO_CLK */ + qcom_branch_set_clk_en(regmap, 0x131ec); /* CAM_CC_GDSC_CLK */ + qcom_branch_set_clk_en(regmap, 0x13208); /* CAM_CC_SLEEP_CLK */ + } =20 ret =3D qcom_cc_really_probe(&pdev->dev, &cam_cc_sa8775p_desc, regmap); =20 --=20 2.25.1