[置顶] 泰晓 RISC-V 实验箱,配套 30+ 讲嵌入式 Linux 系统开发公开课
LWN 465358: (部分)就绪的 IIO
原文:(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 andsampling_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
。每个设备对应一个目录,其目录下有多个属性文件;有一些是对所有种类的设备都需要的公共属性,譬如 name
和 sampling_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 的修改仍然在不停地增加;显然大家都很期待这个子系统能早日进入内核主线。
猜你喜欢:
- 我要投稿:发表原创技术文章,收获福利、挚友与行业影响力
- 知识星球:独家 Linux 实战经验与技巧,订阅「Linux知识星球」
- 视频频道:泰晓学院,B 站,发布各类 Linux 视频课
- 开源小店:欢迎光临泰晓科技自营店,购物支持泰晓原创
- 技术交流:Linux 用户技术交流微信群,联系微信号:tinylab
支付宝打赏 | 微信打赏 | |
请作者喝杯咖啡吧 |
Read Album:
- LWN 531148: Linux 内核文件中的非常规节
- Linux 内核的代码仓库管理与开发流程简介
- LWN 600644: 扩展内核栈
- LWN 563185: 优化抢占
- LWN 575497: 我们很快就可以有 Deadline 调度器了吗?