include/linux/power/smartreflex.h
Source file repositories/reference/linux-study-clean/include/linux/power/smartreflex.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/power/smartreflex.h- Extension
.h- Size
- 9371 bytes
- Lines
- 321
- 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/types.hlinux/platform_device.hlinux/delay.hlinux/platform_data/voltage-omap.h
Detected Declarations
struct omap_srstruct omap_sr_pmic_datastruct omap_smartreflex_dev_attrstruct omap_sr_class_datastruct omap_sr_nvalue_tablestruct omap_sr_dataenum sr_instancefunction omap_sr_enable
Annotated Snippet
struct omap_sr {
char *name;
struct list_head node;
struct platform_device *pdev;
struct omap_sr_nvalue_table *nvalue_table;
struct voltagedomain *voltdm;
struct dentry *dbg_dir;
unsigned int irq;
struct clk *fck;
int srid;
int ip_type;
int nvalue_count;
bool autocomp_active;
u32 clk_length;
u32 err_weight;
u32 err_minlimit;
u32 err_maxlimit;
u32 accum_data;
u32 senn_avgweight;
u32 senp_avgweight;
u32 senp_mod;
u32 senn_mod;
void __iomem *base;
unsigned long enabled:1;
};
/**
* test_cond_timeout - busy-loop, testing a condition
* @cond: condition to test until it evaluates to true
* @timeout: maximum number of microseconds in the timeout
* @index: loop index (integer)
*
* Loop waiting for @cond to become true or until at least @timeout
* microseconds have passed. To use, define some integer @index in the
* calling code. After running, if @index == @timeout, then the loop has
* timed out.
*
* Copied from omap_test_timeout */
#define sr_test_cond_timeout(cond, timeout, index) \
({ \
for (index = 0; index < timeout; index++) { \
if (cond) \
break; \
udelay(1); \
} \
})
/**
* struct omap_sr_pmic_data - Strucutre to be populated by pmic code to pass
* pmic specific info to smartreflex driver
*
* @sr_pmic_init: API to initialize smartreflex on the PMIC side.
*/
struct omap_sr_pmic_data {
void (*sr_pmic_init) (void);
};
/**
* struct omap_smartreflex_dev_attr - Smartreflex Device attribute.
*
* @sensor_voltdm_name: Name of voltdomain of SR instance
*/
struct omap_smartreflex_dev_attr {
const char *sensor_voltdm_name;
};
/*
* The smart reflex driver supports CLASS1 CLASS2 and CLASS3 SR.
* The smartreflex class driver should pass the class type.
* Should be used to populate the class_type field of the
* omap_smartreflex_class_data structure.
*/
#define SR_CLASS1 0x1
#define SR_CLASS2 0x2
#define SR_CLASS3 0x3
/**
* struct omap_sr_class_data - Smartreflex class driver info
*
* @enable: API to enable a particular class smaartreflex.
* @disable: API to disable a particular class smartreflex.
* @configure: API to configure a particular class smartreflex.
* @notify: API to notify the class driver about an event in SR.
* Not needed for class3.
* @notify_flags: specify the events to be notified to the class driver
* @class_type: specify which smartreflex class.
* Can be used by the SR driver to take any class
* based decisions.
*/
struct omap_sr_class_data {
Annotation
- Immediate include surface: `linux/types.h`, `linux/platform_device.h`, `linux/delay.h`, `linux/platform_data/voltage-omap.h`.
- Detected declarations: `struct omap_sr`, `struct omap_sr_pmic_data`, `struct omap_smartreflex_dev_attr`, `struct omap_sr_class_data`, `struct omap_sr_nvalue_table`, `struct omap_sr_data`, `enum sr_instance`, `function omap_sr_enable`.
- 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.