泰晓科技 -- 聚焦 Linux - 追本溯源,见微知著!
网站地址:https://tinylab.org

儿童Linux系统,可打字编程学数理化
请稍侯

LWN 465358: (部分)就绪的 IIO

Wang Chen 创作于 2018/01/05

原文:(Partially) graduating IIO 原创:By Jonathan Corbet @ Nov 2, 2011 翻译:By unicornx 校对:By maxiao1993

The industrial I/O (IIO) subsystem has lived in the staging tree for some time. It provides a framework for drivers that deal with all kinds of sensors that measure quantities like voltages, temperatures, acceleration, ambient light, and more. There has been some disagreement over the years about how sensors of this type should fit into the kernel; IIO, it is hoped, will provide the answer.

工业输入 / 输出(Industrial I/O,简称 IIO)子系统存在于内核源码树的 staging 目录中有一段时间​​了(译者注,有关什么是内核的 “staging 目录” 请参考 The Linux Staging Tree, what it is and is not)。它为开发针对某些传感器设备的驱动提供了一个框架,这些传感器设备采集的数据类型包括电压,温度,加速度,环境光照值等等。多年来,关于这些类型传感器的驱动在内核中的分类问题存在一些分歧 ;而提出 IIO 子系统则有望解决这个困扰。

The core IIO code sat out of tree for a long time; the state of the code, it is said, reflected that fact. There has been a determined effort to improve things in the staging tree, with some measurable results. There is now a set of core IIO patches that, according to maintainer Jonathan Cameron, is now ready to move out of staging and into the mainline proper.

查看相关的代码状态可以明显看出,IIO 子系统的主要代码在 staging 目录下有很长一段时间了,并完成了多次持续的改进。根据其维护者 Jonathan Cameron 的说法,IIO 子系统核心模块的补丁,业已就绪,就等着从 staging 目录下移出来并入主线了。

IIO sensors vary a lot, from simple, low-bandwidth sensors to complex, high-bandwidth devices. The initial IIO move is aimed at the first set. For this kind of sensor, the user-space interface is expected to live entirely in sysfs, under /sys/bus/iio/devices. Each device entry will have a number of attributes; some, like name and sampling_frequency, will be present for all sensors. Others will depend on what the sensor actually measures; the proposed ABI attempts to standardize the names of those attributes wherever possible.

IIO 子系统管理的传感器类型范围很广,从简单的低带宽传感器到复杂的、高带宽设备。最初的 IIO 子系统针对的是前一类设备。用户态访问这类传感器时,可以完全通过 sysfs 来实现,具体的文件系统路径是 /sys/bus/iio/devices。每个设备对应一个目录,其目录下有多个属性文件;有一些是对所有种类的设备都需要的公共属性,譬如 namesampling_frequency。其他的属性将取决于传感器实际测量的内容;系统定义了一份推荐的 ABI 试图尽可能地对这些属性的名称实现标准化。

The plan is to get this core interface into the mainline, then to start moving the simpler (and cleaner) drivers after it. Support for more complex devices will come later. As of this writing, this code has not been pulled for 3.2, but that could yet happen. Meanwhile, vast numbers of IIO changes have gone into the staging tree for 3.2; there is clearly a lot of interest in getting this subsystem into shape.

具体的开发计划是安排核心接口部分的代码先进入主线,然后再合入那些相对简单(和整理得较好)的驱动程序。对那些比较复杂的设备的支持将在稍后进行。截至发稿为止,相关代码并没有如其所愿被合并到 3.2 版本的内核主线中。而于此同时,3.2 版本的 staging 目录中针对 IIO 的修改仍然在不停地增加;显然大家都很期待这个子系统能早日进入内核主线。



Read Album:

Read Related:

Read Latest: