History log of /linux/rust/kernel/pwm.rs (Results 1 – 21 of 21)
Revision Date Author Comments
# c17ee635 23-Feb-2026 Maxime Ripard <mripard@kernel.org>

Merge drm/drm-fixes into drm-misc-fixes

7.0-rc1 was just released, let's merge it to kick the new release cycle.

Signed-off-by: Maxime Ripard <mripard@kernel.org>


# c371f62d 11-Feb-2026 Linus Torvalds <torvalds@linux-foundation.org>

Merge tag 'pwm/for-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux

Pull pwm updates from Uwe Kleine-König:
"There are a few patches adapting to changes in Rust land which s

Merge tag 'pwm/for-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux

Pull pwm updates from Uwe Kleine-König:
"There are a few patches adapting to changes in Rust land which seems
to be the norm since there is a pwm driver written in Rust. Other than
that just a few cleanups and a single fix for the tiehrpwm driver that
came in too late for making it into v6.19.

Thanks to Andy Shevchenko, Bartosz Golaszewski, Daniel Almeida and
Michal Wilczynski for reviews in this cycle, and to Alice Ryhl, Ben
Zong-You Xie, Gokul Praveen, Kari Argillander, Markus Probst, Raag
Jadav, Shankari Anand, Tamir Duberstein and Vladimir Zapolskiy for
code contributions"

* tag 'pwm/for-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux:
pwm: Remove redundant check in pwm_ops_check()
pwm: tiehrpwm: Enable pwmchip's parent device before setting configuration
pwm: Update MAINTAINER entry
rust: pwm: Add __rust_helper to helpers
rust: pwm: Simplify to_result call sites and unsafe blocks
rust: pwm: Fix potential memory leak on init error
dt-bindings: pwm: nxp,lpc32xx-pwm: Specify clocks property as mandatory
pwm: th1520: Replace `kernel::c_str!` with C-Strings
pwm: dwc: Use size macro
pwm: Emit native configuration in /sys/kernel/debug/pwm
rust: pwm: Add UnregisteredChip wrapper around Chip
rust: pwm: Update ARef and AlwaysRefCounted imports to use sync::aref

show more ...


# cc4adab1 20-Jan-2026 Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

Merge tag 'v6.19-rc1' into msm-next

Merge Linux 6.19-rc1 in order to catch up with other changes (e.g. UBWC
config database defining UBWC_6).

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.q

Merge tag 'v6.19-rc1' into msm-next

Merge Linux 6.19-rc1 in order to catch up with other changes (e.g. UBWC
config database defining UBWC_6).

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

show more ...


# fc1e4eae 02-Jan-2026 Kari Argillander <kari.argillander@gmail.com>

rust: pwm: Simplify to_result call sites and unsafe blocks

Remove unnecessary temporary variables around to_result() calls and move
trailing semicolons outside unsafe blocks to improve readability a

rust: pwm: Simplify to_result call sites and unsafe blocks

Remove unnecessary temporary variables around to_result() calls and move
trailing semicolons outside unsafe blocks to improve readability and
produce cleaner rustfmt output.

No functional change intended.

Signed-off-by: Kari Argillander <kari.argillander@gmail.com>
Acked-by: Michal Wilczynski <m.wilczynski@samsung.com>
Link: https://patch.msgid.link/20260102-pwm-rust-v2-2-2702ce57d571@gmail.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>

show more ...


# a2633dc2 02-Jan-2026 Kari Argillander <kari.argillander@gmail.com>

rust: pwm: Fix potential memory leak on init error

When initializing a PWM chip using pwmchip_alloc(), the allocated device
owns an initial reference that must be released on all error paths.

If __

rust: pwm: Fix potential memory leak on init error

When initializing a PWM chip using pwmchip_alloc(), the allocated device
owns an initial reference that must be released on all error paths.

If __pinned_init() were to fail, the allocated pwm_chip would currently
leak because the error path returns without calling pwmchip_put().

Fixes: 7b3dce814a15 ("rust: pwm: Add Kconfig and basic data structures")
Signed-off-by: Kari Argillander <kari.argillander@gmail.com>
Acked-by: Michal Wilczynski <m.wilczynski@samsung.com>
Link: https://patch.msgid.link/20260102-pwm-rust-v2-1-2702ce57d571@gmail.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>

show more ...


# 85a5ffbd 02-Dec-2025 Markus Probst <markus.probst@posteo.de>

rust: pwm: Add UnregisteredChip wrapper around Chip

