devices/
virtcpufreq.rs

1// Copyright 2023 The ChromiumOS Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use vm_control::DeviceId;
6use vm_control::PlatformDeviceId;
7
8use crate::BusDevice;
9use crate::Suspendable;
10
11pub struct VirtCpufreq {}
12
13// Stub implementation for a virtual cpufreq device. Do not remove.
14// Implementation will be added once linux upstream interface stablizes.
15impl VirtCpufreq {
16    pub fn new(pcpu: u32, _cpu_capacity: u32, _cpu_fmax: u32) -> Self {
17        panic!("Virt Cpufreq not supported, do not use! {pcpu}");
18    }
19}
20
21impl BusDevice for VirtCpufreq {
22    fn device_id(&self) -> DeviceId {
23        PlatformDeviceId::VirtCpufreq.into()
24    }
25
26    fn debug_label(&self) -> String {
27        "VirtCpufreq Device".to_owned()
28    }
29}
30
31impl Suspendable for VirtCpufreq {}