xref: /DragonOS/kernel/src/driver/base/platform/platform_device.rs (revision 1496ba7b24a5e6954291ca9643b9f3cec567479a)
1 use crate::driver::base::device::Device;
2 
3 use super::{super::device::DeviceState, CompatibleTable};
4 
5 /// @brief: 实现该trait的设备实例应挂载在platform总线上,
6 ///         同时应该实现Device trait
7 pub trait PlatformDevice: Device {
8     fn compatible_table(&self) -> CompatibleTable;
9     /// @brief: 判断设备是否初始化
10     /// @parameter: None
11     /// @return: 如果已经初始化,返回true,否则,返回false
12     fn is_initialized(&self) -> bool;
13 
14     /// @brief: 设置设备状态
15     /// @parameter set_state: 设备状态
16     /// @return: None
17     fn set_state(&self, set_state: DeviceState);
18 }
19