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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3BC5C2BB41 for ; Tue, 16 Aug 2022 09:51:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234026AbiHPJvE (ORCPT ); Tue, 16 Aug 2022 05:51:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234160AbiHPJug (ORCPT ); Tue, 16 Aug 2022 05:50:36 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8161BC743A for ; Tue, 16 Aug 2022 01:11:41 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id gk3so17502035ejb.8 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=d8Z29SxQmB6Mfw98f09+v71oLUWOaiWI5VUUSMuUp4bImNznDMmV+eMzAH5Bumd9BO BVGPt72Ac4yg8qUzWtJ7ks8f6GAOpBRFvYp5/+vj7G14S56OXQkI5GSXDZRGB8vLHheX KheRyHNCFYncnkqcyvKD/ueR2SsF9BtV0c607lRdwuOgb25g1dQb4PsBY40gQ1MlzEdT PUVJE9S7QVmHzdZNR1E5FKkrdhhKbSl1Mh2gr3B3T7mxX2UQVV7ZAuui80Mxdi83dB1p 0hGUrgNBYwOi0sPKqsy0rKxbbN9a22gNRw3E+ylIsNj2nnaFSz0LSA/NJBo6D0mtCLZN +PTg== X-Gm-Message-State: ACgBeo3+aInJ7Rc3AnrZZXEzL8JopHgwzayQxfp0AEiYiB0D6idTJ4B1 PScy5j7vY4HNbX+6fgwBr6M+5Q== X-Google-Smtp-Source: AA6agR4WrdhecqaaLYVQ7wHTuKDpRrGzTG8WAdXe81yRK8N0ygsJbeUh5JlV6PmM5HfJe1+47RuRww== 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 Precedence: bulk List-ID: X-Mailing-List: devicetree@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 ?