Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3448983rwb; Tue, 16 Aug 2022 03:18:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR4evPcuSXikKfO0DZcUjAKGtOB/YgzPeFv3WWBgnsl/ZQcrzlPEnIV9d72G3NkL4IUKlbbj X-Received: by 2002:a17:907:2e19:b0:730:acf0:4921 with SMTP id ig25-20020a1709072e1900b00730acf04921mr12283200ejc.416.1660645137814; Tue, 16 Aug 2022 03:18:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660645137; cv=none; d=google.com; s=arc-20160816; b=k/wjWo6EyrMr4q1J2BuJ13jy7vtB6qREW7VdXWPb+em+jZm8r9YzRVqmghlg3KnlMU o/gXgB3bhL9YiMKskWxps8ahkhNmBWgDyJQrL/k6n38V9bWjZ+VR6kxGRXnEBr/CAmn5 /nRnqOnVQPWSs71D4w6skJVcgAnT3OOhgSpRdzWHtIgA53Kog9r4DlmZ8BzE3tioAMYZ 5M6hJO35URRY0yLqWT1dPnopcjkApx5Zq1Ar2jtNT/W3Zg97ws3ppB+KDyAO9/IJDhZr T4O0QFN74rb6ni71odZHgIM8RlZ96Se2T7cTJwpbXzC/nCMbJQUFAkNMCfICRMzbXB12 XqIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=W5qjF+03yjl4vJJBs76s6kPKVqJeVUsMt0AyY8twYsQ=; b=C7KWa6XXX0SviAac6hn2MB+bl5T1t5XxEcaeAEcEjTVhn8yHCnMuxw0dB+QgFiCKb4 KZ6XAdh/21fJY/ltL6qj6I786puMX+Bg8aFfm8t0/EGZ9R4pYLAPK/lHcfiT5L1K4k06 SnYAwImqtS4AX7+S4N9+N9/4IEWsTb9hpCMGVo/qgKZ6YwktHwh6cdDyYLBE/8fy8ek9 3Ys7riepYKx6jFZD2Qc98Wo1bYAhKDzdnH3yzk++RCkGGAaP48EPeSiLH6pXcbgKPfOk YIOHx6s2mH0atJ6bYoYZabIUfFZegPXgmwSt2uncVIGt3TOmvi3WKQC3OPAlnMCqP259 pGBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=a31uzct1; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i13-20020a1709064fcd00b00734bbe8d2f7si10649997ejw.952.2022.08.16.03.18.27; Tue, 16 Aug 2022 03:18:57 -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=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=a31uzct1; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234095AbiHPKGO (ORCPT + 99 others); Tue, 16 Aug 2022 06:06:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234190AbiHPKFL (ORCPT ); Tue, 16 Aug 2022 06:05:11 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 016C8C6CD1 for ; Tue, 16 Aug 2022 01:11:40 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id uj29so17568270ejc.0 for ; Tue, 16 Aug 2022 01:11:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=W5qjF+03yjl4vJJBs76s6kPKVqJeVUsMt0AyY8twYsQ=; b=a31uzct1G3C9D+Hs2qHPBGDerVJo1D+cDFBOyXDZSEkBthnRBULx8L05BG1z4Nz+vB DlWvwn77Tw3lX8P+LXQ1P+3WsLW4h4nq4mtuqyh233rjBsC0l+Z4ljNbcsh1tWBYy/cQ TrvXLv3+OD7spjwanEqomikpoS2aXmgZ6O4kRPp5m0FeDgxEU4lYUr4zl6QjJLdnkHr0 wiIznDUa21X6AddFwyVviVV15YX3yGbXDhI1P3P13Vi4a9NzRijk9nXmDiEX4SiCzh2i smMr8cxGrPjWXTRKjFfOwBEVcr3Fbz8TFyNWD6FbEJxSsDYLRgLKZd0/URunHsAi5UEm NThw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=W5qjF+03yjl4vJJBs76s6kPKVqJeVUsMt0AyY8twYsQ=; b=zI8nUgZ5nOEmYj9nWBYuWlVPZphBuUTWWJm1DP9H5DGPi5DQh0rsPgV4lWdwaFJShr 1HDaNH7mtzZeLDquedjRJVxVYV1p3xvK8ODDdVE3PHo7KB7a8M7zTKaDGwQCgpEgjuxG cVxr8BYM7Xq2B7wIrwYq0w+QdT5jAB5V0xo9c9Rv6u9ov3PVkBN60qsGz8N4znYQelwQ cT7iBuWIPBpwvl58uPJ1C1+3wzjYGyL9V9pOsIBAq74igo8MjVEB+f0MiyyUUPAcxwFV nTfiINh4yNuLFcWSybPWewQ26O/j8AQ1BOt6lITyBTBtgvqwtI0U2VlX1lXSmLgLSpBc Yumw== X-Gm-Message-State: ACgBeo0KVCj6wbktkbg5kh3wRqiyq/lx8j46U1WaKYvjgCFDlt6XEh5l rQQry3RpaLffDGW0ALQQQ7Lj9A== X-Received: by 2002:a17:907:762f:b0:730:95d9:9955 with SMTP id jy15-20020a170907762f00b0073095d99955mr12330008ejc.505.1660637497239; Tue, 16 Aug 2022 01:11:37 -0700 (PDT) Received: from [192.168.1.69] (120.205.87.79.rev.sfr.net. [79.87.205.120]) by smtp.gmail.com with ESMTPSA id f25-20020a50fc99000000b004424429afd4sm8078244edq.16.2022.08.16.01.11.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Aug 2022 01:11:36 -0700 (PDT) Message-ID: <0730c493-b49f-02f5-c0e7-999d5871dc4a@baylibre.com> Date: Tue, 16 Aug 2022 10:11:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.1.0 Subject: Re: [PATCH v4 3/3] counter: capture-tiecap: capture driver support for ECAP Content-Language: en-US To: William Breathitt Gray Cc: vilhelm.gray@gmail.com, 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 References: <20220810140724.182389-1-jpanis@baylibre.com> <20220810140724.182389-4-jpanis@baylibre.com> From: Julien Panis In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On 15/08/2022 13:20, William Breathitt Gray wrote: > On Sun, Aug 14, 2022 at 01:03:48PM -0400, William Breathitt Gray wrote: >> On Wed, Aug 10, 2022 at 04:07:24PM +0200, Julien Panis wrote: >>> +static int ecap_cnt_function_read(struct counter_device *counter, >>> + struct counter_count *count, >>> + enum counter_function *function) >>> +{ >>> + *function = COUNTER_FUNCTION_INCREASE; >>> + >>> + return 0; >>> +} >>> + >>> +static int ecap_cnt_action_read(struct counter_device *counter, >>> + struct counter_count *count, >>> + struct counter_synapse *synapse, >>> + enum counter_synapse_action *action) >>> +{ >>> + *action = COUNTER_SYNAPSE_ACTION_BOTH_EDGES; >>> + >>> + return 0; >>> +} >> Right now you have a Signal defined for the ECAPSIG line, but there is >> at least one more relevant Signal to define: the clock updating ECAPCNT. >> The Synapse action of COUNTER_SYNAPSE_ACTION_BOTH_EDGES is for that >> clock Signal, but for the ECAPSIG Signal you will need to report a >> Synapse action based on the polarity of the next capture (i.e. whether >> high or low). > I need to make a correction here. IIUC, the ECAPSIG signal doesn't > affect the count value of ECAPCNT (ECAPSIG only triggers the captures), > so the Synapse action for ECAPSIG should always be > COUNTER_SYNAPSE_ACTION_NONE. You don't need to account for the capture > polarities because they're not relevant in this particular situation: > ECAPSIG doesn't trigger the ECAPCNT count function. > > William Breathitt Gray It appears to me that you spoke about TSCNT register content (32 bits). So, you were not talking about the Mod4 counter (2 bits). Do you confirm that ?