From patchwork Wed May 16 17:50:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Breathitt Gray X-Patchwork-Id: 10404527 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 44C3D60155 for ; Wed, 16 May 2018 17:51:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 32ADD28414 for ; Wed, 16 May 2018 17:51:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 272C2285EB; Wed, 16 May 2018 17:51:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 57EDA28414 for ; Wed, 16 May 2018 17:51:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=37FqzeOmYK00f7Ajd0l/l8YZrCyBAacUdxJNYXKJ5Ig=; b=HCVuVecPNbVNw3LkLErfcXki2x zl9yn1hH4oH4sLA/LVl+gQ+poYF8S/Cj8Y4xO7uRntmFNrcFk0sJ/tvft4282wEzyyafQl5lBZZG5 1G0lNYHWHhpvN4ajkp0MSul+udm/skNHCsrrGVo0T+75vD8IUyL9vNhf3tjLmrhmZ9ZXaTdp2f25h JDc4JryzVadJagrULdu50yKU1HKwDf8+FzkJZ+pEFONcc7YE7TxDCrqe7Uj2XG2bjj3X4RSobX3sB fgPkU+3SLKp3OtwVNG4f7C+UI8IHBbTs0xssEV99ZoOLWAaveoVV7rPfWo7YjLfgnIdBXdQdgmOtq w0Mbgtug==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJ0aS-0005B6-QJ; Wed, 16 May 2018 17:51:41 +0000 Received: from mail-yb0-x243.google.com ([2607:f8b0:4002:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJ0Zs-0004tQ-Aa for linux-arm-kernel@lists.infradead.org; Wed, 16 May 2018 17:51:07 +0000 Received: by mail-yb0-x243.google.com with SMTP id g140-v6so554028ybf.6 for ; Wed, 16 May 2018 10:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Dwu1Wn9X9Lo+fp8bqHy30tjuWeuxCl7zxzEuKeUxpug=; b=OKBon/71mwvnRy76+5jtMJ83yANWXh2yS61eyzLVf0wggWwFMlGMTDFoAp55n/0nHQ m7GMq9xi2Qj2qss/o66N9wzBJfmdTecjR06IP9gMKeN2pm0jCMT8um7go6kLYSUNuNUh P4UrT+qczb4XNooY+GeLJHswtc899kWUafxEHXPWR1ohUtoC2TLx08OQGbB5DjDHs7C0 ebVI9jiqxZCixdO20qWS89v8cw7nGpt44O7wwWLRDlg/K+dbFXmKLmYC9UZYHiPwAxx8 IWkPt8sPHE1DDQBiMLQROtFyLk/LGo5IF7tinxiXVKvtV9Frjzp+r+ejwfooMH03x/Nq rckw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Dwu1Wn9X9Lo+fp8bqHy30tjuWeuxCl7zxzEuKeUxpug=; b=fxrWfvrVCD8kWXifRX92y1X2Hib3oyvZkRbAZwC6UoH0Q5Qi57d5FUsmVUmxxXHkW+ x2Pwz92Jfmst8kz1KEf4ExiigYzbVqlfBu5EQvg95/LmAkAmwgz7gK/X77ldjRmrBfO3 2RE8mBUoTjfThna3mVW6+pSPrZKY2C1mQcdDzcYBWUHeNu7ws7186UiOS0+2TIAU2O/Y CoVaY32KmhHGr83cxK3/rbH85s3W36PHhz9+wbZzQpjssbU+CNxfMQzr8IAn4S2QpPwH pvbFBo+luLGaZPIsj9+vlcm03MyfbSuKJ0fgoV4jkt2wN3Id/SwRG0nDvr9lTHOyXY6T E1/A== X-Gm-Message-State: ALKqPwcEfdUI9SYeoYx8ruUWC7Fu5ZLEYes569Tr269POdz0E/PXr721 xOWZFWNyK1kZZJhE1CugA4s= X-Google-Smtp-Source: AB8JxZr+N49TOnT9L4B5eXf2cvo20f7gzdJy7iXKCve47wH9V4SCZ6iBIgkLV1tz9a+srMNwb6JzXQ== X-Received: by 2002:a25:6fd5:: with SMTP id k204-v6mr1053852ybc.385.1526493061444; Wed, 16 May 2018 10:51:01 -0700 (PDT) Received: from localhost ([72.188.97.40]) by smtp.gmail.com with ESMTPSA id z199-v6sm1273246ywz.110.2018.05.16.10.51.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 May 2018 10:51:00 -0700 (PDT) From: William Breathitt Gray To: jic23@kernel.org Subject: [PATCH v6 2/9] counter: Documentation: Add Generic Counter sysfs documentation Date: Wed, 16 May 2018 13:50:55 -0400 Message-Id: <1bf56af37a1d6dab8181ce71f827914acdf5c4f7.1526487615.git.vilhelm.gray@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180516_105104_519923_1E0D8BEE X-CRM114-Status: GOOD ( 20.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, benjamin.gaignard@st.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, William Breathitt Gray , fabrice.gasnier@st.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds standard documentation for the userspace sysfs attributes of the Generic Counter interface. Signed-off-by: William Breathitt Gray Reviewed-by: Jonathan Cameron --- Documentation/ABI/testing/sysfs-bus-counter | 241 ++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 242 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-counter diff --git a/Documentation/ABI/testing/sysfs-bus-counter b/Documentation/ABI/testing/sysfs-bus-counter new file mode 100644 index 000000000000..e4a45d231b4f --- /dev/null +++ b/Documentation/ABI/testing/sysfs-bus-counter @@ -0,0 +1,241 @@ +What: /sys/bus/counter/devices/counterX/countY/count +KernelVersion: 4.18 +Contact: linux-iio@vger.kernel.org +Description: + Count data of Count Y represented as a string. + +What: /sys/bus/counter/devices/counterX/countY/ceiling +KernelVersion: 4.18 +Contact: linux-iio@vger.kernel.org +Description: + Count value ceiling for Count Y. This is the upper limit for the + respective counter. + +What: /sys/bus/counter/devices/counterX/countY/floor +KernelVersion: 4.18 +Contact: linux-iio@vger.kernel.org +Description: + Count value floor for Count Y. This is the lower limit for the + respective counter. + +What: /sys/bus/counter/devices/counterX/countY/count_mode +KernelVersion: 4.18 +Contact: linux-iio@vger.kernel.org +Description: + Count mode for channel Y. The ceiling and floor values for + Count Y are used by the count mode where required. The following + count modes are available: + + Normal: + Counting is continuous in either direction. + + Range Limit: + An upper or lower limit is set, mimicking limit switches + in the mechanical counterpart. The upper limit is set to + the Count Y ceiling value, while the lower limit is set + to the Count Y floor value. The counter freezes at + count = ceiling when counting up, and at count = floor + when counting down. At either of these limits, the + counting is resumed only when the count direction is + reversed. + + Non-Recycle: + The counter is disabled whenever a counter overflow or + underflow takes place. The counter is re-enabled when a + new count value is loaded to the counter via a preset + operation or direct write. + + Modulo-N: + A count value boundary is set between the Count Y floor + value and the Count Y ceiling value. The counter is + reset to the Cunt Y floor value at count = ceiling when + counting up, while the counter is set to the Count Y + ceiling value at count = floor when counting down; the + counter does not freeze at the boundary points, but + counts continuously throughout. + +What: /sys/bus/counter/devices/counterX/countY/count_mode_available +What: /sys/bus/counter/devices/counterX/countY/error_noise_available +What: /sys/bus/counter/devices/counterX/countY/function_available +What: /sys/bus/counter/devices/counterX/countY/signalZ_action_available +KernelVersion: 4.18 +Contact: linux-iio@vger.kernel.org +Description: + Discrete set of available values for the respective Count Y + configuration are listed in this file. Values are delineated by + newline characters. + +What: /sys/bus/counter/devices/counterX/countY/direction +KernelVersion: 4.18 +Contact: linux-iio@vger.kernel.org +Description: + Read-only attribute that indicates the count direction of Count + Y. Two count directions are available: forward and backward. + + Some counter devices are able to determine the direction of + their counting. For example, quadrature encoding counters can + determine the direction of movement by evaluating the leading + phase of the respective A and B quadrature encoding signals. + This attribute exposes such count directions. + +What: /sys/bus/counter/devices/counterX/countY/enable +KernelVersion: 4.18 +Contact: linux-iio@vger.kernel.org +Description: + Whether channel Y counter is enabled. Valid attribute values are + boolean. + + This attribute is intended to serve as a pause/unpause mechanism + for Count Y. Suppose a counter device is used to count the total + movement of a conveyor belt: this attribute allows an operator + to temporarily pause the counter, service the conveyor belt, + and then finally unpause the counter to continue where it had + left off. + +What: /sys/bus/counter/devices/counterX/countY/error_noise +KernelVersion: 4.18 +Contact: linux-iio@vger.kernel.org +Description: + Read-only attribute that indicates whether excessive noise is + present at the channel Y counter inputs. + +What: /sys/bus/counter/devices/counterX/countY/function +KernelVersion: 4.18 +Contact: linux-iio@vger.kernel.org +Description: + Count function mode of Count Y; count function evaluation is + triggered by conditions specified by the Count Y signalZ_action + attributes. The following count functions are available: + + Increase: + Accumulated count is incremented. + + Decrease: + Accumulated count is decremented. + + Pulse-Direction: + Rising edges on quadrature pair signal A updates the + respective count. The input level of quadrature pair + signal B determines direction. + + Quadrature x1 A: + If direction is forward, rising edges on quadrature pair + signal A updates the respective count; if the direction + is backward, falling edges on quadrature pair signal A + updates the respective count. Quadrature encoding + determines the direction. + + Quadrature x1 B: + If direction is forward, rising edges on quadrature pair + signal B updates the respective count; if the direction + is backward, falling edges on quadrature pair signal B + updates the respective count. Quadrature encoding + determines the direction. + + Quadrature x2 A: + Any state transition on quadrature pair signal A updates + the respective count. Quadrature encoding determines the + direction. + + Quadrature x2 B: + Any state transition on quadrature pair signal B updates + the respective count. Quadrature encoding determines the + direction. + + Quadrature x2 Rising: + Rising edges on either quadrature pair signals updates + the respective count. Quadrature encoding determines the + direction. + + Quadrature x2 Falling: + Falling edges on either quadrature pair signals updates + the respective count. Quadrature encoding determines the + direction. + + Quadrature x4: + Any state transition on either quadrature pair signals + updates the respective count. Quadrature encoding + determines the direction. + +What: /sys/bus/counter/devices/counterX/countY/name +KernelVersion: 4.18 +Contact: linux-iio@vger.kernel.org +Description: + Read-only attribute that indicates the device-specific name of + Count Y. If possible, this should match the name of the + respective channel as it appears in the device datasheet + documentation text. + +What: /sys/bus/counter/devices/counterX/countY/preset +KernelVersion: 4.18 +Contact: linux-iio@vger.kernel.org +Description: + If the counter device supports preset registers, the preset + count for channel Y is provided by this attribute. + +What: /sys/bus/counter/devices/counterX/countY/preset_enable +KernelVersion: 4.18 +Contact: linux-iio@vger.kernel.org +Description: + Whether channel Y counter preset operation is enabled. Valid + attribute values are boolean. + +What: /sys/bus/counter/devices/counterX/countY/signalZ_action +KernelVersion: 4.18 +Contact: linux-iio@vger.kernel.org +Description: + Action mode of Count Y for Signal Z. This attribute indicates + the condition of Signal Z that triggers the count function + evaluation for Count Y. The following action modes are + available: + + None: + Signal does not trigger the count function. In + Pulse-Direction count function mode, this Signal is + evaluated as Direction. + + Rising Edge: + Low state transitions to high state. + + Falling Edge: + High state transitions to low state. + + Both Edges: + Any state transition. + +What: /sys/bus/counter/devices/counterX/name +KernelVersion: 4.18 +Contact: linux-iio@vger.kernel.org +Description: + Read-only attribute that indicates the device-specific name of + the Counter. This should match the name of the device as it + appears in its respective datasheet documentation text. + +What: /sys/bus/counter/devices/counterX/num_counts +KernelVersion: 4.18 +Contact: linux-iio@vger.kernel.org +Description: + Read-only attribute that indicates the total number of Counts + belonging to the Counter. + +What: /sys/bus/counter/devices/counterX/num_signals +KernelVersion: 4.18 +Contact: linux-iio@vger.kernel.org +Description: + Read-only attribute that indicates the total number of Signals + belonging to the Counter. + +What: /sys/bus/counter/devices/counterX/signalY/signal +KernelVersion: 4.18 +Contact: linux-iio@vger.kernel.org +Description: + Signal data of Signal Y represented as a string. + +What: /sys/bus/counter/devices/counterX/signalY/name +KernelVersion: 4.18 +Contact: linux-iio@vger.kernel.org +Description: + Read-only attribute that indicates the device-specific name of + Signal Y. If possible, this should match the name of the + respective signal as it appears in the device datasheet + documentation text. diff --git a/MAINTAINERS b/MAINTAINERS index 2a016d73ab72..1413e3eb49e5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3673,6 +3673,7 @@ COUNTER SUBSYSTEM M: William Breathitt Gray L: linux-iio@vger.kernel.org S: Maintained +F: Documentation/ABI/testing/sysfs-bus-counter* F: drivers/counter/ F: include/linux/counter.h