The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: Bjorn Andersson <andersson@kernel.org>,
	Linus Walleij <linusw@kernel.org>,
	linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	mohammad.rafi.shaik@oss.qualcomm.com
Subject: Re: [PATCH v4 2/2] pinctrl: qcom: lpass-lpi: Switch to PM clock framework for runtime PM
Date: Wed, 13 May 2026 19:23:52 +0530	[thread overview]
Message-ID: <e7c075bf-fb7b-4769-8ce1-aa613ef26acf@oss.qualcomm.com> (raw)
In-Reply-To: <ucmpc5hkbjruix2ftxys2zfk5blntfsap3fbspqta6ihyigrgg@3nyghgnonxvh>



On 5/13/2026 6:22 PM, Dmitry Baryshkov wrote:
> On Wed, May 13, 2026 at 05:55:26PM +0530, Ajay Kumar Nandam wrote:
>> Convert the LPASS LPI pinctrl driver to use the PM clock framework for
>> runtime power management.
>>
>> This allows the LPASS LPI pinctrl driver to drop clock votes when idle,
>> improves power efficiency on platforms using LPASS LPI island mode, and
>> aligns the driver with common runtime PM patterns used across Qualcomm
>> LPASS subsystems.
>>
>> Guard GPIO register read/write helpers and slew-rate register programming
>> with synchronous runtime PM calls so the device is active during MMIO
>> operations whenever autosuspend is enabled.
>>
>> Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
>> ---
>>   drivers/pinctrl/qcom/pinctrl-lpass-lpi.c      | 118 ++++++++++++------
>>   .../pinctrl/qcom/pinctrl-sc7280-lpass-lpi.c   |   7 ++
>>   2 files changed, 88 insertions(+), 37 deletions(-)
>>
>> diff --git a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
>> index 15ced5027579..d95e28926d38 100644
>> --- a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
>> +++ b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
>> @@ -15,6 +15,9 @@
>>   #include <linux/pinctrl/pinconf-generic.h>
>>   #include <linux/pinctrl/pinconf.h>
>>   #include <linux/pinctrl/pinmux.h>
>> +#include <linux/cleanup.h>
>> +#include <linux/pm_clock.h>
>> +#include <linux/pm_runtime.h>
>>   
>>   #include "../pinctrl-utils.h"
>>   
>> @@ -22,7 +25,6 @@
>>   
>>   #define MAX_NR_GPIO		32
>>   #define GPIO_FUNC		0
>> -#define MAX_LPI_NUM_CLKS	2
>>   
>>   struct lpi_pinctrl {
>>   	struct device *dev;
>> @@ -31,7 +33,6 @@ struct lpi_pinctrl {
>>   	struct pinctrl_desc desc;
>>   	char __iomem *tlmm_base;
>>   	char __iomem *slew_base;
>> -	struct clk_bulk_data clks[MAX_LPI_NUM_CLKS];
>>   	/* Protects from concurrent register updates */
>>   	struct mutex lock;
>>   	DECLARE_BITMAP(ever_gpio, MAX_NR_GPIO);
>> @@ -39,29 +40,47 @@ struct lpi_pinctrl {
>>   };
>>   
>>   static int lpi_gpio_read(struct lpi_pinctrl *state, unsigned int pin,
>> -			 unsigned int addr)
>> +			 unsigned int addr, u32 *val)
>>   {
>>   	u32 pin_offset;
>> +	int ret;
>>   
>>   	if (state->data->flags & LPI_FLAG_USE_PREDEFINED_PIN_OFFSET)
>>   		pin_offset = state->data->groups[pin].pin_offset;
>>   	else
>>   		pin_offset = LPI_TLMM_REG_OFFSET * pin;
>>   
>> -	return ioread32(state->tlmm_base + pin_offset + addr);
>> +	ret = pm_runtime_resume_and_get(state->dev);
>> +	if (ret < 0)
>> +		return ret;
>> +
>> +	*val = ioread32(state->tlmm_base + pin_offset + addr);
>> +	ret = pm_runtime_put_autosuspend(state->dev);
>> +	if (ret < 0)
>> +		return ret;
>> +
>> +	return 0;
> 
> Just `return pm_runtime_put_autosuspend(state->dev)`, no need for extra
> ifs.
> 

ACK, Addressed in V5.

Thanks
Ajay Kumar

>>   }
>>   
> 


      reply	other threads:[~2026-05-13 13:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08 11:36 [PATCH v3 0/2] pinctrl: qcom: lpass-lpi: Switch to PM clock framework Ajay Kumar Nandam
2026-05-08 11:36 ` [PATCH v3 1/2] pinctrl: qcom: lpass-lpi: Enable runtime PM hooks on remaining SoCs Ajay Kumar Nandam
2026-05-08 13:41   ` Konrad Dybcio
2026-05-13 13:50     ` Ajay Kumar Nandam
2026-05-13 12:48   ` Dmitry Baryshkov
2026-05-13 13:55     ` Ajay Kumar Nandam
2026-05-08 11:36 ` [PATCH v3 2/2] pinctrl: qcom: lpass-lpi: Switch to PM clock framework for runtime PM Ajay Kumar Nandam
2026-05-08 13:40   ` Konrad Dybcio
2026-05-13 13:49     ` Ajay Kumar Nandam
2026-05-13 12:25 ` [PATCH v4 0/2] pinctrl: qcom: lpass-lpi: Switch to PM clock framework Ajay Kumar Nandam
2026-05-13 12:25 ` [PATCH v4 1/2] pinctrl: qcom: lpass-lpi: Enable runtime PM hooks on LPASS LPI SoCs Ajay Kumar Nandam
2026-05-13 12:51   ` Dmitry Baryshkov
2026-05-13 13:53     ` Ajay Kumar Nandam
2026-05-13 12:25 ` [PATCH v4 2/2] pinctrl: qcom: lpass-lpi: Switch to PM clock framework for runtime PM Ajay Kumar Nandam
2026-05-13 12:52   ` Dmitry Baryshkov
2026-05-13 13:53     ` Ajay Kumar Nandam [this message]

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=e7c075bf-fb7b-4769-8ce1-aa613ef26acf@oss.qualcomm.com \
    --to=ajay.nandam@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=linusw@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mohammad.rafi.shaik@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