Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1538979rwb; Tue, 27 Sep 2022 14:52:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5CW7EC37x/9NsW2ekOSJt37vvVDaJw7oepWIu2Mh7u14lZmu0rLpuUANPqWqbRkDU0yGZi X-Received: by 2002:a63:ff4f:0:b0:439:61d6:197 with SMTP id s15-20020a63ff4f000000b0043961d60197mr25925358pgk.67.1664315528658; Tue, 27 Sep 2022 14:52:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664315528; cv=none; d=google.com; s=arc-20160816; b=a3WTdhpAWhT+NGjVG2VOsqq3eeU+iVgX8G6GxUl/q5l4aSYFJpc/GQQQLXg3R6xsAC 2QkYPzKYGqEdGDHixBNzSYNPqftT731BGaPbOIiNm27/BfkXSxv8gWG0CsLXTQMLQnqz 0EXlnRLHrCAvD+0Ps+41R32FFa45MDLtTuLmlZXlYmuezbK38esDHeFRVrcM3igeQuEX eA+b7B2Y9G/r+tVZ4Kk2b5Qsbv0a8D0Ui+18yydUjVJ0m5RN2vtOgiH4mfPiQaF3mgYZ xiYNtdVOq/XevxFFLRhOlH78rSFj6V3Gw9XLxhzjs3mWRdgO5gQOboLy5HYCbKl7Eh1s CIDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lgKHkP0KiAjJaN/Qd0nmEN83DTLv8hYC6iOmkH4IOGQ=; b=t+LcdcTqg7LaP/eOWd6/XCUXWDlwu+gcJ0HwHWU/eSGMEgXqXP4/KUbd1DnROvxoAj xZ8UNlpeqONPmQ1C2pMxfkyC5vLZ7TVH+JzOeI1Ipy31lRzGUliIPL7RFsii9S0Wf51e dRn6HVrwJkbn7qM8LlVkNyyaYZnaXmE0qQViOZssm7MlrE1fNatUhBegqRYydRZtsTM6 ndNNVUPlw6tAoYsUjrMSV6o7cw3aitSQ9mRHyEMhWKTrC+cU5XDzE2jHGRklYQu2HZp6 FBtlgCg4QGNnFh60g7/7POPoq/cndsD/rooKoxbIK50MUwY75nqjsqSTajUMw5IXFEEO N08Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VMOjYItN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lb1-20020a17090b4a4100b00202b66eaf44si60561pjb.0.2022.09.27.14.51.57; Tue, 27 Sep 2022 14:52:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VMOjYItN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231880AbiI0VtR (ORCPT + 99 others); Tue, 27 Sep 2022 17:49:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231298AbiI0VtO (ORCPT ); Tue, 27 Sep 2022 17:49:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C40E110C783; Tue, 27 Sep 2022 14:49:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C682861BA3; Tue, 27 Sep 2022 21:49:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36DAFC433C1; Tue, 27 Sep 2022 21:49:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664315352; bh=hIZZloxV/4NVdAyWJk4xcqHzdlPe7zVqfPE8pJG0+yk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VMOjYItNT9og7Wz978rlllZaeepZnjlROtCLYQ3Y2XytYxPigy5phFMnIYV3ITtYO dZIuW2KaapxjfXPumqQBEPFSuXxVk4j2Dz6CGJhkuiuTs2QchcjPuCle/NDE5rwRf/ 9uR1mi8VkIjmE7HKjbrJXXBiw2jZ9dzfdcvnOpBZc4Egmtse33Mq7Mv+9KmoXzNaSc TxFqI7C4GlRq/UCQ4W/nZWY5B0mowW6a2aFx73/OkA2JSoR254zhzdqg3SQwK21YGf NuMB6OPLAdkBqv2aDa2egqI+bNTi7yMslRRt/klv/jo2EFrulFbsjPR+8Co3dFBy2q AuNq2ny6vZ8oQ== Date: Tue, 27 Sep 2022 17:49:09 -0400 From: William Breathitt Gray To: Julien Panis Cc: william.gray@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, mranostay@ti.com Subject: Re: [PATCH v9 0/4] ECAP support on TI AM62x SoC Message-ID: References: <20220923142437.271328-1-jpanis@baylibre.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="OgNSUDtuiixoyean" Content-Disposition: inline In-Reply-To: <20220923142437.271328-1-jpanis@baylibre.com> X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --OgNSUDtuiixoyean Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 23, 2022 at 04:24:33PM +0200, Julien Panis wrote: > The Enhanced Capture (ECAP) module can be used to timestamp events > detected on signal input pin. It can be used for time measurements > of pulse train signals. >=20 > ECAP module includes 4 timestamp capture registers. For all 4 sequenced > timestamp capture events (0->1->2->3->0->...), edge polarity (falling/ris= ing > edge) can be selected. >=20 > This driver leverages counter subsystem to : > - select edge polarity for all 4 capture events (event mode) > - log timestamps for each capture event > Event polarity, and CAP0/1/2/3 timestamps give all the information > about the input pulse train. Further information can easily be computed : > period and/or duty cycle if frequency is constant, elapsed time between > pulses, etc... >=20 > This patchset must be applied on top of the following counter subsystem p= atchset : > https://lore.kernel.org/all/cover.1663693757.git.william.gray@linaro.org/ >=20 > Modifications since v8 : > - Add documentation to private driver structure > - Add mutex to prevent IO race conditions > - Stop counter before disabling interrupts in ecap_cnt_capture_disable()= function > - Remove returning of status in ecap_cnt_count_get/set_val() functions > - Remove unnecessary 'return -EBUSY' in all callbacks > - Remove unnecessary '.id =3D 0' in ecap_cnt_counts[] > - Modify driver info in MAINTAINER file >=20 > Userspace commands : > ### CLOCK SIGNAL ### > cd /sys/bus/counter/devices/counter0/signal0 >=20 > # Get frequency > cat frequency >=20 > ### INPUT SIGNAL ### > cd /sys/bus/counter/devices/counter0/signal1 >=20 > # Get polarity for each capture event > cat polarity0 > cat polarity1 > cat polarity2 > cat polarity3 >=20 > # Set polarity for each capture event > echo positive > polarity0 > echo negative > polarity1 > echo positive > polarity2 > echo negative > polarity3 >=20 > ### COUNT ### > cd /sys/bus/counter/devices/counter0/count0 >=20 > # Get ceiling (counter max value) > cat ceiling >=20 > # Reset number of overflows & current timebase counter value > echo 0 > num_overflows > echo 0 > count >=20 > # Run ECAP > echo 1 > enable >=20 > # Get number of overflows & current timebase counter value > cat num_overflows > cat count >=20 > # Get captured timestamps > cat capture0 > cat capture1 > cat capture2 > cat capture3 >=20 > # Note that counter watches can also be used to get > # data from userspace application > # -> see tools/counter/counter_example.c >=20 > # Pause ECAP > echo 0 > enable >=20 > Julien Panis (4): > dt-bindings: counter: add ti,am62-ecap-capture.yaml > Documentation: ABI: sysfs-bus-counter: add frequency & num_overflows > items > counter: ti-ecap-capture: capture driver support for ECAP > MAINTAINERS: add TI ECAP driver info >=20 > Documentation/ABI/testing/sysfs-bus-counter | 14 + > .../counter/ti,am62-ecap-capture.yaml | 61 ++ > MAINTAINERS | 9 + > drivers/counter/Kconfig | 15 + > drivers/counter/Makefile | 1 + > drivers/counter/ti-ecap-capture.c | 614 ++++++++++++++++++ > 6 files changed, 714 insertions(+) > create mode 100644 Documentation/devicetree/bindings/counter/ti,am62-eca= p-capture.yaml > create mode 100644 drivers/counter/ti-ecap-capture.c >=20 > --=20 > 2.37.3 Queued for counter-next with a minor context adjustment for sysfs-bus-counter changes. Thanks, William Breathitt Gray --OgNSUDtuiixoyean Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQSNN83d4NIlKPjon7a1SFbKvhIjKwUCYzNv1QAKCRC1SFbKvhIj KxxzAPsGsMhJL0tIsWdHhCHmfqbuV/FWDAIsiBqAyCIJko39jAD8CANWEJ7SWUvy WXSa1cYdyoNSfp7TXgS2TbDpHa0Hzg8= =NSgI -----END PGP SIGNATURE----- --OgNSUDtuiixoyean--