Commit Graph

95 Commits

Author SHA1 Message Date
Guennadi Liakhovetski 40f075330a [media] V4L2: soc-camera: work around unbalanced calls to .s_power()
Some non soc-camera drivers, e.g. em28xx, use subdevice drivers, originally
written for soc-camera, which use soc_camera_power_on() and
soc_camera_power_off() helpers to implement their .s_power() methods. Those
helpers in turn can enable and disable a clock, if it is supplied to them
as a parameter. This works well when camera host drivers balance their
calls to subdevices' .s_power() methods. However, some such drivers fail to
do that, which leads to unbalanced calls to v4l2_clk_enable() /
v4l2_clk_disable(), which then in turn produce kernel warnings. Such
behaviour is wrong and should be fixed, however, sometimes it is difficult,
because some of those drivers are rather old and use lots of subdevices,
which all should be tested after such a fix. To support such drivers this
patch adds a work-around, allowing host drivers or platforms to set a flag,
in which case soc-camera helpers will only enable the clock, if it is
disabled, and disable it only once on the first call to .s_power(0).

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-10-31 04:38:40 -02:00
Guennadi Liakhovetski d3f884a709 [media] soc-camera: switch to using the new struct v4l2_subdev_platform_data
This prepares soc-camera to use struct v4l2_subdev_platform_data for its
subdevice-facing API, which would allow subdevice driver re-use.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-10-31 04:30:56 -02: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 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 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 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
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
Guennadi Liakhovetski 25a3481100 [media] soc-camera: split struct soc_camera_link into host and subdevice parts
struct soc_camera_link currently contains fields, used both by sensor and
bridge drivers. To make subdevice driver re-use simpler, split it into a
host and a subdevice parts.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-01-05 01:38:02 -02:00
Guennadi Liakhovetski dd669e907c [media] soc-camera: remove struct soc_camera_device::video_lock
Currently soc-camera has a per-device node lock, used for video operations
and a per-host lock for code paths, modifying host's pipeline. Manipulating
the two locks increases complexity and doesn't bring any advantages. This
patch removes the per-device lock and uses the per-host lock for all
operations.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-01-05 01:36:23 -02:00
Guennadi Liakhovetski 7d051b35d5 [media] soc-camera: properly fix camera probing races
The recently introduced host_lock causes lockdep warnings, besides, list
enumeration in scan_add_host() must be protected by holdint the list_lock.
OTOH, holding .video_lock in soc_camera_open() isn't enough to protect
the host during its building of the pipeline, because .video_lock is per
soc-camera device. If, e.g. more than one sensor can be attached to a host
and the user tries to open both device nodes simultaneously, host's .add()
method can be called simultaneously for both sensors. Fix these problems
by holding list_lock instead of .host_lock in scan_add_host() and taking
it shortly at the beginning of soc_camera_open(), and using .host_lock to
protect host's .add() and .remove() operations only.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-01-05 01:35:35 -02:00
Hans Verkuil 4f996594ce [media] v4l2: make vidioc_s_crop const
Write-only ioctls should have a const argument in the ioctl op.
Do this conversion for vidioc_s_crop.
Adding const for write-only ioctls was decided during the 2012 Media Workshop.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26 11:02:25 -03:00
Guennadi Liakhovetski 3bfb41001d [media] V4L: soc-camera: add selection API host operations
Add .get_selection() and .set_selection() soc-camera host driver
operations. Additionally check, that the user is not trying to change the
output sizes during a running capture.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 17:37:39 -03:00
Laurent Pinchart 4ec10bacd6 [media] soc-camera: Add and use soc_camera_power_[on|off]() helper functions
Instead of forcing all soc-camera drivers to go through the mid-layer to
handle power management, create soc_camera_power_[on|off]() functions
that can be called from the subdev .s_power() operation to manage
regulators and platform-specific power handling. This allows non
soc-camera hosts to use soc-camera-aware clients.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[g.liakhovetski@gmx.de: fix compile breakage]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 17:03:29 -03:00
Laurent Pinchart 914f05c811 [media] soc-camera: Support user-configurable line stride
Add a capabilities field to the soc_camera_host structure to flag hosts
that support user-configurable line strides. soc_camera_try_fmt() then
passes the user-provided bytesperline and sizeimage format fields to
such hosts, and expects the host to check (and fix if needed) the
values.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[g.liakhovetski@gmx.de: fix a typo in mx2_camera.c]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-15 16:12:54 -03:00
Guennadi Liakhovetski ad3537b567 [media] V4L: soc-camera: (cosmetic) use a more explicit name for a host handler
Use "enum_framesizes" instead of "enum_fsizes" to more precisely follow
the name of the respective ioctl().

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Reviewed-by: Sergio Aguirre <sergio.a.aguirre@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-15 08:52:49 -03:00
Guennadi Liakhovetski 2f9a0c880d [media] V4L: soc-camera: protect hosts during probing from overzealous user-space
If multiple clients are registered on a single camera host interface,
the user-space hot-plug software can try to access the one, that probed
first, before probing of the second one has completed. This can be
handled by individual host drivers, but it is even better to hold back
the user-space until all the probing on this host has completed. This
fixes a race on ecovec with two clients registered on the CEU1 host, which
otherwise triggers a BUG() in sh_mobile_ceu_remove_device().

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-04-26 11:30:12 -03:00
Guennadi Liakhovetski 8843d119ea [media] soc-camera: remove redundant parameter from .set_bus_param()
The "pixfmt" parameter of the struct soc_camera_host_ops::set_bus_param()
method is redundant, because at the time, when this method is called,
pixfmt is guaranteed to be equal to icd->current_fmt->host_fmt->fourcc.
Remove this parameter and update all drivers accordingly.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 11:00:23 -02:00
Guennadi Liakhovetski 4c0b036db8 [media] V4L: soc-camera: fix compiler warnings on 64-bit platforms
On 64-bit platforms assigning a pointer to a 32-bit variable causes a
compiler warning and cannot actually work. Soc-camera currently doesn't
support any 64-bit systems, but such platforms can be added in the
and in any case compiler warnings should be avoided.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-11 09:34:00 -02:00
Guennadi Liakhovetski 2f0babb7e4 [media] V4L: soc-camera: make (almost) all client drivers re-usable outside of the framework
The most important change in this patch is direct linking to struct
soc_camera_link via the client->dev.platform_data pointer. This makes most
of the soc-camera client drivers also usable outside of the soc-camera
framework. After this change all what is needed for these drivers to
function are inclusions of soc-camera headers for some convenience macros,
suitably configured platform data, which is anyway always required, and
loaded soc-camera core module for library functions. If desired, these
library functions can be made generic in the future and moved to a more
neutral location.

