[PATCH v3 04/10] counter: stm32-timer-cnt: introduce clock signal
William Breathitt Gray
william.gray at linaro.org
Mon Jan 8 08:46:37 PST 2024
On Wed, Dec 20, 2023 at 03:57:20PM +0100, Fabrice Gasnier wrote:
> Introduce the internal clock signal, used to count when in simple rising
> function. Also add the "frequency" extension to the clock signal.
>
> With this patch, signal action reports a consistent state when "increase"
> function is used, and the counting frequency:
> $ echo increase > function
> $ grep -H "" signal*_action
> signal0_action:none
> signal1_action:none
> signal2_action:rising edge
> $ echo 1 > enable
> $ cat count
> 25425
> $ cat count
> 44439
> $ cat ../signal2/frequency
> 208877930
>
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier at foss.st.com>
Reviewed-by: William Breathitt Gray <william.gray at linaro.org>
The code is all right, but some minor suggestions below.
> +static struct counter_comp stm32_count_clock_ext[] = {
> + COUNTER_COMP_SIGNAL_U64("frequency", stm32_count_clk_get_freq, NULL),
It might be worth introducing a new COUNTER_COMP_FREQUENCY() macro now
that we have a second driver with the 'frequency' extension
(ti-ecap-capture also has 'frequency'). But it's up to you if you want
to add a precursor patch to this series, or I'll introduce it separately
myself in a independent patch.
> @@ -287,7 +321,13 @@ static struct counter_signal stm32_signals[] = {
> {
> .id = STM32_CH2_SIG,
> .name = "Channel 2"
> - }
> + },
> + {
> + .id = STM32_CLOCK_SIG,
> + .name = "Clock Signal",
The word "Signal" feels unnecessary to me when both the sysfs path and
data structure will have 'signal' already. Do you think "Clock" by
itself is clear enough?
William Breathitt Gray
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20240108/f20c4846/attachment.sig>
More information about the linux-arm-kernel
mailing list