summaryrefslogtreecommitdiff
path: root/rust/kernel/pwm.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/kernel/pwm.rs')
-rw-r--r--rust/kernel/pwm.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/rust/kernel/pwm.rs b/rust/kernel/pwm.rs
index 79fbb13cd47f..6f2f78c687d5 100644
--- a/rust/kernel/pwm.rs
+++ b/rust/kernel/pwm.rs
@@ -760,3 +760,26 @@ impl<T: PwmOps> Drop for Registration<T> {
unsafe { bindings::pwmchip_remove(chip_raw); }
}
}
+
+/// Declares a kernel module that exposes a single PWM driver.
+///
+/// # Examples
+///
+///```ignore
+/// kernel::module_pwm_platform_driver! {
+/// type: MyDriver,
+/// name: "Module name",
+/// authors: ["Author name"],
+/// description: "Description",
+/// license: "GPL v2",
+/// }
+///```
+#[macro_export]
+macro_rules! module_pwm_platform_driver {
+ ($($user_args:tt)*) => {
+ $crate::module_platform_driver! {
+ $($user_args)*
+ imports_ns: ["PWM"],
+ }
+ };
+}