<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/pwm, branch v7.1.8</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1.8</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1.8'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-07-24T14:21:16+00:00</updated>
<entry>
<title>pwm: rzg2l-gpt: Fix period_ticks type from u32 to u64</title>
<updated>2026-07-24T14:21:16+00:00</updated>
<author>
<name>Biju Das</name>
<email>biju.das.jz@bp.renesas.com</email>
</author>
<published>2026-06-04T09:56:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c97d44a5bdf9af0ab6e2208c99fc30f0a6dca65c'/>
<id>urn:sha1:c97d44a5bdf9af0ab6e2208c99fc30f0a6dca65c</id>
<content type='text'>
commit 2b40d72de9354a76f5e3bb71230a4210eaa92849 upstream.

period_ticks is used to store PWM period values that can exceed the 32-bit
range, so change its type from u32 to u64 to prevent overflow.

Cc: stable@kernel.org
Fixes: 061f087f5d0b ("pwm: Add support for RZ/G2L GPT")
Signed-off-by: Biju Das &lt;biju.das.jz@bp.renesas.com&gt;
Link: https://patch.msgid.link/20260604095647.108654-2-biju.das.jz@bp.renesas.com
Signed-off-by: Uwe Kleine-König &lt;ukleinek@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>pwm: rzg2l-gpt: Add missing newlines to dev_err_probe() messages</title>
<updated>2026-07-24T14:20:08+00:00</updated>
<author>
<name>Biju Das</name>
<email>biju.das.jz@bp.renesas.com</email>
</author>
<published>2026-06-04T09:56:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f966db2568c4b075a34243768b0c3ede1ea89d5e'/>
<id>urn:sha1:f966db2568c4b075a34243768b0c3ede1ea89d5e</id>
<content type='text'>
[ Upstream commit 898ab0f30e008e411ce93ddf81c4099abd9d4e46 ]

dev_err_probe() internally calls dev_err() which uses pr_fmt() and
printk(). Kernel log messages should end with a newline character
to ensure proper log formatting. Add missing '\n' at the end of
the error strings in rzg2l_gpt_probe().

Signed-off-by: Biju Das &lt;biju.das.jz@bp.renesas.com&gt;
Link: https://patch.msgid.link/20260604095647.108654-5-biju.das.jz@bp.renesas.com
Fixes: 061f087f5d0b ("pwm: Add support for RZ/G2L GPT")
Signed-off-by: Uwe Kleine-König &lt;ukleinek@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>pwm: imx27: Fix variable truncation in .apply()</title>
<updated>2026-07-24T14:19:19+00:00</updated>
<author>
<name>Ronaldo Nunez</name>
<email>rnunez@baylibre.com</email>
</author>
<published>2026-05-22T19:13:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0d7beef36455275855965cdf37818140d88e4491'/>
<id>urn:sha1:0d7beef36455275855965cdf37818140d88e4491</id>
<content type='text'>
[ Upstream commit dc9e08fdbcc3eb08a1d2b868b535081c44425e27 ]

Fix a variable truncation when calculating period in microseconds as
part of the solution for the ERR051198 in .apply() callback.

Example scenario:
 - Period of 3us (PWMPR = 196 and prescaler = 1)
 - Expected value in tmp: 198000000000 (NSEC_PER_SEC * (196 + 2) * 1)
 - Actual value is 431504384 (truncation to u32)

Signed-off-by: Ronaldo Nunez &lt;rnunez@baylibre.com&gt;
Reviewed-by: Frank Li &lt;Frank.Li@nxp.com&gt;
Link: https://patch.msgid.link/20260522191348.6227-1-rnunez@baylibre.com
Fixes: a25351e4c774 ("pwm: imx27: Workaround of the pwm output bug when decrease the duty cycle")
Signed-off-by: Uwe Kleine-König &lt;ukleinek@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'pwm/fixes-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux</title>
<updated>2026-04-23T15:37:07+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-04-23T15:37:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8841842cc9be68e0f670323e697c9b3214831d6a'/>
<id>urn:sha1:8841842cc9be68e0f670323e697c9b3214831d6a</id>
<content type='text'>
Pull pwm fixes from Uwe Kleine-König:
 "Two driver fixes

  After having added some more code to libpwm checking the pwm rounding
  rules for the userspace interface I spotted an issue in the pwm-stm32
  driver where in some cases involving inverted polarity the wrong
  hardware settings for the duty offset are chosen. I think it has
  little practical effect because the duty offset is in most cases an
  artificial property of the output waveform. Still it's relevant to get
  this fixed because this driver serves as a reference implementation
  for the still young waveform API.

  The second fix addresses a sleep-in-atomic issue in the pwm-atmel-tcb
  driver"

