Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Taniya Das <quic_tdas@quicinc.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	"Michael Turquette" <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: <linux-arm-msm@vger.kernel.org>, <linux-clk@vger.kernel.org>,
	<quic_jkona@quicinc.com>, <quic_imrashai@quicinc.com>,
	<devicetree@vger.kernel.org>
Subject: Re: [PATCH 2/4] clk: qcom: lpassaudiocc-sc7280: Add support for LPASS resets for QCM6490
Date: Fri, 16 Aug 2024 14:04:03 +0530	[thread overview]
Message-ID: <9ebda78f-efad-40d2-9685-0dc48445ff6a@quicinc.com> (raw)
In-Reply-To: <7ed1a911-ee75-4fb4-9223-c79fa5d3a293@linaro.org>



On 6/16/2024 1:19 PM, Krzysztof Kozlowski wrote:
> On 10/06/2024 12:03, Taniya Das wrote:
>>
>>
>> On 5/31/2024 9:56 PM, Krzysztof Kozlowski wrote:
>>> On 31/05/2024 12:22, Taniya Das wrote:
>>>> On the QCM6490 boards the LPASS firmware controls the complete clock
>>>> controller functionalities. But the LPASS resets are required to be
>>>> controlled from the high level OS. The Audio SW driver should be able to
>>>> assert/deassert the audio resets as required. Thus in clock driver add
>>>> support for the same.
>>>>
>>>> Signed-off-by: Taniya Das <quic_tdas@quicinc.com>
>>>> ---
>>>>    drivers/clk/qcom/lpassaudiocc-sc7280.c | 28 ++++++++++++++++++++++++++
>>>>    1 file changed, 28 insertions(+)
>>>>
>>>> diff --git a/drivers/clk/qcom/lpassaudiocc-sc7280.c b/drivers/clk/qcom/lpassaudiocc-sc7280.c
>>>> index c43d0b1af7f7..7fdfd07c111c 100644
>>>> --- a/drivers/clk/qcom/lpassaudiocc-sc7280.c
>>>> +++ b/drivers/clk/qcom/lpassaudiocc-sc7280.c
>>>> @@ -1,6 +1,7 @@
>>>>    // SPDX-License-Identifier: GPL-2.0-only
>>>>    /*
>>>>     * Copyright (c) 2021, The Linux Foundation. All rights reserved.
>>>> + * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
>>>>     */
>>>>    
>>>>    #include <linux/clk-provider.h>
>>>> @@ -869,10 +870,36 @@ static struct platform_driver lpass_aon_cc_sc7280_driver = {
>>>>    	},
>>>>    };
>>>>    
>>>> +static const struct of_device_id lpass_audio_cc_qcm6490_match_table[] = {
>>>> +	{ .compatible = "qcom,qcm6490-lpassaudiocc" },
>>>> +	{ }
>>>> +};
>>>> +MODULE_DEVICE_TABLE(of, lpass_audio_cc_qcm6490_match_table);
>>>> +
>>>> +static int lpass_audio_cc_qcm6490_probe(struct platform_device *pdev)
>>>> +{
>>>> +	lpass_audio_cc_sc7280_regmap_config.name = "lpassaudio_cc_reset";
>>>> +	lpass_audio_cc_sc7280_regmap_config.max_register = 0xc8;
>>>> +
>>>> +	return qcom_cc_probe_by_index(pdev, 1, &lpass_audio_cc_reset_sc7280_desc);
>>>> +}
>>>> +
>>>> +static struct platform_driver lpass_audio_cc_qcm6490_driver = {
>>>> +	.probe = lpass_audio_cc_qcm6490_probe,
>>>> +	.driver = {
>>>> +		.name = "lpass_audio_cc-qcm6490",
>>>> +		.of_match_table = lpass_audio_cc_qcm6490_match_table,
>>>> +	},
>>>> +};
>>>> +
>>>>    static int __init lpass_audio_cc_sc7280_init(void)
>>>>    {
>>>>    	int ret;
>>>>    
>>>> +	ret = platform_driver_register(&lpass_audio_cc_qcm6490_driver);
>>>> +	if (ret)
>>>> +		return ret;
>>>> +
>>>>    	ret = platform_driver_register(&lpass_aon_cc_sc7280_driver);
>>> Why this is a new platform driver?  There should be just one driver with
>>> different match data.
>>>
>>
>> The main problem for me is that the current board(QCM6490) needs to be
>> only support a subset of the entire(only resets) functionality the
>> SC7280. If I redesign the probe function to pick the match data then I
>> might accidentally break the existing functionalities on SC7280 boards.
> 
> That's not a reason to not implement changes. Test your changes first.
> 
>>
>> Hence I thought to have a separate driver registration which looked a
>> cleaner approach to go away from the "of_device_is_compatible".
> 
> No. You over complicate simple case introducing unusual pattern.
> 

Krzysztof, now I am introducing a match data approach to differentiate 
between SC7280 and QCM6490 for adding the reset functionality only to 
the later board.

v2 series: 
https://lore.kernel.org/lkml/20240816-qcm6490-lpass-reset-v1-0-a11f33cad3c5@quicinc.com/T/#t 


> Best regards,
> Krzysztof
> 

-- 
Thanks & Regards,
Taniya Das.

  reply	other threads:[~2024-08-16  8:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-31 10:22 [PATCH 0/4] Update LPASS Audio clock driver for QCM6490 board Taniya Das
2024-05-31 10:22 ` [PATCH 1/4] dt-bindings: clock: qcom: Add compatible for QCM6490 boards Taniya Das
2024-05-31 10:22 ` [PATCH 2/4] clk: qcom: lpassaudiocc-sc7280: Add support for LPASS resets for QCM6490 Taniya Das
2024-05-31 16:26   ` Krzysztof Kozlowski
2024-06-10 10:03     ` Taniya Das
2024-06-16  7:49       ` Krzysztof Kozlowski
2024-08-16  8:34         ` Taniya Das [this message]
2024-06-07  9:30   ` Konrad Dybcio
2024-06-07  9:34     ` Krzysztof Kozlowski
2024-06-07 10:07       ` Dmitry Baryshkov
2024-06-10 10:20         ` Taniya Das
2024-06-10 10:24       ` Taniya Das
2024-06-10 10:19     ` Taniya Das
2024-06-10 18:19       ` Dmitry Baryshkov
2024-06-18 13:22       ` Konrad Dybcio
2024-08-16  8:34         ` Taniya Das
2024-05-31 10:22 ` [PATCH 3/4] arm64: dts: qcom: qcm6490-idp: Update protected clocks list Taniya Das
2024-05-31 12:04   ` Dmitry Baryshkov
2024-06-10 10:27     ` Taniya Das
2024-06-10 18:21       ` Dmitry Baryshkov
2024-08-16  8:34         ` Taniya Das
2024-08-16 13:03           ` Dmitry Baryshkov
2024-05-31 10:22 ` [PATCH 4/4] arm64: dts: qcom: qcs6490-rb3gen2: Update the LPASS audio node 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=9ebda78f-efad-40d2-9685-0dc48445ff6a@quicinc.com \
    --to=quic_tdas@quicinc.com \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=quic_imrashai@quicinc.com \
    --cc=quic_jkona@quicinc.com \
    --cc=robh+dt@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