The `pwm::Registration::register` function provides no guarantee that the
function isn't called twice with the same pwm chip, which is considered

rust: pwm: Add UnregisteredChip wrapper around Chip

The `pwm::Registration::register` function provides no guarantee that the
function isn't called twice with the same pwm chip, which is considered
unsafe.

Add `pwm::UnregisteredChip` as wrapper around `pwm::Chip`.
Implement `pwm::UnregisteredChip::register` for the registration. This
function takes ownership of `pwm::UnregisteredChip` and therefore
guarantees that the registration can't be called twice on the same pwm
chip.

Signed-off-by: Markus Probst <markus.probst@posteo.de>
Tested-by: Michal Wilczynski <m.wilczynski@samsung.com>
Acked-by: Michal Wilczynski <m.wilczynski@samsung.com>
Link: https://patch.msgid.link/20251202-pwm_safe_register-v2-1-7a2e0d1e287f@posteo.de
[ukleinek: fixes a typo that Michal pointed out during review]
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>

show more ...


# 5025569c 23-Nov-2025 Shankari Anand <shankari.ak0208@gmail.com>

rust: pwm: Update ARef and AlwaysRefCounted imports to use sync::aref

Update call sites in `pwm.rs` to import `ARef` and `AlwaysRefCounted`
from `sync::aref` instead of `types`.

This aligns with th

rust: pwm: Update ARef and AlwaysRefCounted imports to use sync::aref

Update call sites in `pwm.rs` to import `ARef` and `AlwaysRefCounted`
from `sync::aref` instead of `types`.

This aligns with the ongoing effort to move `ARef` and
`AlwaysRefCounted` to sync.

Suggested-by: Benno Lossin <lossin@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/1173
Signed-off-by: Shankari Anand <shankari.ak0208@gmail.com>
Acked-by: Michal Wilczynski <m.wilczynski@samsung.com>
Link: https://patch.msgid.link/20251123092438.182251-7-shankari.ak0208@gmail.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>

show more ...


# 5add3c3c 19-Dec-2025 Thomas Hellström <thomas.hellstrom@linux.intel.com>

Merge drm/drm-next into drm-xe-next

Backmerging to bring in 6.19-rc1. An important upstream bugfix and
to help unblock PTL CI.

Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>


# b8304863 15-Dec-2025 Rodrigo Vivi <rodrigo.vivi@intel.com>

Merge drm/drm-next into drm-intel-next

Sync-up some display code needed for Async flips refactor.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>


# 7f790dd2 15-Dec-2025 Maxime Ripard <mripard@kernel.org>

Merge drm/drm-next into drm-misc-next

Let's kickstart the v6.20 (7.0?) release cycle.

Signed-off-by: Maxime Ripard <mripard@kernel.org>


# ec439c38 17-Dec-2025 Alexei Starovoitov <ast@kernel.org>

Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf after 6.19-rc1

Cross-merge BPF and other fixes after downstream PR.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>


# 24f171c7 21-Dec-2025 Takashi Iwai <tiwai@suse.de>

Merge tag 'asoc-fix-v6.19-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.19

We've been quite busy with fixes since the merge window, though

Merge tag 'asoc-fix-v6.19-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.19

We've been quite busy with fixes since the merge window, though not in
any particularly exciting ways - the standout thing is the fix for _SX
controls which were broken by a change to how we do clamping, otherwise
it's all fairly run of the mill fixes and quirks.

show more ...


# 84318277 15-Dec-2025 Maarten Lankhorst <dev@lankhorst.se>

Merge remote-tracking branch 'drm/drm-fixes' into drm-misc-fixes

Pull in rc1 to include all changes since the merge window closed,
and grab all fixes and changes from drm/drm-next.

Signed-off-by: M

Merge remote-tracking branch 'drm/drm-fixes' into drm-misc-fixes

Pull in rc1 to include all changes since the merge window closed,
and grab all fixes and changes from drm/drm-next.

Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>

show more ...


# 77956cf3 04-Dec-2025 Linus Torvalds <torvalds@linux-foundation.org>

Merge tag 'pwm/for-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux

Pull pwm updates from Uwe Kleine-König:
"In addition to the usual mix of core cleanups, driver changes,

Merge tag 'pwm/for-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux

Pull pwm updates from Uwe Kleine-König:
"In addition to the usual mix of core cleanups, driver changes, minor
fixes and device tree updates the highlight this cycle is Rust support
for the core and a first Rust driver both provided by Michal
Wilczynski.

