summaryrefslogtreecommitdiff
path: root/linux/include
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-03-13 10:08:20 +0100
committerGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-03-13 10:08:20 +0100
commita00a0b74b7fe24e815f70f49ac8b8cc073cdad80 (patch)
treef16012aa64f3de3532962c5d7e6d3024d3a341aa /linux/include
parentedd96a81211ebded1ed720e24e5f81ffec94c455 (diff)
downloadmediapointer-dvb-s2-a00a0b74b7fe24e815f70f49ac8b8cc073cdad80.tar.gz
mediapointer-dvb-s2-a00a0b74b7fe24e815f70f49ac8b8cc073cdad80.tar.bz2
soc-camera: configure drivers with a default format at probe time
From: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Currently soc-camera doesn't set up any image format without an explicit S_FMT. According to the API this should be supported, for example, capture-example.c from v4l2-apps by default doesn't issue an S_FMT. This patch moves negotiating of available host-camera format translations to probe() time, and restores the state from the last close() on the next open(). This is needed for some drivers, which power down or reset hardware after the last user closes the interface. This patch also has a nice side-effect of avoiding multiple allocation anf freeing of format translation tables. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> --- drivers/media/video/soc_camera.c | 39 ++++++++++++++++++++++--------------- include/media/soc_camera.h | 1 + 2 files changed, 24 insertions(+), 16 deletions(-)
Diffstat (limited to 'linux/include')
-rw-r--r--linux/include/media/soc_camera.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/linux/include/media/soc_camera.h b/linux/include/media/soc_camera.h
index e9eb60740..013c81875 100644
--- a/linux/include/media/soc_camera.h
+++ b/linux/include/media/soc_camera.h
@@ -45,6 +45,7 @@ struct soc_camera_device {
int num_formats;
struct soc_camera_format_xlate *user_formats;
int num_user_formats;
+ enum v4l2_field field; /* Preserve field over close() */
struct module *owner;
void *host_priv; /* Per-device host private data */
/* soc_camera.c private count. Only accessed with .video_lock held */