Lines Matching defs: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);
132 unsafe impl Send for Clk {}
136 unsafe impl Sync for Clk {}
138 impl Clk {
139 /// Gets [`Clk`] corresponding to a [`Device`] and a connection id.
149 // INVARIANT: The reference-count is decremented when [`Clk`] goes out of scope.
211 /// Equivalent to calling [`Clk::prepare`] followed by [`Clk::enable`].
221 /// Equivalent to calling [`Clk::disable`] followed by [`Clk::unprepare`].
254 impl Drop for Clk {
263 /// A lightweight wrapper around an optional [`Clk`]. An [`OptionalClk`] represents a [`Clk`]
269 /// An [`OptionalClk`] instance encapsulates a [`Clk`] with either a valid [`struct clk`] or
302 pub struct OptionalClk(Clk);
318 Ok(Self(Clk(from_err_ptr(unsafe {
324 // Make [`OptionalClk`] behave like [`Clk`].
326 type Target = Clk;
328 fn deref(&self) -> &Clk {