diff options
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-ir.c')
-rw-r--r-- | drivers/media/video/cx23885/cx23885-ir.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/media/video/cx23885/cx23885-ir.c b/drivers/media/video/cx23885/cx23885-ir.c index 6ceabd4fba07..7125247dd255 100644 --- a/drivers/media/video/cx23885/cx23885-ir.c +++ b/drivers/media/video/cx23885/cx23885-ir.c | |||
@@ -72,7 +72,7 @@ void cx23885_ir_tx_work_handler(struct work_struct *work) | |||
72 | 72 | ||
73 | } | 73 | } |
74 | 74 | ||
75 | /* Called in an IRQ context */ | 75 | /* Possibly called in an IRQ context */ |
76 | void cx23885_ir_rx_v4l2_dev_notify(struct v4l2_subdev *sd, u32 events) | 76 | void cx23885_ir_rx_v4l2_dev_notify(struct v4l2_subdev *sd, u32 events) |
77 | { | 77 | { |
78 | struct cx23885_dev *dev = to_cx23885(sd->v4l2_dev); | 78 | struct cx23885_dev *dev = to_cx23885(sd->v4l2_dev); |
@@ -86,10 +86,18 @@ void cx23885_ir_rx_v4l2_dev_notify(struct v4l2_subdev *sd, u32 events) | |||
86 | set_bit(CX23885_IR_RX_HW_FIFO_OVERRUN, notifications); | 86 | set_bit(CX23885_IR_RX_HW_FIFO_OVERRUN, notifications); |
87 | if (events & V4L2_SUBDEV_IR_RX_SW_FIFO_OVERRUN) | 87 | if (events & V4L2_SUBDEV_IR_RX_SW_FIFO_OVERRUN) |
88 | set_bit(CX23885_IR_RX_SW_FIFO_OVERRUN, notifications); | 88 | set_bit(CX23885_IR_RX_SW_FIFO_OVERRUN, notifications); |
89 | schedule_work(&dev->ir_rx_work); | 89 | |
90 | /* | ||
91 | * For the integrated AV core, we are already in a workqueue context. | ||
92 | * For the CX23888 integrated IR, we are in an interrupt context. | ||
93 | */ | ||
94 | if (sd == dev->sd_cx25840) | ||
95 | cx23885_ir_rx_work_handler(&dev->ir_rx_work); | ||
96 | else | ||
97 | schedule_work(&dev->ir_rx_work); | ||
90 | } | 98 | } |
91 | 99 | ||
92 | /* Called in an IRQ context */ | 100 | /* Possibly called in an IRQ context */ |
93 | void cx23885_ir_tx_v4l2_dev_notify(struct v4l2_subdev *sd, u32 events) | 101 | void cx23885_ir_tx_v4l2_dev_notify(struct v4l2_subdev *sd, u32 events) |
94 | { | 102 | { |
95 | struct cx23885_dev *dev = to_cx23885(sd->v4l2_dev); | 103 | struct cx23885_dev *dev = to_cx23885(sd->v4l2_dev); |
@@ -97,5 +105,13 @@ void cx23885_ir_tx_v4l2_dev_notify(struct v4l2_subdev *sd, u32 events) | |||
97 | 105 | ||
98 | if (events & V4L2_SUBDEV_IR_TX_FIFO_SERVICE_REQ) | 106 | if (events & V4L2_SUBDEV_IR_TX_FIFO_SERVICE_REQ) |
99 | set_bit(CX23885_IR_TX_FIFO_SERVICE_REQ, notifications); | 107 | set_bit(CX23885_IR_TX_FIFO_SERVICE_REQ, notifications); |
100 | schedule_work(&dev->ir_tx_work); | 108 | |
109 | /* | ||
110 | * For the integrated AV core, we are already in a workqueue context. | ||
111 | * For the CX23888 integrated IR, we are in an interrupt context. | ||
112 | */ | ||
113 | if (sd == dev->sd_cx25840) | ||
114 | cx23885_ir_tx_work_handler(&dev->ir_tx_work); | ||
115 | else | ||
116 | schedule_work(&dev->ir_tx_work); | ||
101 | } | 117 | } |