29 #include <linux/sched.h>
30 #include <linux/slab.h>
31 #include <linux/export.h>
47 spin_unlock_irqrestore(&fh->
vdev->fh_lock, flags);
59 kev->
sev->first = sev_pos(kev->
sev, 1);
62 spin_unlock_irqrestore(&fh->
vdev->fh_lock, flags);
73 return __v4l2_event_dequeue(fh, event);
85 ret = __v4l2_event_dequeue(fh, event);
104 if (sev->type == type && sev->
id ==
id)
118 sev = v4l2_event_subscribed(fh, ev->type, ev->id);
136 kev = sev->
events + sev_pos(sev, 0);
139 sev->
first = sev_pos(sev, 1);
141 if (sev->
elems == 1) {
142 if (sev->
ops && sev->
ops->replace) {
144 copy_payload =
false;
146 }
else if (sev->
ops && sev->
ops->merge) {
148 sev->
events + sev_pos(sev, 0);
155 kev->
event.type = ev->type;
157 kev->
event.u = ev->u;
158 kev->
event.id = ev->id;
160 kev->
event.sequence = fh->sequence;
180 __v4l2_event_queue_fh(fh, ev, ×tamp);
182 spin_unlock_irqrestore(&vdev->
fh_lock, flags);
194 __v4l2_event_queue_fh(fh, ev, ×tamp);
195 spin_unlock_irqrestore(&fh->
vdev->fh_lock, flags);
222 for (i = 0; i <
elems; i++)
231 found_ev = v4l2_event_subscribed(fh, sub->
type, sub->
id);
234 spin_unlock_irqrestore(&fh->
vdev->fh_lock, flags);
241 if (sev->
ops && sev->
ops->add) {
242 int ret = sev->
ops->add(sev, elems);
273 spin_unlock_irqrestore(&fh->
vdev->fh_lock, flags);
294 sev = v4l2_event_subscribed(fh, sub->
type, sub->
id);
297 for (i = 0; i < sev->
in_use; i++) {
304 spin_unlock_irqrestore(&fh->
vdev->fh_lock, flags);
306 if (sev && sev->
ops && sev->
ops->del)