pub enum SearchType {
Exact,
Floor,
Ceil,
}
Expand description
OPP
search options.
§Examples
Defines how to search for an OPP
in a Table
relative to a frequency.
use kernel::clk::Hertz;
use kernel::error::Result;
use kernel::opp::{OPP, SearchType, Table};
use kernel::types::ARef;
fn find_opp(table: &Table, freq: Hertz) -> Result<ARef<OPP>> {
let opp = table.opp_from_freq(freq, Some(true), None, SearchType::Exact)?;
pr_info!("OPP frequency is: {:?}\n", opp.freq(None));
pr_info!("OPP voltage is: {:?}\n", opp.voltage());
pr_info!("OPP level is: {}\n", opp.level());
pr_info!("OPP power is: {:?}\n", opp.power());
Ok(opp)
}
Variants§
Exact
Match the exact frequency.
Floor
Find the highest frequency less than or equal to the given value.
Ceil
Find the lowest frequency greater than or equal to the given value.
Trait Implementations§
Source§impl Clone for SearchType
impl Clone for SearchType
Source§fn clone(&self) -> SearchType
fn clone(&self) -> SearchType
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SearchType
impl Debug for SearchType
Source§impl PartialEq for SearchType
impl PartialEq for SearchType
impl Copy for SearchType
impl Eq for SearchType
impl StructuralPartialEq for SearchType
Auto Trait Implementations§
impl Freeze for SearchType
impl RefUnwindSafe for SearchType
impl Send for SearchType
impl Sync for SearchType
impl Unpin for SearchType
impl UnwindSafe for SearchType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more