From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Jagadeesh Kona <quic_jkona@quicinc.com>,
Andy Gross <agross@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: Bjorn Andersson <andersson@kernel.org>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Taniya Das <quic_tdas@quicinc.com>,
Satya Priya Kakitapalli <quic_skakitap@quicinc.com>,
Imran Shaik <quic_imrashai@quicinc.com>,
Ajit Pandey <quic_ajipan@quicinc.com>
Subject: Re: [PATCH V5 4/5] clk: qcom: camcc-sm8550: Add support for qdss, sleep and xo clocks
Date: Sat, 24 Jun 2023 14:19:53 +0200 [thread overview]
Message-ID: <11b3058c-2261-95a4-2347-b0a33fdeb1e3@linaro.org> (raw)
In-Reply-To: <20230623164619.11464-5-quic_jkona@quicinc.com>
On 23.06.2023 18:46, Jagadeesh Kona wrote:
> Add support for camera qdss, sleep and xo clocks.
>
> Co-developed-by: Taniya Das <quic_tdas@quicinc.com>
> Signed-off-by: Taniya Das <quic_tdas@quicinc.com>
> Signed-off-by: Jagadeesh Kona <quic_jkona@quicinc.com>
> ---
> Changes since v4:
> - No changes.
> Changes since v3:
> - No changes.
> Changes since v2:
> - No changes.
> Changes since v1:
> - Newly added.
>
> drivers/clk/qcom/camcc-sm8550.c | 180 ++++++++++++++++++++++++++++++++
> 1 file changed, 180 insertions(+)
>
> diff --git a/drivers/clk/qcom/camcc-sm8550.c b/drivers/clk/qcom/camcc-sm8550.c
> index 075bea32087c..7b4882444d58 100644
> --- a/drivers/clk/qcom/camcc-sm8550.c
> +++ b/drivers/clk/qcom/camcc-sm8550.c
> @@ -22,6 +22,8 @@
> enum {
> DT_IFACE,
> DT_BI_TCXO,
> + DT_BI_TCXO_AO,
> + DT_SLEEP_CLK,
> };
>
> enum {
> @@ -43,6 +45,7 @@ enum {
> P_CAM_CC_PLL10_OUT_EVEN,
> P_CAM_CC_PLL11_OUT_EVEN,
> P_CAM_CC_PLL12_OUT_EVEN,
> + P_SLEEP_CLK,
> };
>
> static const struct pll_vco lucid_ole_vco[] = {
> @@ -881,6 +884,22 @@ static const struct clk_parent_data cam_cc_parent_data_11[] = {
> { .hw = &cam_cc_pll7_out_even.clkr.hw },
> };
>
> +static const struct parent_map cam_cc_parent_map_12[] = {
> + { P_SLEEP_CLK, 0 },
> +};
> +
> +static const struct clk_parent_data cam_cc_parent_data_12[] = {
> + { .index = DT_SLEEP_CLK },
> +};
> +
> +static const struct parent_map cam_cc_parent_map_13[] = {
> + { P_BI_TCXO, 0 },
> +};
> +
> +static const struct clk_parent_data cam_cc_parent_data_13_ao[] = {
> + { .index = DT_BI_TCXO_AO },
> +};
> +
> static const struct freq_tbl ftbl_cam_cc_bps_clk_src[] = {
> F(19200000, P_BI_TCXO, 1, 0, 0),
> F(200000000, P_CAM_CC_PLL8_OUT_EVEN, 1, 0, 0),
> @@ -1565,6 +1584,29 @@ static struct clk_rcg2 cam_cc_mclk7_clk_src = {
> },
> };
>
> +static const struct freq_tbl ftbl_cam_cc_qdss_debug_clk_src[] = {
> + F(19200000, P_BI_TCXO, 1, 0, 0),
> + F(75000000, P_CAM_CC_PLL0_OUT_EVEN, 8, 0, 0),
> + F(150000000, P_CAM_CC_PLL0_OUT_EVEN, 4, 0, 0),
> + F(300000000, P_CAM_CC_PLL0_OUT_MAIN, 4, 0, 0),
> + { }
> +};
> +
> +static struct clk_rcg2 cam_cc_qdss_debug_clk_src = {
> + .cmd_rcgr = 0x13f24,
> + .mnd_width = 0,
> + .hid_width = 5,
> + .parent_map = cam_cc_parent_map_0,
> + .freq_tbl = ftbl_cam_cc_qdss_debug_clk_src,
> + .clkr.hw.init = &(const struct clk_init_data) {
> + .name = "cam_cc_qdss_debug_clk_src",
> + .parent_data = cam_cc_parent_data_0,
> + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
> + .flags = CLK_SET_RATE_PARENT,
> + .ops = &clk_rcg2_shared_ops,
> + },
> +};
> +
> static const struct freq_tbl ftbl_cam_cc_sfe_0_clk_src[] = {
> F(466000000, P_CAM_CC_PLL6_OUT_EVEN, 1, 0, 0),
> F(594000000, P_CAM_CC_PLL6_OUT_EVEN, 1, 0, 0),
> @@ -1611,6 +1653,26 @@ static struct clk_rcg2 cam_cc_sfe_1_clk_src = {
> },
> };
>
> +static const struct freq_tbl ftbl_cam_cc_sleep_clk_src[] = {
> + F(32000, P_SLEEP_CLK, 1, 0, 0),
> + { }
> +};
> +
> +static struct clk_rcg2 cam_cc_sleep_clk_src = {
> + .cmd_rcgr = 0x141a0,
> + .mnd_width = 0,
> + .hid_width = 5,
> + .parent_map = cam_cc_parent_map_12,
> + .freq_tbl = ftbl_cam_cc_sleep_clk_src,
> + .clkr.hw.init = &(const struct clk_init_data) {
> + .name = "cam_cc_sleep_clk_src",
> + .parent_data = cam_cc_parent_data_12,
> + .num_parents = ARRAY_SIZE(cam_cc_parent_data_12),
> + .flags = CLK_SET_RATE_PARENT,
> + .ops = &clk_rcg2_shared_ops,
> + },
> +};
> +
> static const struct freq_tbl ftbl_cam_cc_slow_ahb_clk_src[] = {
> F(19200000, P_BI_TCXO, 1, 0, 0),
> F(80000000, P_CAM_CC_PLL0_OUT_EVEN, 7.5, 0, 0),
> @@ -1632,6 +1694,26 @@ static struct clk_rcg2 cam_cc_slow_ahb_clk_src = {
> },
> };
>
> +static const struct freq_tbl ftbl_cam_cc_xo_clk_src[] = {
> + F(19200000, P_BI_TCXO, 1, 0, 0),
You're overloading P_BI_TCXO with a different parent clock (XO_A).
The rest lgtm
Konrad
> + { }
> +};
> +
> +static struct clk_rcg2 cam_cc_xo_clk_src = {
> + .cmd_rcgr = 0x14070,
> + .mnd_width = 0,
> + .hid_width = 5,
> + .parent_map = cam_cc_parent_map_13,
> + .freq_tbl = ftbl_cam_cc_xo_clk_src,
> + .clkr.hw.init = &(const struct clk_init_data) {
> + .name = "cam_cc_xo_clk_src",
> + .parent_data = cam_cc_parent_data_13_ao,
> + .num_parents = ARRAY_SIZE(cam_cc_parent_data_13_ao),
> + .flags = CLK_SET_RATE_PARENT,
> + .ops = &clk_rcg2_shared_ops,
> + },
> +};
> +
> static struct clk_branch cam_cc_bps_ahb_clk = {
> .halt_reg = 0x10274,
> .halt_check = BRANCH_HALT,
> @@ -1704,6 +1786,42 @@ static struct clk_branch cam_cc_camnoc_axi_clk = {
> },
> };
>
> +static struct clk_branch cam_cc_camnoc_dcd_xo_clk = {
> + .halt_reg = 0x13f18,
> + .halt_check = BRANCH_HALT,
> + .clkr = {
> + .enable_reg = 0x13f18,
> + .enable_mask = BIT(0),
> + .hw.init = &(const struct clk_init_data) {
> + .name = "cam_cc_camnoc_dcd_xo_clk",
> + .parent_hws = (const struct clk_hw*[]) {
> + &cam_cc_xo_clk_src.clkr.hw,
> + },
> + .num_parents = 1,
> + .flags = CLK_SET_RATE_PARENT,
> + .ops = &clk_branch2_ops,
> + },
> + },
> +};
> +
> +static struct clk_branch cam_cc_camnoc_xo_clk = {
> + .halt_reg = 0x13f1c,
> + .halt_check = BRANCH_HALT,
> + .clkr = {
> + .enable_reg = 0x13f1c,
> + .enable_mask = BIT(0),
> + .hw.init = &(const struct clk_init_data) {
> + .name = "cam_cc_camnoc_xo_clk",
> + .parent_hws = (const struct clk_hw*[]) {
> + &cam_cc_xo_clk_src.clkr.hw,
> + },
> + .num_parents = 1,
> + .flags = CLK_SET_RATE_PARENT,
> + .ops = &clk_branch2_ops,
> + },
> + },
> +};
> +
> static struct clk_branch cam_cc_cci_0_clk = {
> .halt_reg = 0x13a2c,
> .halt_check = BRANCH_HALT,
> @@ -2370,6 +2488,24 @@ static struct clk_branch cam_cc_drv_ahb_clk = {
> },
> };
>
> +static struct clk_branch cam_cc_drv_xo_clk = {
> + .halt_reg = 0x142d4,
> + .halt_check = BRANCH_HALT,
> + .clkr = {
> + .enable_reg = 0x142d4,
> + .enable_mask = BIT(0),
> + .hw.init = &(const struct clk_init_data) {
> + .name = "cam_cc_drv_xo_clk",
> + .parent_hws = (const struct clk_hw*[]) {
> + &cam_cc_xo_clk_src.clkr.hw,
> + },
> + .num_parents = 1,
> + .flags = CLK_SET_RATE_PARENT,
> + .ops = &clk_branch2_ops,
> + },
> + },
> +};
> +
> static struct clk_branch cam_cc_icp_ahb_clk = {
> .halt_reg = 0x138fc,
> .halt_check = BRANCH_HALT,
> @@ -2910,6 +3046,42 @@ static struct clk_branch cam_cc_mclk7_clk = {
> },
> };
>
> +static struct clk_branch cam_cc_qdss_debug_clk = {
> + .halt_reg = 0x14050,
> + .halt_check = BRANCH_HALT,
> + .clkr = {
> + .enable_reg = 0x14050,
> + .enable_mask = BIT(0),
> + .hw.init = &(const struct clk_init_data) {
> + .name = "cam_cc_qdss_debug_clk",
> + .parent_hws = (const struct clk_hw*[]) {
> + &cam_cc_qdss_debug_clk_src.clkr.hw,
> + },
> + .num_parents = 1,
> + .flags = CLK_SET_RATE_PARENT,
> + .ops = &clk_branch2_ops,
> + },
> + },
> +};
> +
> +static struct clk_branch cam_cc_qdss_debug_xo_clk = {
> + .halt_reg = 0x14054,
> + .halt_check = BRANCH_HALT,
> + .clkr = {
> + .enable_reg = 0x14054,
> + .enable_mask = BIT(0),
> + .hw.init = &(const struct clk_init_data) {
> + .name = "cam_cc_qdss_debug_xo_clk",
> + .parent_hws = (const struct clk_hw*[]) {
> + &cam_cc_xo_clk_src.clkr.hw,
> + },
> + .num_parents = 1,
> + .flags = CLK_SET_RATE_PARENT,
> + .ops = &clk_branch2_ops,
> + },
> + },
> +};
> +
> static struct clk_branch cam_cc_sbi_clk = {
> .halt_reg = 0x10540,
> .halt_check = BRANCH_HALT,
> @@ -3133,6 +3305,8 @@ static struct clk_regmap *cam_cc_sm8550_clocks[] = {
> [CAM_CC_BPS_FAST_AHB_CLK] = &cam_cc_bps_fast_ahb_clk.clkr,
> [CAM_CC_CAMNOC_AXI_CLK] = &cam_cc_camnoc_axi_clk.clkr,
> [CAM_CC_CAMNOC_AXI_CLK_SRC] = &cam_cc_camnoc_axi_clk_src.clkr,
> + [CAM_CC_CAMNOC_DCD_XO_CLK] = &cam_cc_camnoc_dcd_xo_clk.clkr,
> + [CAM_CC_CAMNOC_XO_CLK] = &cam_cc_camnoc_xo_clk.clkr,
> [CAM_CC_CCI_0_CLK] = &cam_cc_cci_0_clk.clkr,
> [CAM_CC_CCI_0_CLK_SRC] = &cam_cc_cci_0_clk_src.clkr,
> [CAM_CC_CCI_1_CLK] = &cam_cc_cci_1_clk.clkr,
> @@ -3184,6 +3358,7 @@ static struct clk_regmap *cam_cc_sm8550_clocks[] = {
> [CAM_CC_CSIPHY6_CLK] = &cam_cc_csiphy6_clk.clkr,
> [CAM_CC_CSIPHY7_CLK] = &cam_cc_csiphy7_clk.clkr,
> [CAM_CC_DRV_AHB_CLK] = &cam_cc_drv_ahb_clk.clkr,
> + [CAM_CC_DRV_XO_CLK] = &cam_cc_drv_xo_clk.clkr,
> [CAM_CC_FAST_AHB_CLK_SRC] = &cam_cc_fast_ahb_clk_src.clkr,
> [CAM_CC_ICP_AHB_CLK] = &cam_cc_icp_ahb_clk.clkr,
> [CAM_CC_ICP_CLK] = &cam_cc_icp_clk.clkr,
> @@ -3260,6 +3435,9 @@ static struct clk_regmap *cam_cc_sm8550_clocks[] = {
> [CAM_CC_PLL11_OUT_EVEN] = &cam_cc_pll11_out_even.clkr,
> [CAM_CC_PLL12] = &cam_cc_pll12.clkr,
> [CAM_CC_PLL12_OUT_EVEN] = &cam_cc_pll12_out_even.clkr,
> + [CAM_CC_QDSS_DEBUG_CLK] = &cam_cc_qdss_debug_clk.clkr,
> + [CAM_CC_QDSS_DEBUG_CLK_SRC] = &cam_cc_qdss_debug_clk_src.clkr,
> + [CAM_CC_QDSS_DEBUG_XO_CLK] = &cam_cc_qdss_debug_xo_clk.clkr,
> [CAM_CC_SBI_CLK] = &cam_cc_sbi_clk.clkr,
> [CAM_CC_SBI_FAST_AHB_CLK] = &cam_cc_sbi_fast_ahb_clk.clkr,
> [CAM_CC_SFE_0_CLK] = &cam_cc_sfe_0_clk.clkr,
> @@ -3268,7 +3446,9 @@ static struct clk_regmap *cam_cc_sm8550_clocks[] = {
> [CAM_CC_SFE_1_CLK] = &cam_cc_sfe_1_clk.clkr,
> [CAM_CC_SFE_1_CLK_SRC] = &cam_cc_sfe_1_clk_src.clkr,
> [CAM_CC_SFE_1_FAST_AHB_CLK] = &cam_cc_sfe_1_fast_ahb_clk.clkr,
> + [CAM_CC_SLEEP_CLK_SRC] = &cam_cc_sleep_clk_src.clkr,
> [CAM_CC_SLOW_AHB_CLK_SRC] = &cam_cc_slow_ahb_clk_src.clkr,
> + [CAM_CC_XO_CLK_SRC] = &cam_cc_xo_clk_src.clkr,
> };
>
> static struct gdsc *cam_cc_sm8550_gdscs[] = {
next prev parent reply other threads:[~2023-06-24 12:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-23 16:46 [PATCH V5 0/5] Add camera clock controller support for SM8550 Jagadeesh Kona
2023-06-23 16:46 ` [PATCH V5 1/5] dt-bindings: clock: qcom: Add SM8550 camera clock controller Jagadeesh Kona
2023-06-23 16:46 ` [PATCH V5 2/5] clk: qcom: clk-alpha-pll: Add support for lucid ole pll configure Jagadeesh Kona
2023-06-24 13:55 ` Dmitry Baryshkov
2023-06-23 16:46 ` [PATCH V5 3/5] clk: qcom: camcc-sm8550: Add camera clock controller driver for SM8550 Jagadeesh Kona
2023-06-24 12:18 ` Konrad Dybcio
2023-06-24 13:56 ` Dmitry Baryshkov
2023-06-23 16:46 ` [PATCH V5 4/5] clk: qcom: camcc-sm8550: Add support for qdss, sleep and xo clocks Jagadeesh Kona
2023-06-24 12:19 ` Konrad Dybcio [this message]
2023-06-26 11:59 ` Jagadeesh Kona
2023-06-26 13:40 ` Dmitry Baryshkov
2023-06-30 7:14 ` Jagadeesh Kona
2023-06-30 23:21 ` Konrad Dybcio
2023-07-06 8:29 ` Jagadeesh Kona
2023-06-23 16:46 ` [PATCH V5 5/5] arm64: dts: qcom: sm8550: Add camera clock controller Jagadeesh Kona
2023-06-24 13:57 ` Dmitry Baryshkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11b3058c-2261-95a4-2347-b0a33fdeb1e3@linaro.org \
--to=konrad.dybcio@linaro.org \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=quic_ajipan@quicinc.com \
--cc=quic_imrashai@quicinc.com \
--cc=quic_jkona@quicinc.com \
--cc=quic_skakitap@quicinc.com \
--cc=quic_tdas@quicinc.com \
--cc=robh+dt@kernel.org \
--cc=sboyd@kernel.org \
--cc=vladimir.zapolskiy@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).