__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
/* SPDX-License-Identifier: GPL-2.0-only */
/* The industrial I/O core
*
*Copyright (c) 2008 Jonathan Cameron
*
* General attributes
*/
#ifndef _INDUSTRIAL_IO_SYSFS_H_
#define _INDUSTRIAL_IO_SYSFS_H_
struct iio_buffer;
struct iio_chan_spec;
/**
* struct iio_dev_attr - iio specific device attribute
* @dev_attr: underlying device attribute
* @address: associated register address
* @l: list head for maintaining list of dynamically created attrs
* @c: specification for the underlying channel
* @buffer: the IIO buffer to which this attribute belongs to (if any)
*/
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 */
/**
* IIO_DEV_ATTR_SAMP_FREQ - sets any internal clock frequency
* @_mode: sysfs file mode/permissions
* @_show: output method for the attribute
* @_store: input method for the attribute
**/
#define IIO_DEV_ATTR_SAMP_FREQ(_mode, _show, _store) \
IIO_DEVICE_ATTR(sampling_frequency, _mode, _show, _store, 0)
/**
* IIO_DEV_ATTR_SAMP_FREQ_AVAIL - list available sampling frequencies
* @_show: output method for the attribute
*
* May be mode dependent on some devices
**/
#define IIO_DEV_ATTR_SAMP_FREQ_AVAIL(_show) \
IIO_DEVICE_ATTR(sampling_frequency_available, S_IRUGO, _show, NULL, 0)
/**
* IIO_CONST_ATTR_SAMP_FREQ_AVAIL - list available sampling frequencies
* @_string: frequency string for the attribute
*
* Constant version
**/
#define IIO_CONST_ATTR_SAMP_FREQ_AVAIL(_string) \
IIO_CONST_ATTR(sampling_frequency_available, _string)
/**
* IIO_DEV_ATTR_INT_TIME_AVAIL - list available integration times
* @_show: output method for the attribute
**/
#define IIO_DEV_ATTR_INT_TIME_AVAIL(_show) \
IIO_DEVICE_ATTR(integration_time_available, S_IRUGO, _show, NULL, 0)
/**
* IIO_CONST_ATTR_INT_TIME_AVAIL - list available integration times
* @_string: frequency string for the attribute
*
* Constant version
**/
#define IIO_CONST_ATTR_INT_TIME_AVAIL(_string) \
IIO_CONST_ATTR(integration_time_available, _string)
#define IIO_DEV_ATTR_TEMP_RAW(_show) \
IIO_DEVICE_ATTR(in_temp_raw, S_IRUGO, _show, NULL, 0)
#define IIO_CONST_ATTR_TEMP_OFFSET(_string) \
IIO_CONST_ATTR(in_temp_offset, _string)
#define IIO_CONST_ATTR_TEMP_SCALE(_string) \
IIO_CONST_ATTR(in_temp_scale, _string)
#endif /* _INDUSTRIAL_IO_SYSFS_H_ */
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| accel | Folder | 0755 |
|
|
| adc | Folder | 0755 |
|
|
| afe | Folder | 0755 |
|
|
| common | Folder | 0755 |
|
|
| dac | Folder | 0755 |
|
|
| frequency | Folder | 0755 |
|
|
| gyro | Folder | 0755 |
|
|
| imu | Folder | 0755 |
|
|
| timer | Folder | 0755 |
|
|
| backend.h | File | 8.4 KB | 0644 |
|
| buffer-dma.h | File | 5.64 KB | 0644 |
|
| buffer-dmaengine.h | File | 989 B | 0644 |
|
| buffer.h | File | 1.79 KB | 0644 |
|
| buffer_impl.h | File | 6.95 KB | 0644 |
|
| configfs.h | File | 259 B | 0644 |
|
| consumer.h | File | 15.91 KB | 0644 |
|
| driver.h | File | 1.36 KB | 0644 |
|
| events.h | File | 2.78 KB | 0644 |
|
| hw-consumer.h | File | 602 B | 0644 |
|
| iio-gts-helper.h | File | 6.54 KB | 0644 |
|
| iio-opaque.h | File | 3.22 KB | 0644 |
|
| iio.h | File | 34.23 KB | 0644 |
|
| kfifo_buf.h | File | 640 B | 0644 |
|
| machine.h | File | 1.06 KB | 0644 |
|
| sw_device.h | File | 1.55 KB | 0644 |
|
| sw_trigger.h | File | 1.58 KB | 0644 |
|
| sysfs.h | File | 5.05 KB | 0644 |
|
| trigger.h | File | 5.17 KB | 0644 |
|
| trigger_consumer.h | File | 1.42 KB | 0644 |
|
| triggered_buffer.h | File | 1.28 KB | 0644 |
|
| triggered_event.h | File | 352 B | 0644 |
|
| types.h | File | 1.81 KB | 0644 |
|