summaryrefslogtreecommitdiff
path: root/drivers/media/platform/cec-gpio
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2017-09-25 11:02:57 +0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2017-10-04 23:04:18 +0300
commit5b2c8da1b040c4608c7cfdc0dd96bcaa190af268 (patch)
tree80ec377a7821f1633a7f298458c589a2da47bd51 /drivers/media/platform/cec-gpio
parent6c3b047fa2d2286d5e438bcb470c7b1a49f415f6 (diff)
downloadlinux-5b2c8da1b040c4608c7cfdc0dd96bcaa190af268.tar.xz
[media] cec-gpio: don't generate spurious HPD events
Only send HPD_LOW/HIGH event if the gpio actually changed value. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/cec-gpio')
-rw-r--r--drivers/media/platform/cec-gpio/cec-gpio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/platform/cec-gpio/cec-gpio.c b/drivers/media/platform/cec-gpio/cec-gpio.c
index eb982bce99fc..5debdf08fbe7 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;
}