The only two client drivers, that still depend on soc-camera are:

mt9t031: it uses struct video_device for its PM. Since no hardware is
available, alternative methods cannot be tested.

ov6650: it uses struct soc_camera_device to pass its sense data back to
the bridge driver. A generic v4l2-subdevice approach should be developed
to perform this.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-03 18:29:03 -02:00
Guennadi Liakhovetski 443f483aa2 [media] V4L: mt9m001, mt9v022: use internally cached pixel code
Using the internally cached pixel code, instead of the one, provided by
the soc-camera, removes one more use of struct soc_camera_device in these
drivers. Also remove the no longer needed soc_camera_from_i2c() inline
function.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-03 18:28:59 -02:00
Guennadi Liakhovetski 14178aa57c [media] V4L: soc-camera: start removing struct soc_camera_device from client drivers
Remove most trivial uses of struct soc_camera_device from most client
drivers, abstracting some of them inside inline functions. Next steps
will eliminate remaining uses and modify inline functions to not use
struct soc_camera_device.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-03 18:28:58 -02:00
Hans Verkuil 0934d94a52 [media] soc_camera: remove the now obsolete struct soc_camera_ops
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[g.liakhovetski@gmx.de: mt9m001 hunk moved to an earlier patch]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-03 18:28:55 -02:00
Hans Verkuil d34bfcd2a1 [media] sh_mobile_ceu_camera: implement the control handler
And since this is the last and only host driver that uses controls, also
remove the now obsolete control fields from soc_camera.h.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[g.liakhovetski@gmx.de: moved code around, fixed problems]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-03 18:28:35 -02:00
Hans Verkuil ee02da6455 [media] soc_camera: add control handler support
The soc_camera framework is switched over to use the control framework.
After this patch none of the controls in subdevs or host drivers are available,
until those drivers are also converted to the control framework.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[g.liakhovetski@gmx.de: moved code around, fixed problems]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-03 18:28:34 -02:00
Guennadi Liakhovetski d839fe17a1 [media] V4L: soc-camera: remove soc-camera client bus-param operations and supporting code
soc-camera has been completely ported over to V4L2 subdevice mbus-config
operations, soc-camera client bus-param operations and supporting code
can now be removed.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-03 18:28:18 -02:00
Guennadi Liakhovetski 9d3baeb462 [media] V4L: soc-camera: compatible bus-width flags
With the new subdevice media-bus configuration methods bus-width is not
configured along with other bus parameters, instead, it is derived from
the data format. With those methods it is convenient to specify
supported bus-widths in the platform data as (1 << (width - 1)). We
redefine SOCAM_DATAWIDTH_* flags to use the same convention to make
platform data seemlessly reusable.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-03 18:27:36 -02:00
Guennadi Liakhovetski 32c69fcc78 [media] V4L: soc-camera: add helper functions for new bus configuration type
Add helper functions to process the new media bus configuration type
similar to soc_camera_apply_sensor_flags() and
soc_camera_bus_param_compatible().

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-03 18:27:13 -02:00
Guennadi Liakhovetski 7dfff95366 [media] V4L: soc-camera: remove soc-camera bus and devices on it
Now that v4l2 subdevices have got their own device objects, having
one more device in soc-camera clients became redundant and confusing.
This patch removes those devices and the soc-camera bus, they used to
reside on.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:08 -03:00
Guennadi Liakhovetski d33b290a14 [media] V4L: soc-camera: un-export the soc-camera bus
The soc-camera bus is now completely local again.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:08 -03:00
Guennadi Liakhovetski 033d7463f8 [media] V4L: soc-camera: remove now unused soc-camera specific PM hooks
soc-camera host drivers shall be implementing their PM, using standard
kernel methods, soc-camera specific hooks can die.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:07 -03:00
Guennadi Liakhovetski 8318a64b89 [media] V4L: soc-camera: remove several now unused soc-camera client operations
This patch removes .enum_input(), .suspend() and .resume() soc-camera
client operations.

