summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2017-08-16 03:13:02 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-08-20 08:15:00 -0400
commitcb7474949371ba8d7591a62924f05b627a2601d9 (patch)
treeb955604c97aee25488af1724241cf15dd3ed9357 /include/media
parent9a6b2a87405a5022660022722d4a830b768e8033 (diff)
downloadop-kernel-dev-cb7474949371ba8d7591a62924f05b627a2601d9.zip
op-kernel-dev-cb7474949371ba8d7591a62924f05b627a2601d9.tar.gz
media: cec-pin: fix irq handling
The free_irq() function could be called from interrupt context, which is invalid. Move this to the thread. In the interrupt handler we just request that the thread disables the irq. This is done through an atomic so we don't need to add any spinlocks. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/cec-pin.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/media/cec-pin.h b/include/media/cec-pin.h
index 44b82d2..d28d07fa 100644
--- a/include/media/cec-pin.h
+++ b/include/media/cec-pin.h
@@ -113,6 +113,10 @@ struct cec_pin_ops {
#define CEC_NUM_PIN_EVENTS 128
+#define CEC_PIN_IRQ_UNCHANGED 0
+#define CEC_PIN_IRQ_DISABLE 1
+#define CEC_PIN_IRQ_ENABLE 2
+
struct cec_pin {
struct cec_adapter *adap;
const struct cec_pin_ops *ops;
@@ -137,8 +141,8 @@ struct cec_pin {
struct cec_msg work_rx_msg;
u8 work_tx_status;
- bool work_enable_irq;
ktime_t work_tx_ts;
+ atomic_t work_irq_change;
atomic_t work_pin_events;
unsigned int work_pin_events_wr;
unsigned int work_pin_events_rd;
OpenPOWER on IntegriCloud