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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: William Breathitt Gray <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Dharma-B authored and gregkh committed Oct 19, 2023
1 parent 837b246 commit 8c4f6d1
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 @@ -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;
Expand Down

0 comments on commit 8c4f6d1

Please sign in to comment.