aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 15:09:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 15:09:57 -0400
commit858655116bfc722837e3aec0909b8e9d08f96996 (patch)
treeef9171d51ffcd01e40d1131d62be32e5a7d371dc /include
parent239dab4636f7f5f971ac39b5ca84254cff112cac (diff)
parent1b2c14b44adcb7836528640bfdc40bf7499d987d (diff)
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab: "This series contain: - new i2c video drivers: ml86v7667 (video decoder), ths8200 (video encoder) - a new video driver for EasyCap cards based on Fushicai USBTV007 - Improved support for OF and embedded systems, with V4L2 async initialization and a better support for clocks - API cleanups on the ioctls used by the v4l2 debug tool - Lots of cleanups - As usual, several driver improvements and new cards additions - Revert two changesets that change the minimal symbol rate for stv0399, as request by Manu - Update MAINTAINERS and other files to point to my new e-mail" * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (378 commits) MAINTAINERS & ABI: Update to point to my new email [media] stb0899: restore minimal rate to 5Mbauds [media] exynos4-is: Correct colorspace handling at FIMC-LITE [media] exynos4-is: Set valid initial format on FIMC.n subdevs [media] exynos4-is: Set valid initial format on FIMC-IS-ISP subdev pads [media] exynos4-is: Fix format propagation on FIMC-IS-ISP subdev [media] exynos4-is: Set valid initial format at FIMC-LITE [media] exynos4-is: Fix format propagation on FIMC-LITE.n subdevs [media] MAINTAINERS: Update S5P/Exynos FIMC driver entry [media] Documentation: Update driver's directory in video4linux/fimc.txt [media] exynos4-is: Change fimc-is firmware file names [media] exynos4-is: Add support for Exynos5250 MIPI-CSIS [media] exynos4-is: Add Exynos5250 SoC support to fimc-lite driver [media] exynos4-is: Drop drvdata handling in fimc-lite for non-dt platforms [media] media: i2c: tvp514x: remove manual setting of subdev name [media] media: i2c: tvp7002: remove manual setting of subdev name [media] mem2mem: set missing v4l2_dev pointer [media] wl128x: add missing struct v4l2_device [media] tvp514x: Fix init seqeunce [media] saa7134: Fix sparse warnings by adding __user annotation ...
Diffstat (limited to 'include')
-rw-r--r--include/media/davinci/vpbe_osd.h4
-rw-r--r--include/media/media-device.h9
-rw-r--r--include/media/media-entity.h5
-rw-r--r--include/media/rc-map.h1
-rw-r--r--include/media/s5p_fimc.h58
-rw-r--r--include/media/sh_mobile_ceu.h2
-rw-r--r--include/media/sh_mobile_csi2.h2
-rw-r--r--include/media/soc_camera.h43
-rw-r--r--include/media/ths7303.h2
-rw-r--r--include/media/tveeprom.h11
-rw-r--r--include/media/tvp7002.h46
-rw-r--r--include/media/v4l2-async.h105
-rw-r--r--include/media/v4l2-chip-ident.h352
-rw-r--r--include/media/v4l2-clk.h54
-rw-r--r--include/media/v4l2-common.h10
-rw-r--r--include/media/v4l2-dev.h5
-rw-r--r--include/media/v4l2-int-device.h3
-rw-r--r--include/media/v4l2-ioctl.h2
-rw-r--r--include/media/v4l2-subdev.h14
-rw-r--r--include/uapi/linux/v4l2-controls.h4
-rw-r--r--include/uapi/linux/videodev2.h27
21 files changed, 299 insertions, 460 deletions
diff --git a/include/media/davinci/vpbe_osd.h b/include/media/davinci/vpbe_osd.h
index 42628fcfe1bd..de59364d7ed2 100644
--- a/include/media/davinci/vpbe_osd.h
+++ b/include/media/davinci/vpbe_osd.h
@@ -82,9 +82,9 @@ enum osd_pix_format {
82 PIXFMT_4BPP, 82 PIXFMT_4BPP,
83 PIXFMT_8BPP, 83 PIXFMT_8BPP,
84 PIXFMT_RGB565, 84 PIXFMT_RGB565,
85 PIXFMT_YCbCrI, 85 PIXFMT_YCBCRI,
86 PIXFMT_RGB888, 86 PIXFMT_RGB888,
87 PIXFMT_YCrCbI, 87 PIXFMT_YCRCBI,
88 PIXFMT_NV12, 88 PIXFMT_NV12,
89 PIXFMT_OSD_ATTR, 89 PIXFMT_OSD_ATTR,
90}; 90};
diff --git a/include/media/media-device.h b/include/media/media-device.h
index eaade9815bb6..12155a9596c4 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -45,6 +45,7 @@ struct device;
45 * @entities: List of registered entities 45 * @entities: List of registered entities
46 * @lock: Entities list lock 46 * @lock: Entities list lock
47 * @graph_mutex: Entities graph operation lock 47 * @graph_mutex: Entities graph operation lock
48 * @link_notify: Link state change notification callback
48 * 49 *
49 * This structure represents an abstract high-level media device. It allows easy 50 * This structure represents an abstract high-level media device. It allows easy
50 * access to entities and provides basic media device-level support. The 51 * access to entities and provides basic media device-level support. The
@@ -75,10 +76,14 @@ struct media_device {
75 /* Serializes graph operations. */ 76 /* Serializes graph operations. */
76 struct mutex graph_mutex; 77 struct mutex graph_mutex;
77 78
78 int (*link_notify)(struct media_pad *source, 79 int (*link_notify)(struct media_link *link, u32 flags,
79 struct media_pad *sink, u32 flags); 80 unsigned int notification);
80}; 81};
81 82
83/* Supported link_notify @notification values. */
84#define MEDIA_DEV_NOTIFY_PRE_LINK_CH 0
85#define MEDIA_DEV_NOTIFY_POST_LINK_CH 1
86
82/* media_devnode to media_device */ 87/* media_devnode to media_device */
83#define to_media_device(node) container_of(node, struct media_device, devnode) 88#define to_media_device(node) container_of(node, struct media_device, devnode)
84 89
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index 0c16f518ee09..06bacf937d61 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -128,11 +128,14 @@ void media_entity_cleanup(struct media_entity *entity);
128 128
129int media_entity_create_link(struct media_entity *source, u16 source_pad, 129int media_entity_create_link(struct media_entity *source, u16 source_pad,
130 struct media_entity *sink, u16 sink_pad, u32 flags); 130 struct media_entity *sink, u16 sink_pad, u32 flags);
131void __media_entity_remove_links(struct media_entity *entity);
132void media_entity_remove_links(struct media_entity *entity);
133
131int __media_entity_setup_link(struct media_link *link, u32 flags); 134int __media_entity_setup_link(struct media_link *link, u32 flags);
132int media_entity_setup_link(struct media_link *link, u32 flags); 135int media_entity_setup_link(struct media_link *link, u32 flags);
133struct media_link *media_entity_find_link(struct media_pad *source, 136struct media_link *media_entity_find_link(struct media_pad *source,
134 struct media_pad *sink); 137 struct media_pad *sink);
135struct media_pad *media_entity_remote_source(struct media_pad *pad); 138struct media_pad *media_entity_remote_pad(struct media_pad *pad);
136 139
137struct media_entity *media_entity_get(struct media_entity *entity); 140struct media_entity *media_entity_get(struct media_entity *entity);
138void media_entity_put(struct media_entity *entity); 141void media_entity_put(struct media_entity *entity);
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 5d5d3a30f04a..6628f5d01f52 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -111,6 +111,7 @@ void rc_map_init(void);
111#define RC_MAP_BUDGET_CI_OLD "rc-budget-ci-old" 111#define RC_MAP_BUDGET_CI_OLD "rc-budget-ci-old"
112#define RC_MAP_CINERGY_1400 "rc-cinergy-1400" 112#define RC_MAP_CINERGY_1400 "rc-cinergy-1400"
113#define RC_MAP_CINERGY "rc-cinergy" 113#define RC_MAP_CINERGY "rc-cinergy"
114#define RC_MAP_DELOCK_61959 "rc-delock-61959"
114#define RC_MAP_DIB0700_NEC_TABLE "rc-dib0700-nec" 115#define RC_MAP_DIB0700_NEC_TABLE "rc-dib0700-nec"
115#define RC_MAP_DIB0700_RC5_TABLE "rc-dib0700-rc5" 116#define RC_MAP_DIB0700_RC5_TABLE "rc-dib0700-rc5"
116#define RC_MAP_DIGITALNOW_TINYTWIN "rc-digitalnow-tinytwin" 117#define RC_MAP_DIGITALNOW_TINYTWIN "rc-digitalnow-tinytwin"
diff --git a/include/media/s5p_fimc.h b/include/media/s5p_fimc.h
index f50969025ef3..b975c285c8a9 100644
--- a/include/media/s5p_fimc.h
+++ b/include/media/s5p_fimc.h
@@ -13,6 +13,7 @@
13#define S5P_FIMC_H_ 13#define S5P_FIMC_H_
14 14
15#include <media/media-entity.h> 15#include <media/media-entity.h>
16#include <media/v4l2-dev.h>
16#include <media/v4l2-mediabus.h> 17#include <media/v4l2-mediabus.h>
17 18
18/* 19/*
@@ -115,6 +116,7 @@ struct s5p_platform_fimc {
115 * @color: the driver's private color format id 116 * @color: the driver's private color format id
116 * @memplanes: number of physically non-contiguous data planes 117 * @memplanes: number of physically non-contiguous data planes
117 * @colplanes: number of physically contiguous data planes 118 * @colplanes: number of physically contiguous data planes
119 * @colorspace: v4l2 colorspace (V4L2_COLORSPACE_*)
118 * @depth: per plane driver's private 'number of bits per pixel' 120 * @depth: per plane driver's private 'number of bits per pixel'
119 * @mdataplanes: bitmask indicating meta data plane(s), (1 << plane_no) 121 * @mdataplanes: bitmask indicating meta data plane(s), (1 << plane_no)
120 * @flags: flags indicating which operation mode format applies to 122 * @flags: flags indicating which operation mode format applies to
@@ -126,6 +128,7 @@ struct fimc_fmt {
126 u32 color; 128 u32 color;
127 u16 memplanes; 129 u16 memplanes;
128 u16 colplanes; 130 u16 colplanes;
131 u8 colorspace;
129 u8 depth[FIMC_MAX_PLANES]; 132 u8 depth[FIMC_MAX_PLANES];
130 u16 mdataplanes; 133 u16 mdataplanes;
131 u16 flags; 134 u16 flags;
@@ -140,37 +143,40 @@ struct fimc_fmt {
140#define FMT_FLAGS_YUV (1 << 7) 143#define FMT_FLAGS_YUV (1 << 7)
141}; 144};
142 145
143enum fimc_subdev_index { 146struct exynos_media_pipeline;
144 IDX_SENSOR,
145 IDX_CSIS,
146 IDX_FLITE,
147 IDX_IS_ISP,
148 IDX_FIMC,
149 IDX_MAX,
150};
151 147
152struct media_pipeline; 148/*
153struct v4l2_subdev; 149 * Media pipeline operations to be called from within a video node, i.e. the
150 * last entity within the pipeline. Implemented by related media device driver.
151 */
152struct exynos_media_pipeline_ops {
153 int (*prepare)(struct exynos_media_pipeline *p,
154 struct media_entity *me);
155 int (*unprepare)(struct exynos_media_pipeline *p);
156 int (*open)(struct exynos_media_pipeline *p, struct media_entity *me,
157 bool resume);
158 int (*close)(struct exynos_media_pipeline *p);
159 int (*set_stream)(struct exynos_media_pipeline *p, bool state);
160};
154 161
155struct fimc_pipeline { 162struct exynos_video_entity {
156 struct v4l2_subdev *subdevs[IDX_MAX]; 163 struct video_device vdev;
157 struct media_pipeline *m_pipeline; 164 struct exynos_media_pipeline *pipe;
158}; 165};
159 166
160/* 167struct exynos_media_pipeline {
161 * Media pipeline operations to be called from within the fimc(-lite) 168 struct media_pipeline mp;
162 * video node when it is the last entity of the pipeline. Implemented 169 const struct exynos_media_pipeline_ops *ops;
163 * by corresponding media device driver.
164 */
165struct fimc_pipeline_ops {
166 int (*open)(struct fimc_pipeline *p, struct media_entity *me,
167 bool resume);
168 int (*close)(struct fimc_pipeline *p);
169 int (*set_stream)(struct fimc_pipeline *p, bool state);
170}; 170};
171 171
172#define fimc_pipeline_call(f, op, p, args...) \ 172static inline struct exynos_video_entity *vdev_to_exynos_video_entity(
173 (!(f) ? -ENODEV : (((f)->pipeline_ops && (f)->pipeline_ops->op) ? \ 173 struct video_device *vdev)
174 (f)->pipeline_ops->op((p), ##args) : -ENOIOCTLCMD)) 174{
175 return container_of(vdev, struct exynos_video_entity, vdev);
176}
177
178#define fimc_pipeline_call(ent, op, args...) \
179 (!(ent) ? -ENOENT : (((ent)->pipe->ops && (ent)->pipe->ops->op) ? \
180 (ent)->pipe->ops->op(((ent)->pipe), ##args) : -ENOIOCTLCMD)) \
175 181
176#endif /* S5P_FIMC_H_ */ 182#endif /* S5P_FIMC_H_ */
diff --git a/include/media/sh_mobile_ceu.h b/include/media/sh_mobile_ceu.h
index 6fdb6adf6b2b..7f57056c22ba 100644
--- a/include/media/sh_mobile_ceu.h
+++ b/include/media/sh_mobile_ceu.h
@@ -22,6 +22,8 @@ struct sh_mobile_ceu_info {
22 int max_width; 22 int max_width;
23 int max_height; 23 int max_height;
24 struct sh_mobile_ceu_companion *csi2; 24 struct sh_mobile_ceu_companion *csi2;
25 struct v4l2_async_subdev **asd; /* Flat array, arranged in groups */
26 unsigned int *asd_sizes; /* 0-terminated array pf asd group sizes */
25}; 27};
26 28
27#endif /* __ASM_SH_MOBILE_CEU_H__ */ 29#endif /* __ASM_SH_MOBILE_CEU_H__ */
diff --git a/include/media/sh_mobile_csi2.h b/include/media/sh_mobile_csi2.h
index c586c4f7f16b..14030db51f13 100644
--- a/include/media/sh_mobile_csi2.h
+++ b/include/media/sh_mobile_csi2.h
@@ -33,6 +33,7 @@ struct sh_csi2_client_config {
33 unsigned char lanes; /* bitmask[3:0] */ 33 unsigned char lanes; /* bitmask[3:0] */
34 unsigned char channel; /* 0..3 */ 34 unsigned char channel; /* 0..3 */
35 struct platform_device *pdev; /* client platform device */ 35 struct platform_device *pdev; /* client platform device */
36 const char *name; /* async matching: client name */
36}; 37};
37 38
38struct v4l2_device; 39struct v4l2_device;
@@ -42,7 +43,6 @@ struct sh_csi2_pdata {
42 unsigned int flags; 43 unsigned int flags;
43 struct sh_csi2_client_config *clients; 44 struct sh_csi2_client_config *clients;
44 int num_clients; 45 int num_clients;
45 struct v4l2_device *v4l2_dev;
46}; 46};
47 47
48#endif 48#endif
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index ff77d08c30fd..34d2414f2b8c 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -19,11 +19,13 @@
19#include <linux/videodev2.h> 19#include <linux/videodev2.h>
20#include <media/videobuf-core.h> 20#include <media/videobuf-core.h>
21#include <media/videobuf2-core.h> 21#include <media/videobuf2-core.h>
22#include <media/v4l2-async.h>
22#include <media/v4l2-ctrls.h> 23#include <media/v4l2-ctrls.h>
23#include <media/v4l2-device.h> 24#include <media/v4l2-device.h>
24 25
25struct file; 26struct file;
26struct soc_camera_desc; 27struct soc_camera_desc;
28struct soc_camera_async_client;
27 29
28struct soc_camera_device { 30struct soc_camera_device {
29 struct list_head list; /* list of all registered devices */ 31 struct list_head list; /* list of all registered devices */
@@ -49,6 +51,10 @@ struct soc_camera_device {
49 /* soc_camera.c private count. Only accessed with .host_lock held */ 51 /* soc_camera.c private count. Only accessed with .host_lock held */
50 int use_count; 52 int use_count;
51 struct file *streamer; /* stream owner */ 53 struct file *streamer; /* stream owner */
54 struct v4l2_clk *clk;
55 /* Asynchronous subdevice management */
56 struct soc_camera_async_client *sasc;
57 /* video buffer queue */
52 union { 58 union {
53 struct videobuf_queue vb_vidq; 59 struct videobuf_queue vb_vidq;
54 struct vb2_queue vb2_vidq; 60 struct vb2_queue vb2_vidq;
@@ -58,21 +64,38 @@ struct soc_camera_device {
58/* Host supports programmable stride */ 64/* Host supports programmable stride */
59#define SOCAM_HOST_CAP_STRIDE (1 << 0) 65#define SOCAM_HOST_CAP_STRIDE (1 << 0)
60 66
67enum soc_camera_subdev_role {
68 SOCAM_SUBDEV_DATA_SOURCE = 1,
69 SOCAM_SUBDEV_DATA_SINK,
70 SOCAM_SUBDEV_DATA_PROCESSOR,
71};
72
73struct soc_camera_async_subdev {
74 struct v4l2_async_subdev asd;
75 enum soc_camera_subdev_role role;
76};
77
61struct soc_camera_host { 78struct soc_camera_host {
62 struct v4l2_device v4l2_dev; 79 struct v4l2_device v4l2_dev;
63 struct list_head list; 80 struct list_head list;
64 struct mutex host_lock; /* Protect pipeline modifications */ 81 struct mutex host_lock; /* Main synchronisation lock */
82 struct mutex clk_lock; /* Protect pipeline modifications */
65 unsigned char nr; /* Host number */ 83 unsigned char nr; /* Host number */
66 u32 capabilities; 84 u32 capabilities;
85 struct soc_camera_device *icd; /* Currently attached client */
67 void *priv; 86 void *priv;
68 const char *drv_name; 87 const char *drv_name;
69 struct soc_camera_host_ops *ops; 88 struct soc_camera_host_ops *ops;
89 struct v4l2_async_subdev **asd; /* Flat array, arranged in groups */
90 unsigned int *asd_sizes; /* 0-terminated array of asd group sizes */
70}; 91};
71 92
72struct soc_camera_host_ops { 93struct soc_camera_host_ops {
73 struct module *owner; 94 struct module *owner;
74 int (*add)(struct soc_camera_device *); 95 int (*add)(struct soc_camera_device *);
75 void (*remove)(struct soc_camera_device *); 96 void (*remove)(struct soc_camera_device *);
97 int (*clock_start)(struct soc_camera_host *);
98 void (*clock_stop)(struct soc_camera_host *);
76 /* 99 /*
77 * .get_formats() is called for each client device format, but 100 * .get_formats() is called for each client device format, but
78 * .put_formats() is only called once. Further, if any of the calls to 101 * .put_formats() is only called once. Further, if any of the calls to
@@ -157,6 +180,7 @@ struct soc_camera_host_desc {
157}; 180};
158 181
159/* 182/*
183 * Platform data for "soc-camera-pdrv"
160 * This MUST be kept binary-identical to struct soc_camera_link below, until 184 * This MUST be kept binary-identical to struct soc_camera_link below, until
161 * it is completely replaced by this one, after which we can split it into its 185 * it is completely replaced by this one, after which we can split it into its
162 * two components. 186 * two components.
@@ -322,14 +346,17 @@ static inline void soc_camera_limit_side(int *start, int *length,
322unsigned long soc_camera_apply_board_flags(struct soc_camera_subdev_desc *ssdd, 346unsigned long soc_camera_apply_board_flags(struct soc_camera_subdev_desc *ssdd,
323 const struct v4l2_mbus_config *cfg); 347 const struct v4l2_mbus_config *cfg);
324 348
325int soc_camera_power_on(struct device *dev, struct soc_camera_subdev_desc *ssdd); 349int soc_camera_power_init(struct device *dev, struct soc_camera_subdev_desc *ssdd);
326int soc_camera_power_off(struct device *dev, struct soc_camera_subdev_desc *ssdd); 350int soc_camera_power_on(struct device *dev, struct soc_camera_subdev_desc *ssdd,
351 struct v4l2_clk *clk);
352int soc_camera_power_off(struct device *dev, struct soc_camera_subdev_desc *ssdd,
353 struct v4l2_clk *clk);
327 354
328static inline int soc_camera_set_power(struct device *dev, 355static inline int soc_camera_set_power(struct device *dev,
329 struct soc_camera_subdev_desc *ssdd, bool on) 356 struct soc_camera_subdev_desc *ssdd, struct v4l2_clk *clk, bool on)
330{ 357{
331 return on ? soc_camera_power_on(dev, ssdd) 358 return on ? soc_camera_power_on(dev, ssdd, clk)
332 : soc_camera_power_off(dev, ssdd); 359 : soc_camera_power_off(dev, ssdd, clk);
333} 360}
334 361
335/* This is only temporary here - until v4l2-subdev begins to link to video_device */ 362/* This is only temporary here - until v4l2-subdev begins to link to video_device */
@@ -346,9 +373,9 @@ static inline struct soc_camera_subdev_desc *soc_camera_i2c_to_desc(const struct
346 return client->dev.platform_data; 373 return client->dev.platform_data;
347} 374}
348 375
349static inline struct v4l2_subdev *soc_camera_vdev_to_subdev(const struct video_device *vdev) 376static inline struct v4l2_subdev *soc_camera_vdev_to_subdev(struct video_device *vdev)
350{ 377{
351 struct soc_camera_device *icd = dev_get_drvdata(vdev->parent); 378 struct soc_camera_device *icd = video_get_drvdata(vdev);
352 return soc_camera_to_subdev(icd); 379 return soc_camera_to_subdev(icd);
353} 380}
354 381
diff --git a/include/media/ths7303.h b/include/media/ths7303.h
index 980ec51d574d..a7b49297da82 100644
--- a/include/media/ths7303.h
+++ b/include/media/ths7303.h
@@ -30,13 +30,11 @@
30 * @ch_1: Bias value for channel one. 30 * @ch_1: Bias value for channel one.
31 * @ch_2: Bias value for channel two. 31 * @ch_2: Bias value for channel two.
32 * @ch_3: Bias value for channel three. 32 * @ch_3: Bias value for channel three.
33 * @init_enable: initalize on init.
34 */ 33 */
35struct ths7303_platform_data { 34struct ths7303_platform_data {
36 u8 ch_1; 35 u8 ch_1;
37 u8 ch_2; 36 u8 ch_2;
38 u8 ch_3; 37 u8 ch_3;
39 u8 init_enable;
40}; 38};
41 39
42#endif 40#endif
diff --git a/include/media/tveeprom.h b/include/media/tveeprom.h
index a8ad75a9152a..4a1191abd936 100644
--- a/include/media/tveeprom.h
+++ b/include/media/tveeprom.h
@@ -1,6 +1,17 @@
1/* 1/*
2 */ 2 */
3 3
4enum tveeprom_audio_processor {
5 /* No audio processor present */
6 TVEEPROM_AUDPROC_NONE,
7 /* The audio processor is internal to the video processor */
8 TVEEPROM_AUDPROC_INTERNAL,
9 /* The audio processor is a MSPXXXX device */
10 TVEEPROM_AUDPROC_MSP,
11 /* The audio processor is another device */
12 TVEEPROM_AUDPROC_OTHER,
13};
14
4struct tveeprom { 15struct tveeprom {
5 u32 has_radio; 16 u32 has_radio;
6 /* If has_ir == 0, then it is unknown what the IR capabilities are, 17 /* If has_ir == 0, then it is unknown what the IR capabilities are,
diff --git a/include/media/tvp7002.h b/include/media/tvp7002.h
index ee4353459ef5..fadb6afe9ef0 100644
--- a/include/media/tvp7002.h
+++ b/include/media/tvp7002.h
@@ -26,31 +26,29 @@
26#ifndef _TVP7002_H_ 26#ifndef _TVP7002_H_
27#define _TVP7002_H_ 27#define _TVP7002_H_
28 28
29/* Platform-dependent data 29#define TVP7002_MODULE_NAME "tvp7002"
30 * 30
31 * clk_polarity: 31/**
32 * 0 -> data clocked out on rising edge of DATACLK signal 32 * struct tvp7002_config - Platform dependent data
33 * 1 -> data clocked out on falling edge of DATACLK signal 33 *@clk_polarity: Clock polarity
34 * hs_polarity: 34 * 0 - Data clocked out on rising edge of DATACLK signal
35 * 0 -> active low HSYNC output 35 * 1 - Data clocked out on falling edge of DATACLK signal
36 * 1 -> active high HSYNC output 36 *@hs_polarity: HSYNC polarity
37 * sog_polarity: 37 * 0 - Active low HSYNC output, 1 - Active high HSYNC output
38 * 0 -> normal operation 38 *@vs_polarity: VSYNC Polarity
39 * 1 -> operation with polarity inverted 39 * 0 - Active low VSYNC output, 1 - Active high VSYNC output
40 * vs_polarity: 40 *@fid_polarity: Active-high Field ID polarity.
41 * 0 -> active low VSYNC output 41 * 0 - The field ID output is set to logic 1 for an odd field
42 * 1 -> active high VSYNC output 42 * (field 1) and set to logic 0 for an even field (field 0).
43 * fid_polarity: 43 * 1 - Operation with polarity inverted.
44 * 0 -> the field ID output is set to logic 1 for an odd 44 *@sog_polarity: Active high Sync on Green output polarity.
45 * field (field 1) and set to logic 0 for an even 45 * 0 - Normal operation, 1 - Operation with polarity inverted
46 * field (field 0).
47 * 1 -> operation with polarity inverted.
48 */ 46 */
49struct tvp7002_config { 47struct tvp7002_config {
50 u8 clk_polarity; 48 bool clk_polarity;
51 u8 hs_polarity; 49 bool hs_polarity;
52 u8 vs_polarity; 50 bool vs_polarity;
53 u8 fid_polarity; 51 bool fid_polarity;
54 u8 sog_polarity; 52 bool sog_polarity;
55}; 53};
56#endif 54#endif
diff --git a/include/media/v4l2-async.h b/include/media/v4l2-async.h
new file mode 100644
index 000000000000..c3ec6ac75f7e
--- /dev/null
+++ b/include/media/v4l2-async.h
@@ -0,0 +1,105 @@
1/*
2 * V4L2 asynchronous subdevice registration API
3 *
4 * Copyright (C) 2012-2013, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef V4L2_ASYNC_H
12#define V4L2_ASYNC_H
13
14#include <linux/list.h>
15#include <linux/mutex.h>
16
17struct device;
18struct v4l2_device;
19struct v4l2_subdev;
20struct v4l2_async_notifier;
21
22/* A random max subdevice number, used to allocate an array on stack */
23#define V4L2_MAX_SUBDEVS 128U
24
25enum v4l2_async_bus_type {
26 V4L2_ASYNC_BUS_CUSTOM,
27 V4L2_ASYNC_BUS_PLATFORM,
28 V4L2_ASYNC_BUS_I2C,
29};
30
31/**
32 * struct v4l2_async_subdev - sub-device descriptor, as known to a bridge
33 * @bus_type: subdevice bus type to select the appropriate matching method
34 * @match: union of per-bus type matching data sets
35 * @list: used to link struct v4l2_async_subdev objects, waiting to be
36 * probed, to a notifier->waiting list
37 */
38struct v4l2_async_subdev {
39 enum v4l2_async_bus_type bus_type;
40 union {
41 struct {
42 const char *name;
43 } platform;
44 struct {
45 int adapter_id;
46 unsigned short address;
47 } i2c;
48 struct {
49 bool (*match)(struct device *,
50 struct v4l2_async_subdev *);
51 void *priv;
52 } custom;
53 } match;
54
55 /* v4l2-async core private: not to be used by drivers */
56 struct list_head list;
57};
58
59/**
60 * v4l2_async_subdev_list - provided by subdevices
61 * @list: links struct v4l2_async_subdev_list objects to a global list
62 * before probing, and onto notifier->done after probing
63 * @asd: pointer to respective struct v4l2_async_subdev
64 * @notifier: pointer to managing notifier
65 */
66struct v4l2_async_subdev_list {
67 struct list_head list;
68 struct v4l2_async_subdev *asd;
69 struct v4l2_async_notifier *notifier;
70};
71
72/**
73 * v4l2_async_notifier - v4l2_device notifier data
74 * @num_subdevs:number of subdevices
75 * @subdev: array of pointers to subdevice descriptors
76 * @v4l2_dev: pointer to struct v4l2_device
77 * @waiting: list of struct v4l2_async_subdev, waiting for their drivers
78 * @done: list of struct v4l2_async_subdev_list, already probed
79 * @list: member in a global list of notifiers
80 * @bound: a subdevice driver has successfully probed one of subdevices
81 * @complete: all subdevices have been probed successfully
82 * @unbind: a subdevice is leaving
83 */
84struct v4l2_async_notifier {
85 unsigned int num_subdevs;
86 struct v4l2_async_subdev **subdev;
87 struct v4l2_device *v4l2_dev;
88 struct list_head waiting;
89 struct list_head done;
90 struct list_head list;
91 int (*bound)(struct v4l2_async_notifier *notifier,
92 struct v4l2_subdev *subdev,
93 struct v4l2_async_subdev *asd);
94 int (*complete)(struct v4l2_async_notifier *notifier);
95 void (*unbind)(struct v4l2_async_notifier *notifier,
96 struct v4l2_subdev *subdev,
97 struct v4l2_async_subdev *asd);
98};
99
100int v4l2_async_notifier_register(struct v4l2_device *v4l2_dev,
101 struct v4l2_async_notifier *notifier);
102void v4l2_async_notifier_unregister(struct v4l2_async_notifier *notifier);
103int v4l2_async_register_subdev(struct v4l2_subdev *sd);
104void v4l2_async_unregister_subdev(struct v4l2_subdev *sd);
105#endif
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h
deleted file mode 100644
index c259b36bf1e9..000000000000
--- a/include/media/v4l2-chip-ident.h
+++ /dev/null
@@ -1,352 +0,0 @@
1/*
2 v4l2 chip identifiers header
3
4 This header provides a list of chip identifiers that can be returned
5 through the VIDIOC_DBG_G_CHIP_IDENT ioctl.
6
7 Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl>
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23
24#ifndef V4L2_CHIP_IDENT_H_
25#define V4L2_CHIP_IDENT_H_
26
27/* VIDIOC_DBG_G_CHIP_IDENT: identifies the actual chip installed on the board */
28
29/* KEEP THIS LIST ORDERED BY ID!
30 Otherwise it will be hard to see which ranges are already in use when
31 adding support to a new chip family. */
32enum {
33 /* general idents: reserved range 0-49 */
34 V4L2_IDENT_NONE = 0, /* No chip matched */
35 V4L2_IDENT_AMBIGUOUS = 1, /* Match too general, multiple chips matched */
36 V4L2_IDENT_UNKNOWN = 2, /* Chip found, but cannot identify */
37
38 /* module tvaudio: reserved range 50-99 */
39 V4L2_IDENT_TVAUDIO = 50, /* A tvaudio chip, unknown which it is exactly */
40
41 /* Sony IMX074 */
42 V4L2_IDENT_IMX074 = 74,
43
44 /* module saa7110: just ident 100 */
45 V4L2_IDENT_SAA7110 = 100,
46
47 /* module saa7115: reserved range 101-149 */
48 V4L2_IDENT_SAA7111 = 101,
49 V4L2_IDENT_SAA7111A = 102,
50 V4L2_IDENT_SAA7113 = 103,
51 V4L2_IDENT_SAA7114 = 104,
52 V4L2_IDENT_SAA7115 = 105,
53 V4L2_IDENT_SAA7118 = 108,
54
55 /* module saa7127: reserved range 150-199 */
56 V4L2_IDENT_SAA7127 = 157,
57 V4L2_IDENT_SAA7129 = 159,
58
59 /* module cx25840: reserved range 200-249 */
60 V4L2_IDENT_CX25836 = 236,
61 V4L2_IDENT_CX25837 = 237,
62 V4L2_IDENT_CX25840 = 240,
63 V4L2_IDENT_CX25841 = 241,
64 V4L2_IDENT_CX25842 = 242,
65 V4L2_IDENT_CX25843 = 243,
66
67 /* OmniVision sensors: reserved range 250-299 */
68 V4L2_IDENT_OV7670 = 250,
69 V4L2_IDENT_OV7720 = 251,
70 V4L2_IDENT_OV7725 = 252,
71 V4L2_IDENT_OV7660 = 253,
72 V4L2_IDENT_OV9650 = 254,
73 V4L2_IDENT_OV9655 = 255,
74 V4L2_IDENT_SOI968 = 256,
75 V4L2_IDENT_OV9640 = 257,
76 V4L2_IDENT_OV6650 = 258,
77 V4L2_IDENT_OV2640 = 259,
78 V4L2_IDENT_OV9740 = 260,
79 V4L2_IDENT_OV5642 = 261,
80
81 /* module saa7146: reserved range 300-309 */
82 V4L2_IDENT_SAA7146 = 300,
83
84 /* Conexant MPEG encoder/decoders: reserved range 400-420 */
85 V4L2_IDENT_CX23418_843 = 403, /* Integrated A/V Decoder on the '418 */
86 V4L2_IDENT_CX23415 = 415,
87 V4L2_IDENT_CX23416 = 416,
88 V4L2_IDENT_CX23417 = 417,
89 V4L2_IDENT_CX23418 = 418,
90
91 /* module bt819: reserved range 810-819 */
92 V4L2_IDENT_BT815A = 815,
93 V4L2_IDENT_BT817A = 817,
94 V4L2_IDENT_BT819A = 819,
95
96 /* module au0828 */
97 V4L2_IDENT_AU0828 = 828,
98
99 /* module bttv: ident 848 + 849 */
100 V4L2_IDENT_BT848 = 848,
101 V4L2_IDENT_BT849 = 849,
102
103 /* module bt856: just ident 856 */
104 V4L2_IDENT_BT856 = 856,
105
106 /* module bt866: just ident 866 */
107 V4L2_IDENT_BT866 = 866,
108
109 /* module bttv: ident 878 + 879 */
110 V4L2_IDENT_BT878 = 878,
111 V4L2_IDENT_BT879 = 879,
112
113 /* module ks0127: reserved range 1120-1129 */
114 V4L2_IDENT_KS0122S = 1122,
115 V4L2_IDENT_KS0127 = 1127,
116 V4L2_IDENT_KS0127B = 1128,
117
118 /* module indycam: just ident 2000 */
119 V4L2_IDENT_INDYCAM = 2000,
120
121 /* module vp27smpx: just ident 2700 */
122 V4L2_IDENT_VP27SMPX = 2700,
123
124 /* module vpx3220: reserved range: 3210-3229 */
125 V4L2_IDENT_VPX3214C = 3214,
126 V4L2_IDENT_VPX3216B = 3216,
127 V4L2_IDENT_VPX3220A = 3220,
128
129 /* VX855 just ident 3409 */
130 /* Other via devs could use 3314, 3324, 3327, 3336, 3364, 3353 */
131 V4L2_IDENT_VIA_VX855 = 3409,
132
133 /* module tvp5150 */
134 V4L2_IDENT_TVP5150 = 5150,
135
136 /* module saa5246a: just ident 5246 */
137 V4L2_IDENT_SAA5246A = 5246,
138
139 /* module saa5249: just ident 5249 */
140 V4L2_IDENT_SAA5249 = 5249,
141
142 /* module cs5345: just ident 5345 */
143 V4L2_IDENT_CS5345 = 5345,
144
145 /* module tea6415c: just ident 6415 */
146 V4L2_IDENT_TEA6415C = 6415,
147
148 /* module tea6420: just ident 6420 */
149 V4L2_IDENT_TEA6420 = 6420,
150
151 /* module saa6588: just ident 6588 */
152 V4L2_IDENT_SAA6588 = 6588,
153
154 /* module vs6624: just ident 6624 */
155 V4L2_IDENT_VS6624 = 6624,
156
157 /* module saa6752hs: reserved range 6750-6759 */
158 V4L2_IDENT_SAA6752HS = 6752,
159 V4L2_IDENT_SAA6752HS_AC3 = 6753,
160
161 /* modules tef6862: just ident 6862 */
162 V4L2_IDENT_TEF6862 = 6862,
163
164 /* module tvp7002: just ident 7002 */
165 V4L2_IDENT_TVP7002 = 7002,
166
167 /* module adv7170: just ident 7170 */
168 V4L2_IDENT_ADV7170 = 7170,
169
170 /* module adv7175: just ident 7175 */
171 V4L2_IDENT_ADV7175 = 7175,
172
173 /* module adv7180: just ident 7180 */
174 V4L2_IDENT_ADV7180 = 7180,
175
176 /* module adv7183: just ident 7183 */
177 V4L2_IDENT_ADV7183 = 7183,
178
179 /* module saa7185: just ident 7185 */
180 V4L2_IDENT_SAA7185 = 7185,
181
182 /* module saa7191: just ident 7191 */
183 V4L2_IDENT_SAA7191 = 7191,
184
185 /* module ths7303: just ident 7303 */
186 V4L2_IDENT_THS7303 = 7303,
187
188 /* module adv7343: just ident 7343 */
189 V4L2_IDENT_ADV7343 = 7343,
190
191 /* module ths7353: just ident 7353 */
192 V4L2_IDENT_THS7353 = 7353,
193
194 /* module adv7393: just ident 7393 */
195 V4L2_IDENT_ADV7393 = 7393,
196
197 /* module adv7604: just ident 7604 */
198 V4L2_IDENT_ADV7604 = 7604,
199
200 /* module saa7706h: just ident 7706 */
201 V4L2_IDENT_SAA7706H = 7706,
202
203 /* module mt9v011, just ident 8243 */
204 V4L2_IDENT_MT9V011 = 8243,
205
206 /* module wm8739: just ident 8739 */
207 V4L2_IDENT_WM8739 = 8739,
208
209 /* module wm8775: just ident 8775 */
210 V4L2_IDENT_WM8775 = 8775,
211
212 /* Marvell controllers starting at 8801 */
213 V4L2_IDENT_CAFE = 8801,
214 V4L2_IDENT_ARMADA610 = 8802,
215
216 /* AKM AK8813/AK8814 */
217 V4L2_IDENT_AK8813 = 8813,
218 V4L2_IDENT_AK8814 = 8814,
219
220 /* module cx23885 and cx25840 */
221 V4L2_IDENT_CX23885 = 8850,
222 V4L2_IDENT_CX23885_AV = 8851, /* Integrated A/V decoder */
223 V4L2_IDENT_CX23887 = 8870,
224 V4L2_IDENT_CX23887_AV = 8871, /* Integrated A/V decoder */
225 V4L2_IDENT_CX23888 = 8880,
226 V4L2_IDENT_CX23888_AV = 8881, /* Integrated A/V decoder */
227 V4L2_IDENT_CX23888_IR = 8882, /* Integrated infrared controller */
228
229 /* module ad9389b: just ident 9389 */
230 V4L2_IDENT_AD9389B = 9389,
231
232 /* module tda9840: just ident 9840 */
233 V4L2_IDENT_TDA9840 = 9840,
234
235 /* module tw9910: just ident 9910 */
236 V4L2_IDENT_TW9910 = 9910,
237
238 /* module sn9c20x: just ident 10000 */
239 V4L2_IDENT_SN9C20X = 10000,
240
241 /* module cx231xx and cx25840 */
242 V4L2_IDENT_CX2310X_AV = 23099, /* Integrated A/V decoder; not in '100 */
243 V4L2_IDENT_CX23100 = 23100,
244 V4L2_IDENT_CX23101 = 23101,
245 V4L2_IDENT_CX23102 = 23102,
246
247 /* module msp3400: reserved range 34000-34999 for msp34xx */
248 V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only
249 use internally (tveeprom.c). */
250
251 V4L2_IDENT_MSP3400B = 34002,
252 V4L2_IDENT_MSP3400C = 34003,
253 V4L2_IDENT_MSP3400D = 34004,
254 V4L2_IDENT_MSP3400G = 34007,
255 V4L2_IDENT_MSP3401G = 34017,
256 V4L2_IDENT_MSP3402G = 34027,
257 V4L2_IDENT_MSP3405D = 34054,
258 V4L2_IDENT_MSP3405G = 34057,
259 V4L2_IDENT_MSP3407D = 34074,
260 V4L2_IDENT_MSP3407G = 34077,
261
262 V4L2_IDENT_MSP3410B = 34102,
263 V4L2_IDENT_MSP3410C = 34103,
264 V4L2_IDENT_MSP3410D = 34104,
265 V4L2_IDENT_MSP3410G = 34107,
266 V4L2_IDENT_MSP3411G = 34117,
267 V4L2_IDENT_MSP3412G = 34127,
268 V4L2_IDENT_MSP3415D = 34154,
269 V4L2_IDENT_MSP3415G = 34157,
270 V4L2_IDENT_MSP3417D = 34174,
271 V4L2_IDENT_MSP3417G = 34177,
272
273 V4L2_IDENT_MSP3420G = 34207,
274 V4L2_IDENT_MSP3421G = 34217,
275 V4L2_IDENT_MSP3422G = 34227,
276 V4L2_IDENT_MSP3425G = 34257,
277 V4L2_IDENT_MSP3427G = 34277,
278
279 V4L2_IDENT_MSP3430G = 34307,
280 V4L2_IDENT_MSP3431G = 34317,
281 V4L2_IDENT_MSP3435G = 34357,
282 V4L2_IDENT_MSP3437G = 34377,
283
284 V4L2_IDENT_MSP3440G = 34407,
285 V4L2_IDENT_MSP3441G = 34417,
286 V4L2_IDENT_MSP3442G = 34427,
287 V4L2_IDENT_MSP3445G = 34457,
288 V4L2_IDENT_MSP3447G = 34477,
289
290 V4L2_IDENT_MSP3450G = 34507,
291 V4L2_IDENT_MSP3451G = 34517,
292 V4L2_IDENT_MSP3452G = 34527,
293 V4L2_IDENT_MSP3455G = 34557,
294 V4L2_IDENT_MSP3457G = 34577,
295
296 V4L2_IDENT_MSP3460G = 34607,
297 V4L2_IDENT_MSP3461G = 34617,
298 V4L2_IDENT_MSP3465G = 34657,
299 V4L2_IDENT_MSP3467G = 34677,
300
301 /* module msp3400: reserved range 44000-44999 for msp44xx */
302 V4L2_IDENT_MSP4400G = 44007,
303 V4L2_IDENT_MSP4408G = 44087,
304 V4L2_IDENT_MSP4410G = 44107,
305 V4L2_IDENT_MSP4418G = 44187,
306 V4L2_IDENT_MSP4420G = 44207,
307 V4L2_IDENT_MSP4428G = 44287,
308 V4L2_IDENT_MSP4440G = 44407,
309 V4L2_IDENT_MSP4448G = 44487,
310 V4L2_IDENT_MSP4450G = 44507,
311 V4L2_IDENT_MSP4458G = 44587,
312
313 /* Micron CMOS sensor chips: 45000-45099 */
314 V4L2_IDENT_MT9M001C12ST = 45000,
315 V4L2_IDENT_MT9M001C12STM = 45005,
316 V4L2_IDENT_MT9M111 = 45007,
317 V4L2_IDENT_MT9M112 = 45008,
318 V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */
319 V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */
320 V4L2_IDENT_MT9T031 = 45020,
321 V4L2_IDENT_MT9T111 = 45021,
322 V4L2_IDENT_MT9T112 = 45022,
323 V4L2_IDENT_MT9V111 = 45031,
324 V4L2_IDENT_MT9V112 = 45032,
325
326 /* HV7131R CMOS sensor: just ident 46000 */
327 V4L2_IDENT_HV7131R = 46000,
328
329 /* Sharp RJ54N1CB0C, 0xCB0C = 51980 */
330 V4L2_IDENT_RJ54N1CB0C = 51980,
331
332 /* module m52790: just ident 52790 */
333 V4L2_IDENT_M52790 = 52790,
334
335 /* module cs53132a: just ident 53132 */
336 V4L2_IDENT_CS53l32A = 53132,
337
338 /* modules upd61151 MPEG2 encoder: just ident 54000 */
339 V4L2_IDENT_UPD61161 = 54000,
340 /* modules upd61152 MPEG2 encoder with AC3: just ident 54001 */
341 V4L2_IDENT_UPD61162 = 54001,
342
343 /* module upd64031a: just ident 64031 */
344 V4L2_IDENT_UPD64031A = 64031,
345
346 /* module upd64083: just ident 64083 */
347 V4L2_IDENT_UPD64083 = 64083,
348
349 /* Don't just add new IDs at the end: KEEP THIS LIST ORDERED BY ID! */
350};
351
352#endif
diff --git a/include/media/v4l2-clk.h b/include/media/v4l2-clk.h
new file mode 100644
index 000000000000..0503a90b48bb
--- /dev/null
+++ b/include/media/v4l2-clk.h
@@ -0,0 +1,54 @@
1/*
2 * V4L2 clock service
3 *
4 * Copyright (C) 2012-2013, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ATTENTION: This is a temporary API and it shall be replaced by the generic
11 * clock API, when the latter becomes widely available.
12 */
13
14#ifndef MEDIA_V4L2_CLK_H
15#define MEDIA_V4L2_CLK_H
16
17#include <linux/atomic.h>
18#include <linux/list.h>
19#include <linux/mutex.h>
20
21struct module;
22struct device;
23
24struct v4l2_clk {
25 struct list_head list;
26 const struct v4l2_clk_ops *ops;
27 const char *dev_id;
28 const char *id;
29 int enable;
30 struct mutex lock; /* Protect the enable count */
31 atomic_t use_count;
32 void *priv;
33};
34
35struct v4l2_clk_ops {
36 struct module *owner;
37 int (*enable)(struct v4l2_clk *clk);
38 void (*disable)(struct v4l2_clk *clk);
39 unsigned long (*get_rate)(struct v4l2_clk *clk);
40 int (*set_rate)(struct v4l2_clk *clk, unsigned long);
41};
42
43struct v4l2_clk *v4l2_clk_register(const struct v4l2_clk_ops *ops,
44 const char *dev_name,
45 const char *name, void *priv);
46void v4l2_clk_unregister(struct v4l2_clk *clk);
47struct v4l2_clk *v4l2_clk_get(struct device *dev, const char *id);
48void v4l2_clk_put(struct v4l2_clk *clk);
49int v4l2_clk_enable(struct v4l2_clk *clk);
50void v4l2_clk_disable(struct v4l2_clk *clk);
51unsigned long v4l2_clk_get_rate(struct v4l2_clk *clk);
52int v4l2_clk_set_rate(struct v4l2_clk *clk, unsigned long rate);
53
54#endif
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 1d93c48cb371..015ff82da73c 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -100,16 +100,6 @@ u32 v4l2_ctrl_next(const u32 * const *ctrl_classes, u32 id);
100 100
101/* ------------------------------------------------------------------------- */ 101/* ------------------------------------------------------------------------- */
102 102
103/* Register/chip ident helper function */
104
105struct i2c_client; /* forward reference */
106int v4l2_chip_match_i2c_client(struct i2c_client *c, const struct v4l2_dbg_match *match);
107int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct v4l2_dbg_chip_ident *chip,
108 u32 ident, u32 revision);
109int v4l2_chip_match_host(const struct v4l2_dbg_match *match);
110
111/* ------------------------------------------------------------------------- */
112
113/* I2C Helper functions */ 103/* I2C Helper functions */
114 104
115struct i2c_driver; 105struct i2c_driver;
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 95d1c91770f4..c768c9f8abc2 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -96,9 +96,9 @@ struct video_device
96 struct device dev; /* v4l device */ 96 struct device dev; /* v4l device */
97 struct cdev *cdev; /* character device */ 97 struct cdev *cdev; /* character device */
98 98
99 /* Set either parent or v4l2_dev if your driver uses v4l2_device */
100 struct device *parent; /* device parent */
101 struct v4l2_device *v4l2_dev; /* v4l2_device parent */ 99 struct v4l2_device *v4l2_dev; /* v4l2_device parent */
100 /* Only set parent if that can't be deduced from v4l2_dev */
101 struct device *dev_parent; /* device parent */
102 102
103 /* Control handler associated with this device node. May be NULL. */ 103 /* Control handler associated with this device node. May be NULL. */
104 struct v4l2_ctrl_handler *ctrl_handler; 104 struct v4l2_ctrl_handler *ctrl_handler;
@@ -129,7 +129,6 @@ struct video_device
129 129
130 /* Video standard vars */ 130 /* Video standard vars */
131 v4l2_std_id tvnorms; /* Supported tv norms */ 131 v4l2_std_id tvnorms; /* Supported tv norms */
132 v4l2_std_id current_norm; /* Current tvnorm */
133 132
134 /* callbacks */ 133 /* callbacks */
135 void (*release)(struct video_device *vdev); 134 void (*release)(struct video_device *vdev);
diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h
index e6aa2318367b..0286c95814ff 100644
--- a/include/media/v4l2-int-device.h
+++ b/include/media/v4l2-int-device.h
@@ -220,8 +220,6 @@ enum v4l2_int_ioctl_num {
220 vidioc_int_reset_num, 220 vidioc_int_reset_num,
221 /* VIDIOC_INT_INIT */ 221 /* VIDIOC_INT_INIT */
222 vidioc_int_init_num, 222 vidioc_int_init_num,
223 /* VIDIOC_DBG_G_CHIP_IDENT */
224 vidioc_int_g_chip_ident_num,
225 223
226 /* 224 /*
227 * 225 *
@@ -303,6 +301,5 @@ V4L2_INT_WRAPPER_1(enum_frameintervals, struct v4l2_frmivalenum, *);
303 301
304V4L2_INT_WRAPPER_0(reset); 302V4L2_INT_WRAPPER_0(reset);
305V4L2_INT_WRAPPER_0(init); 303V4L2_INT_WRAPPER_0(init);
306V4L2_INT_WRAPPER_1(g_chip_ident, int, *);
307 304
308#endif 305#endif
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index 931652f0e2af..e0b74a430b3a 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -247,8 +247,6 @@ struct v4l2_ioctl_ops {
247 int (*vidioc_g_chip_info) (struct file *file, void *fh, 247 int (*vidioc_g_chip_info) (struct file *file, void *fh,
248 struct v4l2_dbg_chip_info *chip); 248 struct v4l2_dbg_chip_info *chip);
249#endif 249#endif
250 int (*vidioc_g_chip_ident) (struct file *file, void *fh,
251 struct v4l2_dbg_chip_ident *chip);
252 250
253 int (*vidioc_enum_framesizes) (struct file *file, void *fh, 251 int (*vidioc_enum_framesizes) (struct file *file, void *fh,
254 struct v4l2_frmsizeenum *fsize); 252 struct v4l2_frmsizeenum *fsize);
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 5298d678d0f3..3250cc5e7925 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -24,6 +24,7 @@
24#include <linux/types.h> 24#include <linux/types.h>
25#include <linux/v4l2-subdev.h> 25#include <linux/v4l2-subdev.h>
26#include <media/media-entity.h> 26#include <media/media-entity.h>
27#include <media/v4l2-async.h>
27#include <media/v4l2-common.h> 28#include <media/v4l2-common.h>
28#include <media/v4l2-dev.h> 29#include <media/v4l2-dev.h>
29#include <media/v4l2-fh.h> 30#include <media/v4l2-fh.h>
@@ -88,7 +89,6 @@ struct v4l2_decode_vbi_line {
88 89
89/* Core ops: it is highly recommended to implement at least these ops: 90/* Core ops: it is highly recommended to implement at least these ops:
90 91
91 g_chip_ident
92 log_status 92 log_status
93 g_register 93 g_register
94 s_register 94 s_register
@@ -145,7 +145,6 @@ struct v4l2_subdev_io_pin_config {
145 performed later. It must not sleep. *Called from an IRQ context*. 145 performed later. It must not sleep. *Called from an IRQ context*.
146 */ 146 */
147struct v4l2_subdev_core_ops { 147struct v4l2_subdev_core_ops {
148 int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);
149 int (*log_status)(struct v4l2_subdev *sd); 148 int (*log_status)(struct v4l2_subdev *sd);
150 int (*s_io_pin_config)(struct v4l2_subdev *sd, size_t n, 149 int (*s_io_pin_config)(struct v4l2_subdev *sd, size_t n,
151 struct v4l2_subdev_io_pin_config *pincfg); 150 struct v4l2_subdev_io_pin_config *pincfg);
@@ -585,8 +584,17 @@ struct v4l2_subdev {
585 void *host_priv; 584 void *host_priv;
586 /* subdev device node */ 585 /* subdev device node */
587 struct video_device *devnode; 586 struct video_device *devnode;
587 /* pointer to the physical device, if any */
588 struct device *dev;
589 struct v4l2_async_subdev_list asdl;
588}; 590};
589 591
592static inline struct v4l2_subdev *v4l2_async_to_subdev(
593 struct v4l2_async_subdev_list *asdl)
594{
595 return container_of(asdl, struct v4l2_subdev, asdl);
596}
597
590#define media_entity_to_v4l2_subdev(ent) \ 598#define media_entity_to_v4l2_subdev(ent) \
591 container_of(ent, struct v4l2_subdev, entity) 599 container_of(ent, struct v4l2_subdev, entity)
592#define vdev_to_v4l2_subdev(vdev) \ 600#define vdev_to_v4l2_subdev(vdev) \
@@ -660,7 +668,7 @@ void v4l2_subdev_init(struct v4l2_subdev *sd,
660/* Call an ops of a v4l2_subdev, doing the right checks against 668/* Call an ops of a v4l2_subdev, doing the right checks against
661 NULL pointers. 669 NULL pointers.
662 670
663 Example: err = v4l2_subdev_call(sd, core, g_chip_ident, &chip); 671 Example: err = v4l2_subdev_call(sd, core, s_std, norm);
664 */ 672 */
665#define v4l2_subdev_call(sd, o, f, args...) \ 673#define v4l2_subdev_call(sd, o, f, args...) \
666 (!(sd) ? -ENODEV : (((sd)->ops->o && (sd)->ops->o->f) ? \ 674 (!(sd) ? -ENODEV : (((sd)->ops->o && (sd)->ops->o->f) ? \
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index 69bd5bb0d5af..e90a88a8708f 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -53,13 +53,13 @@
53#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */ 53#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */
54#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ 54#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
55#define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ 55#define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */
56#define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */ 56#define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator controls */
57#define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */ 57#define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */
58#define V4L2_CTRL_CLASS_JPEG 0x009d0000 /* JPEG-compression controls */ 58#define V4L2_CTRL_CLASS_JPEG 0x009d0000 /* JPEG-compression controls */
59#define V4L2_CTRL_CLASS_IMAGE_SOURCE 0x009e0000 /* Image source controls */ 59#define V4L2_CTRL_CLASS_IMAGE_SOURCE 0x009e0000 /* Image source controls */
60#define V4L2_CTRL_CLASS_IMAGE_PROC 0x009f0000 /* Image processing controls */ 60#define V4L2_CTRL_CLASS_IMAGE_PROC 0x009f0000 /* Image processing controls */
61#define V4L2_CTRL_CLASS_DV 0x00a00000 /* Digital Video controls */ 61#define V4L2_CTRL_CLASS_DV 0x00a00000 /* Digital Video controls */
62#define V4L2_CTRL_CLASS_FM_RX 0x00a10000 /* Digital Video controls */ 62#define V4L2_CTRL_CLASS_FM_RX 0x00a10000 /* FM Receiver controls */
63 63
64/* User-class control IDs */ 64/* User-class control IDs */
65 65
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index f40b41c7e108..95ef4551edc1 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -395,7 +395,7 @@ struct v4l2_pix_format {
395#define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */ 395#define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */
396#define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */ 396#define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */
397#define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */ 397#define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */
398#define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 ES */ 398#define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 part 2 ES */
399#define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */ 399#define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */
400#define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */ 400#define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */
401#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */ 401#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
@@ -555,7 +555,7 @@ struct v4l2_jpegcompression {
555 __u32 jpeg_markers; /* Which markers should go into the JPEG 555 __u32 jpeg_markers; /* Which markers should go into the JPEG
556 * output. Unless you exactly know what 556 * output. Unless you exactly know what
557 * you do, leave them untouched. 557 * you do, leave them untouched.
558 * Inluding less markers will make the 558 * Including less markers will make the
559 * resulting code smaller, but there will 559 * resulting code smaller, but there will
560 * be fewer applications which can read it. 560 * be fewer applications which can read it.
561 * The presence of the APP and COM marker 561 * The presence of the APP and COM marker
@@ -567,7 +567,7 @@ struct v4l2_jpegcompression {
567#define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */ 567#define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */
568#define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */ 568#define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */
569#define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will 569#define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will
570 * allways use APP0 */ 570 * always use APP0 */
571}; 571};
572 572
573/* 573/*
@@ -900,7 +900,7 @@ typedef __u64 v4l2_std_id;
900/* 900/*
901 * "Common" PAL - This macro is there to be compatible with the old 901 * "Common" PAL - This macro is there to be compatible with the old
902 * V4L1 concept of "PAL": /BGDKHI. 902 * V4L1 concept of "PAL": /BGDKHI.
903 * Several PAL standards are mising here: /M, /N and /Nc 903 * Several PAL standards are missing here: /M, /N and /Nc
904 */ 904 */
905#define V4L2_STD_PAL (V4L2_STD_PAL_BG |\ 905#define V4L2_STD_PAL (V4L2_STD_PAL_BG |\
906 V4L2_STD_PAL_DK |\ 906 V4L2_STD_PAL_DK |\
@@ -1787,11 +1787,13 @@ struct v4l2_event_subscription {
1787/* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */ 1787/* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */
1788 1788
1789#define V4L2_CHIP_MATCH_BRIDGE 0 /* Match against chip ID on the bridge (0 for the bridge) */ 1789#define V4L2_CHIP_MATCH_BRIDGE 0 /* Match against chip ID on the bridge (0 for the bridge) */
1790#define V4L2_CHIP_MATCH_SUBDEV 4 /* Match against subdev index */
1791
1792/* The following four defines are no longer in use */
1790#define V4L2_CHIP_MATCH_HOST V4L2_CHIP_MATCH_BRIDGE 1793#define V4L2_CHIP_MATCH_HOST V4L2_CHIP_MATCH_BRIDGE
1791#define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver name */ 1794#define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver name */
1792#define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */ 1795#define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */
1793#define V4L2_CHIP_MATCH_AC97 3 /* Match against anciliary AC97 chip */ 1796#define V4L2_CHIP_MATCH_AC97 3 /* Match against ancillary AC97 chip */
1794#define V4L2_CHIP_MATCH_SUBDEV 4 /* Match against subdev index */
1795 1797
1796struct v4l2_dbg_match { 1798struct v4l2_dbg_match {
1797 __u32 type; /* Match type */ 1799 __u32 type; /* Match type */
@@ -1808,13 +1810,6 @@ struct v4l2_dbg_register {
1808 __u64 val; 1810 __u64 val;
1809} __attribute__ ((packed)); 1811} __attribute__ ((packed));
1810 1812
1811/* VIDIOC_DBG_G_CHIP_IDENT */
1812struct v4l2_dbg_chip_ident {
1813 struct v4l2_dbg_match match;
1814 __u32 ident; /* chip identifier as specified in <media/v4l2-chip-ident.h> */
1815 __u32 revision; /* chip revision, chip specific */
1816} __attribute__ ((packed));
1817
1818#define V4L2_CHIP_FL_READABLE (1 << 0) 1813#define V4L2_CHIP_FL_READABLE (1 << 0)
1819#define V4L2_CHIP_FL_WRITABLE (1 << 1) 1814#define V4L2_CHIP_FL_WRITABLE (1 << 1)
1820 1815
@@ -1915,12 +1910,6 @@ struct v4l2_create_buffers {
1915#define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register) 1910#define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register)
1916#define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register) 1911#define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register)
1917 1912
1918/* Experimental, meant for debugging, testing and internal use.
1919 Never use this ioctl in applications!
1920 Note: this ioctl is deprecated in favor of VIDIOC_DBG_G_CHIP_INFO and
1921 will go away in the future. */
1922#define VIDIOC_DBG_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_dbg_chip_ident)
1923
1924#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) 1913#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek)
1925 1914
1926#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings) 1915#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings)