include/linux/iio/sysfs.h
Source file repositories/reference/linux-study-clean/include/linux/iio/sysfs.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/iio/sysfs.h- Extension
.h- Size
- 5176 bytes
- Lines
- 164
- 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
- No C-style include directives detected by the generator.
Detected Declarations
struct iio_bufferstruct iio_chan_specstruct iio_dev_attrstruct iio_const_attr
Annotated Snippet
struct iio_dev_attr {
struct device_attribute dev_attr;
u64 address;
struct list_head l;
struct iio_chan_spec const *c;
struct iio_buffer *buffer;
};
#define to_iio_dev_attr(_dev_attr) \
container_of(_dev_attr, struct iio_dev_attr, dev_attr)
ssize_t iio_read_const_attr(struct device *dev,
struct device_attribute *attr,
char *len);
/**
* struct iio_const_attr - constant device specific attribute
* often used for things like available modes
* @string: attribute string
* @dev_attr: underlying device attribute
*/
struct iio_const_attr {
const char *string;
struct device_attribute dev_attr;
};
#define to_iio_const_attr(_dev_attr) \
container_of(_dev_attr, struct iio_const_attr, dev_attr)
/* Some attributes will be hard coded (device dependent) and not require an
address, in these cases pass a negative */
#define IIO_ATTR(_name, _mode, _show, _store, _addr) \
{ .dev_attr = __ATTR(_name, _mode, _show, _store), \
.address = _addr }
#define IIO_ATTR_RO(_name, _addr) \
{ .dev_attr = __ATTR_RO(_name), \
.address = _addr }
#define IIO_ATTR_WO(_name, _addr) \
{ .dev_attr = __ATTR_WO(_name), \
.address = _addr }
#define IIO_ATTR_RW(_name, _addr) \
{ .dev_attr = __ATTR_RW(_name), \
.address = _addr }
#define IIO_DEVICE_ATTR(_name, _mode, _show, _store, _addr) \
struct iio_dev_attr iio_dev_attr_##_name \
= IIO_ATTR(_name, _mode, _show, _store, _addr)
#define IIO_DEVICE_ATTR_RO(_name, _addr) \
struct iio_dev_attr iio_dev_attr_##_name \
= IIO_ATTR_RO(_name, _addr)
#define IIO_DEVICE_ATTR_WO(_name, _addr) \
struct iio_dev_attr iio_dev_attr_##_name \
= IIO_ATTR_WO(_name, _addr)
#define IIO_DEVICE_ATTR_RW(_name, _addr) \
struct iio_dev_attr iio_dev_attr_##_name \
= IIO_ATTR_RW(_name, _addr)
#define IIO_DEVICE_ATTR_NAMED(_vname, _name, _mode, _show, _store, _addr) \
struct iio_dev_attr iio_dev_attr_##_vname \
= IIO_ATTR(_name, _mode, _show, _store, _addr)
#define IIO_CONST_ATTR(_name, _string) \
struct iio_const_attr iio_const_attr_##_name \
= { .string = _string, \
.dev_attr = __ATTR(_name, S_IRUGO, iio_read_const_attr, NULL)}
#define IIO_CONST_ATTR_NAMED(_vname, _name, _string) \
struct iio_const_attr iio_const_attr_##_vname \
= { .string = _string, \
.dev_attr = __ATTR(_name, S_IRUGO, iio_read_const_attr, NULL)}
#define IIO_STATIC_CONST_DEVICE_ATTR(_name, _string) \
static ssize_t iio_const_dev_attr_show_##_name( \
struct device *dev, \
struct device_attribute *attr, \
char *buf) \
{ \
return sysfs_emit(buf, "%s\n", _string); \
} \
static IIO_DEVICE_ATTR(_name, 0444, \
iio_const_dev_attr_show_##_name, NULL, 0)
/* Generic attributes of onetype or another */
Annotation
- Detected declarations: `struct iio_buffer`, `struct iio_chan_spec`, `struct iio_dev_attr`, `struct iio_const_attr`.
- 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.