Commit Graph

1258 Commits

Author SHA1 Message Date
Hans Verkuil a89bcd4c6c [media] adv7842: add new video decoder driver
This is a Analog Devices Component/Graphics/SD Digitizer with 2:1
Multiplexed HDMI Receiver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-26 07:51:44 -03:00
Hans Verkuil b8f0fff427 [media] v4l2-dv-timings: add callback to handle exceptions
In most cases the v4l2_bt_timings_cap struct has all the information
necessary to determine valid timings, but occasionally there are exceptions.
Add a callback function to be able to test for those exceptions.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-24 04:30:01 -03:00
Hans Verkuil 70b654945b [media] v4l2-dv-timings: rename v4l2_dv_valid_timings to v4l2_valid_dv_timings
All other functions follow the v4l2_<foo>_dv_timings pattern, do the same for
this function.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-24 04:28:27 -03:00
Hans Verkuil d1c65ad6a4 [media] v4l2-dv-timings: export the timings list
Some drivers need to be able to access the full list of timings.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-24 04:28:05 -03:00
Hans Verkuil ef1ed8f5d3 [media] v4l2-dv-timings: rename v4l_match_dv_timings to v4l2_match_dv_timings
It's the only function in v4l2-dv-timings.c with the v4l prefix instead
of v4l2. Make it consistent with the other functions.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-24 04:26:51 -03:00
Hans Verkuil 0216dc2fe6 [media] v4l2-dv-timings: add v4l2_print_dv_timings helper
Drivers often have to log the contents of a dv_timings struct. Adding
this helper will make it easier for drivers to do so.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-24 04:26:05 -03:00
Lad, Prabhakar d1d70aa69d [media] media: OF: add "sync-on-green-active" property
This patch adds 'sync-on-green-active' property as part
of endpoint property.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-24 04:15:05 -03:00
Sakari Ailus a354177f05 [media] smiapp: Call the clock "ext_clk"
As the clock framework makes it possible to assign a device specific name to
the clocks, remove the ability to use a named clock in the driver.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-22 11:39:12 -03:00
Laurent Pinchart 3300a8fd48 [media] mt9v032: Use the common clock framework
Configure the device external clock using the common clock framework
instead of a board code callback function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-22 11:37:46 -03:00
Mauro Carvalho Chehab bfd22c490b v4l2-common: warning fix (W=1): add a missed function prototype
changeset d1e9b7c12 added a new ancilliary function to API, but forgot
to add it to the corresponding header file.