Functionality, provided by .enum_input(), if needed, can be implemented
using the v4l2-subdev API.

As for .suspend() and .resume(), the only client driver, implementing
these methods has been mt9m111, and the only host driver, using them
has been pxa-camera. Now that both those drivers have been converted
to the standard subdev .s_power() operation, .suspend() and .resume()
can be removed.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:23 -03:00
Guennadi Liakhovetski b7ccdba02a [media] V4L: soc-camera: MIPI flags are not sensor flags
SOCAM_MIPI_[1234]LANE flags are not board-specific sensor flags, they
are bus configuration flags.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:22 -03:00
Kassey Li ee1b6f4bf3 [media] V4L: soc-camera: add MIPI bus flags
Signed-off-by: Kassey Lee <ygli@marvell.com>
Signed-off-by: Qing Xu <qingx@marvell.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20 12:00:41 -03:00
Guennadi Liakhovetski aee5c2f1fc [media] V4L: soc-camera: add a livecrop host operation
Add an soc-camera host livecrop operation to implement live zoom. If
a host driver implements it, it should take care to preserve output
frame format, then live crop doesn't break streaming.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20 11:55:31 -03:00
Sergio Aguirre 0e4c180d3e [media] v4l: soc-camera: Store negotiated buffer settings
This fixes the problem in which a host driver
sets a personalized sizeimage or bytesperline field,
and gets ignored when doing G_FMT.

Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 19:41:55 -03:00
Guennadi Liakhovetski 8eb4476d44 [media] V4L: soc-camera: add helper functions for videobuf queue handling
Add two helper inline functions to retrieve soc-camera device context
from videobuf and videobuf2 queue pointers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:32:15 -03:00
Guennadi Liakhovetski 592c2aba26 [media] V4L: soc-camera: extend to also support videobuf2
Extend soc-camera core to also support the videobuf2 API.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:32:15 -03:00
Qing Xu ed5b65dc36 [media] V4L: soc-camera: add enum-frame-size ioctl
add vidioc_enum_framesizes implementation, follow default_g_parm()
and g_mbus_fmt() method