Michal wrote about these changes on

https://mwilczynski.dev/posts/bringing-rust-to-the-pwm-subsystem/

which is a nice read"

* tag 'pwm/for-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux: (22 commits)
pwm: rzg2l-gpt: Allow checking period_tick cache value only if sibling channel is enabled
pwm: bcm2835: Make sure the channel is enabled after pwm_request()
pwm: mediatek: Make use of struct_size macro
pwm: mediatek: Remove unneeded semicolon
pwm: airoha: Add support for EN7581 SoC
pwm: mediatek: Convert to waveform API
pwm: max7360: Clean MAX7360 code
pwm: Drop unused function pwm_apply_args()
pwm: Use %u to printf unsigned int pwm_chip::npwm and pwm_chip::id
pwm: Simplify printf to emit chip->npwm in $debugfs/pwm
pwm: th1520: Use module_pwm_platform_driver! macro
pwm: th1520: Fix clippy warning for redundant struct field init
pwm: Fix Rust formatting
dt-bindings: pwm: thead: Add T-HEAD TH1520 PWM controller
pwm: Add Rust driver for T-HEAD TH1520 SoC
rust: pwm: Fix broken intra-doc link
rust: pwm: Drop wrapping of PWM polarity and state
rust: pwm: Add module_pwm_platform_driver! macro
rust: pwm: Add complete abstraction layer
rust: pwm: Add Kconfig and basic data structures
...

show more ...


# a5d51e02 07-Nov-2025 Uwe Kleine-König <ukleinek@kernel.org>

Merge branch 'pwm/th1520' into pwm/for-next


# 6fe9e919 29-Oct-2025 Miguel Ojeda <ojeda@kernel.org>

pwm: Fix Rust formatting

We do our best to keep the repository `rustfmt`-clean [1], thus run the
tool to fix the formatting issue.

A trailing empty comment [2] is added in order to preserve the wan

pwm: Fix Rust formatting

We do our best to keep the repository `rustfmt`-clean [1], thus run the
tool to fix the formatting issue.

A trailing empty comment [2] is added in order to preserve the wanted
style for imports (otherwise the tool will compact the first two items).

Link: https://rust-for-linux.com/contributing#submit-checklist-addendum [1]
Link: https://docs.kernel.org/rust/coding-guidelines.html#style-formatting [2]
Fixes: d8046cd50879 ("rust: pwm: Add complete abstraction layer")
Fixes: 7b3dce814a15 ("rust: pwm: Add Kconfig and basic data structures")
Fixes: e03724aac758 ("pwm: Add Rust driver for T-HEAD TH1520 SoC")
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://patch.msgid.link/20251029182502.783392-1-ojeda@kernel.org
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>

show more ...


# 51b4c0f9 29-Oct-2025 Miguel Ojeda <ojeda@kernel.org>

rust: pwm: Fix broken intra-doc link

`rustdoc` reports a broken intra-doc link:

error: unresolved link to `Devres::register`
--> rust/kernel/pwm.rs:722:11
|
722 | /// via [`D

rust: pwm: Fix broken intra-doc link

`rustdoc` reports a broken intra-doc link:

