Skip to content

Commit 7decb65

Browse files
Dharma-Bgregkh
authored andcommitted
counter: microchip-tcb-capture: Fix the use of internal GCLK logic
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]>
1 parent a177771 commit 7decb65

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
@@ -111,7 +111,7 @@ static int mchp_tc_count_function_set(struct counter_device *counter,
111111
priv->qdec_mode = 0;
112112
/* Set highest rate based on whether soc has gclk or not */
113113
bmr &= ~(ATMEL_TC_QDEN | ATMEL_TC_POSEN);
114-
if (priv->tc_cfg->has_gclk)
114+
if (!priv->tc_cfg->has_gclk)
115115
cmr |= ATMEL_TC_TIMER_CLOCK2;
116116
else
117117
cmr |= ATMEL_TC_TIMER_CLOCK1;

0 commit comments

Comments
 (0)