linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <andersson@kernel.org>
To: Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: linux-arm-msm@vger.kernel.org, agross@kernel.org,
	krzysztof.kozlowski@linaro.org, marijn.suijten@somainline.org,
	Amit Kucheria <amitk@kernel.org>,
	Thara Gopinath <thara.gopinath@gmail.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Zhang Rui <rui.zhang@intel.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] thermal/drivers/qcom/lmh: Use driver data as flags instead of bool
Date: Wed, 18 Jan 2023 21:05:13 -0600	[thread overview]
Message-ID: <20230119030513.eyj3o2b7yugisvqy@builder.lan> (raw)
In-Reply-To: <20230113031401.2336157-2-konrad.dybcio@linaro.org>

On Fri, Jan 13, 2023 at 04:14:00AM +0100, Konrad Dybcio wrote:
> Currently the OF driver data is used to determine whether to manually
> enable the LMH algorithms through secure calls. In preparation for
> introducing support for SoCs with a configuration that differs from
> both SDM845 and SM8150, convert this to a set of bitflags for more
> flexibility.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  drivers/thermal/qcom/lmh.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/thermal/qcom/lmh.c b/drivers/thermal/qcom/lmh.c
> index 4122a51e9874..5e8ff196c9a6 100644
> --- a/drivers/thermal/qcom/lmh.c
> +++ b/drivers/thermal/qcom/lmh.c
> @@ -28,7 +28,7 @@
>  
>  #define LMH_REG_DCVS_INTR_CLR		0x8
>  
> -#define LMH_ENABLE_ALGOS		1
> +#define LMH_ENABLE_ALGOS		BIT(0)

Looks perfectly fine, but please include a patch in the same series that
adds another bit. And don't forget to update the .data in the
of_match_id listing.

Regards,
Bjorn

>  
>  struct lmh_hw_data {
>  	void __iomem *base;
> @@ -92,9 +92,11 @@ static int lmh_probe(struct platform_device *pdev)
>  	struct device_node *cpu_node;
>  	struct lmh_hw_data *lmh_data;
>  	int temp_low, temp_high, temp_arm, cpu_id, ret;
> -	unsigned int enable_alg;
> +	unsigned int flags;
>  	u32 node_id;
>  
> +	flags = (uintptr_t)of_device_get_match_data(dev);
> +
>  	lmh_data = devm_kzalloc(dev, sizeof(*lmh_data), GFP_KERNEL);
>  	if (!lmh_data)
>  		return -ENOMEM;
> @@ -144,9 +146,7 @@ static int lmh_probe(struct platform_device *pdev)
>  	if (!qcom_scm_lmh_dcvsh_available())
>  		return -EINVAL;
>  
> -	enable_alg = (uintptr_t)of_device_get_match_data(dev);
> -
> -	if (enable_alg) {
> +	if (flags & LMH_ENABLE_ALGOS) {
>  		ret = qcom_scm_lmh_dcvsh(LMH_SUB_FN_CRNT, LMH_ALGO_MODE_ENABLE, 1,
>  					 LMH_NODE_DCVS, node_id, 0);
>  		if (ret)
> -- 
> 2.39.0
> 

  reply	other threads:[~2023-01-19  3:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230113031401.2336157-1-konrad.dybcio@linaro.org>
2023-01-13  3:14 ` [PATCH 1/2] thermal/drivers/qcom/lmh: Use driver data as flags instead of bool Konrad Dybcio
2023-01-19  3:05   ` Bjorn Andersson [this message]
2023-01-13  3:14 ` [PATCH 2/2] firmware: qcom_scm: Fully implement qcom_scm_lmh_dcvsh() Konrad Dybcio
2023-01-19  3:04   ` Bjorn Andersson
2023-01-19 10:41     ` Konrad Dybcio

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=20230119030513.eyj3o2b7yugisvqy@builder.lan \
    --to=andersson@kernel.org \
    --cc=agross@kernel.org \
    --cc=amitk@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=thara.gopinath@gmail.com \
    /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).