error: unresolved link to `Devres::register`
--> rust/kernel/pwm.rs:722:11
|
722 | /// via [`Devres::register`]. This ties the lifetime of the PWM chip registration
| ^^^^^^^^^^^^^^^^ no item named `Devres` in scope
|
= note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(rustdoc::broken_intra_doc_links)]`

Thus fix it.

Fixes: d8046cd50879 ("rust: pwm: Add complete abstraction layer")
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://patch.msgid.link/20251029181940.780629-1-ojeda@kernel.org
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>

show more ...


# a69a54f8 25-Oct-2025 Uwe Kleine-König <u.kleine-koenig@baylibre.com>

rust: pwm: Drop wrapping of PWM polarity and state

These were introduced and used in an earlier revision of the patch that
became commit fb3957af9ec6 ("pwm: Add Rust driver for T-HEAD TH1520
SoC").

rust: pwm: Drop wrapping of PWM polarity and state

These were introduced and used in an earlier revision of the patch that
became commit fb3957af9ec6 ("pwm: Add Rust driver for T-HEAD TH1520
SoC"). The variant that was actually applied sticks to the modern
waveform abstraction only (and other drivers are supposed to do that,
too), so they can be dropped.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/20251025122359.361372-2-u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>

show more ...


# 264b501b 28-Oct-2025 Michal Wilczynski <m.wilczynski@samsung.com>

rust: pwm: Add module_pwm_platform_driver! macro

Rust PWM drivers using the abstractions in `kernel/pwm.rs` typically
call C functions (like `pwmchip_alloc`, `__pwmchip_add`, etc.) that are
exported

rust: pwm: Add module_pwm_platform_driver! macro

Rust PWM drivers using the abstractions in `kernel/pwm.rs` typically
call C functions (like `pwmchip_alloc`, `__pwmchip_add`, etc.) that are
exported to the `PWM` C symbol namespace.

With the introduction of `imports_ns` support in the `module!` macro,
every PWM driver would need to manually include `imports_ns: ["PWM"]` in
its module declaration.

To simplify this for driver authors and ensure consistency, introduce a
new helper macro `module_pwm_platform_driver!` in `pwm.rs`. This macro
wraps the standard `module_platform_driver!`, forwards all user provided
arguments using the `($($user_args:tt)*)` pattern, and automatically
injects the `imports_ns: ["PWM"]` declaration.

This follows the pattern used in other subsystems (e.g.,
`module_pci_driver!`) to provide specialized module registration
helpers. It makes writing PWM drivers slightly simpler and less error
prone regarding namespace imports.

Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Reviewed-by: Elle Rhumsaa <elle@weathered-steel.dev>
Link: https://patch.msgid.link/20251028-pwm_fixes-v1-2-25a532d31998@samsung.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>

show more ...


# d8046cd5 16-Oct-2025 Michal Wilczynski <m.wilczynski@samsung.com>

rust: pwm: Add complete abstraction layer

Introduce a comprehensive abstraction layer for the PWM subsystem to
enable writing drivers in Rust.

Because `Device`, `Chip`, and `PwmOps` all refer to ea

rust: pwm: Add complete abstraction layer

Introduce a comprehensive abstraction layer for the PWM subsystem to
enable writing drivers in Rust.

Because `Device`, `Chip`, and `PwmOps` all refer to each other, they
form a single, indivisible unit with circular dependencies. They are
introduced together in this single commit to create a complete,
compilable abstraction layer.

The main components are:
- Data Wrappers: Safe, idiomatic wrappers for core C types like
`pwm_device`, and `pwm_chip`.

- PwmOps Trait: An interface that drivers can implement to provide
their hardware-specific logic, mirroring the C `pwm_ops` interface.

- FFI VTable and Adapter: A bridge to connect the high-level PwmOps trait
to the C kernel's pwm_ops vtable.

- Allocation and Lifetime Management: A high-level `Chip::new()`
API to safely allocate a chip and a `Registration` guard that integrates
with `devres` to manage the chip's registration with the PWM core.
An `AlwaysRefCounted` implementation and a custom release handler
prevent memory leaks by managing the chip's lifetime and freeing
driver data correctly.

Reviewed-by: Danilo Krummrich <dakr@kernel.org>
Reviewed-by: Elle Rhumsaa <elle@weathered-steel.dev>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Link: https://patch.msgid.link/20251016-rust-next-pwm-working-fan-for-sending-v16-3-a5df2405d2bd@samsung.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>

show more ...


# 7b3dce81 16-Oct-2025 Michal Wilczynski <m.wilczynski@samsung.com>

rust: pwm: Add Kconfig and basic data structures

Introduce the foundational support for PWM abstractions in Rust.

This commit adds the `RUST_PWM_ABSTRACTIONS` Kconfig option to enable
the feature,

rust: pwm: Add Kconfig and basic data structures

Introduce the foundational support for PWM abstractions in Rust.

This commit adds the `RUST_PWM_ABSTRACTIONS` Kconfig option to enable
the feature, along with the necessary build-system support and C
helpers.

It also introduces the first set of safe wrappers for the PWM
subsystem, covering the basic data carrying C structs and enums:
- `Polarity`: A safe wrapper for `enum pwm_polarity`.
- `Waveform`: A wrapper for `struct pwm_waveform`.
- `State`: A wrapper for `struct pwm_state`.

These types provide memory safe, idiomatic Rust representations of the
core PWM data structures and form the building blocks for the
abstractions that will follow.

Tested-by: Drew Fustini <fustini@kernel.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Elle Rhumsaa <elle@weathered-steel.dev>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Link: https://patch.msgid.link/20251016-rust-next-pwm-working-fan-for-sending-v16-2-a5df2405d2bd@samsung.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>

show more ...