mod rockchip;
pub(crate) mod scmi;
#[cfg(feature = "rockchip-soc")]
pub(crate) use rockchip::{
RockchipPinCtrl, rk3588_enable_clock, rk3588_enable_power_domain, rk3588_reset_assert,
rk3588_reset_deassert, rk3588_set_clock_rate,
};
#[cfg(not(feature = "rockchip-soc"))]
pub(crate) fn rk3588_enable_clock(id: u32) -> Result<(), rdrive::probe::OnProbeError> {
Err(rdrive::probe::OnProbeError::other(alloc::format!(
"RK3588 clock support is not enabled for clock {id:#x}"
)))
}
#[cfg(not(feature = "rockchip-soc"))]
pub(crate) fn rk3588_set_clock_rate(
id: u32,
rate_hz: u64,
) -> Result<(), rdrive::probe::OnProbeError> {
Err(rdrive::probe::OnProbeError::other(alloc::format!(
"RK3588 clock support is not enabled for clock {id:#x} rate {rate_hz}"
)))
}
#[cfg(not(feature = "rockchip-soc"))]
pub(crate) fn rk3588_enable_power_domain(domain: usize) -> Result<(), alloc::string::String> {
Err(alloc::format!(
"RK3588 power-domain support is not enabled for power domain {domain}"
))
}
#[cfg(not(feature = "rockchip-soc"))]
pub(crate) struct RockchipPinCtrl;
#[cfg(not(feature = "rockchip-soc"))]
impl rdrive::DriverGeneric for RockchipPinCtrl {
fn name(&self) -> &str {
"rk3588-pinctrl-unavailable"
}
}
#[cfg(not(feature = "rockchip-soc"))]
impl RockchipPinCtrl {
pub(crate) fn enable_fixed_regulator(
&mut self,
phandle: fdt_edit::Phandle,
) -> Result<(), rdrive::probe::OnProbeError> {
Err(rdrive::probe::OnProbeError::other(alloc::format!(
"RK3588 pinctrl support is not enabled for regulator phandle {phandle:?}"
)))
}
}
#[cfg(not(feature = "rockchip-soc"))]
pub(crate) fn rk3588_reset_assert(id: u64) -> Result<(), rdrive::probe::OnProbeError> {
Err(rdrive::probe::OnProbeError::other(alloc::format!(
"RK3588 reset support is not enabled for reset {id:#x}"
)))
}
#[cfg(not(feature = "rockchip-soc"))]
pub(crate) fn rk3588_reset_deassert(id: u64) -> Result<(), rdrive::probe::OnProbeError> {
Err(rdrive::probe::OnProbeError::other(alloc::format!(
"RK3588 reset support is not enabled for reset {id:#x}"
)))
}