include/linux/devfreq-event.h
Source file repositories/reference/linux-study-clean/include/linux/devfreq-event.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/devfreq-event.h- Extension
.h- Size
- 6095 bytes
- Lines
- 201
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.h
Detected Declarations
struct devfreq_event_devstruct devfreq_event_datastruct devfreq_event_opsstruct devfreq_event_descfunction devfreq_event_enable_edevfunction devfreq_event_disable_edevfunction devfreq_event_is_enabledfunction devfreq_event_set_eventfunction devfreq_event_get_eventfunction devfreq_event_reset_eventfunction devfreq_event_get_edev_countfunction devfreq_event_remove_edevfunction devm_devfreq_event_remove_edev
Annotated Snippet
struct devfreq_event_dev {
struct list_head node;
struct device dev;
struct mutex lock;
u32 enable_count;
const struct devfreq_event_desc *desc;
};
/**
* struct devfreq_event_data - the devfreq-event data
*
* @load_count : load count of devfreq-event device for the given period.
* @total_count : total count of devfreq-event device for the given period.
* each count may represent a clock cycle, a time unit
* (ns/us/...), or anything the device driver wants.
* Generally, utilization is load_count / total_count.
*
* This structure contains the data of devfreq-event device for polling period.
*/
struct devfreq_event_data {
unsigned long load_count;
unsigned long total_count;
};
/**
* struct devfreq_event_ops - the operations of devfreq-event device
*
* @enable : Enable the devfreq-event device.
* @disable : Disable the devfreq-event device.
* @reset : Reset all setting of the devfreq-event device.
* @set_event : Set the specific event type for the devfreq-event device.
* @get_event : Get the result of the devfreq-event devie with specific
* event type.
*
* This structure contains devfreq-event device operations which can be
* implemented by devfreq-event device drivers.
*/
struct devfreq_event_ops {
/* Optional functions */
int (*enable)(struct devfreq_event_dev *edev);
int (*disable)(struct devfreq_event_dev *edev);
int (*reset)(struct devfreq_event_dev *edev);
/* Mandatory functions */
int (*set_event)(struct devfreq_event_dev *edev);
int (*get_event)(struct devfreq_event_dev *edev,
struct devfreq_event_data *edata);
};
/**
* struct devfreq_event_desc - the descriptor of devfreq-event device
*
* @name : the name of devfreq-event device.
* @event_type : the type of the event determined and used by driver
* @driver_data : the private data for devfreq-event driver.
* @ops : the operation to control devfreq-event device.
*
* Each devfreq-event device is described with a this structure.
* This structure contains the various data for devfreq-event device.
* The event_type describes what is going to be counted in the register.
* It might choose to count e.g. read requests, write data in bytes, etc.
* The full supported list of types is present in specyfic header in:
* include/dt-bindings/pmu/.
*/
struct devfreq_event_desc {
const char *name;
u32 event_type;
void *driver_data;
const struct devfreq_event_ops *ops;
};
#if defined(CONFIG_PM_DEVFREQ_EVENT)
extern int devfreq_event_enable_edev(struct devfreq_event_dev *edev);
extern int devfreq_event_disable_edev(struct devfreq_event_dev *edev);
extern bool devfreq_event_is_enabled(struct devfreq_event_dev *edev);
extern int devfreq_event_set_event(struct devfreq_event_dev *edev);
extern int devfreq_event_get_event(struct devfreq_event_dev *edev,
struct devfreq_event_data *edata);
extern int devfreq_event_reset_event(struct devfreq_event_dev *edev);
extern struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(
struct device *dev,
const char *phandle_name,
int index);
extern int devfreq_event_get_edev_count(struct device *dev,
const char *phandle_name);
extern struct devfreq_event_dev *devfreq_event_add_edev(struct device *dev,
struct devfreq_event_desc *desc);
Annotation
- Immediate include surface: `linux/device.h`.
- Detected declarations: `struct devfreq_event_dev`, `struct devfreq_event_data`, `struct devfreq_event_ops`, `struct devfreq_event_desc`, `function devfreq_event_enable_edev`, `function devfreq_event_disable_edev`, `function devfreq_event_is_enabled`, `function devfreq_event_set_event`, `function devfreq_event_get_event`, `function devfreq_event_reset_event`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.