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

Go to the source code of this file.

Data Structures

struct  v4l2_priv_tun_config
 
struct  v4l2_routing
 
struct  v4l2_discrete_probe
 

Macros

#define v4l_printk(level, name, adapter, addr, fmt, arg...)   printk(level "%s %d-%04x: " fmt, name, i2c_adapter_id(adapter), addr , ## arg)
 
#define v4l_client_printk(level, client, fmt, arg...)
 
#define v4l_err(client, fmt, arg...)   v4l_client_printk(KERN_ERR, client, fmt , ## arg)
 
#define v4l_warn(client, fmt, arg...)   v4l_client_printk(KERN_WARNING, client, fmt , ## arg)
 
#define v4l_info(client, fmt, arg...)   v4l_client_printk(KERN_INFO, client, fmt , ## arg)
 
#define v4l_dbg(level, debug, client, fmt, arg...)
 
#define v4l2_printk(level, dev, fmt, arg...)   printk(level "%s: " fmt, (dev)->name , ## arg)
 
#define v4l2_err(dev, fmt, arg...)   v4l2_printk(KERN_ERR, dev, fmt , ## arg)
 
#define v4l2_warn(dev, fmt, arg...)   v4l2_printk(KERN_WARNING, dev, fmt , ## arg)
 
#define v4l2_info(dev, fmt, arg...)   v4l2_printk(KERN_INFO, dev, fmt , ## arg)
 
#define v4l2_dbg(level, debug, dev, fmt, arg...)
 
#define V4L2_CTRL_MENU_IDS_END   (0xffffffff)
 
#define TUNER_SET_CONFIG   _IOW('d', 92, struct v4l2_priv_tun_config)
 
#define VIDIOC_INT_RESET   _IOW ('d', 102, u32)
 

Enumerations

enum  v4l2_i2c_tuner_type { ADDRS_RADIO, ADDRS_DEMOD, ADDRS_TV, ADDRS_TV_WITH_DEMOD }
 

Functions

int v4l2_ctrl_check (struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl, const char *const *menu_items)
 
const charv4l2_ctrl_get_name (u32 id)
 
const char *constv4l2_ctrl_get_menu (u32 id)
 
int v4l2_ctrl_query_fill (struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def)
 
int v4l2_ctrl_query_menu (struct v4l2_querymenu *qmenu, struct v4l2_queryctrl *qctrl, const char *const *menu_items)
 
int v4l2_ctrl_query_menu_valid_items (struct v4l2_querymenu *qmenu, const u32 *ids)
 
u32 v4l2_ctrl_next (const u32 *const *ctrl_classes, u32 id)
 
int v4l2_chip_match_i2c_client (struct i2c_client *c, const struct v4l2_dbg_match *match)
 
int v4l2_chip_ident_i2c_client (struct i2c_client *c, struct v4l2_dbg_chip_ident *chip, u32 ident, u32 revision)
 
int v4l2_chip_match_host (const struct v4l2_dbg_match *match)
 
struct v4l2_subdevv4l2_i2c_new_subdev (struct v4l2_device *v4l2_dev, struct i2c_adapter *adapter, const char *client_type, u8 addr, const unsigned short *probe_addrs)
 
struct v4l2_subdevv4l2_i2c_new_subdev_board (struct v4l2_device *v4l2_dev, struct i2c_adapter *adapter, struct i2c_board_info *info, const unsigned short *probe_addrs)
 
void v4l2_i2c_subdev_init (struct v4l2_subdev *sd, struct i2c_client *client, const struct v4l2_subdev_ops *ops)
 
unsigned short v4l2_i2c_subdev_addr (struct v4l2_subdev *sd)
 
const unsigned shortv4l2_i2c_tuner_addrs (enum v4l2_i2c_tuner_type type)
 
void v4l_bound_align_image (unsigned int *w, unsigned int wmin, unsigned int wmax, unsigned int walign, unsigned int *h, unsigned int hmin, unsigned int hmax, unsigned int halign, unsigned int salign)
 
int v4l_fill_dv_preset_info (u32 preset, struct v4l2_dv_enum_preset *info)
 
struct v4l2_frmsize_discretev4l2_find_nearest_format (const struct v4l2_discrete_probe *probe, s32 width, s32 height)
 
bool v4l_match_dv_timings (const struct v4l2_dv_timings *t1, const struct v4l2_dv_timings *t2, unsigned pclock_delta)
 
bool v4l2_detect_cvt (unsigned frame_height, unsigned hfreq, unsigned vsync, u32 polarities, struct v4l2_dv_timings *fmt)
 
