summaryrefslogtreecommitdiffstats
path: root/include/media/cec-pin.h
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2017-08-16 09:13:02 +0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-08-20 14:15:00 +0200
commitcb7474949371ba8d7591a62924f05b627a2601d9 (patch)
treeb955604c97aee25488af1724241cf15dd3ed9357 /include/media/cec-pin.h
parentmedia: cec: rename pin events/function (diff)
downloadlinux-cb7474949371ba8d7591a62924f05b627a2601d9.tar.xz
linux-cb7474949371ba8d7591a62924f05b627a2601d9.zip
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/cec-pin.h')
-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 44b82d29d480..d28d07fa312e 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;