All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matti Vaittinen <mazziesaccount@gmail.com>
To: Linus Walleij <linusw@kernel.org>
Cc: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>,
	Matti Vaittinen <matti.vaittinen@linux.dev>,
	Lee Jones <lee@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney@redhat.com>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-rtc@vger.kernel.org
Subject: Re: [PATCH 2/8] dt-bindings: mfd: ROHM BD73800 PMIC
Date: Mon, 3 Aug 2026 08:48:59 +0300	[thread overview]
Message-ID: <db4a8ecc-65c2-4965-bb53-bd637e3765df@gmail.com> (raw)
In-Reply-To: <CAD++jLnaOOoLsLxzib4d1XXLxRpWBPrqCdRwqVVEUmKYS4ad6g@mail.gmail.com>

Hi dee Ho Linus,

The way too short summer holiday is now gone, so I am back at this :) 
Thanks again for the comments, I am trying to improve for v2 ;)

On 03/07/2026 23:46, Linus Walleij wrote:
> On Wed, Jul 1, 2026 at 2:41 PM Matti Vaittinen
> <matti.vaittinen@linux.dev> wrote:
> 
>> +  # The GPIO1, CLKOUT (GPIO2), FAULT_B and EXTEN_OUT pins can be
>> +  # configured to interrupt pins by OTP.
> 
> Maybe move this helpful comment into the top description: instead?
> It's kind of generic helpful info.
> 
>> +# The GPIO1, CLKOUT, FAULT_B and EXTEN_OUT pins may be configured for a
>> +# specific purpose (like ADC input, 32.768 clk output, fault indicator or
>> +# delivering power sequence to a companion PMIC when multiple PMICs are
>> +# used) - but also to be either a GPO or GPI. (When used as a GPI the pin
>> +# can also be used as an IRQ source). The pin purpose is determined by
>> +# OTP (One Time Programmable memory), typically during device manufacturing.
>> +# The OTP can't be read at runtime so device-tree should describe the pins.
>> +  rohm,pin-gpio1:
>> +    $ref: /schemas/types.yaml#/definitions/string
>> +    description:
>> +      Indicate if the GPIO1 pin has been set to GPI or GPO at manufacturing.
>> +    enum: [gpi, gpo]
>> +
>> +  rohm,pin-clkout:
>> +    $ref: /schemas/types.yaml#/definitions/string
>> +    description:
>> +      Indicate if the CLKOUT pin has been set to GPI or GPO at manufacturing.
>> +    enum: [gpi, gpo]
>> +
>> +  rohm,pin-fault-b:
>> +    $ref: /schemas/types.yaml#/definitions/string
>> +    description:
>> +      Indicate if the FAULT_B pin has been set to GPI or GPO at manufacturing.
>> +    enum: [gpi, gpo]
>> +
>> +  rohm,pin-exten:
>> +    $ref: /schemas/types.yaml#/definitions/string
>> +    description:
>> +      Indicate if the EXTEN_OUT pin has been set to GPI or GPO at
>> +      manufacturing.
>> +    enum: [gpi, gpo]
> 
> Can we explain what "GPI" and "GPO" means in this context?
> 
> I read it as "general purpose input" and "general purpose output", but...
> you just describe the exact purpose? So what is "general purpose"
> about them in that case?

These property names (pin-gpio1, pin-clkout, pin-fault-b, pin-exten) do 
not define the purpose of the pin, but they match the pin name in the 
data-sheet. The idea is indeed to be able to say "the fault-b -pin is 
not a fault signal, but a general purpose input" - if the IC we are 
describing here has OTP configuration enabling this.

I am re-using the approach from the BD72720 here. I think I will add a 
common binding file with these, which can then be referred by multiple 
rohm ICs (in same fashion I added the 
Documentation/devicetree/bindings/regulator/rohm,pmic-states.yaml for 
commonly used ROHM regulator properties). I'll see if it looks Ok (to 
me), and send it in v2 :)

> I would re-use "input-enable" and "output-enable" from:
> Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml
> (I mean don't $rf that, just use these strings).
> 
> I suppose:
> enum: [input-enable, output-enable]
> 
>> +  rohm,clkout-open-drain:
>> +    description: clk32kout mode. Set to 1 for "open-drain" or 0 for "cmos".
>> +    $ref: /schemas/types.yaml#/definitions/uint32
>> +    minimum: 0
>> +    maximum: 1
> 
> Here I would also reuse the generic pinconf properties,
> something like;
> 
> rohm,clkout-drive-type:
>    enum: [drive-push-pull, drive-open-drain]

As I mentioned in my very hasty original reply, this is also an existing 
binding used in quite a few PMIC device-trees. Changing it now sounds 
like asking for problems, for (in my opinion) little benefit. Yet, since 
it is used by a few PMICs, I could perhaps put it in a common rohm 
binding file as well. Then it would be more obvious it is an existing 
property if new models re-use this.

> (Push-pull is what is colloquially referred to as "cmos".)

I will at least add a.k.a "push-pull" to the description :)

