From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3089CC43381 for ; Thu, 21 Jan 2021 03:37:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D0AD238A1 for ; Thu, 21 Jan 2021 03:37:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726829AbhAUDfR (ORCPT ); Wed, 20 Jan 2021 22:35:17 -0500 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:45062 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728475AbhAUCFA (ORCPT ); Wed, 20 Jan 2021 21:05:00 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0UMNRkxF_1611194647; Received: from IT-FVFX43SYHV2H.local(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0UMNRkxF_1611194647) by smtp.aliyun-inc.com(127.0.0.1); Thu, 21 Jan 2021 10:04:08 +0800 Subject: Re: [PATCH v3 1/3] docs/zh_CN: add iio iio_configfs.rst translation To: Yanteng Si , Jonathan Corbet Cc: Harry Wei , Yanteng Si , linux-doc@vger.kernel.org, realpuyuwang@gmail.com, Huacai Chen , Jiaxun Yang References: <20210121012352.449558-1-siyanteng@loongson.cn> From: Alex Shi Message-ID: <9a65551a-04e4-1daa-4d49-39e6423ca751@linux.alibaba.com> Date: Thu, 21 Jan 2021 10:04:06 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20210121012352.449558-1-siyanteng@loongson.cn> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org Reviewed-by: Alex Shi 在 2021/1/21 上午9:23, Yanteng Si 写道: > This patch translates Documentation/iio/iio_configfs.rst into Chinese. > > Signed-off-by: Yanteng Si > --- > .../translations/zh_CN/iio/iio_configfs.rst | 102 ++++++++++++++++++ > 1 file changed, 102 insertions(+) > create mode 100644 Documentation/translations/zh_CN/iio/iio_configfs.rst > > diff --git a/Documentation/translations/zh_CN/iio/iio_configfs.rst b/Documentation/translations/zh_CN/iio/iio_configfs.rst > new file mode 100644 > index 000000000000..223bc732ce66 > --- /dev/null > +++ b/Documentation/translations/zh_CN/iio/iio_configfs.rst > @@ -0,0 +1,102 @@ > +.. include:: ../disclaimer-zh_CN.rst > + > +:Original: :doc:`../../../iio/iio_configfs` > +:Translator: Yanteng Si > + > +.. _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 > + > + > + 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, > + }; > + > + static struct iio_sw_trigger_type iio_trig_sample = { > + .name = "trig-sample", > + .owner = THIS_MODULE, > + .ops = &iio_trig_sample_ops, > + }; > + > +module_iio_sw_trigger_driver(iio_trig_sample); > + > +每种触发器类型在/config/iio/triggers下都有其自己的目录。 加载iio-trig-sample > +模块将创建“ trig-sample”触发器类型目录/config/iio/triggers/trig-sample. > + > +我们支持以下中断源(触发器类型) > + > + * hrtimer,使用高分辨率定时器作为中断源 > + > +3.1 Hrtimer触发器创建与销毁 > +--------------------------- > + > +加载iio-trig-hrtimer模块将注册hrtimer触发器类型,从而允许用户在 > +/config/iio/triggers/hrtimer下创建hrtimer触发器。 > + > +例如:: > + > + $ mkdir /config/iio/triggers/hrtimer/instance1 > + $ rmdir /config/iio/triggers/hrtimer/instance1 > + > +每个触发器可以具有一个或多个独特的触发器类型的属性。 > + > +3.2 "hrtimer" 触发器类型属性 > +---------------------------- > + > +"hrtimer”触发器类型没有来自/config dir的任何可配置属性。 > +但它确实将采样频率属性引入了触发目录。 >