drivers/media/v4l2-core/v4l2-ctrls.c:568:18: warning: no previous prototype for 'v4l2_ctrl_get_int_menu' [-Wmissing-prototypes]
 const s64 const *v4l2_ctrl_get_int_menu(u32 id, u32 *len)

Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-18 10:18:30 -03:00
Mauro Carvalho Chehab 04074f1fdf [media] saa7115: make multi-line comments compliant with CodingStyle
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 <jonarne@jonarne.no>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-18 08:39:24 -03:00
Jon Arne Jørgensen 2ccf12afe6 [media] saa7115: Implement i2c_board_info.platform_data
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 <jonarne@jonarne.no>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-18 08:27:07 -03:00
Hans Verkuil 2576415846 [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 <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-18 08:16:54 -03:00
Hans Verkuil b18787ed1c [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 <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-18 08:15:46 -03:00
Ondrej Zary 59b564599b [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 <linux@rainbow-software.org>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-18 08:08:05 -03:00
Laurent Pinchart 5548a38250 [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 <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-18 07:20:59 -03:00
Laurent Pinchart 5c7b25b90d [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 <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-18 07:16:48 -03:00
David S. Miller 2ff1cf12c9 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-08-16 15:37:26 -07:00
Joe Perches 574e2af7c0 include: Convert ethernet mac address declarations to use ETH_ALEN
It's convenient to have ethernet mac addresses use
ETH_ALEN to be able to grep for them a bit easier and
also to ensure that the addresses are __aligned(2).

Add #include <linux/if_ether.h> as necessary.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-02 12:33:54 -07:00
Srinivas Kandagatla ca7a722db1 [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 <srinivas.kandagatla@st.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-07-31 16:30:27 -03:00
Srinivas Kandagatla 8b2ff32049 [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 <srinivas.kandagatla@st.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-07-31 16:28:01 -03:00
Sylwester Nawrocki b426b3a660 [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 <prabhakar.csengg@gmail.com>

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-07-30 15:54:56 -03:00
Sylwester Nawrocki e8419d0890 [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 <prabhakar.csengg@gmail.com>

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-07-30 15:53:11 -03:00
Sylwester Nawrocki e7359f8e66 [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 <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-07-30 15:52:32 -03:00
Sylwester Nawrocki cfca7644d7 [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 <prabhakar.csengg@gmail.com>

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-07-30 15:52:00 -03:00
Lad, Prabhakar 5e95814ff3 [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 <prabhakar.csengg@gmail.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-07-26 13:20:36 -03:00
Lad, Prabhakar 4b8a531e6b [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 <prabhakar.csengg@gmail.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-07-26 13:17:15 -03:00
Lad, Prabhakar 873229e4fd [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 <prabhakar.csengg@gmail.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-07-26 13:16:37 -03:00
Andrzej Hajda 81913283c8 [media] v4l2: added missing mutex.h include to v4l2-ctrls.h
This patch fixes following error:
include/media/v4l2-ctrls.h:193:15: error: field ‘_lock’ has incomplete type
include/media/v4l2-ctrls.h: In function ‘v4l2_ctrl_lock’:
include/media/v4l2-ctrls.h:570:2: error: implicit declaration of
	function ‘mutex_lock’ [-Werror=implicit-function-declaration]
include/media/v4l2-ctrls.h: In function ‘v4l2_ctrl_unlock’:
include/media/v4l2-ctrls.h:579:2: error: implicit declaration of
	function ‘mutex_unlock’ [-Werror=implicit-function-declaration]

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-07-26 10:14:52 -03:00
Philipp Zabel 33bdd5a88a [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 <p.zabel@pengutronix.de>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-07-26 10:00:33 -03:00
Sylwester Nawrocki 1c26190a8d [media] exynos4-is: Correct colorspace handling at FIMC-LITE
Ensure the colorspace is properly adjusted by the driver for YUV
and Bayer image formats. The subdev try_fmt helper is simplified.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-28 15:33:27 -03:00
Guennadi Liakhovetski f687f3263e [media] V4L2: soc-camera: fix uninitialised use compiler warning
In scan_async_group() if the size parameter is negative, the sasd pointer
will be used uninitialised:
drivers/media/platform/soc_camera/soc_camera.c: In function "soc_camera_host_register":
drivers/media/platform/soc_camera/soc_camera.c:1514:55: warning: "sasd" may
be used uninitialized in this function [-Wmaybe-uninitialized]
    sasd->asd.match.i2c.adapter_id, sasd->asd.match.i2c.address);
                                                       ^
drivers/media/platform/soc_camera/soc_camera.c:1464:34: note: "sasd" was
declared here
  struct soc_camera_async_subdev *sasd;
Fix this by making "size" and the array, from which it is assigned unsigned.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-28 14:57:18 -03:00
Guennadi Liakhovetski 676d2d4f08 [media] sh_mobile_ceu_camera: add asynchronous subdevice probing support
Use the v4l2-async API to support asynchronous subdevice probing,
including the CSI2 subdevice. Synchronous probing is still supported too.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-21 16:35:53 -03:00
Guennadi Liakhovetski e09da11da4 [media] soc-camera: 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. The selected approach adds a
notifier for each struct soc_camera_device instance, i.e. for each video
device node, even when there are multiple such instances registered with a
single soc-camera host simultaneously.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-21 16:34:17 -03:00
Guennadi Liakhovetski 9aea470b39 [media] soc-camera: switch I2C subdevice drivers to use v4l2-clk
Instead of centrally enabling and disabling subdevice master clocks in
soc-camera core, let subdevice drivers do that themselves, using the
V4L2 clock API and soc-camera convenience wrappers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-21 16:32:36 -03:00
Guennadi Liakhovetski e9e310491b [media] V4L2: support asynchronous subdevice registration
Currently bridge device drivers register devices for all subdevices
synchronously, typically, during their probing. E.g. if an I2C CMOS sensor
is attached to a video bridge device, the bridge driver will create an I2C
device and wait for the respective I2C driver to probe. This makes linking
of devices straight forward, but this approach cannot be used with
intrinsically asynchronous and unordered device registration systems like
the Flattened Device Tree. To support such systems this patch adds an
asynchronous subdevice registration framework to V4L2. To use it respective
(e.g. I2C) subdevice drivers must register themselves with the framework.
A bridge driver on the other hand must register notification callbacks,
that will be called upon various related events.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-21 16:30:00 -03:00
Guennadi Liakhovetski 668773b846 [media] V4L2: add a device pointer to struct v4l2_subdev
It is often useful to have simple means to get from a subdevice to the
underlying physical device. This patch adds such a pointer to struct
v4l2_subdev and sets it accordingly in the I2C and SPI cases.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-21 16:28:36 -03:00
Guennadi Liakhovetski ff5430de70 [media] V4L2: add temporary clock helpers
Typical video devices like camera sensors require an external clock source.
Many such devices cannot even access their hardware registers without a
running clock. These clock sources should be controlled by their consumers.
This should be performed, using the generic clock framework. Unfortunately
so far only very few systems have been ported to that framework. This patch
adds a set of temporary helpers, mimicking the generic clock API, to V4L2.
Platforms, adopting the clock API, should switch to using it. Eventually
this temporary API should be removed.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-21 16:28:02 -03:00
Guennadi Liakhovetski eb569cf9db [media] soc-camera: add host clock callbacks to start and stop the master clock
Currently soc-camera uses a single camera host callback to activate the
interface master clock and to configure the interface for a specific
client. However, during probing we might not have the information about
a client, we just need to activate the clock. Add new camera host driver
callbacks to only start and stop the clock without and client-specific
configuration.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-21 15:35:51 -03:00
Guennadi Liakhovetski f7f6ce2d09 [media] soc-camera: move common code to soc_camera.c
All soc-camera host drivers include a pointer to an soc-camera device in
their host private struct to check, that only one client is connected.
Move this common code to soc_camera.c.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-21 15:35:30 -03:00
Hans Verkuil 1c1d86a1ea [media] v4l2: always require v4l2_dev, rename parent to dev_parent
The last set of drivers still using the parent field of video_device instead
of the v4l2_dev field have been converted, so v4l2_dev is now always set.
A proper pointer to v4l2_dev is necessary these days otherwise the advanced
debugging ioctls will not work when addressing sub-devices. It also ensures
that the core can always go from a video_device struct to the top-level
v4l2_device struct.
There is still one single use case for the parent pointer: if there are
multiple busses, each being the parent of one or more video nodes, and if
they all share the same v4l2_device struct. In that case one still needs a
parent pointer since the v4l2_device struct can only refer to a single
parent device. The cx88 driver is one such case. Unfortunately, the cx88
failed to set the parent pointer since 3.6. The next patch will correct this.
In order to support this use-case the parent pointer is only renamed to
dev_parent, not removed altogether. It has been renamed to ensure that the
compiler will catch any (possibly out-of-tree) drivers that were missed during
the conversion.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-21 11:07:12 -03:00
Hans Verkuil 14381c2677 [media] soc_camera: replace vdev->parent by vdev->v4l2_dev
The parent field will eventually disappear to be replaced by v4l2_dev.
soc_camera does provide a v4l2_device struct but did not point to it in
struct video_device. This is now fixed.
Now the video nodes can be found under the correct platform bus, and
the advanced debug ioctls work correctly as well (the core implementation
of those ioctls requires that v4l2_dev is set correctly).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-21 11:02:24 -03:00
Hans Verkuil b71c99801e [media] v4l2-core: remove support for obsolete VIDIOC_DBG_G_CHIP_IDENT
This has been replaced by the new and much better VIDIOC_DBG_G_CHIP_INFO.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-21 10:46:44 -03:00
Hans Verkuil 1286914571 [media] v4l2-int-device: remove unused chip_ident reference
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-21 10:45:58 -03:00
Hans Verkuil aee38734d2 [media] v4l2-common: remove unused v4l2_chip_match/ident_i2c_client functions
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-21 10:45:42 -03:00
Hans Verkuil 6ec19898ed [media] v4l2: remove obsolete v4l2_chip_match_host()
This function is no longer needed since it is now the responsibility of the
v4l2 core to check if the DBG_G/S_REGISTER and DBG_G_CHIP_INFO ioctls are
called for the bridge driver or not.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-21 10:30:54 -03:00
Mauro Carvalho Chehab 37c1d2e409 Merge branch 'linus' into patchwork
* linus: (1465 commits)
  ARM: tegra30: clocks: Fix pciex clock registration
  lseek(fd, n, SEEK_END) does *not* go to eof - n
  Linux 3.10-rc6
  smp.h: Use local_irq_{save,restore}() in !SMP version of on_each_cpu().
  powerpc: Fix missing/delayed calls to irq_work
  powerpc: Fix emulation of illegal instructions on PowerNV platform
  powerpc: Fix stack overflow crash in resume_kernel when ftracing
  snd_pcm_link(): fix a leak...
  use can_lookup() instead of direct checks of ->i_op->lookup
  move exit_task_namespaces() outside of exit_notify()
  fput: task_work_add() can fail if the caller has passed exit_task_work()
  xfs: don't shutdown log recovery on validation errors
  xfs: ensure btree root split sets blkno correctly
  xfs: fix implicit padding in directory and attr CRC formats
  xfs: don't emit v5 superblock warnings on write
  mei: me: clear interrupts on the resume path
  mei: nfc: fix nfc device freeing
  mei: init: Flush scheduled work before resetting the device
  sctp: fully initialize sctp_outq in sctp_outq_init
  netiucv: Hold rtnl between name allocation and device registration.
  ...
2013-06-20 05:19:09 -03:00
Sylwester Nawrocki 7349cec14d [media] media: Add a function removing all links of a media entity
This function allows to remove all media entity's links to other
entities, leaving no references to a media entity's links array
at its remote entities.
Currently, when a driver of some entity is removed it will free its
media entities links[] array, leaving dangling pointers at other
entities that are part of same media graph. This is troublesome when
drivers of a media device entities are in separate kernel modules,
removing only some modules will leave others in an incorrect state.
This function is intended to be used when an entity is being
unregistered from a media device.
With an assumption that normally the media links should be created
between media entities registered to a media device, with the graph
mutex held.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-19 08:59:54 -03:00
Linus Torvalds aad7601365 Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab:
 "Series of fixes for 3.10.  There are some usual driver fixes (mostly
  on s5p/exynos playform drivers), plus some fixes at V4L2 core"

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (40 commits)
  [media] soc_camera: error dev remove and v4l2 call
  [media] sh_veu: fix the buffer size calculation
  [media] sh_veu: keep power supply until the m2m context is released
  [media] sh_veu: invoke v4l2_m2m_job_finish() even if a job has been aborted
  [media] v4l2-ioctl: don't print the clips list
  [media] v4l2-ctrls: V4L2_CTRL_CLASS_FM_RX controls are also valid radio controls
  [media] cx88: fix NULL pointer dereference
  [media] DocBook/media/v4l: update version number
  [media] exynos4-is: Remove "sysreg" clock handling
  [media] exynos4-is: Fix reported colorspace at FIMC-IS-ISP subdev
  [media] exynos4-is: Ensure fimc-is clocks are not enabled until properly configured
  [media] exynos4-is: Prevent NULL pointer dereference when firmware isn't loaded
  [media] s5p-mfc: Add NULL check for allocated buffer
  [media] s5p-mfc: added missing end-of-lines in debug messages
  [media] s5p-mfc: v4l2 controls setup routine moved to initialization code
  [media] s5p-mfc: separate encoder parameters for h264 and mpeg4
  [media] s5p-mfc: Remove special clock usage in driver
  [media] s5p-mfc: Remove unused s5p_mfc_get_decoded_status_v6() function
  [media] v4l2: mem2mem: save irq flags correctly
  [media] coda: v4l2-compliance fix: add VIDIOC_CREATE_BUFS support
  ...
2013-06-18 06:25:08 -10:00
Hans Verkuil ca37157506 [media] v4l2: remove deprecated current_norm support completely
The use of current_norm to keep track of the current standard has been
deprecated for quite some time. Now that all drivers that were using it
have been converted to use g_std we can drop it from the core.
It was a bad idea to introduce this at the time: since it is a per-device
node field it didn't work for drivers that create multiple nodes, all sharing
the same tuner (e.g. video and vbi nodes, or a raw video node and a compressed
video node). In addition it was very surprising behavior that g_std was
implemented in the core. Often drivers implemented both g_std and current_norm,
because they didn't understand how it should be used.
Since the benefits were very limited (if they were there at all), it is better
to just drop it and require that drivers just implement g_std.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-17 09:39:53 -03:00
Hans Verkuil 3300101001 [media] tveeprom: remove v4l2-chip-ident.h include
Replace the V4L2_IDENT_* usage with tveeprom-specific defines. This header
is deprecated, so those defines shouldn't be used anymore.
The em28xx driver is the only one that uses the tveeprom audio_processor
field, so that has been updated to use the new tveeprom AUDPROC define.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-17 08:48:03 -03:00
Lad, Prabhakar d97ada97ae [media] media: i2c: ths7303: remove init_enable option from pdata
This patch removes init_enable option from pdata, the init_enable
was intended that the device should start streaming video immediately
but ideally the bridge drivers should call s_stream explicitly for such
devices to start video.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-13 11:41:18 -03:00
Sylwester Nawrocki 813f5c0ac5 [media] media: Change media device link_notify behaviour
Currently the media device link_notify callback is invoked before the
actual change of state of a link when the link is being enabled, and
after the actual change of state when the link is being disabled.
This doesn't allow a media device driver to perform any operations
on a full graph before a link is disabled, as well as performing
any tasks on a modified graph right after a link's state is changed.
This patch modifies signature of the link_notify callback. This
callback is now called always before and after a link's state change.
To distinguish the notifications a 'notification' argument is added
to the link_notify callback: MEDIA_DEV_NOTIFY_PRE_LINK_CH indicates
notification before link's state change and
MEDIA_DEV_NOTIFY_POST_LINK_CH corresponds to a notification after
link flags change.

[mchehab@redhat.com: whitespace cleanups]
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-12 22:16:27 -03:00
Sylwester Nawrocki 403dfbec45 [media] exynos4-is: Use common exynos_media_pipeline data structure
This enumeration is now private to exynos4-is and the exynos5 camera
subsystem driver may have the subdevs handling designed differently.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-12 21:57:59 -03:00
Sylwester Nawrocki bc7584b0b7 [media] exynos4-is: Add struct exynos_video_entity
This patch introduces common structure for the video entities
to handle all video nodes and media pipelines associated with
them in more generic way.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-12 21:53:33 -03:00
Andrzej Hajda 1bddf1b3ac [media] media: Rename media_entity_remote_source to media_entity_remote_pad
Function media_entity_remote_source actually returns the remote pad to
the given one, regardless if this is the source or the sink pad.
Name media_entity_remote_pad is more adequate for this function.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-08 21:47:11 -03:00
Philipp Zabel 8b94ca61d7 [media] v4l2-mem2mem: add v4l2_m2m_create_bufs helper
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-03 15:51:11 -03:00
Lad, Prabhakar 19ec930574 [media] media: i2c: tvp7002: rearrange description of structure members
This patch rearranges the description of field members of
struct tvp7002_config. Also as the all the fields where accepting
a value either 0/1, made the members as bool.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-05-27 09:29:56 -03:00
Mauro Carvalho Chehab b11460b053 [media] saa7115: add detection code for gm7113c
Adds a code that (auto)detects gm7113c clones. The auto-detection
here is not perfect, as, on contrary to what it would be expected
by looking into its datasheets some devices would return, instead:
	saa7115 0-0025: chip 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 @ 0x4a is unknown
(found on a device labeled as GM7113C 1145 by Ezequiel Garcia)

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Jon Arne Jørgensen <jonarne@jonarne.no>
Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-05-21 08:24:31 -03:00
Lad, Prabhakar 63eb2ca171 [media] media: i2c: tvp7002: enable TVP7002 decoder for media controller based usage
This patch enables tvp7002 decoder driver for media controller
based usage by adding v4l2_subdev_pad_ops  operations support
for enum_mbus_code, set_pad_format, get_pad_format and media_entity_init()
on probe and media_entity_cleanup() on remove.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-05-21 08:21:13 -03:00
Lad, Prabhakar 849325e331 [media] media: davinci: vpbe: fix checkpatch warning for CamelCase
This patch fixes checkpatch warning to avoid CamelCase.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-05-21 08:19:17 -03:00
Jakob Haufe 3020bea57f [media] rc: Add rc-delock-61959
This adds the keytable for the remote that comes with the Delock 61959.
NEC protocol with address 0x866b.

Signed-off-by: Jakob Haufe <sur5r@sur5r.net>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-05-21 08:18:19 -03:00
Linus Torvalds a49fe6d59a Merge branch 'topic/omap3isp' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull omap3isp clk support from Mauro Carvalho Chehab:
 "This patch were sent in separate as it depends on a merge from clock
  framework, that you merged in commit 362ed48dee50"

* 'topic/omap3isp' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] omap3isp: Use the common clock framework
2013-05-01 09:57:04 -07:00
Mauro Carvalho Chehab 966a160187 Merge branch 'topic/si476x' into patchwork
* topic/si476x:
  Revert "[media] mfd: Add chip properties handling code for SI476X MFD"
  Revert "[media] mfd: Add the main bulk of core driver for SI476x code"
  Revert "[media] mfd: Add commands abstraction layer for SI476X MFD"
  [media] v4l2: Add a V4L2 driver for SI476X MFD
2013-04-25 10:26:43 -03:00
Mauro Carvalho Chehab cb132cd5d7 [media] videobuf-dma-contig: remove support for cached mem
videobuf_queue_dma_contig_init_cached() is not used anywhere.
Drop support for it, cleaning up the code a little bit.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-25 09:50:19 -03:00
Andrey Smirnov b879a9c2a7 [media] v4l2: Add a V4L2 driver for SI476X MFD
This commit adds a driver that exposes all the radio related
functionality of the Si476x series of chips via the V4L2 subsystem.

[mchehab@redhat.com: change it to depends on MFD_SI476X_CORE instead of
 selecting it; vidioc_s_register now uses const struct]
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-18 21:20:34 -03:00
Mauro Carvalho Chehab 82cd0b278f Revert "[media] v4l2: Add a V4L2 driver for SI476X MFD"
As requested by Andrey Smirnov <andrew.smirnov@gmail.com>, revert
this patch.

This reverts commit 30bac91104.

Conflicts:
	drivers/media/radio/Kconfig
	drivers/media/radio/radio-si476x.c

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-17 06:05:18 -03:00
Antti Palosaari 52f5ad6c5f [media] rc: add rc-reddo
It is very similar than rc-msi-digivox-iii but new keytable is needed
as there is one existing scancode mapped to different button. Also that
one has less buttons.
NEC extended protocol with address 0x61d6.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 22:48:35 -03:00
Laurent Pinchart 9b28ee3c91 [media] omap3isp: Use the common clock framework
Expose the two ISP external clocks XCLKA and XCLKB as common clocks for
subdev drivers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 20:21:12 -03:00
Hans Verkuil 96b03d2a30 [media] v4l2: rename VIDIOC_DBG_G_CHIP_NAME to _CHIP_INFO
This ioctl will be extended to return more information than just the name.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:47:33 -03:00
Hans Verkuil cd634f1bfc [media] v4l2: put VIDIOC_DBG_G_CHIP_NAME under ADV_DEBUG
Only enable this ioctl if the VIDEO_ADV_DEBUG config option is set. This
prevents abuse from both userspace and kernelspace (some bridge drivers
abuse DBG_G_CHIP_IDENT, lets prevent that from happening again with this
ioctl).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:45:23 -03:00
Laurent Pinchart d67492585d [media] mt9p031: Use the common clock framework
Configure the device external clock using the common clock framework
instead of a board code callback function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 16:03:22 -03:00
Sylwester Nawrocki 488f29d00e [media] exynos4-is: Move the subdev group ID definitions to public header
Move the sub-device group ID definitions to the driver's public header
so they are available to other media drivers that need to share modules
found in exynos4-is.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 15:46:40 -03:00
Ondrej Zary cdcd141c95 [media] tuner-core: Change config from unsigned int to void *
config looks like a hack that was added to tuner-core to allow some
configuration of TDA8290 tuner (it's not used by any other driver).
But with the new configuration options of tda8290 driver (no_i2c_gate
and std_map), it's no longer sufficient.
Change config to be void * instead, which allows passing tuner-dependent
config struct to drivers.
Also update saa7134 driver to reflect this change (no other driver uses this).

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 07:01:36 -03:00
Sylwester Nawrocki e90ad659cd [media] exynos4-is: Allow colorspace conversion at FIMC-LITE
The FIMC-LITE output DMA allows to configure different YUV order
than the order at the camera input interface. Thus there is some
limited colorspace conversion possible. This patch makes the
color format variable be per FIMC-LITE input/output, rather than
a global per device. This also fixes incorrect behavior where
color format at the FIMC-LITE.N subdev's source pad is modified
by VIDIOC_S_FMT ioctl on the related video node.
YUV order definitions are corrected so that we use notation:
         | byte3 | byte2 | byte1 | byte0
  -------+-------+-------+-------+------
  YCBYCR | CR    | Y     | CB    | Y
  YCRYCB | CB    | Y     | CR    | Y
  CBYCRY | Y     | CR    | Y     | CB
  CRYCBY | Y     | CB    | Y     | CR

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-04 20:23:24 -03:00
Sylwester Nawrocki c6e8d96d42 [media] V4L: Remove incorrect EXPORT_SYMBOL() usage at v4l2-of.c
v4l2_of_parse_parallel_bus() function is now static and
EXPORT_SYMBOL() doesn't apply to it any more. Drop this
meaningless statement, which was supposed to be done in
the original merged patch.
While at it, edit the copyright notice so it is sorted in
both the v4l2-of.c and v4l2-of.h file in newest entries
on top order, and state clearly I'm just the author of
parts of the code, not the copyright owner.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-04 19:57:13 -03:00
Phil Edworthy 7b88fc086a [media] soc_camera: Add RGB666 & RGB888 formats
Based on work done by Katsuya Matsubara.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-04 19:40:08 -03:00
Sylwester Nawrocki 80f958f40d [media] s5p-fimc: Remove dependency on fimc-core.h in fimc-lite driver
Drop fimc-lite.h header inclusion to make the exynos-fimc-lite
module independent on other modules. Move struct fimc_fmt
declaration to the driver's private headers as it is used in
multiple modules.

Reported-by: Shaik Ameer Basha <shaik.ameer@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-31 11:02:39 -03:00
Sylwester Nawrocki 2b13f7d4e3 [media] s5p-fimc: Add device tree based sensors registration
The sensor (I2C and/or SPI client) devices are instantiated by their
corresponding control bus drivers. Since the I2C client's master clock
is often provided by a video bus receiver (host interface) or other
than I2C/SPI controller device, the drivers of those client devices
are not accessing hardware in their driver's probe() callback. Instead,
after enabling clock, the host driver calls back into a sub-device
when it wants to activate them. This pattern is used by some in-tree
drivers and this patch also uses it for DT case. This patch is intended
as a first step for adding device tree support to the S5P/Exynos SoC
camera drivers. The second one is adding support for asynchronous
sub-devices registration and clock control from sub-device driver
level. The bindings shall not change when asynchronous probing support
is added.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-31 10:54:18 -03:00
Sylwester Nawrocki e2985a260e [media] s5p-fimc: Add device tree support for the media device driver
This patch adds changes required for the main camera media device
driver corresponding to the top level 'camera' device node.
The drivers of devices corresponding to child nodes of the 'camera'
node are looked up and and registered as sub-devices to the top
level driver. The main driver's probing is deferred if any of the
sub-device drivers is not yet initialized and ready.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-31 10:46:12 -03:00
Sylwester Nawrocki 02399e35e6 [media] s5p-csis: Add device tree support
This patch support for binding the driver to the MIPI-CSIS
devices instantiated from device tree and parsing the SoC
and board specific properties. The MIPI CSI-2 channel is
determined by the value of reg property placed in csis'
port subnode.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-31 10:42:58 -03:00
Guennadi Liakhovetski 99fd133f90 [media] Add a V4L2 OF parser
Add a V4L2 OF parser, implementing bindings documented in
Documentation/devicetree/bindings/media/video-interfaces.txt.
[s.nawrocki@samsung.com: various corrections and improvements
since the initial version]

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-31 10:34:09 -03:00
Andrey Smirnov 30bac91104 [media] v4l2: Add a V4L2 driver for SI476X MFD
This commit adds a driver that exposes all the radio related
functionality of the Si476x series of chips via the V4L2 subsystem.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-29 09:25:49 -03:00
Mauro Carvalho Chehab 6d43be7789 [media] ioctl numbers are unsigned int
ioctl's number is unsigned int. Fix it at vidioc_default.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-29 08:18:36 -03:00
Hans Verkuil 79b0c64005 [media] v4l2: add new VIDIOC_DBG_G_CHIP_NAME ioctl
Simplify the debugging ioctls by creating the VIDIOC_DBG_G_CHIP_NAME ioctl.
This will eventually replace VIDIOC_DBG_G_CHIP_IDENT. Chip matching is done
by the name or index of subdevices or an index to a bridge chip. Most of this
can all be done automatically, so most drivers just need to provide get/set
register ops.
In particular, it is now possible to get/set subdev registers without
requiring assistance of the bridge driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 09:31:05 -03:00
Hans Verkuil 02fa628217 [media] v4l2 core: remove the obsolete dv_preset support
These ioctls are no longer used by any drivers, so remove them.

[mchehab@redhat.com: Fix merge conflict]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 13:49:17 -03:00
Hans Verkuil 6c2afac434 [media] v4l2-subdev: remove obsolete dv_preset ops
These ops are no longer used, so it's time to remove them.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 13:38:33 -03:00
Hans Verkuil 2d80647b6e [media] v4l2-common: remove obsolete v4l_fill_dv_preset_info
It's no longer used, so it can now be removed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 13:37:10 -03:00
Hans Verkuil 73d9f97933 [media] uda1342: add new uda1342 audio codec driver
This based on the wis-uda1342.c driver that's part of the go7007 driver.
It has been converted to a v4l subdev driver by Pete Eberlein, and I made
additional cleanups.
Based on work by: Pete Eberlein <pete@sensoray.com>

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 12:24:11 -03:00
Hans Verkuil e4d2a6162d [media] tuner: add Sony BTF tuners
This adds support for three Sony BTF tuners:
TUNER_SONY_BTF_PG472Z: PAL+SECAM
TUNER_SONY_BTF_PK467Z: NTSC-M-JP
TUNER_SONY_BTF_PB463Z: NTSC-M
These come from the go7007 staging driver where they were implemented in
the wis-sony-tuner i2c driver.
Adding support for these tuners to tuner-types.c is the first step towards
removing the wis-sony-tuner driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 12:11:35 -03:00
Hans Verkuil 1589037f87 [media] saa7115: add support for double-rate ASCLK
Some devices expect a double rate ASCLK. Add a flag to let the driver know
through the s_crystal_freq call.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 12:10:18 -03:00
Hans Verkuil a0fc58868b [media] saa7115: add config flag to change the IDQ polarity
Needed by the go7007 driver: it assumes a different polarity of the IDQ
signal, so we need to be able to tell the saa7115 about this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 12:02:59 -03:00
Hans Verkuil 2180f92def [media] v4l2-core: add code to check for specific ops
This patch adds a v4l2_subdev_has_op() macro and a v4l2_device_has_op macro to
quickly check if a specific subdev or any subdev supports a particular subdev
operation.
This makes it easy for drivers to disable certain ioctls if none of the subdevs
supports the necessary functionality.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 11:59:02 -03:00
Andy Walls 6cd247ef22 [media] v4l2-ctrls: eliminate lockdep false alarms for struct v4l2_ctrl_handler.lock
When calling v4l2_ctrl_add_handler(), lockdep would detect a potential
recursive locking problem on a situation that is by design intended and
not a recursive lock.  This happened because all struct
v4l2_ctrl_handler.lock mutexes were created as members of the same lock
class in v4l2_ctrl_handler_init(), and v4l2_ctrl_add_handler() takes the
hdl->lock on two different v4l2_ctrl_handler instances.
This change breaks the large lockdep lock class for struct
v4l2_ctrl_handler.lock and breaks it into v4l2_ctrl_handler
instantiation specific lock classes with meaningful class names.
This will validly eliminate lockdep alarms for v4l2_ctrl_handler locking
validation, as long as the relationships between drivers adding v4l2
controls to their own handler from other v4l2 drivers' control handlers
remains straightforward.
struct v4l2_ctrl_handler.lock lock classes are created with names such
that the output of cat /proc/lockdep indicates where in the v4l2 driver
code v4l2_ctrl_handle_init() is being called on instantiations:
ffffffffa045f490 FD:   10 BD:    8 +.+...: cx2341x:1534:(hdl)->lock
ffffffffa0497d20 FD:   12 BD:    2 +.+.+.: saa7115:1581:(hdl)->lock
ffffffffa04ac660 FD:   14 BD:    2 +.+.+.: msp3400_driver:756:(hdl)->lock
ffffffffa0484b90 FD:   12 BD:    1 +.+.+.: ivtv_gpio:366:(&itv->hdl_gpio)->lock
ffffffffa04eb530 FD:   11 BD:    2 +.+.+.: cx25840_core:1982:(&state->hdl)->lock
ffffffffa04fbc80 FD:   11 BD:    3 +.+.+.: wm8775:246:(&state->hdl)->lock
Some lock chains, that were previously causing the recursion alarms, are
now visible in the output of cat /proc/lockdep_chains:
irq_context: 0
[ffffffffa0497d20] saa7115:1581:(hdl)->lock
[ffffffffa045f490] cx2341x:1534:(hdl)->lock
irq_context: 0
[ffffffffa04ac660] msp3400_driver:756:(hdl)->lock
[ffffffffa045f490] cx2341x:1534:(hdl)->lock
irq_context: 0
[ffffffffa0484b90] ivtv_gpio:366:(&itv->hdl_gpio)->lock
[ffffffffa045f490] cx2341x:1534:(hdl)->lock
irq_context: 0
[ffffffffa04eb530] cx25840_core:1982:(&state->hdl)->lock
[ffffffffa045f490] cx2341x:1534:(hdl)->lock
irq_context: 0
[ffffffffa04fbc80] wm8775:246:(&state->hdl)->lock
[ffffffffa045f490] cx2341x:1534:(hdl)->lock

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
[hans.verkuil@cisco.com: keep mutex_init in v4l2_ctrl_handler_init_class]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 11:47:09 -03:00
Hans Verkuil 977ba3b1b7 [media] v4l2: add const to argument of write-only s_register ioctl
This ioctl is defined as IOW, so pass the argument as const.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 08:47:01 -03:00
Hans Verkuil 314527acbb [media] v4l2: pass std by value to the write-only s_std ioctl
This ioctl is defined as IOW, so pass the argument by value instead of by
reference. I could have chosen to add const instead, but this is 1) easier
to handle in drivers and 2) consistent with the s_std subdev operation.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 06:47:00 -03:00
Hans Verkuil 2f73c7c582 [media] v4l2: add const to argument of write-only s_tuner ioctl
This ioctl is defined as IOW, so pass the argument as const.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 06:31:23 -03:00
Hans Verkuil b530a447bb [media] v4l2: add const to argument of write-only s_frequency ioctl
This ioctl is defined as IOW, so pass the argument as const.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 06:25:34 -03:00
David Härdeman 9719afae5e [media] rc-core: don't treat dev->rc_map.rc_type as a bitmap
store_protocols() treats dev->rc_map.rc_type as a bitmap which is wrong for
two reasons. First of all, it is pretty bogus to change the protocol type of
the keymap just because the hardware has been asked to decode a different
protocol.
Second, dev->rc_map.rc_type is an enum (i.e. a single protocol) as pointed
out by James Hogan <james.hogan@imgtec.com>.
Fix both issues by introducing a separate enabled_protocols member to
struct rc_dev.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 11:25:54 -03:00
Lad, Prabhakar 88da0183eb [media] media: ths7353: add support for ths7353 video amplifier
The patch adds support for THS7353 video amplifier.
The the THS7353 amplifier is very much similar to the
existing THS7303 video amplifier driver.
This patch appropriately makes changes to the existing
ths7303 driver and adds support for the THS7353.
This patch also adds V4L2_IDENT_THS7353 for the THS7353
chip and appropriate changes to Kconfig file for building.

Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:04:47 -03:00