From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Janani Sunil <janani.sunil@analog.com>
Cc: "Michael Walle" <mwalle@kernel.org>,
"Linus Walleij" <linusw@kernel.org>,
"Bartosz Golaszewski" <brgl@kernel.org>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
"Nuno Sá" <nuno.sa@analog.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"Janani Sunil" <jananisunil.dev@gmail.com>
Subject: Re: [PATCH v8 2/3] gpio: regmap: Add optional runtime PM support
Date: Fri, 11 Sep 2026 08:41:52 +0300 [thread overview]
Message-ID: <aqOUoEsxHXPH_Yzy@ashevche-desk.local> (raw)
In-Reply-To: <20260910-ad7768-gpio-v8-2-6aaaa15adeb3@analog.com>
On Thu, Sep 10, 2026 at 07:29:11PM +0200, Janani Sunil wrote:
> Some gpio-regmap consumers share their regmap with a parent device that
> may be runtime suspended. GPIO register accesses must resume that device
> first.
>
> Add an optional pm_dev field and acquire it before register translation
> or access. Release it using runtime autosuspend after each operation.
> Keep the device active across the complete direction-output sequence and
> propagate failure when setting the initial output value.
...
> - ret = gpio->reg_mask_xlate(gpio, GPIO_REGMAP_GET_OP, base, offset, ®, &mask);
Hmm... As far as I understand the xlate function should not touch the hardware.
Is it not the case?
> + GPIO_REGMAP_RUNTIME_ACQUIRE(gpio, pm);
> + ret = GPIO_REGMAP_RUNTIME_ACQUIRE_ERR(&pm);
> + if (ret)
> + return ret;
> +
> + ret = gpio->reg_mask_xlate(gpio, GPIO_REGMAP_GET_OP, base, offset,
> + ®, &mask);
> if (ret)
> return ret;
Otherwise runtime PM may be handled after that call.
...
Ditto for the rest.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-09-11 5:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 17:29 [PATCH v8 0/3] gpio: Add AD7768 GPIO support Janani Sunil
2026-09-10 17:29 ` [PATCH v8 1/3] gpio: regmap: Use regmap_test_bits() for single bit reads Janani Sunil
2026-09-10 17:29 ` [PATCH v8 2/3] gpio: regmap: Add optional runtime PM support Janani Sunil
2026-09-10 17:55 ` Linus Walleij
2026-09-11 5:41 ` Andy Shevchenko [this message]
2026-09-11 5:44 ` Andy Shevchenko
2026-09-10 17:29 ` [PATCH v8 3/3] gpio: ad7768: Add AD7768 GPIO auxiliary driver Janani Sunil
2026-09-16 9:08 ` [PATCH v8 0/3] gpio: Add AD7768 GPIO support Bartosz Golaszewski
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=aqOUoEsxHXPH_Yzy@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=brgl@kernel.org \
--cc=janani.sunil@analog.com \
--cc=jananisunil.dev@gmail.com \
--cc=jic23@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mwalle@kernel.org \
--cc=nuno.sa@analog.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
all inboxes | Powered by JetHome®