Re: [PATCH V10 14/15] rust: opp: Extend OPP abstractions with cpufreq support

From: Danilo Krummrich
Date: Wed Apr 16 2025 - 04:53:07 EST


On Wed, Apr 16, 2025 at 12:09:31PM +0530, Viresh Kumar wrote:
> Extend the OPP abstractions to include support for interacting with the
> cpufreq core, including the ability to retrieve frequency tables from
> OPP table.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
> ---
> rust/kernel/opp.rs | 67 ++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 67 insertions(+)
>
> diff --git a/rust/kernel/opp.rs b/rust/kernel/opp.rs
> index 44e11808793a..734be8b6d0ef 100644
> --- a/rust/kernel/opp.rs
> +++ b/rust/kernel/opp.rs
> @@ -19,6 +19,12 @@
> types::{ARef, AlwaysRefCounted, Opaque},
> };
>
> +#[cfg(CONFIG_CPU_FREQ)]

This config is needed quite often, it probably makes sense to move this code in
its own Rust module, i.e.:

#[cfg(CONFIG_CPU_FREQ)]
pub mod freq;