From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Stephen Boyd <sboyd@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Rob Herring <robh@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] clk: qcom: dispcc-sm8750: Add SM8750 Display clock controller
Date: Wed, 4 Dec 2024 11:05:38 +0100 [thread overview]
Message-ID: <ef6f9bd0-c24b-4964-9228-bdab1221fff5@linaro.org> (raw)
In-Reply-To: <5f05f2305f37bd40bf92299c04480fbf.sboyd@kernel.org>
On 03/12/2024 23:09, Stephen Boyd wrote:
> Quoting Krzysztof Kozlowski (2024-11-28 07:08:01)
>> diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
>> index 2ec9be21ff678e3343cccafa85801aa68805f440..d9ab42c625ddd61f9bf1857522d44d4547e42bf5 100644
>> --- a/drivers/clk/qcom/Kconfig
>> +++ b/drivers/clk/qcom/Kconfig
>> @@ -1022,6 +1022,16 @@ config SM_DISPCC_8550
>> Say Y if you want to support display devices and functionality such as
>> splash screen.
>>
>> +config SM_DISPCC_8750
>> + tristate "SM8750 Display Clock Controller"
>> + depends on ARM64 || COMPILE_TEST
>
> Please select QCOM_GDSC
Ack
>
>> + depends on SM_GCC_8750
>
> select? Or imply? It's a functional dependency, not a build time one.
ARM64 is as well functional dependency, ARCH_QCOM present in all other
drivers as well. It is all the same. The point is to limit the config
options available to users/distros when they do not need them. In this
particular case: if user does not select main clock controller (GCC)
then allowing to choose Display clock controller is pointless.
>
>> + help
>> diff --git a/drivers/clk/qcom/dispcc-sm8750.c b/drivers/clk/qcom/dispcc-sm8750.c
>> new file mode 100644
>> index 0000000000000000000000000000000000000000..ff64ff93c4dbdd2aae22b55dd0e404544cc9373e
>> --- /dev/null
>> +++ b/drivers/clk/qcom/dispcc-sm8750.c
>> @@ -0,0 +1,1960 @@
>> +// SPDX-License-Identifier: GPL-2.0-only
>> +/*
>> + * Copyright (c) 2021, The Linux Foundation. All rights reserved.
>> + * Copyright (c) 2023-2024, Linaro Ltd.
>> + */
>> +
>> +#include <linux/clk.h>
>
> Is this include used?
Not used, copy pasta from older driver. I'll clean it up.
>
>> +#include <linux/clk-provider.h>
>> +#include <linux/err.h>
>> +#include <linux/kernel.h>
>> +#include <linux/module.h>
>> +#include <linux/of.h>
>> +#include <linux/platform_device.h>
>> +#include <linux/regmap.h>
>> +#include <linux/pm_runtime.h>
>> +
>> +#include <dt-bindings/clock/qcom,sm8750-dispcc.h>
>> +
>> +#include "common.h"
>> +#include "clk-alpha-pll.h"
>> +#include "clk-branch.h"
>> +#include "clk-pll.h"
>> +#include "clk-rcg.h"
>> +#include "clk-regmap.h"
>> +#include "clk-regmap-divider.h"
>> +#include "clk-regmap-mux.h"
>> +#include "reset.h"
>> +#include "gdsc.h"
> [...]
>> +};
>> +
>> +static struct clk_rcg2 disp_cc_mdss_mdp_clk_src = {
>> + .cmd_rcgr = 0x8150,
>> + .mnd_width = 0,
>> + .hid_width = 5,
>> + .parent_map = disp_cc_parent_map_9,
>> + .freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src,
>> + .clkr.hw.init = &(const struct clk_init_data) {
>> + .name = "disp_cc_mdss_mdp_clk_src",
>> + .parent_data = disp_cc_parent_data_9,
>> + .num_parents = ARRAY_SIZE(disp_cc_parent_data_9),
>> + .flags = CLK_SET_RATE_PARENT,
>> + .ops = &clk_rcg2_shared_ops, /* TODO: switch to cesta managed clocks */
>
> What is cesta?
Cesta is a new hardware block which receives votes from consumers and
then manages groups of clocks. We do not have drivers for it, so I am
not sure how this here will work out.
I will grow the explanation in comment.
>
>> + },
>> +};
>> +
>> +static struct clk_rcg2 disp_cc_mdss_pclk0_clk_src = {
>> + .cmd_rcgr = 0x8108,
>> + .mnd_width = 8,
>> + .hid_width = 5,
>> + .parent_map = disp_cc_parent_map_1,
>> + .freq_tbl = ftbl_disp_cc_esync0_clk_src,
>> + .clkr.hw.init = &(const struct clk_init_data) {
>> + .name = "disp_cc_mdss_pclk0_clk_src",
>> + .parent_data = disp_cc_parent_data_1,
>> + .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
>> + .flags = CLK_SET_RATE_PARENT,
>> + .ops = &clk_pixel_ops,
>> + },
> [...]
>> + .enable_reg = 0x80b4,
>> + .enable_mask = BIT(0),
>> + .hw.init = &(const struct clk_init_data) {
>> + .name = "disp_cc_osc_clk",
>> + .parent_hws = (const struct clk_hw*[]) {
>> + &disp_cc_osc_clk_src.clkr.hw,
>> + },
>> + .num_parents = 1,
>> + .flags = CLK_SET_RATE_PARENT,
>> + .ops = &clk_branch2_ops,
>> + },
>> + },
>> +};
>> +
>> +static struct gdsc mdss_gdsc = {
>> + .gdscr = 0x9000,
>> + .en_rest_wait_val = 0x2,
>> + .en_few_wait_val = 0x2,
>> + .clk_dis_wait_val = 0xf,
>> + .pd = {
>> + .name = "mdss_gdsc",
>> + },
>> + .pwrsts = PWRSTS_OFF_ON,
>> + .flags = POLL_CFG_GDSCR | HW_CTRL | RETAIN_FF_ENABLE,
>> + // TODO: no supply?
>
> What is this?
Development note. I will clean it up.
Best regards,
Krzysztof
next prev parent reply other threads:[~2024-12-04 10:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-28 15:07 [PATCH 0/3] clk: qcom: sm8750: Add sm8750-dispcc " Krzysztof Kozlowski
2024-11-28 15:07 ` [PATCH 1/3] dt-bindings: clock: qcom,sm8550-dispcc: Add SM8750 DISPCC Krzysztof Kozlowski
2024-11-28 17:12 ` Conor Dooley
2024-11-28 17:38 ` Krzysztof Kozlowski
2024-11-29 15:33 ` Conor Dooley
2024-11-28 15:08 ` [PATCH 2/3] clk: qcom: clk-alpha-pll: Add Pongo PLL Krzysztof Kozlowski
2024-12-03 22:07 ` Stephen Boyd
2024-12-04 9:25 ` Krzysztof Kozlowski
2024-11-28 15:08 ` [PATCH 3/3] clk: qcom: dispcc-sm8750: Add SM8750 Display clock controller Krzysztof Kozlowski
2024-12-03 22:09 ` Stephen Boyd
2024-12-04 10:05 ` Krzysztof Kozlowski [this message]
2024-12-04 17:49 ` Taniya Das
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=ef6f9bd0-c24b-4964-9228-bdab1221fff5@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.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=neil.armstrong@linaro.org \
--cc=robh@kernel.org \
--cc=sboyd@kernel.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
all inboxes | Powered by JetHome®