Re: [PATCH v2 5/7] gpio: regmap: Add runtime PM and read_output_reg_set support

"Michael Walle" <[email protected]>
Newsgroups org.kernel.vger.linux-gpio,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-doc,org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Thu Aug 6, 2026 at 5:41 PM CEST, Janani Sunil wrote:
> The new pm_dev field in gpio_regmap_config allows a driver to supply a
> device for runtime PM. All operations call pm_runtime_resume_and_get()
> before accessing the regmap and pm_runtime_put_autosuspend() on return.
>
> The new read_output_reg_set flag when set, gpio_regmap_get() checks the
> pin direction first and reads from reg_set_base instead of reg_dat_base
> for output pins. Requires both reg_dat_base and reg_set_base to be
> configured.

As already mentioned. please split it into two patches. Also, could
you add some context where/why this is used/useful?

So, if the direction is output, then you just read back the set
value (instead of the actual line state). Is that correct? Why can't
you read the input buffer in that case? Input buffer deactivated?
(NB. you can never get the real line state in that case, which is
sometimes useful for debugging.)

Anyway, you should be able to achieve the same with the
reg_mask_xlate(), no? Check if the pin is in output mode, then
change the &reg.

-michael
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.