Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

counter: interrupt-cnt: add counter_push_event()

Add counter_push_event() to notify user space about new pulses

Link: https://lore.kernel.org/r/20220203135727.2374052-3-o.rempel@pengutronix.de
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Link: https://lore.kernel.org/r/9da3460113b5092e8658e12f23578567aab7cc5f.1647373009.git.vilhelm.gray@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Oleksij Rempel and committed by
Greg Kroah-Hartman
257e3df4 73799a88

+5 -2
+5 -2
drivers/counter/interrupt-cnt.c
··· 26 26 27 27 static irqreturn_t interrupt_cnt_isr(int irq, void *dev_id) 28 28 { 29 - struct interrupt_cnt_priv *priv = dev_id; 29 + struct counter_device *counter = dev_id; 30 + struct interrupt_cnt_priv *priv = counter_priv(counter); 30 31 31 32 atomic_inc(&priv->count); 33 + 34 + counter_push_event(counter, COUNTER_EVENT_CHANGE_OF_STATE, 0); 32 35 33 36 return IRQ_HANDLED; 34 37 } ··· 212 209 irq_set_status_flags(priv->irq, IRQ_NOAUTOEN); 213 210 ret = devm_request_irq(dev, priv->irq, interrupt_cnt_isr, 214 211 IRQF_TRIGGER_RISING | IRQF_NO_THREAD, 215 - dev_name(dev), priv); 212 + dev_name(dev), counter); 216 213 if (ret) 217 214 return ret; 218 215