bool v4l2_detect_gtf (unsigned frame_height, unsigned hfreq, unsigned vsync, u32 polarities, struct v4l2_fract aspect, struct v4l2_dv_timings *fmt)
 
struct v4l2_fract v4l2_calc_aspect_ratio (u8 hor_landscape, u8 vert_portrait)
 

Macro Definition Documentation

#define TUNER_SET_CONFIG   _IOW('d', 92, struct v4l2_priv_tun_config)

Definition at line 186 of file v4l2-common.h.

#define V4L2_CTRL_MENU_IDS_END   (0xffffffff)

Definition at line 92 of file v4l2-common.h.

#define v4l2_dbg (   level,
  debug,
  dev,
  fmt,
  arg... 
)
Value:
do { \
if (debug >= (level)) \
v4l2_printk(KERN_DEBUG, dev, fmt , ## arg); \
} while (0)

Definition at line 75 of file v4l2-common.h.

#define v4l2_err (   dev,
  fmt,
  arg... 
)    v4l2_printk(KERN_ERR, dev, fmt , ## arg)

Definition at line 64 of file v4l2-common.h.

#define v4l2_info (   dev,
  fmt,
  arg... 
)    v4l2_printk(KERN_INFO, dev, fmt , ## arg)

Definition at line 70 of file v4l2-common.h.

#define v4l2_printk (   level,
  dev,
  fmt,
  arg... 
)    printk(level "%s: " fmt, (dev)->name , ## arg)

Definition at line 61 of file v4l2-common.h.

#define v4l2_warn (   dev,
  fmt,
  arg... 
)    v4l2_printk(KERN_WARNING, dev, fmt , ## arg)

Definition at line 67 of file v4l2-common.h.

#define v4l_client_printk (   level,
  client,
  fmt,
  arg... 
)
Value:
v4l_printk(level, (client)->driver->driver.name, (client)->adapter, \
(client)->addr, fmt , ## arg)

Definition at line 37 of file v4l2-common.h.

#define v4l_dbg (   level,
  debug,
  client,
  fmt,
  arg... 
)
Value:
do { \
if (debug >= (level)) \
v4l_client_printk(KERN_DEBUG, client, fmt , ## arg); \
} while (0)

Definition at line 52 of file v4l2-common.h.

#define v4l_err (   client,
  fmt,
  arg... 
)    v4l_client_printk(KERN_ERR, client, fmt , ## arg)

Definition at line 41 of file v4l2-common.h.

#define v4l_info (   client,
  fmt,
  arg... 
)    v4l_client_printk(KERN_INFO, client, fmt , ## arg)

Definition at line 47 of file v4l2-common.h.

#define v4l_printk (   level,
  name,
  adapter,
  addr,
  fmt,
  arg... 
)    printk(level "%s %d-%04x: " fmt, name, i2c_adapter_id(adapter), addr , ## arg)

Definition at line 34 of file v4l2-common.h.

#define v4l_warn (   client,
  fmt,
  arg... 
)    v4l_client_printk(KERN_WARNING, client, fmt , ## arg)

Definition at line 44 of file v4l2-common.h.

#define VIDIOC_INT_RESET   _IOW ('d', 102, u32)

Definition at line 188 of file v4l2-common.h.

Enumeration Type Documentation

Enumerator:
ADDRS_RADIO 
ADDRS_DEMOD 
ADDRS_TV 
ADDRS_TV_WITH_DEMOD 

Definition at line 142 of file v4l2-common.h.

Function Documentation

struct v4l2_fract v4l2_calc_aspect_ratio ( u8  hor_landscape,
u8  vert_portrait 
)
read

v4l2_calc_aspect_ratio - calculate the aspect ratio based on bytes 0x15 and 0x16 from the EDID. - byte 0x15 from the EDID. - byte 0x16 from the EDID.

Determines the aspect ratio from the EDID. See VESA Enhanced EDID standard, release A, rev 2, section 3.6.2: "Horizontal and Vertical Screen Size or Aspect Ratio"

Definition at line 916 of file v4l2-common.c.

int v4l2_chip_ident_i2c_client ( struct i2c_client c,
struct v4l2_dbg_chip_ident chip,
u32  ident,
u32  revision 
)
int v4l2_chip_match_host ( const struct v4l2_dbg_match match)

Definition at line 230 of file v4l2-common.c.

int v4l2_chip_match_i2c_client ( struct i2c_client c,
const struct v4l2_dbg_match match 
)
int v4l2_ctrl_check ( struct v4l2_ext_control ctrl,
struct v4l2_queryctrl qctrl,
const char *const menu_items 
)

Definition at line 87 of file v4l2-common.c.

const char* const* v4l2_ctrl_get_menu ( u32  id)

Definition at line 64 of file v4l2-ctrls.c.

const char* v4l2_ctrl_get_name ( u32  id)

Definition at line 553 of file v4l2-ctrls.c.

u32 v4l2_ctrl_next ( const u32 *const ctrl_classes,
u32  id 
)

Definition at line 187 of file v4l2-common.c.

int v4l2_ctrl_query_fill ( struct v4l2_queryctrl qctrl,
s32  min,
s32  max,
s32  step,
s32  def 
)

Definition at line 115 of file v4l2-common.c.

int v4l2_ctrl_query_menu ( struct v4l2_querymenu qmenu,
struct v4l2_queryctrl qctrl,
const char *const menu_items 
)

Definition at line 139 of file v4l2-common.c.

int v4l2_ctrl_query_menu_valid_items ( struct v4l2_querymenu qmenu,
const u32 ids 
)

Definition at line 161 of file v4l2-common.c.

bool v4l2_detect_cvt ( unsigned  frame_height,
unsigned  hfreq,
unsigned  vsync,
u32  polarities,
struct v4l2_dv_timings fmt 
)

v4l2_detect_cvt - detect if the given timings follow the CVT standard - the total height of the frame (including blanking) in lines. - the horizontal frequency in Hz. - the height of the vertical sync in lines. - the horizontal and vertical polarities (same as struct v4l2_bt_timings polarities). - the resulting timings.

This function will attempt to detect if the given values correspond to a valid CVT format. If so, then it will return true, and fmt will be filled in with the found CVT timings.

Definition at line 675 of file v4l2-common.c.

bool v4l2_detect_gtf ( unsigned  frame_height,
unsigned  hfreq,
unsigned  vsync,
u32  polarities,
struct v4l2_fract  aspect,
struct v4l2_dv_timings fmt 
)

v4l2_detect_gtf - detect if the given timings follow the GTF standard - the total height of the frame (including blanking) in lines. - the horizontal frequency in Hz. - the height of the vertical sync in lines. - the horizontal and vertical polarities (same as struct v4l2_bt_timings polarities). - preferred aspect ratio. GTF has no method of determining the aspect ratio in order to derive the image width from the image height, so it has to be passed explicitly. Usually the native screen aspect ratio is used for this. If it is not filled in correctly, then 16:9 will be assumed. - the resulting timings.

This function will attempt to detect if the given values correspond to a valid GTF format. If so, then it will return true, and fmt will be filled in with the found GTF timings.

Definition at line 832 of file v4l2-common.c.

struct v4l2_frmsize_discrete* v4l2_find_nearest_format ( const struct v4l2_discrete_probe probe,
s32  width,
s32  height 
)
read

Definition at line 958 of file v4l2-common.c.

struct v4l2_subdev* v4l2_i2c_new_subdev ( struct v4l2_device v4l2_dev,
struct i2c_adapter adapter,
const char client_type,
u8  addr,
const unsigned short probe_addrs 
)
read
struct v4l2_subdev* v4l2_i2c_new_subdev_board ( struct v4l2_device v4l2_dev,
struct i2c_adapter adapter,
struct i2c_board_info info,
const unsigned short probe_addrs 
)
read
unsigned short v4l2_i2c_subdev_addr ( struct v4l2_subdev sd)
void v4l2_i2c_subdev_init ( struct v4l2_subdev sd,
struct i2c_client client,
const struct v4l2_subdev_ops ops 
)
const unsigned short* v4l2_i2c_tuner_addrs ( enum v4l2_i2c_tuner_type  type)
void v4l_bound_align_image ( unsigned int w,
unsigned int  wmin,
unsigned int  wmax,
unsigned int  walign,
unsigned int h,
unsigned int  hmin,
unsigned int  hmax,
unsigned int  halign,
unsigned int  salign 
)

Definition at line 516 of file v4l2-common.c.

int v4l_fill_dv_preset_info ( u32  preset,
struct v4l2_dv_enum_preset info 
)

v4l_fill_dv_preset_info - fill description of a digital video preset - preset value - pointer to struct v4l2_dv_enum_preset

drivers can use this helper function to fill description of dv preset in info.

Definition at line 561 of file v4l2-common.c.

bool v4l_match_dv_timings ( const struct v4l2_dv_timings t1,
const struct v4l2_dv_timings t2,
unsigned  pclock_delta 
)

v4l_match_dv_timings - check if two timings match - compare this v4l2_dv_timings struct... - with this struct. - the allowed pixelclock deviation.

Compare t1 with t2 with a given margin of error for the pixelclock.

Definition at line 608 of file v4l2-common.c.