Lines Matching full:enabled
31 impl Sealed for super::Enabled {} implementation
42 /// A state where the [`Regulator`] is known to be enabled.
46 pub struct Enabled; struct
49 /// underlying regulator to be enabled. This means that this reference does not
53 /// A state that models the C API. The [`Regulator`] can be either enabled or
60 impl RegulatorState for Enabled { implementation
72 /// A trait that abstracts the ability to check if a [`Regulator`] is enabled.
92 /// This example uses [`Regulator<Enabled>`], which is suitable for drivers that
96 /// These users can store [`Regulator<Enabled>`] directly in their driver's
103 /// # use kernel::regulator::{Voltage, Regulator, Disabled, Enabled};
116 /// // From now on, the regulator is known to be enabled because of the type
117 /// // `Enabled`.
121 /// let regulator: Regulator<Enabled> =
130 /// // Dropping an enabled regulator will disable it. The refcount will be
147 /// # use kernel::regulator::{Voltage, Regulator, Enabled};
150 /// let regulator: Regulator<Enabled> = Regulator::<Enabled>::get(dev, c_str!("vcc"))?;
152 /// // Dropping an enabled regulator will disable it. The refcount will be
167 /// # use kernel::regulator::{Regulator, Enabled, Disabled};
168 /// fn disable(dev: &Device, regulator: Regulator<Enabled>) -> Result {
169 /// // We can also disable an enabled regulator without reliquinshing our
189 /// control of the enabled reference count. This is useful for drivers that
213 /// // Increase the `enabled` reference count.
220 /// // Decrease the `enabled` reference count.
309 /// Attempts to convert the regulator to an enabled state.
310 pub fn try_into_enabled(self) -> Result<Regulator<Enabled>, Error<Disabled>> { in try_into_enabled() argument
312 // `Regulator<Enabled>`. in try_into_enabled()
328 impl Regulator<Enabled> {
339 pub fn try_into_disabled(self) -> Result<Regulator<Disabled>, Error<Enabled>> { in try_into_disabled() argument
359 /// the regulator is unknown and it is up to the user to manage the enabled
363 /// dynamically manage the enabled reference count at runtime.
368 /// Increases the `enabled` reference count.
373 /// Decreases the `enabled` reference count.
380 /// Checks if the regulator is enabled.
391 // reference on the enabled refcount, so it is safe to relinquish it in drop()