All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cec-gpio: don't generate spurious HPD events
@ 2017-09-25  8:02 Hans Verkuil
  0 siblings, 0 replies; only message in thread
From: Hans Verkuil @ 2017-09-25  8:02 UTC (permalink / raw)
  To: Linux Media Mailing List

Only send HPD_LOW/HIGH event if the gpio actually changed value.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
diff --git a/drivers/media/platform/cec-gpio/cec-gpio.c b/drivers/media/platform/cec-gpio/cec-gpio.c
index 548c9dffec73..4a96856f8b36 100644
--- a/drivers/media/platform/cec-gpio/cec-gpio.c
+++ b/drivers/media/platform/cec-gpio/cec-gpio.c
@@ -80,9 +80,12 @@ static irqreturn_t cec_hpd_gpio_irq_handler_thread(int irq, void *priv)
 static irqreturn_t cec_hpd_gpio_irq_handler(int irq, void *priv)
 {
 	struct cec_gpio *cec = priv;
+	bool is_high = gpiod_get_value(cec->hpd_gpio);

+	if (is_high == cec->hpd_is_high)
+		return IRQ_HANDLED;
 	cec->hpd_ts = ktime_get();
-	cec->hpd_is_high = gpiod_get_value(cec->hpd_gpio);
+	cec->hpd_is_high = is_high;
 	return IRQ_WAKE_THREAD;
 }

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-09-25  8:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-25  8:02 [PATCH] cec-gpio: don't generate spurious HPD events Hans Verkuil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.