summaryrefslogtreecommitdiffstats
path: root/drivers/media/cec/core
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2023-07-07 13:26:41 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-08-10 07:58:32 +0200
commit2f4d3718cc92d8c200a7f662e3afbaa9b1555e08 (patch)
tree0b5320459cf38bad7427d3b622ff648b37950365 /drivers/media/cec/core
parentbbe9cfc713f651b8ba7e38e91863896e7abf3032 (diff)
downloadlinux-2f4d3718cc92d8c200a7f662e3afbaa9b1555e08.tar.gz
linux-2f4d3718cc92d8c200a7f662e3afbaa9b1555e08.tar.bz2
linux-2f4d3718cc92d8c200a7f662e3afbaa9b1555e08.zip
media: cec-pin: only enable interrupts when monitoring the CEC pin
The CEC interrupt is only needed if userspace wants to monitor the CEC pin for an unconfigured CEC device. That gives it the most precise CEC pin debugging results. This avoids a corner case where the interrupt is enabled for a short period when the adapter is about to be configured. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/cec/core')
-rw-r--r--drivers/media/cec/core/cec-pin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/cec/core/cec-pin.c b/drivers/media/cec/core/cec-pin.c
index 8a3921fc9c99..330d5d5d86ab 100644
--- a/drivers/media/cec/core/cec-pin.c
+++ b/drivers/media/cec/core/cec-pin.c
@@ -982,7 +982,7 @@ static enum hrtimer_restart cec_pin_timer(struct hrtimer *timer)
}
if (pin->state != CEC_ST_IDLE || pin->ops->enable_irq == NULL ||
pin->enable_irq_failed || adap->is_configuring ||
- adap->is_configured || adap->monitor_all_cnt)
+ adap->is_configured || adap->monitor_all_cnt || !adap->monitor_pin_cnt)
break;
/* Switch to interrupt mode */
atomic_set(&pin->work_irq_change, CEC_PIN_IRQ_ENABLE);
@@ -1317,7 +1317,7 @@ void cec_pin_changed(struct cec_adapter *adap, bool value)
cec_pin_update(pin, value, false);
if (!value && (adap->is_configuring || adap->is_configured ||
- adap->monitor_all_cnt))
+ adap->monitor_all_cnt || !adap->monitor_pin_cnt))
atomic_set(&pin->work_irq_change, CEC_PIN_IRQ_DISABLE);
}
EXPORT_SYMBOL_GPL(cec_pin_changed);