Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cx23885-ir.c
Go to the documentation of this file.
1 /*
2  * Driver for the Conexant CX23885/7/8 PCIe bridge
3  *
4  * Infrared device support routines - non-input, non-vl42_subdev routines
5  *
6  * Copyright (C) 2009 Andy Walls <[email protected]>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  * 02110-1301, USA.
22  */
23 
24 #include <media/v4l2-device.h>
25 
26 #include "cx23885.h"
27 #include "cx23885-input.h"
28 
29 #define CX23885_IR_RX_FIFO_SERVICE_REQ 0
30 #define CX23885_IR_RX_END_OF_RX_DETECTED 1
31 #define CX23885_IR_RX_HW_FIFO_OVERRUN 2
32 #define CX23885_IR_RX_SW_FIFO_OVERRUN 3
33 
34 #define CX23885_IR_TX_FIFO_SERVICE_REQ 0
35 
36 
38 {
39  struct cx23885_dev *dev =
40  container_of(work, struct cx23885_dev, ir_rx_work);
41  u32 events = 0;
42  unsigned long *notifications = &dev->ir_rx_notifications;
43 
52 
53  if (events == 0)
54  return;
55 
56  if (dev->kernel_ir)
57  cx23885_input_rx_work_handler(dev, events);
58 }
59 
61 {
62  struct cx23885_dev *dev =
63  container_of(work, struct cx23885_dev, ir_tx_work);
64  u32 events = 0;
65  unsigned long *notifications = &dev->ir_tx_notifications;
66 
69 
70  if (events == 0)
71  return;
72 
73 }
74 
75 /* Possibly called in an IRQ context */
77 {
78  struct cx23885_dev *dev = to_cx23885(sd->v4l2_dev);
79  unsigned long *notifications = &dev->ir_rx_notifications;
80 
86  set_bit(CX23885_IR_RX_HW_FIFO_OVERRUN, notifications);
88  set_bit(CX23885_IR_RX_SW_FIFO_OVERRUN, notifications);
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)
96  else
98 }
99 
100 /* Possibly called in an IRQ context */
102 {
103  struct cx23885_dev *dev = to_cx23885(sd->v4l2_dev);
104  unsigned long *notifications = &dev->ir_tx_notifications;
105 
107  set_bit(CX23885_IR_TX_FIFO_SERVICE_REQ, notifications);
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)
115  else
116  schedule_work(&dev->ir_tx_work);
117 }