linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikita Travkin <nikita@trvn.ru>
To: thierry.reding@gmail.com, lee.jones@linaro.org
Cc: u.kleine-koenig@pengutronix.de, robh+dt@kernel.org,
	sboyd@kernel.org, krzk@kernel.org, linus.walleij@linaro.org,
	masneyb@onstation.org, sean.anderson@seco.com,
	linux-pwm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	~postmarketos/upstreaming@lists.sr.ht,
	Nikita Travkin <nikita@trvn.ru>
Subject: [PATCH v5 0/2] Clock based PWM output driver
Date: Sat, 12 Feb 2022 21:23:40 +0500	[thread overview]
Message-ID: <20220212162342.72646-1-nikita@trvn.ru> (raw)

This series introduces an "adapter" driver that allows PWM consumers
to control clock outputs with duty-cycle control.

Some platforms (e.g. some Qualcomm chipsets) have "General Purpose"
clocks that can be muxed to GPIO outputs and used as PWM outputs.
Those outputs may be connected to various peripherals such as
leds in display backlight or haptic feedback motor driver.

To avoid re-implementing every single PWM consumer driver with clk
support (like in [1]) and don't put the burden of providing the PWM
sources on the clock drivers (as was proposed in [2]), clk based
pwm controller driver is introduced.

There is an existing driver that provides the opposite function
in drivers/clk/clk-pwm.c with a compatible "pwm-clock" so the new
driver uses the opposite naming scheme: drivers/pwm/pwm-clk.c
and compatible "clk-pwm".

Changes in v2:
 - Fix filename in the DT schema.
 - Address Uwe's review comments.
Changes in v3:
 - Fix node pattern in the core pwm schema.
 - Address Uwe's review comments.
Changes in v4:
 - Drop the (incorrect) pwm schema change.
 - Use generic node name in the dt bindings example.
Changes in v5:
 - Correct required properties.
 - add missed returns.

Nikita Travkin (2):
  dt-bindings: pwm: Document clk based PWM controller
  pwm: Add clock based PWM output driver

 .../devicetree/bindings/pwm/clk-pwm.yaml      |  46 ++++++
 drivers/pwm/Kconfig                           |  10 ++
 drivers/pwm/Makefile                          |   1 +
 drivers/pwm/pwm-clk.c                         | 139 ++++++++++++++++++
 4 files changed, 196 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pwm/clk-pwm.yaml
 create mode 100644 drivers/pwm/pwm-clk.c

-- 
2.34.1


             reply	other threads:[~2022-02-12 16:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-12 16:23 Nikita Travkin [this message]
2022-02-12 16:23 ` [PATCH v5 1/2] dt-bindings: pwm: Document clk based PWM controller Nikita Travkin
2022-02-14  7:43   ` Krzysztof Kozlowski
2022-02-12 16:23 ` [PATCH v5 2/2] pwm: Add clock based PWM output driver Nikita Travkin
2022-02-14 11:19   ` Krzysztof Kozlowski
2022-02-19  6:48     ` Nikita Travkin
2022-02-14 18:43   ` Uwe Kleine-König
2022-02-19  6:46     ` Nikita Travkin
2022-02-19 10:10       ` Uwe Kleine-König
2022-02-19 13:54         ` Nikita Travkin

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=20220212162342.72646-1-nikita@trvn.ru \
    --to=nikita@trvn.ru \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=masneyb@onstation.org \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=sean.anderson@seco.com \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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).