From: Christian Marangi <ansuelsmth@gmail.com>
To: Rob Herring <robh@kernel.org>
Cc: "Lorenzo Bianconi" <lorenzo@kernel.org>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Sean Wang" <sean.wang@kernel.org>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"Lee Jones" <lee@kernel.org>,
"Uwe Kleine-König" <ukleinek@kernel.org>,
linux-mediatek@lists.infradead.org, linux-gpio@vger.kernel.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
upstream@airoha.com, benjamin.larsson@genexis.eu,
linux-pwm@vger.kernel.org
Subject: Re: [PATCH v8 3/6] dt-bindings: pwm: airoha: Add EN7581 pwm
Date: Tue, 22 Oct 2024 18:06:06 +0200 [thread overview]
Message-ID: <6717cd70.df0a0220.850c6.7b5d@mx.google.com> (raw)
In-Reply-To: <20241021190053.GA948525-robh@kernel.org>
On Mon, Oct 21, 2024 at 02:00:53PM -0500, Rob Herring wrote:
> On Fri, Oct 18, 2024 at 03:19:04PM +0200, Lorenzo Bianconi wrote:
> > Introduce device-tree binding documentation for Airoha EN7581 pwm
> > controller.
> >
> > Co-developed-by: Christian Marangi <ansuelsmth@gmail.com>
> > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> > .../devicetree/bindings/pwm/airoha,en7581-pwm.yaml | 61 ++++++++++++++++++++++
> > 1 file changed, 61 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/pwm/airoha,en7581-pwm.yaml b/Documentation/devicetree/bindings/pwm/airoha,en7581-pwm.yaml
> > new file mode 100644
> > index 0000000000000000000000000000000000000000..fb68c10b037b840a571a2ceee57f13cbae78da66
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/pwm/airoha,en7581-pwm.yaml
> > @@ -0,0 +1,61 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/pwm/airoha,en7581-pwm.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Airoha EN7581 PWM Controller
> > +
> > +maintainers:
> > + - Lorenzo Bianconi <lorenzo@kernel.org>
> > +
> > +allOf:
> > + - $ref: pwm.yaml#
> > +
> > +properties:
> > + compatible:
> > + const: airoha,en7581-pwm
> > +
> > + "#pwm-cells":
> > + const: 3
> > +
> > + airoha,74hc595-mode:
> > + description: Set the PWM to handle attached shift register chip 74HC595.
> > +
> > + With this disabled, PWM assume a 74HC164 chip attached.
> > +
> > + The main difference between the 2 chip is the presence of a latch pin
> > + that needs to triggered to apply the configuration and PWM needs to
> > + account for that.
> > + type: boolean
> > +
> > + airoha,sipo-clock-divisor:
> > + description: Declare Shift Register chip clock divisor (clock source is
> > + from SoC APB Clock)
>
> Where is the clock source defined?
>
> You can specify the PWM frequency in PWM cells and should be able to get
> the APB Clock frequency. Then you can calculate the divider.
>
Hi Rob,
this property is related to the Shift Register chip and is not related
to the clock of the PWM.
It's really to configure the clock that will be feed to Shift Register
chip if for whatever reason one OEM mount a different kind (but still
register compatible) and requires to run at higher clock rate.
We can consider hardcoding it if really needed but considering the case
with 2 different kind of shift register supported, I assume configuring
this might be needed on some corner case Devices.
For the clock we are not 100% but we might have an idea of what is the
source, but still it will be just referenced and enabled in the driver
(it's always enabled).
Hope I can get some hint by you on how to proceed.
Is it ok with:
- Defining the attached clock
- Keep the property
?
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + default: 32
> > + enum: [4, 8, 16, 32]
> > +
> > + airoha,sipo-clock-delay:
> > + description: Declare Serial GPIO Clock delay.
> > + This can be needed to permit the attached shift register to correctly
> > + setup and apply settings. Value must NOT be greater than
> > + "airoha,sipo-clock-divisor" / 2
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + default: 1
> > + minimum: 1
> > + maximum: 16
> > +
> > +required:
> > + - compatible
> > + - "#pwm-cells"
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > + - |
> > + pwm {
> > + compatible = "airoha,en7581-pwm";
> > +
> > + #pwm-cells = <3>;
> > + };
> >
> > --
> > 2.47.0
> >
--
Ansuel
next prev parent reply other threads:[~2024-10-22 16:44 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-18 13:19 [PATCH v8 0/6] Add mfd, pinctrl and pwm support to EN7581 SoC Lorenzo Bianconi
2024-10-18 13:19 ` [PATCH v8 1/6] dt-bindings: arm: airoha: Add the chip-scu node for " Lorenzo Bianconi
2024-10-21 13:42 ` AngeloGioacchino Del Regno
2024-10-18 13:19 ` [PATCH v8 2/6] dt-bindings: pinctrl: airoha: Add EN7581 pinctrl Lorenzo Bianconi
2024-10-21 13:42 ` AngeloGioacchino Del Regno
2024-10-18 13:19 ` [PATCH v8 3/6] dt-bindings: pwm: airoha: Add EN7581 pwm Lorenzo Bianconi
2024-10-21 13:42 ` AngeloGioacchino Del Regno
2024-10-21 19:00 ` Rob Herring
2024-10-22 16:06 ` Christian Marangi [this message]
2024-10-22 21:17 ` Rob Herring
2024-10-22 21:32 ` Benjamin Larsson
2024-10-22 16:57 ` Benjamin Larsson
2024-10-22 20:02 ` Benjamin Larsson
2024-10-22 21:08 ` Rob Herring
2024-10-22 21:12 ` Christian Marangi
2024-10-22 21:21 ` Benjamin Larsson
2024-10-18 13:19 ` [PATCH v8 4/6] dt-bindings: mfd: Add support for Airoha EN7581 GPIO System Controller Lorenzo Bianconi
2024-10-18 13:19 ` [PATCH v8 5/6] pinctrl: airoha: Add support for EN7581 SoC Lorenzo Bianconi
2024-10-18 13:19 ` [PATCH v8 6/6] pwm: " Lorenzo Bianconi
2024-10-21 13:42 ` AngeloGioacchino Del Regno
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=6717cd70.df0a0220.850c6.7b5d@mx.google.com \
--to=ansuelsmth@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=benjamin.larsson@genexis.eu \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pwm@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=robh@kernel.org \
--cc=sean.wang@kernel.org \
--cc=ukleinek@kernel.org \
--cc=upstream@airoha.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;
as well as URLs for NNTP newsgroup(s).