Signed-off-by: Qing Xu <qingx@marvell.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:32:13 -03:00
Alberto Panizzo 96e442c1b2 [media] soc_camera: Add the ability to bind regulators to soc_camedra devices
In certain machines, camera devices are supplied directly
by a number of regulators. This patch add the ability to drive
these regulators directly by the soc_camera driver.

Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 22:29:37 -02:00
Guennadi Liakhovetski 57bee29d6e V4L/DVB: soc-camera: allow only one video queue per device
Multiple user-space application instances can open the same video device, but
it only makes sense for one of them to manage the videobuffer queue and set
video format of the device. Restrict soc-camera respectively.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:18 -02:00
Guennadi Liakhovetski 52d268a362 V4L/DVB: V4L2: soc-camera: export soc-camera bus type for notifications
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:38 -03:00
Hans Verkuil 3805f20193 V4L/DVB: v4l2-subdev.h: fix enum_mbus_fmt prototype
enum_mbus_fmt received an index argument that was defined as an int instead
of an unsigned int. This is now fixed. This had the knock-on effect that the
index argument in the callback get_formats in soc_camera.h also had to be
changed to unsigned int.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:21:40 -03:00
Mauro Carvalho Chehab 4f9fb5ed02 V4L/DVB: soc-camera: add runtime pm support for subdevices
To save power soc-camera powers subdevices down, when they are not in use,
if this is supported by the platform. However, the V4L standard dictates,
that video nodes shall preserve configuration between uses. This requires
runtime power management, which is implemented by this patch. It allows
subdevice drivers to specify their runtime power-management methods, by
assigning a type to the video device.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:46:09 -03:00
Márton Németh e26b314491 V4L/DVB: The first two parameters of soc_camera_limit_side() are usually pointers to struct v4l2_rect elements. They are signed, so adjust the prototype accordingly
This will remove the following sparse warning (see "make C=1"):

 * incorrect type in argument 1 (different signedness)
       expected unsigned int *start
       got signed int *<noident>

as well as a couple more signedness mismatches.

Signed-off-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:44:09 -03:00
Guennadi Liakhovetski c9f6ef6986 soc-camera: add support for VIDIOC_S_PARM and VIDIOC_G_PARM ioctls
Just pass VIDIOC_S_PARM and VIDIOC_G_PARM down to host drivers. So far no
special handling in soc-camera core.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:11:00 -03:00
Guennadi Liakhovetski 760697beca V4L/DVB (13659): soc-camera: convert to the new mediabus API
Convert soc-camera core and all soc-camera drivers to the new mediabus
API. This also takes soc-camera client drivers one step closer to also be
usable with generic v4l2-subdev host drivers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16 09:27:29 -02:00
Guennadi Liakhovetski 3fd7ceffdd V4L/DVB (13648): soc-camera: add a private field to struct soc_camera_link
Up to now, if a client driver needed platform data apart from those contained
in struct soc_camera_link, it had to embed the struct into its own object. This
makes the use of such a driver in configurations other than soc-camera

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16 09:27:18 -02:00
Guennadi Liakhovetski 325361088b V4L/DVB (13644): v4l: add new v4l2-subdev sensor operations, use g_skip_top_lines in soc-camera
Introduce new v4l2-subdev sensor operations, move .enum_framesizes() and
.enum_frameintervals() methods to it, add a new .g_skip_top_lines() method
and switch soc-camera to use it instead of .y_skip_top soc_camera_device
member, which can now be removed.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Reviewed-by: Sergio Aguirre <saaguirre@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16 09:27:13 -02:00