[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <24f967b5-0f15-4aed-a81f-ad54f8e541fa@oss.qualcomm.com>
Date: Tue, 3 Feb 2026 12:14:12 +0100
From: Konrad Dybcio <konrad.dybcio@....qualcomm.com>
To: Praveen Talari <praveen.talari@....qualcomm.com>,
Andi Shyti <andi.shyti@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley
<conor+dt@...nel.org>,
Mukesh Kumar Savaliya <mukesh.savaliya@....qualcomm.com>,
Viken Dadhaniya <viken.dadhaniya@....qualcomm.com>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konradybcio@...nel.org>, linux-arm-msm@...r.kernel.org,
linux-i2c@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, bryan.odonoghue@...aro.org,
dmitry.baryshkov@....qualcomm.com, bjorn.andersson@....qualcomm.com
Cc: prasad.sodagudi@....qualcomm.com, quic_vtanuku@...cinc.com,
aniket.randive@....qualcomm.com, chandana.chiluveru@....qualcomm.com
Subject: Re: [PATCH v3 06/12] soc: qcom: geni-se: Introduce helper APIs for
performance control
On 1/30/26 5:54 PM, Praveen Talari wrote:
> Hi Konrad
>
> On 1/30/2026 5:53 PM, Konrad Dybcio wrote:
>> On 1/12/26 11:47 AM, Praveen Talari wrote:
>>> The GENI Serial Engine (SE) drivers (I2C, SPI, and SERIAL) currently
>>> manage performance levels and operating points directly. This resulting
>>> in code duplication across drivers. such as configuring a specific level
>>> or find and apply an OPP based on a clock frequency.
>>>
>>> Introduce two new helper APIs, geni_se_set_perf_level() and
>>> geni_se_set_perf_opp(), addresses this issue by providing a streamlined
>>> method for the GENI Serial Engine (SE) drivers to find and set the OPP
>>> based on the desired performance level, thereby eliminating redundancy.
>>>
>>> Signed-off-by: Praveen Talari <praveen.talari@....qualcomm.com>
>>> ---
>>
>> [...]
>>
>>> +/**
>>> + * geni_se_set_perf_level() - Set performance level for GENI SE.
>>> + * @se: Pointer to the struct geni_se instance.
>>> + * @level: The desired performance level.
>>> + *
>>> + * Sets the performance level by directly calling dev_pm_opp_set_level
>>> + * on the performance device associated with the SE.
>>> + *
>>> + * Return: 0 on success, or a negative error code on failure.
>>> + */
>>> +int geni_se_set_perf_level(struct geni_se *se, unsigned long level)
>>> +{
>>> + return dev_pm_opp_set_level(se->pd_list->pd_devs[DOMAIN_IDX_PERF], level);
>>> +}
>>> +EXPORT_SYMBOL_GPL(geni_se_set_perf_level);
>>
>> This function is never used
>
> it will be used by UART driver, not for I2C/SPI.
Adding unused exported symbols is "eeeh"..
>>
>>> +
>>> +/**
>>> + * geni_se_set_perf_opp() - Set performance OPP for GENI SE by frequency.
>>> + * @se: Pointer to the struct geni_se instance.
>>> + * @clk_freq: The requested clock frequency.
>>> + *
>>> + * Finds the nearest operating performance point (OPP) for the given
>>> + * clock frequency and applies it to the SE's performance device.
>>> + *
>>> + * Return: 0 on success, or a negative error code on failure.
>>> + */
>>> +int geni_se_set_perf_opp(struct geni_se *se, unsigned long clk_freq)
>>
>> I think with the SPI driver in mind (which seems to do a simple rateset
>
> APIs were added as generic interfaces shared across I²C/SPI which is specific to firmware control, not Linux control.
>
>> for both backends) we could do:
>>
>>> +{
>>> + struct device *perf_dev = se->pd_list->pd_devs[DOMAIN_IDX_PERF];
>>
>> Then, we can do struct device * perf_dev = se->dev;
> I don't think, it is needed since this is specific to firmware control, not Linux control.
My point is that it doesn't have to be specific to the auto usecase,
further commonizing the code..
Konrad
Powered by blists - more mailing lists