Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b2c8da1 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[media] cec-gpio: don't generate spurious HPD events



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

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 6c3b047f
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -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)
static irqreturn_t cec_hpd_gpio_irq_handler(int irq, void *priv)
{
{
	struct cec_gpio *cec = 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_ts = ktime_get();
	cec->hpd_is_high = gpiod_get_value(cec->hpd_gpio);
	cec->hpd_is_high = is_high;
	return IRQ_WAKE_THREAD;
	return IRQ_WAKE_THREAD;
}
}