summaryrefslogtreecommitdiff
path: root/linux/include/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-03-18 12:17:14 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-18 12:17:14 -0300
commit976a91082e499203f3700aa589a54aefedc3c22a (patch)
tree311541d0a78d789d3f59dbba22637ce262227f51 /linux/include/media
parentd42d95e43ed8a60e001ff0a8a4f323380098be7d (diff)
parent70bbc9f369222fa300c1fcb727eefd22da4db452 (diff)
downloadmediapointer-dvb-s2-976a91082e499203f3700aa589a54aefedc3c22a.tar.gz
mediapointer-dvb-s2-976a91082e499203f3700aa589a54aefedc3c22a.tar.bz2
merge: http://linuxtv.org/hg/~dheitmueller/hvr950q-analog2
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/include/media')
-rw-r--r--linux/include/media/bt819.h33
-rw-r--r--linux/include/media/ir-kbd-i2c.h3
-rw-r--r--linux/include/media/soc_camera.h16
-rw-r--r--linux/include/media/v4l2-device.h9
-rw-r--r--linux/include/media/v4l2-subdev.h5
5 files changed, 59 insertions, 7 deletions
diff --git a/linux/include/media/bt819.h b/linux/include/media/bt819.h
new file mode 100644
index 000000000..38f666bde
--- /dev/null
+++ b/linux/include/media/bt819.h
@@ -0,0 +1,33 @@
+/*
+ bt819.h - bt819 notifications
+
+ Copyright (C) 2009 Hans Verkuil (hverkuil@xs4all.nl)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef _BT819_H_
+#define _BT819_H_
+
+#include <linux/ioctl.h>
+
+/* v4l2_device notifications. */
+
+/* Needed to reset the FIFO buffer when changing the input
+ or the video standard. */
+#define BT819_FIFO_RESET_LOW _IO('b', 0)
+#define BT819_FIFO_RESET_HIGH _IO('b', 1)
+
+#endif
diff --git a/linux/include/media/ir-kbd-i2c.h b/linux/include/media/ir-kbd-i2c.h
index 00fa57eb9..07963d705 100644
--- a/linux/include/media/ir-kbd-i2c.h
+++ b/linux/include/media/ir-kbd-i2c.h
@@ -14,8 +14,7 @@ struct IR_i2c {
/* Used to avoid fast repeating */
unsigned char old;
- struct work_struct work;
- struct timer_list timer;
+ struct delayed_work work;
char phys[32];
int (*get_key)(struct IR_i2c*, u32*, u32*);
};
diff --git a/linux/include/media/soc_camera.h b/linux/include/media/soc_camera.h
index c63a3409f..37013688a 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 */
@@ -74,7 +75,8 @@ struct soc_camera_host_ops {
int (*resume)(struct soc_camera_device *);
int (*get_formats)(struct soc_camera_device *, int,
struct soc_camera_format_xlate *);
- int (*set_fmt)(struct soc_camera_device *, __u32, struct v4l2_rect *);
+ int (*set_crop)(struct soc_camera_device *, struct v4l2_rect *);
+ int (*set_fmt)(struct soc_camera_device *, struct v4l2_format *);
int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *);
void (*init_videobuf)(struct videobuf_queue *,
struct soc_camera_device *);
@@ -93,13 +95,18 @@ struct soc_camera_host_ops {
struct soc_camera_link {
/* Camera bus id, used to match a camera and a bus */
int bus_id;
- /* GPIO number to switch between 8 and 10 bit modes */
- unsigned int gpio;
/* Per camera SOCAM_SENSOR_* bus flags */
unsigned long flags;
/* Optional callbacks to power on or off and reset the sensor */
int (*power)(struct device *, int);
int (*reset)(struct device *);
+ /*
+ * some platforms may support different data widths than the sensors
+ * native ones due to different data line routing. Let the board code
+ * overwrite the width flags.
+ */
+ int (*set_bus_param)(struct soc_camera_link *, unsigned long flags);
+ unsigned long (*query_bus_param)(struct soc_camera_link *);
};
static inline struct soc_camera_device *to_soc_camera_dev(struct device *dev)
@@ -159,7 +166,8 @@ struct soc_camera_ops {
int (*release)(struct soc_camera_device *);
int (*start_capture)(struct soc_camera_device *);
int (*stop_capture)(struct soc_camera_device *);
- int (*set_fmt)(struct soc_camera_device *, __u32, struct v4l2_rect *);
+ int (*set_crop)(struct soc_camera_device *, struct v4l2_rect *);
+ int (*set_fmt)(struct soc_camera_device *, struct v4l2_format *);
int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *);
unsigned long (*query_bus_param)(struct soc_camera_device *);
int (*set_bus_param)(struct soc_camera_device *, unsigned long);
diff --git a/linux/include/media/v4l2-device.h b/linux/include/media/v4l2-device.h
index 5d7146dc2..0dd3e8e86 100644
--- a/linux/include/media/v4l2-device.h
+++ b/linux/include/media/v4l2-device.h
@@ -44,13 +44,20 @@ struct v4l2_device {
spinlock_t lock;
/* unique device name, by default the driver name + bus ID */
char name[V4L2_DEVICE_NAME_SIZE];
+ /* notify callback called by some sub-devices. */
+ void (*notify)(struct v4l2_subdev *sd,
+ unsigned int notification, void *arg);
};
/* Initialize v4l2_dev and make dev->driver_data point to v4l2_dev.
dev may be NULL in rare cases (ISA devices). In that case you
must fill in the v4l2_dev->name field before calling this function. */
int __must_check v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev);
-/* Set v4l2_dev->dev->driver_data to NULL and unregister all sub-devices */
+/* Set v4l2_dev->dev to NULL. Call when the USB parent disconnects.
+ Since the parent disappears this ensures that v4l2_dev doesn't have an
+ invalid parent pointer. */
+void v4l2_device_disconnect(struct v4l2_device *v4l2_dev);
+/* Unregister all sub-devices and any other resources related to v4l2_dev. */
void v4l2_device_unregister(struct v4l2_device *v4l2_dev);
/* Register a subdev with a v4l2 device. While registered the subdev module
diff --git a/linux/include/media/v4l2-subdev.h b/linux/include/media/v4l2-subdev.h
index 05b69652e..1b97a2c33 100644
--- a/linux/include/media/v4l2-subdev.h
+++ b/linux/include/media/v4l2-subdev.h
@@ -191,4 +191,9 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd,
(!(sd) ? -ENODEV : (((sd) && (sd)->ops->o && (sd)->ops->o->f) ? \
(sd)->ops->o->f((sd) , ##args) : -ENOIOCTLCMD))
+/* Send a notification to v4l2_device. */
+#define v4l2_subdev_notify(sd, notification, arg) \
+ ((!(sd) || !(sd)->v4l2_dev || !(sd)->v4l2_dev->notify) ? -ENODEV : \
+ (sd)->v4l2_dev->notify((sd), (notification), (arg)))
+
#endif