Skip to content

Commit df8fdd0

Browse files
Dharma-BWilliam Breathitt Gray
authored andcommitted
counter: microchip-tcb-capture: Fix the use of internal GCLK logic
As per the datasheet, the clock selection Bits 2:0 – TCCLKS[2:0] should be set to 0 while using the internal GCLK (TIMER_CLOCK1). Fixes: 106b104 ("counter: Add microchip TCB capture counter") Signed-off-by: Dharma Balasubiramani <dharma.b@microchip.com> Link: https://lore.kernel.org/r/20230905100835.315024-1-dharma.b@microchip.com Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
1 parent 3170256 commit df8fdd0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/counter/microchip-tcb-capture.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static int mchp_tc_count_function_write(struct counter_device *counter,
9898
priv->qdec_mode = 0;
9999
/* Set highest rate based on whether soc has gclk or not */
100100
bmr &= ~(ATMEL_TC_QDEN | ATMEL_TC_POSEN);
101-
if (priv->tc_cfg->has_gclk)
101+
if (!priv->tc_cfg->has_gclk)
102102
cmr |= ATMEL_TC_TIMER_CLOCK2;
103103
else
104104
cmr |= ATMEL_TC_TIMER_CLOCK1;

0 commit comments

Comments
 (0)