Commit df8fdd01 authored by Dharma Balasubiramani's avatar Dharma Balasubiramani Committed by William Breathitt Gray

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: 106b1041 ("counter: Add microchip TCB capture counter")
Signed-off-by: default avatarDharma Balasubiramani <dharma.b@microchip.com>
Link: https://lore.kernel.org/r/20230905100835.315024-1-dharma.b@microchip.comSigned-off-by: default avatarWilliam Breathitt Gray <william.gray@linaro.org>
parent 3170256d
......@@ -98,7 +98,7 @@ static int mchp_tc_count_function_write(struct counter_device *counter,
priv->qdec_mode = 0;
/* Set highest rate based on whether soc has gclk or not */
bmr &= ~(ATMEL_TC_QDEN | ATMEL_TC_POSEN);
if (priv->tc_cfg->has_gclk)
if (!priv->tc_cfg->has_gclk)
cmr |= ATMEL_TC_TIMER_CLOCK2;
else
cmr |= ATMEL_TC_TIMER_CLOCK1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment