Lines Matching refs:Clk
96 /// A [`Clk`] instance holds either a pointer to a valid [`struct clk`] created by the C
99 /// Instances of this type are reference-counted. Calling [`Clk::get`] ensures that the
100 /// allocation remains valid for the lifetime of the [`Clk`].
107 /// use kernel::clk::{Clk, Hertz};
112 /// let clk = Clk::get(dev, Some(c"apb_clk"))?;
129 pub struct Clk(*mut bindings::clk);
131 impl Clk {
132 /// Gets [`Clk`] corresponding to a [`Device`] and a connection id.
142 // INVARIANT: The reference-count is decremented when [`Clk`] goes out of scope.
204 /// Equivalent to calling [`Clk::prepare`] followed by [`Clk::enable`].
214 /// Equivalent to calling [`Clk::disable`] followed by [`Clk::unprepare`].
247 impl Drop for Clk {
256 /// A lightweight wrapper around an optional [`Clk`]. An [`OptionalClk`] represents a [`Clk`]
262 /// An [`OptionalClk`] instance encapsulates a [`Clk`] with either a valid [`struct clk`] or
295 pub struct OptionalClk(Clk);
311 Ok(Self(Clk(from_err_ptr(unsafe {
317 // Make [`OptionalClk`] behave like [`Clk`].
319 type Target = Clk;
321 fn deref(&self) -> &Clk {