Documentation/translations/zh_CN/iio/iio_configfs.rst
Source file repositories/reference/linux-study-clean/Documentation/translations/zh_CN/iio/iio_configfs.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/translations/zh_CN/iio/iio_configfs.rst- Extension
.rst- Size
- 3009 bytes
- Lines
- 106
- Domain
- Support Tooling And Documentation
- Bucket
- Documentation
- Inferred role
- Support Tooling And Documentation: documentation
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/iio/sw_trigger.h
Detected Declarations
function iio_trig_sample_remove
Annotated Snippet
.. include:: ../disclaimer-zh_CN.rst
:Original: Documentation/iio/iio_configfs.rst
:翻译:
司延腾 Yanteng Si <siyanteng@loongson.cn>
.. _cn_iio_configfs:
=====================
工业 IIO configfs支持
=====================
1. 概述
=======
Configfs是一种内核对象的基于文件系统的管理系统,IIO使用一些可以通过
configfs轻松配置的对象(例如:设备,触发器)。
关于configfs是如何运行的,请查阅Documentation/filesystems/configfs.rst
了解更多信息。
2. 用法
=======
为了使configfs支持IIO,我们需要在编译时选中config的CONFIG_IIO_CONFIGFS
选项。
然后,挂载configfs文件系统(通常在 /config directory目录下)::
$ mkdir/config
$ mount -t configfs none/config
此时,将创建所有默认IIO组,并可以在/ config / iio下对其进行访问。 下一章
将介绍可用的IIO配置对象。
3. 软件触发器
=============
IIO默认configfs组之一是“触发器”组。挂载configfs后可以自动访问它,并且可
以在/config/iio/triggers下找到。
IIO软件触发器为创建多种触发器类型提供了支持。通常在include/linux/iio
/sw_trigger.h:中的接口下将新的触发器类型实现为单独的内核模块:
::
/*
* drivers/iio/trigger/iio-trig-sample.c
* 一种新触发器类型的内核模块实例
*/
#include <linux/iio/sw_trigger.h>
static struct iio_sw_trigger *iio_trig_sample_probe(const char *name)
{
/*
* 这将分配并注册一个IIO触发器以及其他触发器类型特性的初始化。
*/
}
static int iio_trig_sample_remove(struct iio_sw_trigger *swt)
{
/*
* 这会废弃iio_trig_sample_probe中的操作
*/
}
static const struct iio_sw_trigger_ops iio_trig_sample_ops = {
.probe = iio_trig_sample_probe,
.remove = iio_trig_sample_remove,
Annotation
- Immediate include surface: `linux/iio/sw_trigger.h`.
- Detected declarations: `function iio_trig_sample_remove`.
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
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.