[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7b581014-a351-4077-8832-d3d347b4fdb5@prolan.hu>
Date: Wed, 5 Feb 2025 09:57:15 +0100
From: Csókás Bence <csokas.bence@...lan.hu>
To: William Breathitt Gray <wbg@...nel.org>
CC: <linux-arm-kernel@...ts.infradead.org>, <linux-iio@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, Kamel Bouhara <kamel.bouhara@...tlin.com>
Subject: Re: [PATCH v2 2/2] counter: microchip-tcb-capture: Add capture
extensions for registers RA-RC
Hi,
On 2025. 02. 05. 1:11, William Breathitt Gray wrote:
> On Mon, Feb 03, 2025 at 05:29:53PM +0100, Bence Csókás wrote:
>> TCB hardware is capable of capturing the timer value to registers RA and
>> RB. On top, it is capable of triggering on compare against a third
>> register, RC. Add these registers as extensions.
>>
>> Signed-off-by: Bence Csókás <csokas.bence@...lan.hu>
>
> What is the difference between RA and RB (your code looks like they
> represent two distinct event channels, so I want to confirm)? Is RC a
> threshold value set by the user, or is it another captured timer value?
> The capture extension represents Count value specifically, so I want to
> make sure we're using the right extension for these components.
RA, RB and RC are three R/W-able "general purpose" hardware registers.
The HW additionally has the following capabilities:
* in PWM mode (not used by this driver), send an interrupt on compare to
RA/B/C, and/or change output signals
* in Counter Capture mode (used here):
* trigger interrupt on RC compare only
* on external trigger rising/falling edge, sample Counter Value
Register (CV) to RA/RB, optionally send an interrupt of this change
* stop counting after sampling to RB
All of this is enable-able of course.
So yes, RA and RB can be thought of two near-identical, separate
channels. Since they both sample CV, it made sense to use
COUNTER_EVENT_CAPTURE. RC is indeed set by the user.
Bence
Powered by blists - more mailing lists