Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Praveen Talari <praveen.talari@oss.qualcomm.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	Andi Shyti <andi.shyti@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com>,
	Viken Dadhaniya <viken.dadhaniya@oss.qualcomm.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	bryan.odonoghue@linaro.org, dmitry.baryshkov@oss.qualcomm.com,
	bjorn.andersson@oss.qualcomm.com
Cc: prasad.sodagudi@oss.qualcomm.com, quic_vtanuku@quicinc.com,
	aniket.randive@oss.qualcomm.com,
	chandana.chiluveru@oss.qualcomm.com
Subject: Re: [PATCH v3 03/12] soc: qcom: geni-se: Introduce helper API for resource initialization
Date: Fri, 30 Jan 2026 22:30:04 +0530	[thread overview]
Message-ID: <eaed2a51-2efe-44d7-9186-115dfd185a62@oss.qualcomm.com> (raw)
In-Reply-To: <f3a47ca9-643a-4885-b8cf-0e32c6a1ea2f@oss.qualcomm.com>

Hi Konrad

On 1/30/2026 5:40 PM, Konrad Dybcio wrote:
> On 1/12/26 11:47 AM, Praveen Talari wrote:
>> The GENI Serial Engine drivers (I2C, SPI, and SERIAL) currently duplicate
>> code for initializing shared resources such as clocks and interconnect
>> paths.
>>
>> Introduce a new helper API, geni_se_resources_init(), to centralize this
>> initialization logic, improving modularity and simplifying the probe
>> function.
>>
>> Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
>> ---
>> v1 -> v2:
>>  From kernel test robot
>> - Updated proper return value for devm_pm_opp_set_clkname()
>> ---
>>   drivers/soc/qcom/qcom-geni-se.c  | 47 ++++++++++++++++++++++++++++++++
>>   include/linux/soc/qcom/geni-se.h |  6 ++++
>>   2 files changed, 53 insertions(+)
>>
>> diff --git a/drivers/soc/qcom/qcom-geni-se.c b/drivers/soc/qcom/qcom-geni-se.c
>> index b0542f836453..75e722cd1a94 100644
>> --- a/drivers/soc/qcom/qcom-geni-se.c
>> +++ b/drivers/soc/qcom/qcom-geni-se.c
>> @@ -19,6 +19,7 @@
>>   #include <linux/of_platform.h>
>>   #include <linux/pinctrl/consumer.h>
>>   #include <linux/platform_device.h>
>> +#include <linux/pm_opp.h>
>>   #include <linux/soc/qcom/geni-se.h>
>>   
>>   /**
>> @@ -1012,6 +1013,52 @@ int geni_icc_disable(struct geni_se *se)
>>   }
>>   EXPORT_SYMBOL_GPL(geni_icc_disable);
>>   
>> +/**
>> + * geni_se_resources_init() - Initialize resources for a GENI SE device.
>> + * @se: Pointer to the geni_se structure representing the GENI SE device.
>> + *
>> + * This function initializes various resources required by the GENI Serial Engine
>> + * (SE) device, including clock resources (core and SE clocks), interconnect
>> + * paths for communication.
>> + * It retrieves optional and mandatory clock resources, adds an OF-based
>> + * operating performance point (OPP) table, and sets up interconnect paths
>> + * with default bandwidths. The function also sets a flag (`has_opp`) to
>> + * indicate whether OPP support is available for the device.
>> + *
>> + * Return: 0 on success, or a negative errno on failure.
>> + */
>> +int geni_se_resources_init(struct geni_se *se)
>> +{
>> +	int ret;
>> +
>> +	se->core_clk = devm_clk_get_optional(se->dev, "core");
>> +	if (IS_ERR(se->core_clk))
>> +		return dev_err_probe(se->dev, PTR_ERR(se->core_clk),
>> +				     "Failed to get optional core clk\n");
>> +
>> +	se->clk = devm_clk_get(se->dev, "se");
>> +	if (IS_ERR(se->clk) && !has_acpi_companion(se->dev))
>> +		return dev_err_probe(se->dev, PTR_ERR(se->clk),
>> +				     "Failed to get SE clk\n");
>> +
>> +	ret = devm_pm_opp_set_clkname(se->dev, "se");
>> +	if (ret)
>> +		return ret;
>> +
>> +	ret = devm_pm_opp_of_add_table(se->dev);
>> +	if (ret && ret != -ENODEV)
>> +		return dev_err_probe(se->dev, ret, "Failed to add OPP table\n");
>> +
>> +	se->has_opp = (ret == 0);
>> +
>> +	ret = geni_icc_get(se, "qup-memory");
> 
> The second argument is a NOP after patch 1.. originally I think I had a
> cross-subsys patch to get rid of that, neither solution is exactly pretty..

I will drop the second argument once these changes are ported across 
UART and SPI as well.

Thanks,
Praveen Talari

> 
> But otherwise, this looks good
> 
> Konrad


  reply	other threads:[~2026-01-30 17:00 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-12 10:47 [PATCH v3 00/12] Enable I2C on SA8255p Qualcomm platforms Praveen Talari
2026-01-12 10:47 ` [PATCH v3 01/12] soc: qcom: geni-se: Refactor geni_icc_get() and make qup-memory ICC path optional Praveen Talari
2026-01-12 10:47 ` [PATCH v3 02/12] soc: qcom: geni-se: Add geni_icc_set_bw_ab() function Praveen Talari
2026-01-12 10:47 ` [PATCH v3 03/12] soc: qcom: geni-se: Introduce helper API for resource initialization Praveen Talari
2026-01-30 12:10   ` Konrad Dybcio
2026-01-30 17:00     ` Praveen Talari [this message]
2026-01-12 10:47 ` [PATCH v3 04/12] soc: qcom: geni-se: Add resources activation/deactivation helpers Praveen Talari
2026-01-30 12:11   ` Konrad Dybcio
2026-02-02 16:20     ` Praveen Talari
2026-01-12 10:47 ` [PATCH v3 05/12] soc: qcom: geni-se: Introduce helper API for attaching power domains Praveen Talari
2026-01-30 12:12   ` Konrad Dybcio
2026-01-30 16:55     ` Praveen Talari
2026-02-02 16:19     ` Praveen Talari
2026-01-12 10:47 ` [PATCH v3 06/12] soc: qcom: geni-se: Introduce helper APIs for performance control Praveen Talari
2026-01-30 12:23   ` Konrad Dybcio
2026-01-30 16:54     ` Praveen Talari
2026-02-03 11:14       ` Konrad Dybcio
2026-02-04  5:42         ` Praveen Talari
2026-02-17 12:25           ` Konrad Dybcio
2026-02-20  5:23             ` Praveen Talari
2026-02-23 13:43               ` Praveen Talari
2026-02-25 14:25               ` Konrad Dybcio
2026-01-12 10:47 ` [PATCH v3 07/12] dt-bindings: i2c: Describe SA8255p Praveen Talari
2026-01-12 10:47 ` [PATCH v3 08/12] i2c: qcom-geni: Isolate serial engine setup Praveen Talari
2026-01-21  7:47   ` Viken Dadhaniya
2026-01-12 10:47 ` [PATCH v3 09/12] i2c: qcom-geni: Move resource initialization to separate function Praveen Talari
2026-01-21  8:57   ` Viken Dadhaniya
2026-01-12 10:47 ` [PATCH v3 10/12] i2c: qcom-geni: Use resources helper APIs in runtime PM functions Praveen Talari
2026-01-21  8:58   ` Viken Dadhaniya
2026-01-30 12:05   ` Konrad Dybcio
2026-01-30 16:48     ` Praveen Talari
2026-02-03 11:13       ` Konrad Dybcio
2026-02-04  5:46         ` Praveen Talari
2026-01-12 10:47 ` [PATCH v3 11/12] i2c: qcom-geni: Store of_device_id data in driver private struct Praveen Talari
2026-01-21  8:59   ` Viken Dadhaniya
2026-01-30 12:29   ` Konrad Dybcio
2026-02-02 16:19     ` Praveen Talari
2026-01-12 10:47 ` [PATCH v3 12/12] i2c: qcom-geni: Enable I2C on SA8255p Qualcomm platforms Praveen Talari
2026-01-21 10:21   ` Viken Dadhaniya
2026-01-30 12:34   ` Konrad Dybcio
2026-01-30 16:44     ` Praveen Talari
2026-02-02 14:53       ` Konrad Dybcio
2026-02-04  5:43         ` Praveen Talari
2026-01-14 15:05 ` [PATCH v3 00/12] " Andi Shyti
2026-01-28 22:49 ` [SPAM] " Andi Shyti

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=eaed2a51-2efe-44d7-9186-115dfd185a62@oss.qualcomm.com \
    --to=praveen.talari@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=andi.shyti@kernel.org \
    --cc=aniket.randive@oss.qualcomm.com \
    --cc=bjorn.andersson@oss.qualcomm.com \
    --cc=bryan.odonoghue@linaro.org \
    --cc=chandana.chiluveru@oss.qualcomm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mukesh.savaliya@oss.qualcomm.com \
    --cc=prasad.sodagudi@oss.qualcomm.com \
    --cc=quic_vtanuku@quicinc.com \
    --cc=robh@kernel.org \
    --cc=viken.dadhaniya@oss.qualcomm.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