summaryrefslogtreecommitdiff
path: root/rust/kernel/clk.rs
AgeCommit message (Collapse)Author
2025-06-19rust: replace literals with constants in `clk::Hertz`Onur Özkan
Replaces repeated numeric literals in `Hertz` conversions with named constants. Signed-off-by: Onur Özkan <work@onurozkan.dev> Link: https://lore.kernel.org/r/20250618092810.29370-1-work@onurozkan.dev Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2025-06-19rust: shorten `con_id`s in `get` methods in clk moduleOnur Özkan
Converts `if-else` blocks into one line code using `map_or` for simplicity. Signed-off-by: Onur Özkan <work@onurozkan.dev> Link: https://lore.kernel.org/r/20250618093508.16343-1-work@onurozkan.dev Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2025-06-19rust: make `clk::Hertz` methods constOnur Özkan
Marks `Hertz` methods as `const` to make them available for `const` contexts. This can be useful when defining static/compile-time frequency parameters in drivers/subsystems. Signed-off-by: Onur Özkan <work@onurozkan.dev> Link: https://lore.kernel.org/r/20250618091442.29104-1-work@onurozkan.dev Reviewed-by: Alice Ryhl <aliceryhl@google.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2025-05-19rust: clk: Add initial abstractionsViresh Kumar
Add initial abstractions for the clk APIs. These provide the minimal functionality needed for common use cases, making them straightforward to introduce in the first iteration. These will be used by Rust based cpufreq / OPP layers to begin with. Tested-by: Daniel Almeida <daniel.almeida@collabora.com> Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>