Go to the documentation of this file.
21 #ifndef _V4L2_DEVICE_H
22 #define _V4L2_DEVICE_H
35 #define V4L2_DEVICE_NAME_SIZE (20 + 16)
44 #if defined(CONFIG_MEDIA_CONTROLLER)
69 static inline void v4l2_device_get(
struct v4l2_device *v4l2_dev)
71 kref_get(&v4l2_dev->
ref);
124 #define v4l2_device_for_each_subdev(sd, v4l2_dev) \
125 list_for_each_entry(sd, &(v4l2_dev)->subdevs, list)
130 #define __v4l2_device_call_subdevs_p(v4l2_dev, sd, cond, o, f, args...) \
132 list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) \
133 if ((cond) && (sd)->ops->o && (sd)->ops->o->f) \
134 (sd)->ops->o->f((sd) , ##args); \
137 #define __v4l2_device_call_subdevs(v4l2_dev, cond, o, f, args...) \
139 struct v4l2_subdev *__sd; \
141 __v4l2_device_call_subdevs_p(v4l2_dev, __sd, cond, o, \
149 #define __v4l2_device_call_subdevs_until_err_p(v4l2_dev, sd, cond, o, f, args...) \
153 list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) { \
154 if ((cond) && (sd)->ops->o && (sd)->ops->o->f) \
155 __err = (sd)->ops->o->f((sd) , ##args); \
156 if (__err && __err != -ENOIOCTLCMD) \
159 (__err == -ENOIOCTLCMD) ? 0 : __err; \
162 #define __v4l2_device_call_subdevs_until_err(v4l2_dev, cond, o, f, args...) \
164 struct v4l2_subdev *__sd; \
165 __v4l2_device_call_subdevs_until_err_p(v4l2_dev, __sd, cond, o, \
172 #define v4l2_device_call_all(v4l2_dev, grpid, o, f, args...) \
174 struct v4l2_subdev *__sd; \
176 __v4l2_device_call_subdevs_p(v4l2_dev, __sd, \
177 !(grpid) || __sd->grp_id == (grpid), o, f , \
185 #define v4l2_device_call_until_err(v4l2_dev, grpid, o, f, args...) \
187 struct v4l2_subdev *__sd; \
188 __v4l2_device_call_subdevs_until_err_p(v4l2_dev, __sd, \
189 !(grpid) || __sd->grp_id == (grpid), o, f , \