drivers/macintosh/windfarm.h
Source file repositories/reference/linux-study-clean/drivers/macintosh/windfarm.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/macintosh/windfarm.h- Extension
.h- Size
- 4166 bytes
- Lines
- 157
- Domain
- Driver Families
- Bucket
- drivers/macintosh
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kref.hlinux/list.hlinux/module.hlinux/notifier.hlinux/device.h
Detected Declarations
struct wf_controlstruct wf_control_opsstruct wf_controlstruct wf_sensorstruct wf_sensor_opsstruct wf_sensorfunction wf_control_set_maxfunction wf_control_set_minfunction wf_control_setfunction wf_control_getfunction wf_control_get_minfunction wf_control_get_maxfunction wf_sensor_get
Annotated Snippet
struct wf_control_ops {
int (*set_value)(struct wf_control *ct, s32 val);
int (*get_value)(struct wf_control *ct, s32 *val);
s32 (*get_min)(struct wf_control *ct);
s32 (*get_max)(struct wf_control *ct);
void (*release)(struct wf_control *ct);
struct module *owner;
};
struct wf_control {
struct list_head link;
const struct wf_control_ops *ops;
const char *name;
int type;
struct kref ref;
struct device_attribute attr;
void *priv;
};
#define WF_CONTROL_TYPE_GENERIC 0
#define WF_CONTROL_RPM_FAN 1
#define WF_CONTROL_PWM_FAN 2
/* Note about lifetime rules: wf_register_control() will initialize
* the kref and wf_unregister_control will decrement it, thus the
* object creating/disposing a given control shouldn't assume it
* still exists after wf_unregister_control has been called.
*/
extern int wf_register_control(struct wf_control *ct);
extern void wf_unregister_control(struct wf_control *ct);
extern int wf_get_control(struct wf_control *ct);
extern void wf_put_control(struct wf_control *ct);
static inline int wf_control_set_max(struct wf_control *ct)
{
s32 vmax = ct->ops->get_max(ct);
return ct->ops->set_value(ct, vmax);
}
static inline int wf_control_set_min(struct wf_control *ct)
{
s32 vmin = ct->ops->get_min(ct);
return ct->ops->set_value(ct, vmin);
}
static inline int wf_control_set(struct wf_control *ct, s32 val)
{
return ct->ops->set_value(ct, val);
}
static inline int wf_control_get(struct wf_control *ct, s32 *val)
{
return ct->ops->get_value(ct, val);
}
static inline s32 wf_control_get_min(struct wf_control *ct)
{
return ct->ops->get_min(ct);
}
static inline s32 wf_control_get_max(struct wf_control *ct)
{
return ct->ops->get_max(ct);
}
/*
* Sensor objects
*/
struct wf_sensor;
struct wf_sensor_ops {
int (*get_value)(struct wf_sensor *sr, s32 *val);
void (*release)(struct wf_sensor *sr);
struct module *owner;
};
struct wf_sensor {
struct list_head link;
const struct wf_sensor_ops *ops;
const char *name;
struct kref ref;
struct device_attribute attr;
void *priv;
};
/* Same lifetime rules as controls */
extern int wf_register_sensor(struct wf_sensor *sr);
extern void wf_unregister_sensor(struct wf_sensor *sr);
Annotation
- Immediate include surface: `linux/kref.h`, `linux/list.h`, `linux/module.h`, `linux/notifier.h`, `linux/device.h`.
- Detected declarations: `struct wf_control`, `struct wf_control_ops`, `struct wf_control`, `struct wf_sensor`, `struct wf_sensor_ops`, `struct wf_sensor`, `function wf_control_set_max`, `function wf_control_set_min`, `function wf_control_set`, `function wf_control_get`.
- Atlas domain: Driver Families / drivers/macintosh.
- 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.