Re: [PATCH v2 09/10] gpio: bd73800: Support ROHM BD73800 PMIC GPIOs

From: Matti Vaittinen

Date: Thu Aug 13 2026 - 08:55:31 EST


On 13/08/2026 11:34, Matti Vaittinen wrote:
On 07/08/2026 23:29, Linus Walleij wrote:

...

  * @fixed_direction_output:
  *                      (Optional) Bitmap representing the fixed direction of
  *                      the GPIO lines. Useful when there are GPIO lines with a
  *                      fixed direction mixed together in the same register.

It seems you can set up the fixed_direction_output mask from OTP
and just use the library, right?

The BD73800 uses different registers for 'out' and 'in'. So there aren't really "GPIO lines with a fixed direction mixed together in the same register".

...

I think the BD73800 can indeed use the gpio-regmap, by keeping the pin direction information in private data and adding a custom xlate, which errors out if get is requested for output pin, or set is requested for input. I am not sure how much of an improvement it is compared to the patch v2, but I'll give it a shot :) I believe the new -rc1 isn't that far away, and hopefully the gpio-regmap -stuff from the next will be in it together with the regulator stuff bindings depended.

Gah. Please, ignore the erroring-out part. I don't know where I picked the idea that the hardware would always return '0' when reading the GPO_OUT register. I think this might have been something I have experienced on a setup where the pin was _not_ set to GPO by OTP. Furthermore, the xlate will never get called if user tries to set value for a GPI pin.

Anyways, implementing xlate with op-check allows me to support this PMIC, even though the register to read for pin status depends on OTP.

So yes, v3 should be able to use gpio-regmap. I will probably delay sending it until v7.3-rc1 is out so I get (all?) dependencies in.

Yours,
-- Matti

--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~