> 
>> +            rohm,pin-gpio1 = "gpo";
>> +            rohm,pin-exten = "gpi";
> 
> If you instead use nodes with properties you can do this:
> 
> rohm,pin-clkout {
>      output-enable;
>      drive-push-pull;
> };
> 
> This collects the clkout config in one place and make
> it obvious what is going on. But I don't know what the DT
> maintainers think about this idea.

I believe you mean I could translate:

rohm,pin-clkout = "gpo";
rohm,clkout-open-drain = <0>;

to
rohm,pin-clkout {
	output-enable;
	drive-push-pull;
};
right?

I am actually not sure if this would work. The data-sheet made me to 
assume it might not. There is separate "OUT32K" register, which controls 
the clock gate. This, as far as I understand, is not usable when the OTP 
variant sets the CLKOUT -pin to GPO. The mode (open-drain / cmos) 
configuration resides in this clock gate register.

[Just to complete picture, when OTP is set to GPO, the pin output is 
controlled by GPIO_OUT register instead. When OTP has set the pin to clk 
output (or to GPI), then the GPIO_OUT register writes have no impact.]

Thus, in case of the BD73800, the:

rohm,pin-clkout = "gpo";
rohm,clkout-open-drain = <0>;

might actually be contradicting.

...

Now, I will make a side-note... The data-sheet front page says:
> 4 GPIOs
> - OTP Option for GPIOs instead of I/F signals:
> EXTEN_OUT, FAULT_B, CLKOUT, GPIO1
> - GPO Supports Open Drain and CMOS Output

I, however, see no register control for the GPO output types. I _assume_ 
the output type (when pins are used for GPO) depends on OTP again. I 
will see if I can clarify this.

Yours,
	-- Matti

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

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

  parent reply	other threads:[~2026-08-03  5:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 12:40 [PATCH 0/8] Support ROHM BD73800 Matti Vaittinen
2026-07-01 12:41 ` [PATCH 1/8] dt-bindings: regulator: ROHM BD73800 regulators Matti Vaittinen
2026-07-01 15:39   ` Rob Herring (Arm)
2026-07-01 19:25   ` Rob Herring
2026-07-02  4:45     ` Matti Vaittinen
2026-07-01 12:41 ` [PATCH 2/8] dt-bindings: mfd: ROHM BD73800 PMIC Matti Vaittinen
2026-07-02  8:05   ` Krzysztof Kozlowski
2026-07-02  8:25     ` Matti Vaittinen
2026-07-03 20:46   ` Linus Walleij
2026-07-12 16:03     ` Matti Vaittinen
2026-08-03  5:48     ` Matti Vaittinen [this message]
2026-07-01 12:41 ` [PATCH 3/8] mfd: Support for ROHM BD73800 PMIC core Matti Vaittinen
2026-07-09 10:48   ` Lee Jones
2026-07-12 17:54     ` Matti Vaittinen
2026-07-01 12:42 ` [PATCH 4/8] rtc: bd70528: Support RTC on ROHM BD73800 Matti Vaittinen
2026-07-01 12:55   ` Alexandre Belloni
2026-07-01 12:42 ` [PATCH 5/8] regulator: bd71828: Support " Matti Vaittinen
2026-07-01 13:01   ` Mark Brown
2026-07-02  4:55     ` Matti Vaittinen
2026-07-01 12:43 ` [PATCH 6/8] clk: bd718x7: " Matti Vaittinen
2026-07-01 12:43 ` [PATCH 7/8] gpio: bd73800: Support ROHM BD73800 PMIC GPIOs Matti Vaittinen
2026-07-03 13:11   ` Bartosz Golaszewski
2026-07-12 15:42     ` Matti Vaittinen
2026-07-13  8:16       ` Bartosz Golaszewski
2026-07-14 14:14         ` Matti Vaittinen
2026-07-01 12:43 ` [PATCH 8/8] MAINTAINERS: Add ROHM BD73800 PMIC files Matti Vaittinen

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=db4a8ecc-65c2-4965-bb53-bd637e3765df@gmail.com \
    --to=mazziesaccount@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bmasney@redhat.com \
    --cc=brgl@kernel.org \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linusw@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=matti.vaittinen@linux.dev \
    --cc=mturquette@baylibre.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.