Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
v4l2-device.h File Reference
#include <media/media-device.h>
#include <media/v4l2-subdev.h>
#include <media/v4l2-dev.h>

Go to the source code of this file.

Data Structures

struct  v4l2_device
 

Macros

#define V4L2_DEVICE_NAME_SIZE   (20 + 16)
 
#define v4l2_device_for_each_subdev(sd, v4l2_dev)   list_for_each_entry(sd, &(v4l2_dev)->subdevs, list)
 
#define __v4l2_device_call_subdevs_p(v4l2_dev, sd, cond, o, f, args...)
 
#define __v4l2_device_call_subdevs(v4l2_dev, cond, o, f, args...)
 
#define __v4l2_device_call_subdevs_until_err_p(v4l2_dev, sd, cond, o, f, args...)
 
#define __v4l2_device_call_subdevs_until_err(v4l2_dev, cond, o, f, args...)
 
#define v4l2_device_call_all(v4l2_dev, grpid, o, f, args...)
 
#define v4l2_device_call_until_err(v4l2_dev, grpid, o, f, args...)
 

Functions

int v4l2_device_put (struct v4l2_device *v4l2_dev)
 
int __must_check v4l2_device_register (struct device *dev, struct v4l2_device *v4l2_dev)
 
int v4l2_device_set_name (struct v4l2_device *v4l2_dev, const char *basename, atomic_t *instance)
 
void v4l2_device_disconnect (struct v4l2_device *v4l2_dev)
 
void v4l2_device_unregister (struct v4l2_device *v4l2_dev)
 
int __must_check v4l2_device_register_subdev (struct v4l2_device *v4l2_dev, struct v4l2_subdev *sd)
 
void v4l2_device_unregister_subdev (struct v4l2_subdev *sd)
 
int __must_check v4l2_device_register_subdev_nodes (struct v4l2_device *v4l2_dev)
 

Macro Definition Documentation

#define __v4l2_device_call_subdevs (   v4l2_dev,
  cond,
  o,
  f,
  args... 
)
Value:
do { \
__v4l2_device_call_subdevs_p(v4l2_dev, __sd, cond, o, \
f , ##args); \
} while (0)

Definition at line 137 of file v4l2-device.h.

#define __v4l2_device_call_subdevs_p (   v4l2_dev,
  sd,
  cond,
  o,
  f,
  args... 
)
Value:
do { \
list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) \
if ((cond) && (sd)->ops->o && (sd)->ops->o->f) \
(sd)->ops->o->f((sd) , ##args); \
} while (0)

Definition at line 130 of file v4l2-device.h.

#define __v4l2_device_call_subdevs_until_err (   v4l2_dev,
  cond,
  o,
  f,
  args... 
)
Value:
({ \
__v4l2_device_call_subdevs_until_err_p(v4l2_dev, __sd, cond, o, \
f , ##args); \
})

Definition at line 162 of file v4l2-device.h.

#define __v4l2_device_call_subdevs_until_err_p (   v4l2_dev,
  sd,
  cond,
  o,
  f,
  args... 
)
Value:
({ \
long __err = 0; \
list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) { \
if ((cond) && (sd)->ops->o && (sd)->ops->o->f) \
__err = (sd)->ops->o->f((sd) , ##args); \
if (__err && __err != -ENOIOCTLCMD) \
break; \
} \
(__err == -ENOIOCTLCMD) ? 0 : __err; \
})

Definition at line 149 of file v4l2-device.h.

#define v4l2_device_call_all (   v4l2_dev,
  grpid,
  o,
  f,
  args... 
)
Value:
do { \
!(grpid) || __sd->grp_id == (grpid), o, f , \
##args); \
} while (0)

Definition at line 172 of file v4l2-device.h.

#define v4l2_device_call_until_err (   v4l2_dev,
  grpid,
  o,
  f,
  args... 
)
Value:
({ \
__v4l2_device_call_subdevs_until_err_p(v4l2_dev, __sd, \
!(grpid) || __sd->grp_id == (grpid), o, f , \
##args); \
})

Definition at line 185 of file v4l2-device.h.

#define v4l2_device_for_each_subdev (   sd,
  v4l2_dev 
)    list_for_each_entry(sd, &(v4l2_dev)->subdevs, list)

Definition at line 124 of file v4l2-device.h.

#define V4L2_DEVICE_NAME_SIZE   (20 + 16)

Definition at line 35 of file v4l2-device.h.

Function Documentation

void v4l2_device_disconnect ( struct v4l2_device v4l2_dev)

Definition at line 92 of file v4l2-device.c.

int v4l2_device_put ( struct v4l2_device v4l2_dev)

Definition at line 70 of file v4l2-device.c.

int __must_check v4l2_device_register ( struct device dev,
struct v4l2_device v4l2_dev 
)

Definition at line 33 of file v4l2-device.c.

int __must_check v4l2_device_register_subdev ( struct v4l2_device v4l2_dev,
struct v4l2_subdev sd 
)

Definition at line 141 of file v4l2-device.c.

int __must_check v4l2_device_register_subdev_nodes ( struct v4l2_device v4l2_dev)

Definition at line 205 of file v4l2-device.c.

int v4l2_device_set_name ( struct v4l2_device v4l2_dev,
const char basename,
atomic_t instance 
)

Definition at line 76 of file v4l2-device.c.

void v4l2_device_unregister ( struct v4l2_device v4l2_dev)

Definition at line 104 of file v4l2-device.c.

void v4l2_device_unregister_subdev ( struct v4l2_subdev sd)

Definition at line 255 of file v4l2-device.c.