From 33bdd5a88a0fb7fbd08947261b243fcec4ff089d Mon Sep 17 00:00:00 2001
From: Philipp Zabel
Date: Mon, 3 Jun 2013 04:23:48 -0300
Subject: [media] mem2mem: add support for hardware buffered queue
On mem2mem decoders with a hardware bitstream ringbuffer, to drain the
buffer at the end of the stream, remaining frames might need to be decoded
from the bitstream buffer without additional input buffers being provided.
To achieve this, allow a queue to be marked as buffered by the driver, and
allow scheduling of device_runs when buffered ready queues are empty.
This also allows a driver to copy input buffers into their bitstream
ringbuffer and immediately mark them as done to be dequeued.
The motivation for this patch is hardware assisted h.264 reordering support
in the coda driver. For high profile streams, the coda can hold back
out-of-order frames, causing a few mem2mem device runs in the beginning, that
don't produce any decompressed buffer at the v4l2 capture side. At the same
time, the last few frames can be decoded from the bitstream with mem2mem device
runs that don't need a new input buffer at the v4l2 output side. The decoder
command ioctl can be used to put the decoder into the ringbuffer draining
end-of-stream mode.
Signed-off-by: Philipp Zabel
Acked-by: Sylwester Nawrocki
Signed-off-by: Kamil Debski
Signed-off-by: Mauro Carvalho Chehab
---
include/media/v4l2-mem2mem.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
(limited to 'include')
diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h
index 0f4555b2a31b..44542a20ab81 100644
--- a/include/media/v4l2-mem2mem.h
+++ b/include/media/v4l2-mem2mem.h
@@ -60,6 +60,7 @@ struct v4l2_m2m_queue_ctx {
struct list_head rdy_queue;
spinlock_t rdy_spinlock;
u8 num_rdy;
+ bool buffered;
};
struct v4l2_m2m_ctx {
@@ -134,6 +135,18 @@ struct v4l2_m2m_ctx *v4l2_m2m_ctx_init(struct v4l2_m2m_dev *m2m_dev,
void *drv_priv,
int (*queue_init)(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_vq));
+static inline void v4l2_m2m_set_src_buffered(struct v4l2_m2m_ctx *m2m_ctx,
+ bool buffered)
+{
+ m2m_ctx->out_q_ctx.buffered = buffered;
+}
+
+static inline void v4l2_m2m_set_dst_buffered(struct v4l2_m2m_ctx *m2m_ctx,
+ bool buffered)
+{
+ m2m_ctx->cap_q_ctx.buffered = buffered;
+}
+
void v4l2_m2m_ctx_release(struct v4l2_m2m_ctx *m2m_ctx);
void v4l2_m2m_buf_queue(struct v4l2_m2m_ctx *m2m_ctx, struct vb2_buffer *vb);
--
cgit v1.2.3
From 873229e4fdf34196aa5d707957c59ba54c25eaba Mon Sep 17 00:00:00 2001
From: "Lad, Prabhakar"
Date: Tue, 25 Jun 2013 11:17:34 -0300
Subject: [media] media: davinci: vpif: capture: add V4L2-async support
Add support for asynchronous subdevice probing, using the v4l2-async API.
The legacy synchronous mode is still supported too, which allows to
gradually update drivers and platforms.
Signed-off-by: Prabhakar Lad
Cc: Guennadi Liakhovetski
Cc: Hans Verkuil
Cc: Laurent Pinchart
Cc: Sakari Ailus
Cc: Mauro Carvalho Chehab
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
---
include/media/davinci/vpif_types.h | 2 ++
1 file changed, 2 insertions(+)
(limited to 'include')
diff --git a/include/media/davinci/vpif_types.h b/include/media/davinci/vpif_types.h
index 3882e0675ccf..e08bcde52d05 100644
--- a/include/media/davinci/vpif_types.h
+++ b/include/media/davinci/vpif_types.h
@@ -81,5 +81,7 @@ struct vpif_capture_config {
struct vpif_subdev_info *subdev_info;
int subdev_count;
const char *card_name;
+ struct v4l2_async_subdev **asd; /* Flat array, arranged in groups */
+ int *asd_sizes; /* 0-terminated array of asd group sizes */
};
#endif /* _VPIF_TYPES_H */
--
cgit v1.2.3
From 4b8a531e6bb0686203e9cf82a54dfe189de7d5c2 Mon Sep 17 00:00:00 2001
From: "Lad, Prabhakar"
Date: Tue, 25 Jun 2013 11:17:35 -0300
Subject: [media] media: davinci: vpif: display: add V4L2-async support
Add support for asynchronous subdevice probing, using the v4l2-async API.
The legacy synchronous mode is still supported too, which allows to
gradually update drivers and platforms.
Signed-off-by: Lad, Prabhakar
Cc: Guennadi Liakhovetski
Cc: Hans Verkuil
Cc: Laurent Pinchart
Cc: Sakari Ailus
Cc: Mauro Carvalho Chehab
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
---
include/media/davinci/vpif_types.h | 2 ++
1 file changed, 2 insertions(+)
(limited to 'include')
diff --git a/include/media/davinci/vpif_types.h b/include/media/davinci/vpif_types.h
index e08bcde52d05..3cb1704a0650 100644
--- a/include/media/davinci/vpif_types.h
+++ b/include/media/davinci/vpif_types.h
@@ -59,6 +59,8 @@ struct vpif_display_config {
int subdev_count;
struct vpif_display_chan_config chan_config[VPIF_DISPLAY_MAX_CHANNELS];
const char *card_name;
+ struct v4l2_async_subdev **asd; /* Flat array, arranged in groups */
+ int *asd_sizes; /* 0-terminated array of asd group sizes */
};
struct vpif_input {
--
cgit v1.2.3
From 5e95814ff3f2a6ea7d76e822bbc3b0c0b94495a4 Mon Sep 17 00:00:00 2001
From: "Lad, Prabhakar"
Date: Sat, 20 Jul 2013 02:21:05 -0300
Subject: [media] media: i2c: adv7343: make the platform data members as array
This patch makes the platform data members as array wherever
possible, so as this makes easier while collecting the data
in DT case and read the entire array at once.
This patch also makes appropriate changes to board-da850-evm.c
Signed-off-by: Lad, Prabhakar
Acked-by: Sekhar Nori
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
---
include/media/adv7343.h | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
(limited to 'include')
diff --git a/include/media/adv7343.h b/include/media/adv7343.h
index 944757be49bb..e4142b1ef8cd 100644
--- a/include/media/adv7343.h
+++ b/include/media/adv7343.h
@@ -28,12 +28,7 @@
* @pll_control: PLL and oversampling control. This control allows internal
* PLL 1 circuit to be powered down and the oversampling to be
* switched off.
- * @dac_1: power on/off DAC 1.
- * @dac_2: power on/off DAC 2.
- * @dac_3: power on/off DAC 3.
- * @dac_4: power on/off DAC 4.
- * @dac_5: power on/off DAC 5.
- * @dac_6: power on/off DAC 6.
+ * @dac: array to configure power on/off DAC's 1..6
*
* Power mode register (Register 0x0), for more info refer REGISTER MAP ACCESS
* section of datasheet[1], table 17 page no 30.
@@ -43,23 +38,16 @@
struct adv7343_power_mode {
bool sleep_mode;
bool pll_control;
- bool dac_1;
- bool dac_2;
- bool dac_3;
- bool dac_4;
- bool dac_5;
- bool dac_6;
+ u32 dac[6];
};
/**
* struct adv7343_sd_config - SD Only Output Configuration.
- * @sd_dac_out1: Configure SD DAC Output 1.
- * @sd_dac_out2: Configure SD DAC Output 2.
+ * @sd_dac_out: array configuring SD DAC Outputs 1 and 2
*/
struct adv7343_sd_config {
/* SD only Output Configuration */
- bool sd_dac_out1;
- bool sd_dac_out2;
+ u32 sd_dac_out[2];
};
/**
--
cgit v1.2.3
From 8fd79579c9ccc6ac98d02c2c97d5fb367cfc0e29 Mon Sep 17 00:00:00 2001
From: Ondrej Zary
Date: Tue, 14 May 2013 16:54:43 -0300
Subject: [media] tea575x-tuner: move HW init to a separate function
Move HW initialization to separate function to allow using the code without
the v4l parts. This is needed for use in the bttv driver.
Signed-off-by: Ondrej Zary
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
---
include/sound/tea575x-tuner.h | 1 +
1 file changed, 1 insertion(+)
(limited to 'include')
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h
index 098c4de44945..2d4fa59db902 100644
--- a/include/sound/tea575x-tuner.h
+++ b/include/sound/tea575x-tuner.h
@@ -71,6 +71,7 @@ struct snd_tea575x {
int (*ext_init)(struct snd_tea575x *tea);
};
+int snd_tea575x_hw_init(struct snd_tea575x *tea);
int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner);
void snd_tea575x_exit(struct snd_tea575x *tea);
void snd_tea575x_set_freq(struct snd_tea575x *tea);
--
cgit v1.2.3
From cfca7644d7959e1f50cb132306d1557bf6c2da57 Mon Sep 17 00:00:00 2001
From: Sylwester Nawrocki
Date: Fri, 19 Jul 2013 12:14:46 -0300
Subject: [media] V4L: Rename v4l2_async_bus_* to v4l2_async_match_*
enum v4l2_async_bus_type also selects a method subdevs are matched
in the notification handlers, rename it to v4l2_async_match_type
so V4L2_ASYNC_MATCH_OF entry can be further added for matching by
device tree node pointer.
Acked-and-tested-by: Lad, Prabhakar
Signed-off-by: Sylwester Nawrocki
Signed-off-by: Kyungmin Park
Acked-by: Laurent Pinchart
Acked-by: Hans Verkuil
Acked-by: Guennadi Liakhovetski
Signed-off-by: Mauro Carvalho Chehab
---
include/media/v4l2-async.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
(limited to 'include')
diff --git a/include/media/v4l2-async.h b/include/media/v4l2-async.h
index c3ec6ac75f7e..33e3b2a30ecb 100644
--- a/include/media/v4l2-async.h
+++ b/include/media/v4l2-async.h
@@ -22,10 +22,10 @@ struct v4l2_async_notifier;
/* A random max subdevice number, used to allocate an array on stack */
#define V4L2_MAX_SUBDEVS 128U
-enum v4l2_async_bus_type {
- V4L2_ASYNC_BUS_CUSTOM,
- V4L2_ASYNC_BUS_PLATFORM,
- V4L2_ASYNC_BUS_I2C,
+enum v4l2_async_match_type {
+ V4L2_ASYNC_MATCH_CUSTOM,
+ V4L2_ASYNC_MATCH_DEVNAME,
+ V4L2_ASYNC_MATCH_I2C,
};
/**
@@ -36,11 +36,11 @@ enum v4l2_async_bus_type {
* probed, to a notifier->waiting list
*/
struct v4l2_async_subdev {
- enum v4l2_async_bus_type bus_type;
+ enum v4l2_async_match_type match_type;
union {
struct {
const char *name;
- } platform;
+ } device_name;
struct {
int adapter_id;
unsigned short address;
--
cgit v1.2.3
From e7359f8e660882fb2168609638163561eb2f50f0 Mon Sep 17 00:00:00 2001
From: Sylwester Nawrocki
Date: Fri, 19 Jul 2013 12:21:29 -0300
Subject: [media] V4L: Add V4L2_ASYNC_MATCH_OF subdev matching type
Add support for matching by device_node pointer. This allows
the notifier user to simply pass a list of device_node pointers
corresponding to sub-devices.
Signed-off-by: Sylwester Nawrocki
Signed-off-by: Kyungmin Park
Acked-by: Lad, Prabhakar
Acked-by: Laurent Pinchart
Acked-by: Hans Verkuil
Acked-by: Guennadi Liakhovetski
Signed-off-by: Mauro Carvalho Chehab
---
include/media/v4l2-async.h | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'include')
diff --git a/include/media/v4l2-async.h b/include/media/v4l2-async.h
index 33e3b2a30ecb..82b29813f8be 100644
--- a/include/media/v4l2-async.h
+++ b/include/media/v4l2-async.h
@@ -15,6 +15,7 @@
#include
struct device;
+struct device_node;
struct v4l2_device;
struct v4l2_subdev;
struct v4l2_async_notifier;
@@ -26,6 +27,7 @@ enum v4l2_async_match_type {
V4L2_ASYNC_MATCH_CUSTOM,
V4L2_ASYNC_MATCH_DEVNAME,
V4L2_ASYNC_MATCH_I2C,
+ V4L2_ASYNC_MATCH_OF,
};
/**
@@ -38,6 +40,9 @@ enum v4l2_async_match_type {
struct v4l2_async_subdev {
enum v4l2_async_match_type match_type;
union {
+ struct {
+ const struct device_node *node;
+ } of;
struct {
const char *name;
} device_name;
--
cgit v1.2.3
From e8419d0890efaccb93f9f274d9ba0aae91210e8c Mon Sep 17 00:00:00 2001
From: Sylwester Nawrocki
Date: Fri, 19 Jul 2013 12:31:10 -0300
Subject: [media] V4L: Rename subdev field of struct v4l2_async_notifier
This is a purely cosmetic change. Since the 'subdev' member
points to an array of subdevs make it more explicit by
renaming to the plural form.
Acked-and-tested-by: Lad, Prabhakar
Signed-off-by: Sylwester Nawrocki
Signed-off-by: Kyungmin Park
Acked-by: Laurent Pinchart
Acked-by: Hans Verkuil
Acked-by: Guennadi Liakhovetski
Signed-off-by: Mauro Carvalho Chehab
---
include/media/v4l2-async.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'include')
diff --git a/include/media/v4l2-async.h b/include/media/v4l2-async.h
index 82b29813f8be..8fac8eaca51a 100644
--- a/include/media/v4l2-async.h
+++ b/include/media/v4l2-async.h
@@ -77,7 +77,7 @@ struct v4l2_async_subdev_list {
/**
* v4l2_async_notifier - v4l2_device notifier data
* @num_subdevs:number of subdevices
- * @subdev: array of pointers to subdevice descriptors
+ * @subdevs: array of pointers to subdevice descriptors
* @v4l2_dev: pointer to struct v4l2_device
* @waiting: list of struct v4l2_async_subdev, waiting for their drivers
* @done: list of struct v4l2_async_subdev_list, already probed
@@ -88,7 +88,7 @@ struct v4l2_async_subdev_list {
*/
struct v4l2_async_notifier {
unsigned int num_subdevs;
- struct v4l2_async_subdev **subdev;
+ struct v4l2_async_subdev **subdevs;
struct v4l2_device *v4l2_dev;
struct list_head waiting;
struct list_head done;
--
cgit v1.2.3
From b426b3a660c85faf6e1ca1c92c6d43577022aa3b Mon Sep 17 00:00:00 2001
From: Sylwester Nawrocki
Date: Mon, 22 Jul 2013 08:01:33 -0300
Subject: [media] V4L: Merge struct v4l2_async_subdev_list with struct
v4l2_subdev
By integrating the v4l2-async API internals a bit more with
the core overall the v4l2-async code becomes a bit simpler
and easier to follow.
Acked-and-tested-by: Lad, Prabhakar
Signed-off-by: Sylwester Nawrocki
Signed-off-by: Kyungmin Park
Acked-by: Laurent Pinchart
Acked-by: Hans Verkuil
Acked-by: Guennadi Liakhovetski
Signed-off-by: Mauro Carvalho Chehab
---
include/media/v4l2-async.h | 15 +--------------
include/media/v4l2-subdev.h | 13 ++++++-------
2 files changed, 7 insertions(+), 21 deletions(-)
(limited to 'include')
diff --git a/include/media/v4l2-async.h b/include/media/v4l2-async.h
index 8fac8eaca51a..768356917bea 100644
--- a/include/media/v4l2-async.h
+++ b/include/media/v4l2-async.h
@@ -61,26 +61,13 @@ struct v4l2_async_subdev {
struct list_head list;
};
-/**
- * v4l2_async_subdev_list - provided by subdevices
- * @list: links struct v4l2_async_subdev_list objects to a global list
- * before probing, and onto notifier->done after probing
- * @asd: pointer to respective struct v4l2_async_subdev
- * @notifier: pointer to managing notifier
- */
-struct v4l2_async_subdev_list {
- struct list_head list;
- struct v4l2_async_subdev *asd;
- struct v4l2_async_notifier *notifier;
-};
-
/**
* v4l2_async_notifier - v4l2_device notifier data
* @num_subdevs:number of subdevices
* @subdevs: array of pointers to subdevice descriptors
* @v4l2_dev: pointer to struct v4l2_device
* @waiting: list of struct v4l2_async_subdev, waiting for their drivers
- * @done: list of struct v4l2_async_subdev_list, already probed
+ * @done: list of struct v4l2_subdev, already probed
* @list: member in a global list of notifiers
* @bound: a subdevice driver has successfully probed one of subdevices
* @complete: all subdevices have been probed successfully
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 3250cc5e7925..bfda0fe9aeb0 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -586,15 +586,14 @@ struct v4l2_subdev {
struct video_device *devnode;
/* pointer to the physical device, if any */
struct device *dev;
- struct v4l2_async_subdev_list asdl;
+ /* Links this subdev to a global subdev_list or @notifier->done list. */
+ struct list_head async_list;
+ /* Pointer to respective struct v4l2_async_subdev. */
+ struct v4l2_async_subdev *asd;
+ /* Pointer to the managing notifier. */
+ struct v4l2_async_notifier *notifier;
};
-static inline struct v4l2_subdev *v4l2_async_to_subdev(
- struct v4l2_async_subdev_list *asdl)
-{
- return container_of(asdl, struct v4l2_subdev, asdl);
-}
-
#define media_entity_to_v4l2_subdev(ent) \
container_of(ent, struct v4l2_subdev, entity)
#define vdev_to_v4l2_subdev(vdev) \
--
cgit v1.2.3
From 8b2ff3204909687be26f20d63dcddc8e3d7a6c14 Mon Sep 17 00:00:00 2001
From: Srinivas Kandagatla
Date: Mon, 22 Jul 2013 04:22:57 -0300
Subject: [media] media: rc: Add rc_open/close and use count to rc_dev
This patch adds user count to rc_dev structure, the reason to add this
new member is to allow other code like lirc to open rc device directly.
In the existing code, rc device is only opened by input subsystem which
works ok if we have any input drivers to match. But in case like lirc
where there will be no input driver, rc device will be never opened.
Having this user count variable will be usefull to allow rc device to be
opened from code other than rc-main.
This patch also adds rc_open and rc_close functions for other drivers
like lirc to open and close rc devices. This functions safely increment
and decrement the user count. Other driver wanting to open rc device
should call rc_open and rc_close, rather than directly modifying the
rc_dev structure.
Signed-off-by: Srinivas Kandagatla
Signed-off-by: Mauro Carvalho Chehab
---
include/media/rc-core.h | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'include')
diff --git a/include/media/rc-core.h b/include/media/rc-core.h
index 06a75deff553..2f6f1f78d958 100644
--- a/include/media/rc-core.h
+++ b/include/media/rc-core.h
@@ -101,6 +101,7 @@ struct rc_dev {
bool idle;
u64 allowed_protos;
u64 enabled_protocols;
+ u32 users;
u32 scanmask;
void *priv;
spinlock_t keylock;
@@ -142,6 +143,9 @@ void rc_free_device(struct rc_dev *dev);
int rc_register_device(struct rc_dev *dev);
void rc_unregister_device(struct rc_dev *dev);
+int rc_open(struct rc_dev *rdev);
+void rc_close(struct rc_dev *rdev);
+
void rc_repeat(struct rc_dev *dev);
void rc_keydown(struct rc_dev *dev, int scancode, u8 toggle);
void rc_keydown_notimeout(struct rc_dev *dev, int scancode, u8 toggle);
--
cgit v1.2.3
From ca7a722db1c90dfe0dba165ecef01d6ac8cfee0d Mon Sep 17 00:00:00 2001
From: Srinivas Kandagatla
Date: Mon, 22 Jul 2013 04:23:07 -0300
Subject: [media] media: lirc: Allow lirc dev to talk to rc device
The use case is simple, if any rc device has allowed protocols =
RC_TYPE_LIRC and map_name = RC_MAP_LIRC set, the driver open will be never
called. The reason for this is, all of the key maps except lirc have some
KEYS in there map, so during rc_register_device process these keys are
matched against the input drivers and open is performed, so for the case
of RC_MAP_EMPTY, a vt/keyboard is matched and the driver open is
performed.
In case of lirc, there is no match and result is that there is no open
performed, however the lirc-dev will go ahead and create a /dev/lirc0
node. Now when lircd/mode2 opens this device, no data is available
because the driver was never opened.
Other case pointed by Sean Young, As rc device gets opened via the
input interface. If the input device is never opened (e.g. embedded with
no console) then the rc open is never called and lirc will not work
either. So that's another case.
lirc_dev seems to have no link with actual rc device w.r.t open/close.
This patch adds rc_dev pointer to lirc_driver structure for cases like
this, so that it can do the open/close of the real driver in accordance
to lircd/mode2 open/close.
Without this patch its impossible to open a rc device which has
RC_TYPE_LIRC ad RC_MAP_LIRC set.
Signed-off-by: Srinivas Kandagatla
Signed-off-by: Mauro Carvalho Chehab
---
include/media/lirc_dev.h | 1 +
1 file changed, 1 insertion(+)
(limited to 'include')
diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h
index 168dd0b1bae2..78f0637ca68d 100644
--- a/include/media/lirc_dev.h
+++ b/include/media/lirc_dev.h
@@ -139,6 +139,7 @@ struct lirc_driver {
struct lirc_buffer *rbuf;
int (*set_use_inc) (void *data);
void (*set_use_dec) (void *data);
+ struct rc_dev *rdev;
const struct file_operations *fops;
struct device *dev;
struct module *owner;
--
cgit v1.2.3
From bc9028e1d38419f9249cb0d1285e290be7e67223 Mon Sep 17 00:00:00 2001
From: Arun Kumar K
Date: Tue, 9 Jul 2013 01:24:41 -0300
Subject: [media] V4L: Add VP8 encoder controls
This patch adds new V4L controls for VP8 encoding.
Signed-off-by: Kiran AVND
Signed-off-by: Arun Kumar K
Acked-by: Hans Verkuil
Signed-off-by: Kamil Debski
Signed-off-by: Mauro Carvalho Chehab
---
include/uapi/linux/v4l2-controls.h | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
(limited to 'include')
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index e90a88a8708f..083bb5a5aae2 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -161,6 +161,8 @@ enum v4l2_colorfx {
#define V4L2_CID_USER_SI476X_BASE (V4L2_CID_USER_BASE + 0x1040)
/* MPEG-class control IDs */
+/* The MPEG controls are applicable to all codec controls
+ * and the 'MPEG' part of the define is historical */
#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)
@@ -522,6 +524,33 @@ enum v4l2_mpeg_video_mpeg4_profile {
};
#define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+407)
+/* Control IDs for VP8 streams
+ * Although VP8 is not part of MPEG we add these controls to the MPEG class
+ * as that class is already handling other video compression standards
+ */
+#define V4L2_CID_MPEG_VIDEO_VPX_NUM_PARTITIONS (V4L2_CID_MPEG_BASE+500)
+enum v4l2_vp8_num_partitions {
+ V4L2_CID_MPEG_VIDEO_VPX_1_PARTITION = 0,
+ V4L2_CID_MPEG_VIDEO_VPX_2_PARTITIONS = 1,
+ V4L2_CID_MPEG_VIDEO_VPX_4_PARTITIONS = 2,
+ V4L2_CID_MPEG_VIDEO_VPX_8_PARTITIONS = 3,
+};
+#define V4L2_CID_MPEG_VIDEO_VPX_IMD_DISABLE_4X4 (V4L2_CID_MPEG_BASE+501)
+#define V4L2_CID_MPEG_VIDEO_VPX_NUM_REF_FRAMES (V4L2_CID_MPEG_BASE+502)
+enum v4l2_vp8_num_ref_frames {
+ V4L2_CID_MPEG_VIDEO_VPX_1_REF_FRAME = 0,
+ V4L2_CID_MPEG_VIDEO_VPX_2_REF_FRAME = 1,
+ V4L2_CID_MPEG_VIDEO_VPX_3_REF_FRAME = 2,
+};
+#define V4L2_CID_MPEG_VIDEO_VPX_FILTER_LEVEL (V4L2_CID_MPEG_BASE+503)
+#define V4L2_CID_MPEG_VIDEO_VPX_FILTER_SHARPNESS (V4L2_CID_MPEG_BASE+504)
+#define V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD (V4L2_CID_MPEG_BASE+505)
+#define V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL (V4L2_CID_MPEG_BASE+506)
+enum v4l2_vp8_golden_frame_sel {
+ V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_PREV = 0,
+ V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_REF_PERIOD = 1,
+};
+
/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)
--
cgit v1.2.3
From 5c7b25b90d36942c524d06522ebaf0510a75592a Mon Sep 17 00:00:00 2001
From: Laurent Pinchart
Date: Fri, 7 Jun 2013 12:45:11 -0300
Subject: [media] media: Add support for circular graph traversal
The graph traversal API (media_entity_graph_walk_*) doesn't support
cyclic graphs and will fail to correctly walk a graph when circular
links exist. Support circular graph traversal by checking whether an
entity has already been visited before pushing it to the stack.
Signed-off-by: Laurent Pinchart
Acked-by: Sakari Ailus
Acked-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
---
include/media/media-entity.h | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'include')
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index 06bacf937d61..10df55187981 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -23,6 +23,7 @@
#ifndef _MEDIA_ENTITY_H
#define _MEDIA_ENTITY_H
+#include
#include
#include
@@ -113,12 +114,15 @@ static inline u32 media_entity_subtype(struct media_entity *entity)
}
#define MEDIA_ENTITY_ENUM_MAX_DEPTH 16
+#define MEDIA_ENTITY_ENUM_MAX_ID 64
struct media_entity_graph {
struct {
struct media_entity *entity;
int link;
} stack[MEDIA_ENTITY_ENUM_MAX_DEPTH];
+
+ DECLARE_BITMAP(entities, MEDIA_ENTITY_ENUM_MAX_ID);
int top;
};
--
cgit v1.2.3
From 5548a382508f1f76320e1ed55524dda73234299d Mon Sep 17 00:00:00 2001
From: Laurent Pinchart
Date: Thu, 1 Aug 2013 21:44:38 -0300
Subject: [media] media: vb2: Clarify queue_setup() and buf_prepare() usage
documentation
Explain how the two operations must handle formats and validate buffer
sizes when used with VIDIOC_CREATE_BUFS.
Signed-off-by: Laurent Pinchart
Acked-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
---
include/media/videobuf2-core.h | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
(limited to 'include')
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index d88a098d1aff..6781258d0b67 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -219,8 +219,9 @@ struct vb2_buffer {
* configured format and *num_buffers is the total number
* of buffers, that are being allocated. When called from
* VIDIOC_CREATE_BUFS, fmt != NULL and it describes the
- * target frame format. In this case *num_buffers are being
- * allocated additionally to q->num_buffers.
+ * target frame format (if the format isn't valid the
+ * callback must return -EINVAL). In this case *num_buffers
+ * are being allocated additionally to q->num_buffers.
* @wait_prepare: release any locks taken while calling vb2 functions;
* it is called before an ioctl needs to wait for a new
* buffer to arrive; required to avoid a deadlock in
@@ -236,8 +237,10 @@ struct vb2_buffer {
* @buf_prepare: called every time the buffer is queued from userspace
* and from the VIDIOC_PREPARE_BUF ioctl; drivers may
* perform any initialization required before each hardware
- * operation in this callback; if an error is returned, the
- * buffer will not be queued in driver; optional
+ * operation in this callback; drivers that support
+ * VIDIOC_CREATE_BUFS must also validate the buffer size;
+ * if an error is returned, the buffer will not be queued
+ * in driver; optional
* @buf_finish: called before every dequeue of the buffer back to
* userspace; drivers may perform any operations required
* before userspace accesses the buffer; optional
--
cgit v1.2.3
From f57fa2102cd5c0b50359def79a3d39cda8431204 Mon Sep 17 00:00:00 2001
From: Laurent Pinchart
Date: Wed, 5 Jun 2013 04:19:53 -0300
Subject: [media] v4l: Add media format codes for ARGB8888 and AYUV8888 on
32-bit busses
Signed-off-by: Laurent Pinchart
Reviewed-by: Sylwester Nawrocki
Acked-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
---
include/uapi/linux/v4l2-mediabus.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
(limited to 'include')
diff --git a/include/uapi/linux/v4l2-mediabus.h b/include/uapi/linux/v4l2-mediabus.h
index 6ee63d09b32d..a9601257bb43 100644
--- a/include/uapi/linux/v4l2-mediabus.h
+++ b/include/uapi/linux/v4l2-mediabus.h
@@ -37,7 +37,7 @@
enum v4l2_mbus_pixelcode {
V4L2_MBUS_FMT_FIXED = 0x0001,
- /* RGB - next is 0x100d */
+ /* RGB - next is 0x100e */
V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE = 0x1001,
V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE = 0x1002,
V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE = 0x1003,
@@ -50,8 +50,9 @@ enum v4l2_mbus_pixelcode {
V4L2_MBUS_FMT_RGB888_1X24 = 0x100a,
V4L2_MBUS_FMT_RGB888_2X12_BE = 0x100b,
V4L2_MBUS_FMT_RGB888_2X12_LE = 0x100c,
+ V4L2_MBUS_FMT_ARGB8888_1X32 = 0x100d,
- /* YUV (including grey) - next is 0x2017 */
+ /* YUV (including grey) - next is 0x2018 */
V4L2_MBUS_FMT_Y8_1X8 = 0x2001,
V4L2_MBUS_FMT_UV8_1X8 = 0x2015,
V4L2_MBUS_FMT_UYVY8_1_5X8 = 0x2002,
@@ -74,6 +75,7 @@ enum v4l2_mbus_pixelcode {
V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d,
V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e,
V4L2_MBUS_FMT_YUV10_1X30 = 0x2016,
+ V4L2_MBUS_FMT_AYUV8_1X32 = 0x2017,
/* Bayer - next is 0x3019 */
V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001,
--
cgit v1.2.3
From 8493054844145e47a8f0668f57e2b0073aca850f Mon Sep 17 00:00:00 2001
From: Laurent Pinchart
Date: Wed, 26 Jun 2013 09:46:42 -0300
Subject: [media] v4l: Add V4L2_PIX_FMT_NV16M and V4L2_PIX_FMT_NV61M formats
NV16M and NV61M are planar YCbCr 4:2:2 and YCrCb 4:2:2 formats with a
luma plane followed by an interleaved chroma plane. The planes are not
required to be contiguous in memory, and the formats can only be used
with the multi-planar formats API.
Signed-off-by: Laurent Pinchart
Reviewed-by: Sylwester Nawrocki
Reviewed-by: Sakari Ailus
Acked-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
---
include/uapi/linux/videodev2.h | 2 ++
1 file changed, 2 insertions(+)
(limited to 'include')
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 95ef4551edc1..fec0c205f38b 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -348,6 +348,8 @@ struct v4l2_pix_format {
/* two non contiguous planes - one Y, one Cr + Cb interleaved */
#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
#define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */
+#define V4L2_PIX_FMT_NV16M v4l2_fourcc('N', 'M', '1', '6') /* 16 Y/CbCr 4:2:2 */
+#define V4L2_PIX_FMT_NV61M v4l2_fourcc('N', 'M', '6', '1') /* 16 Y/CrCb 4:2:2 */
#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */
#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 macroblocks */
--
cgit v1.2.3
From 26e0ca22c3b85b04f693dd0422f13a61846ccfa9 Mon Sep 17 00:00:00 2001
From: Laurent Pinchart
Date: Tue, 4 Jun 2013 11:22:30 -0300
Subject: [media] v4l: Renesas R-Car VSP1 driver
The VSP1 is a video processing engine that includes a blender, scalers,
filters and statistics computation. Configurable data path routing logic
allows ordering the internal blocks in a flexible way.
Due to the configurable nature of the pipeline the driver implements the
media controller API and doesn't use the V4L2 mem-to-mem framework, even
though the device usually operates in memory to memory mode.
Only the read pixel formatters, up/down scalers, write pixel formatters
and LCDC interface are supported at this stage.
Signed-off-by: Laurent Pinchart
Acked-by: Sakari Ailus
Signed-off-by: Mauro Carvalho Chehab
---
include/linux/platform_data/vsp1.h | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
create mode 100644 include/linux/platform_data/vsp1.h
(limited to 'include')
diff --git a/include/linux/platform_data/vsp1.h b/include/linux/platform_data/vsp1.h
new file mode 100644
index 000000000000..a73a456d7f11
--- /dev/null
+++ b/include/linux/platform_data/vsp1.h
@@ -0,0 +1,25 @@
+/*
+ * vsp1.h -- R-Car VSP1 Platform Data
+ *
+ * Copyright (C) 2013 Renesas Corporation
+ *
+ * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
+ *
+ * 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.
+ */
+#ifndef __PLATFORM_VSP1_H__
+#define __PLATFORM_VSP1_H__
+
+#define VSP1_HAS_LIF (1 << 0)
+
+struct vsp1_platform_data {
+ unsigned int features;
+ unsigned int rpf_count;
+ unsigned int uds_count;
+ unsigned int wpf_count;
+};
+
+#endif /* __PLATFORM_VSP1_H__ */
--
cgit v1.2.3
From 59b564599bc66f086856b09e480f89555d47b35c Mon Sep 17 00:00:00 2001
From: Ondrej Zary
Date: Sun, 28 Jul 2013 16:01:43 -0300
Subject: [media] tea575x: Move header from sound to media
Move include/sound/tea575x-tuner.h to include/media/tea575x.h and update files that include it.
Signed-off-by: Ondrej Zary
Acked-by: Takashi Iwai
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
---
include/media/tea575x.h | 79 +++++++++++++++++++++++++++++++++++++++++++
include/sound/tea575x-tuner.h | 79 -------------------------------------------
2 files changed, 79 insertions(+), 79 deletions(-)
create mode 100644 include/media/tea575x.h
delete mode 100644 include/sound/tea575x-tuner.h
(limited to 'include')
diff --git a/include/media/tea575x.h b/include/media/tea575x.h
new file mode 100644
index 000000000000..2d4fa59db902
--- /dev/null
+++ b/include/media/tea575x.h
@@ -0,0 +1,79 @@
+#ifndef __SOUND_TEA575X_TUNER_H
+#define __SOUND_TEA575X_TUNER_H
+
+/*
+ * ALSA driver for TEA5757/5759 Philips AM/FM tuner chips
+ *
+ * Copyright (c) 2004 Jaroslav Kysela
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include
+#include
+#include
+#include
+
+#define TEA575X_FMIF 10700
+#define TEA575X_AMIF 450
+
+#define TEA575X_DATA (1 << 0)
+#define TEA575X_CLK (1 << 1)
+#define TEA575X_WREN (1 << 2)
+#define TEA575X_MOST (1 << 3)
+
+struct snd_tea575x;
+
+struct snd_tea575x_ops {
+ /* Drivers using snd_tea575x must either define read_ and write_val */
+ void (*write_val)(struct snd_tea575x *tea, u32 val);
+ u32 (*read_val)(struct snd_tea575x *tea);
+ /* Or define the 3 pin functions */
+ void (*set_pins)(struct snd_tea575x *tea, u8 pins);
+ u8 (*get_pins)(struct snd_tea575x *tea);
+ void (*set_direction)(struct snd_tea575x *tea, bool output);
+};
+
+struct snd_tea575x {
+ struct v4l2_device *v4l2_dev;
+ struct v4l2_file_operations fops;
+ struct video_device vd; /* video device */
+ int radio_nr; /* radio_nr */
+ bool tea5759; /* 5759 chip is present */
+ bool has_am; /* Device can tune to AM freqs */
+ bool cannot_read_data; /* Device cannot read the data pin */
+ bool cannot_mute; /* Device cannot mute */
+ bool mute; /* Device is muted? */
+ bool stereo; /* receiving stereo */
+ bool tuned; /* tuned to a station */
+ unsigned int val; /* hw value */
+ u32 band; /* 0: FM, 1: FM-Japan, 2: AM */
+ u32 freq; /* frequency */
+ struct mutex mutex;
+ struct snd_tea575x_ops *ops;
+ void *private_data;
+ u8 card[32];
+ u8 bus_info[32];
+ struct v4l2_ctrl_handler ctrl_handler;
+ int (*ext_init)(struct snd_tea575x *tea);
+};
+
+int snd_tea575x_hw_init(struct snd_tea575x *tea);
+int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner);
+void snd_tea575x_exit(struct snd_tea575x *tea);
+void snd_tea575x_set_freq(struct snd_tea575x *tea);
+
+#endif /* __SOUND_TEA575X_TUNER_H */
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h
deleted file mode 100644
index 2d4fa59db902..000000000000
--- a/include/sound/tea575x-tuner.h
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef __SOUND_TEA575X_TUNER_H
-#define __SOUND_TEA575X_TUNER_H
-
-/*
- * ALSA driver for TEA5757/5759 Philips AM/FM tuner chips
- *
- * Copyright (c) 2004 Jaroslav Kysela
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include
-#include
-#include
-#include
-
-#define TEA575X_FMIF 10700
-#define TEA575X_AMIF 450
-
-#define TEA575X_DATA (1 << 0)
-#define TEA575X_CLK (1 << 1)
-#define TEA575X_WREN (1 << 2)
-#define TEA575X_MOST (1 << 3)
-
-struct snd_tea575x;
-
-struct snd_tea575x_ops {
- /* Drivers using snd_tea575x must either define read_ and write_val */
- void (*write_val)(struct snd_tea575x *tea, u32 val);
- u32 (*read_val)(struct snd_tea575x *tea);
- /* Or define the 3 pin functions */
- void (*set_pins)(struct snd_tea575x *tea, u8 pins);
- u8 (*get_pins)(struct snd_tea575x *tea);
- void (*set_direction)(struct snd_tea575x *tea, bool output);
-};
-
-struct snd_tea575x {
- struct v4l2_device *v4l2_dev;
- struct v4l2_file_operations fops;
- struct video_device vd; /* video device */
- int radio_nr; /* radio_nr */
- bool tea5759; /* 5759 chip is present */
- bool has_am; /* Device can tune to AM freqs */
- bool cannot_read_data; /* Device cannot read the data pin */
- bool cannot_mute; /* Device cannot mute */
- bool mute; /* Device is muted? */
- bool stereo; /* receiving stereo */
- bool tuned; /* tuned to a station */
- unsigned int val; /* hw value */
- u32 band; /* 0: FM, 1: FM-Japan, 2: AM */
- u32 freq; /* frequency */
- struct mutex mutex;
- struct snd_tea575x_ops *ops;
- void *private_data;
- u8 card[32];
- u8 bus_info[32];
- struct v4l2_ctrl_handler ctrl_handler;
- int (*ext_init)(struct snd_tea575x *tea);
-};
-
-int snd_tea575x_hw_init(struct snd_tea575x *tea);
-int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner);
-void snd_tea575x_exit(struct snd_tea575x *tea);
-void snd_tea575x_set_freq(struct snd_tea575x *tea);
-
-#endif /* __SOUND_TEA575X_TUNER_H */
--
cgit v1.2.3
From 299878fa3c373dbf74edf5872c79ef4c65b80a04 Mon Sep 17 00:00:00 2001
From: Hans Verkuil
Date: Mon, 29 Jul 2013 08:40:54 -0300
Subject: [media] v4l2-dv-timings.h: remove duplicate
V4L2_DV_BT_DMT_1366X768P60
This particular DMT timing definition was duplicated in the header.
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
---
include/uapi/linux/v4l2-dv-timings.h | 8 --------
1 file changed, 8 deletions(-)
(limited to 'include')
diff --git a/include/uapi/linux/v4l2-dv-timings.h b/include/uapi/linux/v4l2-dv-timings.h
index 4e0c58d25ff0..be709fe29552 100644
--- a/include/uapi/linux/v4l2-dv-timings.h
+++ b/include/uapi/linux/v4l2-dv-timings.h
@@ -823,12 +823,4 @@
V4L2_DV_FL_REDUCED_BLANKING) \
}
-#define V4L2_DV_BT_DMT_1366X768P60 { \
- .type = V4L2_DV_BT_656_1120, \
- V4L2_INIT_BT_TIMINGS(1366, 768, 0, \
- V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
- 85500000, 70, 143, 213, 3, 3, 24, 0, 0, 0, \
- V4L2_DV_BT_STD_DMT, 0) \
-}
-
#endif
--
cgit v1.2.3
From b18787ed1ce32eb0c2ce2323220abd4ed93c4b97 Mon Sep 17 00:00:00 2001
From: Hans Verkuil
Date: Mon, 29 Jul 2013 08:40:55 -0300
Subject: [media] v4l2-dv-timings: add new helper module
This module makes it easy to filter valid timings from the full list of
CEA and DMT timings based on the timings capabilities.
Signed-off-by: Hans Verkuil
Acked-by: Lad, Prabhakar
Signed-off-by: Mauro Carvalho Chehab
---
include/media/v4l2-dv-timings.h | 67 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)
create mode 100644 include/media/v4l2-dv-timings.h
(limited to 'include')
diff --git a/include/media/v4l2-dv-timings.h b/include/media/v4l2-dv-timings.h
new file mode 100644
index 000000000000..41075fa02a96
--- /dev/null
+++ b/include/media/v4l2-dv-timings.h
@@ -0,0 +1,67 @@
+/*
+ * v4l2-dv-timings - Internal header with dv-timings helper functions
+ *
+ * Copyright 2013 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *
+ * This program is free software; you may redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef __V4L2_DV_TIMINGS_H
+#define __V4L2_DV_TIMINGS_H
+
+#include
+
+/** v4l2_dv_valid_timings() - are these timings valid?
+ * @t: the v4l2_dv_timings struct.
+ * @cap: the v4l2_dv_timings_cap capabilities.
+ *
+ * Returns true if the given dv_timings struct is supported by the
+ * hardware capabilities, returns false otherwise.
+ */
+bool v4l2_dv_valid_timings(const struct v4l2_dv_timings *t,
+ const struct v4l2_dv_timings_cap *cap);
+
+/** v4l2_enum_dv_timings_cap() - Helper function to enumerate possible DV timings based on capabilities
+ * @t: the v4l2_enum_dv_timings struct.
+ * @cap: the v4l2_dv_timings_cap capabilities.
+ *
+ * This enumerates dv_timings using the full list of possible CEA-861 and DMT
+ * timings, filtering out any timings that are not supported based on the
+ * hardware capabilities.
+ *
+ * If a valid timing for the given index is found, it will fill in @t and
+ * return 0, otherwise it returns -EINVAL.
+ */
+int v4l2_enum_dv_timings_cap(struct v4l2_enum_dv_timings *t,
+ const struct v4l2_dv_timings_cap *cap);
+
+/** v4l2_find_dv_timings_cap() - Find the closest timings struct
+ * @t: the v4l2_enum_dv_timings struct.
+ * @cap: the v4l2_dv_timings_cap capabilities.
+ * @pclock_delta: maximum delta between t->pixelclock and the timing struct
+ * under consideration.
+ *
+ * This function tries to map the given timings to an entry in the
+ * full list of possible CEA-861 and DMT timings, filtering out any timings
+ * that are not supported based on the hardware capabilities.
+ *
+ * On success it will fill in @t with the found timings and it returns true.
+ * On failure it will return false.
+ */
+bool v4l2_find_dv_timings_cap(struct v4l2_dv_timings *t,
+ const struct v4l2_dv_timings_cap *cap,
+ unsigned pclock_delta);
+
+#endif
--
cgit v1.2.3
From 2576415846bcbad3c0a6885fc44f950837106364 Mon Sep 17 00:00:00 2001
From: Hans Verkuil
Date: Mon, 29 Jul 2013 08:40:56 -0300
Subject: [media] v4l2: move dv-timings related code to v4l2-dv-timings.c
v4l2-common.c contained a bunch of dv-timings related functions.
Move that to the new v4l2-dv-timings.c which is a more appropriate
place for them.
There aren't many drivers that do HDTV, so it is a good idea to separate
common code related to that into a module of its own.
Signed-off-by: Hans Verkuil
Acked-by: Lad, Prabhakar
Signed-off-by: Mauro Carvalho Chehab
---
include/media/v4l2-common.h | 13 ---------
include/media/v4l2-dv-timings.h | 59 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 59 insertions(+), 13 deletions(-)
(limited to 'include')
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 015ff82da73c..0e1d01056f16 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -201,19 +201,6 @@ const struct v4l2_frmsize_discrete *v4l2_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);
-
void v4l2_get_timestamp(struct timeval *tv);
#endif /* V4L2_COMMON_H_ */
diff --git a/include/media/v4l2-dv-timings.h b/include/media/v4l2-dv-timings.h
index 41075fa02a96..4c7bb5491658 100644
--- a/include/media/v4l2-dv-timings.h
+++ b/include/media/v4l2-dv-timings.h
@@ -64,4 +64,63 @@ bool v4l2_find_dv_timings_cap(struct v4l2_dv_timings *t,
const struct v4l2_dv_timings_cap *cap,
unsigned pclock_delta);
+/** v4l_match_dv_timings() - do two timings match?
+ * @measured: the measured timings data.
+ * @standard: the timings according to the standard.
+ * @pclock_delta: maximum delta in Hz between standard->pixelclock and
+ * the measured timings.
+ *
+ * Returns true if the two timings match, returns false otherwise.
+ */
+bool v4l_match_dv_timings(const struct v4l2_dv_timings *measured,
+ const struct v4l2_dv_timings *standard,
+ unsigned pclock_delta);
+
+/** v4l2_detect_cvt - detect if the given timings follow the CVT standard
+ * @frame_height - the total height of the frame (including blanking) in lines.
+ * @hfreq - the horizontal frequency in Hz.
+ * @vsync - the height of the vertical sync in lines.
+ * @polarities - the horizontal and vertical polarities (same as struct
+ * v4l2_bt_timings polarities).
+ * @fmt - 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.
+ */
+bool v4l2_detect_cvt(unsigned frame_height, unsigned hfreq, unsigned vsync,
+ u32 polarities, struct v4l2_dv_timings *fmt);
+
+/** v4l2_detect_gtf - detect if the given timings follow the GTF standard
+ * @frame_height - the total height of the frame (including blanking) in lines.
+ * @hfreq - the horizontal frequency in Hz.
+ * @vsync - the height of the vertical sync in lines.
+ * @polarities - the horizontal and vertical polarities (same as struct
+ * v4l2_bt_timings polarities).
+ * @aspect - 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.
+ * @fmt - 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.
+ */
+bool v4l2_detect_gtf(unsigned frame_height, unsigned hfreq, unsigned vsync,
+ u32 polarities, struct v4l2_fract aspect,
+ struct v4l2_dv_timings *fmt);
+
+/** v4l2_calc_aspect_ratio - calculate the aspect ratio based on bytes
+ * 0x15 and 0x16 from the EDID.
+ * @hor_landscape - byte 0x15 from the EDID.
+ * @vert_portrait - 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"
+ */
+struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait);
+
#endif
--
cgit v1.2.3
From 7f68127fa11f08c5468537eb28ca6b8b95d70f08 Mon Sep 17 00:00:00 2001
From: Hans Verkuil
Date: Mon, 29 Jul 2013 08:40:58 -0300
Subject: [media] videodev2.h: defines to calculate blanking and frame sizes
It is very common to have to calculate the total width and height of the
blanking and the full frame, so add a few defines that deal with that.
Signed-off-by: Hans Verkuil
Acked-by: Lad, Prabhakar
Signed-off-by: Mauro Carvalho Chehab
---
include/uapi/linux/videodev2.h | 10 ++++++++++
1 file changed, 10 insertions(+)
(limited to 'include')
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index fec0c205f38b..437f1b0f8937 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -1057,6 +1057,16 @@ struct v4l2_bt_timings {
or used depends on the hardware. */
#define V4L2_DV_FL_HALF_LINE (1 << 3)
+/* A few useful defines to calculate the total blanking and frame sizes */
+#define V4L2_DV_BT_BLANKING_WIDTH(bt) \
+ (bt->hfrontporch + bt->hsync + bt->hbackporch)
+#define V4L2_DV_BT_FRAME_WIDTH(bt) \
+ (bt->width + V4L2_DV_BT_BLANKING_WIDTH(bt))
+#define V4L2_DV_BT_BLANKING_HEIGHT(bt) \
+ (bt->vfrontporch + bt->vsync + bt->vbackporch + \
+ bt->il_vfrontporch + bt->il_vsync + bt->il_vbackporch)
+#define V4L2_DV_BT_FRAME_HEIGHT(bt) \
+ (bt->height + V4L2_DV_BT_BLANKING_HEIGHT(bt))
/** struct v4l2_dv_timings - DV timings
* @type: the type of the timings
--
cgit v1.2.3
From 2ccf12afe6da2145085056cebaae2149899f4f8c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jon=20Arne=20J=C3=B8rgensen?=
Date: Sat, 3 Aug 2013 09:19:37 -0300
Subject: [media] saa7115: Implement i2c_board_info.platform_data
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This patch implements i2c_board_info.platform_data, and some options to
override the default initialization table for the GM7113C and SAA7113
chips.
Signed-off-by: Jon Arne Jørgensen
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
---
include/media/saa7115.h | 64 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
(limited to 'include')
diff --git a/include/media/saa7115.h b/include/media/saa7115.h
index 407918625c80..e8d512a7592f 100644
--- a/include/media/saa7115.h
+++ b/include/media/saa7115.h
@@ -64,5 +64,69 @@
#define SAA7115_FREQ_FL_APLL (1 << 2) /* SA 3A[3], APLL, SAA7114/5 only */
#define SAA7115_FREQ_FL_DOUBLE_ASCLK (1 << 3) /* SA 39, LRDIV, SAA7114/5 only */
+/* ===== SAA7113 Config enums ===== */
+
+/* Register 0x08 "Horizontal time constant" [Bit 3..4]:
+ * Should be set to "Fast Locking Mode" according to the datasheet,
+ * and that is the default setting in the gm7113c_init table.
+ * saa7113_init sets this value to "VTR Mode". */
+enum saa7113_r08_htc {
+ SAA7113_HTC_TV_MODE = 0x00,
+ SAA7113_HTC_VTR_MODE, /* Default for saa7113_init */
+ SAA7113_HTC_FAST_LOCKING_MODE = 0x03 /* Default for gm7113c_init */
+};
+
+/* Register 0x10 "Output format selection" [Bit 6..7]:
+ * Defaults to ITU_656 as specified in datasheet. */
+enum saa7113_r10_ofts {
+ SAA7113_OFTS_ITU_656 = 0x0, /* Default */
+ SAA7113_OFTS_VFLAG_BY_VREF,
+ SAA7113_OFTS_VFLAG_BY_DATA_TYPE
+};
+
+/* Register 0x12 "Output control" [Bit 0..3 Or Bit 4..7]:
+ * This is used to select what data is output on the RTS0 and RTS1 pins.
+ * RTS1 [Bit 4..7] Defaults to DOT_IN. (This value can not be set for RTS0)
+ * RTS0 [Bit 0..3] Defaults to VIPB in gm7113c_init as specified
+ * in the datasheet, but is set to HREF_HS in the saa7113_init table. */
+enum saa7113_r12_rts {
+ SAA7113_RTS_DOT_IN = 0, /* OBS: Only for RTS1 (Default RTS1) */
+ SAA7113_RTS_VIPB, /* Default RTS0 For gm7113c_init */
+ SAA7113_RTS_GPSW,
+ SAA7115_RTS_HL,
+ SAA7113_RTS_VL,
+ SAA7113_RTS_DL,
+ SAA7113_RTS_PLIN,
+ SAA7113_RTS_HREF_HS, /* Default RTS0 For saa7113_init */
+ SAA7113_RTS_HS,
+ SAA7113_RTS_HQ,
+ SAA7113_RTS_ODD,
+ SAA7113_RTS_VS,
+ SAA7113_RTS_V123,
+ SAA7113_RTS_VGATE,
+ SAA7113_RTS_VREF,
+ SAA7113_RTS_FID
+};
+
+struct saa7115_platform_data {
+ /* saa7113 only: Force the use of the gm7113c_init table,
+ * instead of the old saa7113_init table. */
+ bool saa7113_force_gm7113c_init;
+
+ /* SAA7113/GM7113C Specific configurations */
+ enum saa7113_r08_htc *saa7113_r08_htc; /* [R_08 - Bit 3..4] */
+
+ bool *saa7113_r10_vrln; /* [R_10 - Bit 3]
+ Disabled for gm7113c_init
+ Enabled for saa7113c_init */
+ enum saa7113_r10_ofts *saa7113_r10_ofts; /* [R_10 - Bit 6..7] */
+
+ enum saa7113_r12_rts *saa7113_r12_rts0; /* [R_12 - Bit 0..3] */
+ enum saa7113_r12_rts *saa7113_r12_rts1; /* [R_12 - Bit 4..7] */
+
+ bool *saa7113_r13_adlsb; /* [R_13 - Bit 7]
+ Default disabled */
+};
+
#endif
--
cgit v1.2.3
From 04074f1fdfe9eefc51bded7f45fafd8cc5d3779c Mon Sep 17 00:00:00 2001
From: Mauro Carvalho Chehab
Date: Sun, 18 Aug 2013 08:35:36 -0300
Subject: [media] saa7115: make multi-line comments compliant with CodingStyle
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
changeset 2ccf12a did a crappy job when added multi-line comment lines,
violating CodingStyle.
Change the comments added there to fulfill CodingStyle, and document
the platform_data using Documentation/kernel-doc-nano-HOWTO.txt.
Cc: Jon Arne Jørgensen
Cc: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
---
include/media/saa7115.h | 49 +++++++++++++++++++++++++++++--------------------
1 file changed, 29 insertions(+), 20 deletions(-)
(limited to 'include')
diff --git a/include/media/saa7115.h b/include/media/saa7115.h
index e8d512a7592f..76911e71de17 100644
--- a/include/media/saa7115.h
+++ b/include/media/saa7115.h
@@ -47,9 +47,11 @@
#define SAA7111_FMT_YUV411 0xc0
/* config flags */
-/* Register 0x85 should set bit 0 to 0 (it's 1 by default). This bit
+/*
+ * Register 0x85 should set bit 0 to 0 (it's 1 by default). This bit
* controls the IDQ signal polarity which is set to 'inverted' if the bit
- * it 1 and to 'default' if it is 0. */
+ * it 1 and to 'default' if it is 0.
+ */
#define SAA7115_IDQ_IS_DEFAULT (1 << 0)
/* s_crystal_freq values and flags */
@@ -84,11 +86,13 @@ enum saa7113_r10_ofts {
SAA7113_OFTS_VFLAG_BY_DATA_TYPE
};
-/* Register 0x12 "Output control" [Bit 0..3 Or Bit 4..7]:
+/*
+ * Register 0x12 "Output control" [Bit 0..3 Or Bit 4..7]:
* This is used to select what data is output on the RTS0 and RTS1 pins.
* RTS1 [Bit 4..7] Defaults to DOT_IN. (This value can not be set for RTS0)
* RTS0 [Bit 0..3] Defaults to VIPB in gm7113c_init as specified
- * in the datasheet, but is set to HREF_HS in the saa7113_init table. */
+ * in the datasheet, but is set to HREF_HS in the saa7113_init table.
+ */
enum saa7113_r12_rts {
SAA7113_RTS_DOT_IN = 0, /* OBS: Only for RTS1 (Default RTS1) */
SAA7113_RTS_VIPB, /* Default RTS0 For gm7113c_init */
@@ -108,24 +112,29 @@ enum saa7113_r12_rts {
SAA7113_RTS_FID
};
+/**
+ * struct saa7115_platform_data - Allow overriding default initialization
+ *
+ * @saa7113_force_gm7113c_init: Force the use of the gm7113c_init table
+ * instead of saa7113_init table
+ * (saa7113 only)
+ * @saa7113_r08_htc: [R_08 - Bit 3..4]
+ * @saa7113_r10_vrln: [R_10 - Bit 3]
+ * default: Disabled for gm7113c_init
+ * Enabled for saa7113c_init
+ * @saa7113_r10_ofts: [R_10 - Bit 6..7]
+ * @saa7113_r12_rts0: [R_12 - Bit 0..3]
+ * @saa7113_r12_rts1: [R_12 - Bit 4..7]
+ * @saa7113_r13_adlsb: [R_13 - Bit 7] - default: disabled
+ */
struct saa7115_platform_data {
- /* saa7113 only: Force the use of the gm7113c_init table,
- * instead of the old saa7113_init table. */
bool saa7113_force_gm7113c_init;
-
- /* SAA7113/GM7113C Specific configurations */
- enum saa7113_r08_htc *saa7113_r08_htc; /* [R_08 - Bit 3..4] */
-
- bool *saa7113_r10_vrln; /* [R_10 - Bit 3]
- Disabled for gm7113c_init
- Enabled for saa7113c_init */
- enum saa7113_r10_ofts *saa7113_r10_ofts; /* [R_10 - Bit 6..7] */
-
- enum saa7113_r12_rts *saa7113_r12_rts0; /* [R_12 - Bit 0..3] */
- enum saa7113_r12_rts *saa7113_r12_rts1; /* [R_12 - Bit 4..7] */
-
- bool *saa7113_r13_adlsb; /* [R_13 - Bit 7]
- Default disabled */
+ enum saa7113_r08_htc *saa7113_r08_htc;
+ bool *saa7113_r10_vrln;
+ enum saa7113_r10_ofts *saa7113_r10_ofts;
+ enum saa7113_r12_rts *saa7113_r12_rts0;
+ enum saa7113_r12_rts *saa7113_r12_rts1;
+ bool *saa7113_r13_adlsb;
};
#endif
--
cgit v1.2.3
From 73135e969970304a474c18c9f732fa3e36d88514 Mon Sep 17 00:00:00 2001
From: Vladimir Barinov
Date: Thu, 25 Jul 2013 17:23:10 -0300
Subject: [media] V4L2: soc_camera: Renesas R-Car VIN driver
Add Renesas R-Car VIN (Video In) V4L2 driver.
Based on the patch by Phil Edworthy .
[Sergei: removed deprecated IRQF_DISABLED flag, reordered/renamed 'enum chip_id'
values, reordered rcar_vin_id_table[] entries, removed senseless parens from
to_buf_list() macro, used ALIGN() macro in rcar_vin_setup(), added {} to the
*if* statement and used 'bool' values instead of 0/1 where necessary, removed
unused macros, done some reformatting and clarified some comments.]
Signed-off-by: Vladimir Barinov
Signed-off-by: Sergei Shtylyov
Signed-off-by: Guennadi Liakhovetski
Signed-off-by: Mauro Carvalho Chehab
---
include/linux/platform_data/camera-rcar.h | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
create mode 100644 include/linux/platform_data/camera-rcar.h
(limited to 'include')
diff --git a/include/linux/platform_data/camera-rcar.h b/include/linux/platform_data/camera-rcar.h
new file mode 100644
index 000000000000..dfc83c581593
--- /dev/null
+++ b/include/linux/platform_data/camera-rcar.h
@@ -0,0 +1,25 @@
+/*
+ * Platform data for Renesas R-Car VIN soc-camera driver
+ *
+ * Copyright (C) 2011-2013 Renesas Solutions Corp.
+ * Copyright (C) 2013 Cogent Embedded, Inc.,