Skip to contentSkip to conversation

counter: 104-quad-8: Fix Synapse action reported for Index signals

PATCH Applied William Breathitt Gray 2 participants 2 messages Mar 16, 2023 – Mar 18, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 counter: 104-quad-8: Fix Synapse action reported for Index signals

Signal 16 and higher represent the device's Index lines. The priv->preset_enable array holds the device configuration for these Index lines. The preset_enable configuration is active low on the device, so invert the conditional check in quad8_action_read() to properly handle the logical state of preset_enable.

Fixes f1d8a071d45b ("counter: 104-quad-8: Add Generic Counter interface support")
---
 drivers/counter/104-quad-8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/counter/104-quad-8.c +1 -1
index deed4afadb29..529bce4ee631 100644
@@ -378,7 +378,7 @@ static int quad8_action_read(struct counter_device *counter,
 
 	/* Handle Index signals */
 	if (synapse->signal->id >= 16) {
-		if (priv->preset_enable[count->id])
+		if (!priv->preset_enable[count->id])
 			*action = COUNTER_SYNAPSE_ACTION_RISING_EDGE;
 		else
 			*action = COUNTER_SYNAPSE_ACTION_NONE;

base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6

Signature · 1 line
2.39.2
maintainer Applied
#1 lore raw
Quoted 9 lines · William Breathitt Gray

Signal 16 and higher represent the device's Index lines. The priv->preset_enable array holds the device configuration for these Index lines. The preset_enable configuration is active low on the device, so invert the conditional check in quad8_action_read() to properly handle the logical state of preset_enable.

Fixes f1d8a071d45b ("counter: 104-quad-8: Add Generic Counter interface support")

Applied to counter-fixes.

William Breathitt Gray