Skip to content

Commit

Permalink
counter: microchip-tcb-capture: Fix the use of internal GCLK logic
Browse files Browse the repository at this point in the history
commit df8fdd0 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Dharma Balasubiramani authored and Greg Kroah-Hartman committed Oct 25, 2023
1 parent a177771 commit 7decb65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/counter/microchip-tcb-capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static int mchp_tc_count_function_set(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;
Expand Down

0 comments on commit 7decb65

Please sign in to comment.