* tag 'pwm/fixes-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux:
  pwm: atmel-tcb: Cache clock rates and mark chip as atomic
  pwm: stm32: Fix rounding issue for requests with inverted polarity
</content>
</entry>
<entry>
<title>pwm: atmel-tcb: Cache clock rates and mark chip as atomic</title>
<updated>2026-04-22T05:24:33+00:00</updated>
<author>
<name>Sangyun Kim</name>
<email>sangyun.kim@snu.ac.kr</email>
</author>
<published>2026-04-19T08:08:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=68637b68afcc3cb4d56aca14a3a1d1b47b879369'/>
<id>urn:sha1:68637b68afcc3cb4d56aca14a3a1d1b47b879369</id>
<content type='text'>
atmel_tcb_pwm_apply() holds tcbpwmc-&gt;lock as a spinlock via
guard(spinlock)() and then calls atmel_tcb_pwm_config(), which calls
clk_get_rate() twice. clk_get_rate() acquires clk_prepare_lock (a
mutex), so this is a sleep-in-atomic-context violation.

On CONFIG_DEBUG_ATOMIC_SLEEP kernels every pwm_apply_state() that
enables or reconfigures the PWM triggers a "BUG: sleeping function
called from invalid context" warning.

Acquire exclusive control over the clock rates with
clk_rate_exclusive_get() at probe time and cache the rates in struct
atmel_tcb_pwm_chip, then read the cached rates from
atmel_tcb_pwm_config(). This keeps the spinlock-based mutual exclusion
introduced in commit 37f7707077f5 ("pwm: atmel-tcb: Fix race condition
and convert to guards") and removes the sleeping calls from the atomic
section.

With no sleeping calls left in .apply() and the regmap-mmio bus already
running with fast_io=true, also mark the chip as atomic so consumers
can use pwm_apply_atomic() from atomic context.

Fixes: 37f7707077f5 ("pwm: atmel-tcb: Fix race condition and convert to guards")
Signed-off-by: Sangyun Kim &lt;sangyun.kim@snu.ac.kr&gt;
Link: https://patch.msgid.link/20260419080838.3192357-1-sangyun.kim@snu.ac.kr
[ukleinek: Ensure .clk is enabled before calling clk_get_rate on it.]
Signed-off-by: Uwe Kleine-König &lt;ukleinek@kernel.org&gt;
</content>
</entry>
<entry>
<title>pwm: stm32: Fix rounding issue for requests with inverted polarity</title>
<updated>2026-04-16T05:25:15+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@baylibre.com</email>
</author>
<published>2026-04-15T14:50:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5d087c485b6ecf200a9ebb2a032bf8571d330250'/>
<id>urn:sha1:5d087c485b6ecf200a9ebb2a032bf8571d330250</id>
<content type='text'>
The calculation of the number of pwm clk ticks from a time length in
nanoseconds involves a division and thus some rounding. That might
result in

	duty_ticks + offset_ticks &lt; period_ticks

despite

	duty_length_ns + duty_offset_ns &gt;= period_length_ns

. The stm32 PWM cannot configure offset_ticks freely, it can only select
0 or period_length_ns - duty_length_ns---that is the classic normal and
inverted polarity. The decision to select the hardware polarity must be
done using the ticks values and not the nanoseconds times to adhere to
the rounding rules by the pwm core.

With the pwm clk running at 208900 kHz on my test machine
(stm32mp135f-dk), a test case that was handled wrong is:

	# pwmround -P 9999962 -O 24970 -D 9974992
	period_length = 9999962
	duty_length = 9974840
	duty_offset = 25123

With this change applied the rounding is done correctly:

	# pwmround -P 9999962 -O 24970 -D 9974992
	period_length = 9999962
	duty_length = 9974840
	duty_offset = 0

Fixes: deaba9cff809 ("pwm: stm32: Implementation of the waveform callbacks")
Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@baylibre.com&gt;
Link: https://patch.msgid.link/c5e7767cee821b5f6e00f95bd14a5e13015646fb.1776264104.git.u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König &lt;ukleinek@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'pwm/for-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux</title>
<updated>2026-04-15T21:13:31+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-04-15T21:13:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b9962335d4c6dee152e95dce9f0dd32048735a6d'/>
<id>urn:sha1:b9962335d4c6dee152e95dce9f0dd32048735a6d</id>
<content type='text'>
Pull pwm updates from Uwe Kleine-König:
 "Just two minor fixes, a device tree binding addition to support a few
  more SoCs (without the need for driver adaptions), a driver include
  cleanup and the addition of the #linux-pwm irc channel to MAINTAINERS"

* tag 'pwm/for-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux:
  pwm: th1520: fix `CLIPPY=1` warning
  pwm: jz4740: Drop unused include
  MAINTAINERS: Add #linux-pwm irc channel to pwm entry
  dt-bindings: pwm: amlogic: Document A4 A5 and T7 PWM
  pwm: imx-tpm: Count the number of enabled channels in probe
</content>
</entry>
<entry>
<title>pwm: th1520: remove impl Send/Sync for Th1520PwmDriverData</title>
<updated>2026-04-03T09:57:35+00:00</updated>
<author>
<name>Alice Ryhl</name>
<email>aliceryhl@google.com</email>
</author>
<published>2026-02-23T10:08:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=96f4e74cab632ea5c7e7fa996a28337283ecca11'/>
<id>urn:sha1:96f4e74cab632ea5c7e7fa996a28337283ecca11</id>
<content type='text'>
Now that clk implements Send and Sync, we no longer need to manually
implement these traits for Th1520PwmDriverData. Thus remove the
implementations.

Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;
Reviewed-by: Daniel Almeida &lt;daniel.almeida@collabora.com&gt;
Acked-by: Uwe Kleine-König &lt;ukleinek@kernel.org&gt;
Reviewed-by: Michal Wilczynski &lt;m.wilczynski@samsung.com&gt;
Signed-off-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Link: https://patch.msgid.link/20260223-clk-send-sync-v5-3-181bf2f35652@google.com
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>pwm: th1520: fix `CLIPPY=1` warning</title>
<updated>2026-03-29T07:37:13+00:00</updated>
<author>
<name>Miguel Ojeda</name>
<email>ojeda@kernel.org</email>
</author>
<published>2026-01-21T18:37:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aa8f35172ab66c57d4355a8c4e28d05b44c938e3'/>
<id>urn:sha1:aa8f35172ab66c57d4355a8c4e28d05b44c938e3</id>
<content type='text'>
The Rust kernel code should be kept `CLIPPY=1`-clean [1].

Clippy reports:

    error: this pattern reimplements `Option::unwrap_or`
      --&gt; drivers/pwm/pwm_th1520.rs:64:5
       |
    64 | /     (match ns.checked_mul(rate_hz) {
    65 | |         Some(product) =&gt; product,
    66 | |         None =&gt; u64::MAX,
    67 | |     }) / NSEC_PER_SEC_U64
       | |______^ help: replace with: `ns.checked_mul(rate_hz).unwrap_or(u64::MAX)`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#manual_unwrap_or
       = note: `-D clippy::manual-unwrap-or` implied by `-D warnings`
       = help: to override `-D warnings` add `#[allow(clippy::manual_unwrap_or)]`

Applying the suggestion then triggers:

    error: manual saturating arithmetic
      --&gt; drivers/pwm/pwm_th1520.rs:64:5
       |
    64 |     ns.checked_mul(rate_hz).unwrap_or(u64::MAX) / NSEC_PER_SEC_U64
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_mul`: `ns.saturating_mul(rate_hz)`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#manual_saturating_arithmetic
       = note: `-D clippy::manual-saturating-arithmetic` implied by `-D warnings`
       = help: to override `-D warnings` add `#[allow(clippy::manual_saturating_arithmetic)]`

Thus fix it by using saturating arithmetic, which simplifies the code
as well.

Link: https://rust-for-linux.com/contributing#submit-checklist-addendum [1]
Fixes: e03724aac758 ("pwm: Add Rust driver for T-HEAD TH1520 SoC")
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Reviewed-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Reviewed-by: Michal Wilczynski &lt;m.wilczynski@samsung.com&gt;
Link: https://patch.msgid.link/20260121183719.71659-1-ojeda@kernel.org
Signed-off-by: Uwe Kleine-König &lt;ukleinek@kernel.org&gt;
</content>
</entry>
<entry>
<title>pwm: jz4740: Drop unused include</title>
<updated>2026-03-21T22:34:37+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2026-03-20T22:06:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8ab1fc9104158045f68fde2d0ae16f5fbcf8bfbd'/>
<id>urn:sha1:8ab1fc9104158045f68fde2d0ae16f5fbcf8bfbd</id>
<content type='text'>
This driver includes the legacy header &lt;linux/gpio.h&gt; but does
not use any symbols from it. Drop the inclusion.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Acked-by: Paul Cercueil &lt;paul@crapouillou.net&gt;
Link: https://patch.msgid.link/20260320220644.3237290-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Uwe Kleine-König &lt;ukleinek@kernel.org&gt;
</content>
</entry>
</feed>
