devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herve Codina <herve.codina@bootlin.com>
To: "Uwe Kleine-König" <ukleinek@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Herve Codina" <herve.codina@bootlin.com>
Cc: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Luca Ceresoli <luca.ceresoli@bootlin.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: [PATCH v3 0/2] pwm: Add support for pwm nexus node
Date: Wed,  5 Feb 2025 10:55:41 +0100	[thread overview]
Message-ID: <20250205095547.536083-1-herve.codina@bootlin.com> (raw)

Platforms can have a standardized connector/expansion slot that exposes
PWMs signals to expansion boards.

A nexus node [1] allows to remap a phandle list in a consumer node
through a connector node in a generic way. With this remapping, the
consumer node needs to know only about the nexus node. Resources behind
the nexus node are decoupled by the nexus node itself.

This is particularly useful when this consumer is described in a
device-tree overlay. Indeed, to have the exact same overlay reused with
several base systems the overlay needs to known only about the connector
is going to be applied to without any knowledge of the SoC (or the
component providing the resource) available in the system.

As an example, suppose 3 PWMs connected to a connector. The connector
PWM 0 and 2 comes from the PWM 1 and 3 of the pwm-controller1. The
connector PWM 1 comes from the PWM 4 of the pwm-controller2. An
expansion device is connected to the connector and uses the connector
PMW 1.

Nexus node support in PWM allows the following description:
        soc {
                soc_pwm1: pwm-controller1 {
                        #pwm-cells = <3>;
                };

                soc_pwm2: pwm-controller2 {
                        #pwm-cells = <3>;
                };
        };

        connector: connector {
                #pwm-cells = <3>;
                pwm-map = <0 0 0 &soc_pwm1 1 0 0>,
                          <1 0 0 &soc_pwm2 4 0 0>,
                          <2 0 0 &soc_pwm1 3 0 0>;
                pwm-map-mask = <0xffffffff 0x0 0x0>;
                pwm-map-pass-thru = <0x0 0xffffffff 0xffffffff>;
        };

        expansion_device {
                pwms = <&connector 1 57000 0>;
        };

From the expansion device point of view, the PWM requested is the PWM 1
available at the connector regardless of the exact PWM wired to this
connector PWM 1. Thanks to nexus node remapping described at connector
node, this PWM is the PWM 4 of the pwm-controller2.

[1] https://github.com/devicetree-org/devicetree-specification/blob/v0.4/source/chapter2-devicetree-basics.rst#nexus-nodes-and-specifier-mapping

Compared to previous iteration, this v3 series mainly adds the PWM nexus node
devicetree binding.

Best regards,
Hervé Codina

Changes v2 -> v3
  - Patch 1 (new patch)
    devicetree binding

  - Patch 2 (single patch in v2)
    Fix typos in commit log DT example.
    Avoid wildcard for PWM nexus node properties in the commit log.

Changes v1 -> v2
  v1: https://lore.kernel.org/all/20241202164459.157672-1-herve.codina@bootlin.com/

  - Rework commit log

Herve Codina (2):
  dt-bindings: pwm: Add support for PWM nexus node
  pwm: Add support for pwm nexus dt bindings

 .../bindings/pwm/pwm-nexus-node.yaml          | 65 +++++++++++++++++++
 drivers/pwm/core.c                            |  3 +-
 2 files changed, 66 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pwm/pwm-nexus-node.yaml

-- 
2.47.1


             reply	other threads:[~2025-02-05  9:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-05  9:55 Herve Codina [this message]
2025-02-05  9:55 ` [PATCH v3 1/2] dt-bindings: pwm: Add support for PWM nexus node Herve Codina
2025-02-11 20:56   ` Rob Herring
2025-02-05  9:55 ` [PATCH v3 2/2] pwm: Add support for pwm nexus dt bindings Herve Codina
2025-02-05 11:38   ` Uwe Kleine-König
2025-02-05 13:37     ` Herve Codina
2025-02-05 16:29       ` Uwe Kleine-König
2025-02-05 17:19         ` Herve Codina
2025-02-05 18:09           ` Uwe Kleine-König
2025-02-12  8:25 ` [PATCH v3 0/2] pwm: Add support for pwm nexus node Uwe Kleine-König

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=20250205095547.536083-1-herve.codina@bootlin.com \
    --to=herve.codina@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=robh@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=ukleinek@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 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).