Commit Graph

1024 Commits

Author SHA1 Message Date
Hans Verkuil 82b655bfc3 [media] v4l2: add core support for the new VIDIOC_ENUM_FREQ_BANDS ioctl
This adds the usual core support code for this new ioctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-30 20:23:05 -03:00
Manjunath Hadli 6964b10363 [media] davinci: vpif: add support for clipping on output data
add hardware clipping support for VPIF output data. This
is needed as it is possible that the external encoder
might get confused between the FF or 00 which are a part
of the data and that of the SAV or EAV codes.

Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-30 19:06:55 -03:00
Du, Changbin 500c3201e2 [media] media: gpio-ir-recv: add allowed_protos for platform data
It's better to give platform code a chance to specify the allowed
protocols to use.

[mchehab@redhat.com: fix merge conflict with a patch that made
 half of this change]
Signed-off-by: Du, Changbin <changbin.du@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 18:21:53 -03:00
Hans Verkuil 4c1ffcaad5 [media] videobuf2-core: add helper functions
Add helper functions to make it easier to adapt drivers to vb2.

These helpers take care of core locking and check if the filehandle is the
owner of the queue.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 17:32:06 -03:00
Hans Verkuil 5a5adf6b66 [media] v4l2-dev/ioctl.c: add vb2_queue support to video_device
This prepares struct video_device for easier integration with vb2.

It also introduces a new lock that protects the vb2_queue. It is up
to the driver to use it or not. And the driver can associate an owner
filehandle with the queue to check whether queuing requests are
permitted for the calling filehandle.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 17:30:54 -03:00
Hans Verkuil 4a085168b5 [media] v4l2-ioctl: remove v4l_(i2c_)print_ioctl
v4l_i2c_print_ioctl wasn't used and v4l_print_ioctl could be replaced by
v4l_printk_ioctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 17:26:46 -03:00
Benoît Thébaudeau ebc04047b3 [PATCH] media: add Analog Devices ADV7393 video encoder driver
Add ADV7393 I²C-based video encoder driver. This driver has been tested on
custom hardware. It has been tested for composite output. It is derived from the
ADV7343 driver.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 15:46:17 -03:00
Mauro Carvalho Chehab 31361fc463 [media] videobuf-core.h: remove input fields
Now that the input fields got removed from the userspace API,
there's no sense to keep there at the VB struct. Remove it.

Cc: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 18:03:20 -03:00
Benoît Thébaudeau 2bd237b8a4 [media] media: gpio-ir-recv: add map name
Make it possible for gpio-ir-recv users to choose a map name.

Cc: Ravi Kumar V <kumarrav@codeaurora.org>
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-25 14:37:52 -03:00
Albert Wang 86b0905516 [media] videobuf2: correct the #ifndef text mistake in videobuf2-dma-contig.h
It should be a mistake due to copy & paste in header file
  Correct it in videobuf2-dma-config.h for avoiding duplicate include it

Change-Id: I1f71fcec2889c033c7db380c58d9a1369c5afb35

Signed-off-by: Albert Wang <twang13@marvell.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 19:54:42 -03:00
Laurent Pinchart 0bc77f3f06 [media] mt9t001: Implement V4L2_CID_PIXEL_RATE control
The pixel rate control is required by the OMAP3 ISP driver and should be
implemented by all media controller-compatible sensor drivers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-24 09:25:15 -03:00
remi schwartz 75c7dbcab4 [media] patch for Asus My Cinema PS3-100 (1043:48cd)
Signed-off-by: Remi Schwartz <remi.schwartz@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-20 16:05:02 -03:00
Sakari Ailus 2547428de0 [media] smiapp: Allow using external clock from the clock framework
Instead of providing a function in platform data, allow also providing the
name of the external clock and use it through the clock framework.

Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-20 12:44:24 -03:00
Federico Vaga a8f3c203e1 [media] videobuf-dma-contig: add cache support
Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-20 12:01:58 -03:00
Anssi Hannula 5085c99eeb [media] ati_remote: add keymap for Medion X10 OR2x remotes
Add another Medion X10 remote keymap. This is for the Medion OR2x
remotes with the Windows MCE button.

The receiver shipped with this remote has the same USB ID as the other
Medion receivers, but the name is different and is therefore used to
detect this variant.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-20 11:40:06 -03:00
Sylwester Nawrocki 0f735f5236 [media] s5p-fimc: Rework the video pipeline control functions
There is getting more entities to manage within single video pipeline
in newer SoCs. To simplify code put subdevs' pointer into an array
rather than adding new member in struct fimc_pipeline for each subdev.
This allows to easier handle subdev operations in proper order.

Additionally walk graph in one direction only in fimc_pipeline_prepare()
function to make sure we properly gather only media entities that below
to single data pipeline. This avoids wrong initialization in case where,
for example there are multiple active links from s5p-mipi-csis subdev
output pad.

struct fimc_pipeline declaration is moved to the driver's public header
to allow other drivers to reuse the fimc-lite driver added in subsequent
patches.

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>
2012-05-20 09:22:47 -03:00
Hans Verkuil 5d7758eed2 [media] v4l2 framework: add support for the new dv_timings ioctls
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-20 08:22:30 -03:00
Kuninori Morimoto 2564f67bc8 [media] V4L2: sh_mobile_ceu: manage lower 8bit bus
CAMCR::DTIF feild controls camera bus as upper8bit/16bit/lower8bit.
This patch manages unmanaged lower 8bit bus

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-15 16:15:14 -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
Laurent Pinchart 8929c96378 [media] soc-camera: Add soc_mbus_image_size
The function returns the minimum size of an image for a given number of
bytes per line (as per the V4L2 specification), width and format.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-15 16:10:20 -03:00
Laurent Pinchart ad3b81faa1 [media] soc-camera: Add plane layout information to struct soc_mbus_pixelfmt
To compute the value of the v4l2_pix_format::bytesperline field, we need
information about planes layout for planar formats. The new enum
soc_mbus_layout conveys that information.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-15 16:09:41 -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
Hans Verkuil 6e6d76cdc5 [media] v4l2-event: fix regression with initial event handling
If the V4L2_EVENT_SUB_FL_SEND_INITIAL was set, then the application expects
to receive an initial event of the initial value of the control.

However, commit c53c254933 that added the new
v4l2_subscribed_event_ops introduced a regression: while the code still queued
that initial event the __v4l2_event_queue_fh() function was modified to ignore
such requests if sev->elems was 0 (meaning that the event subscription wasn't
finished yet).

And sev->elems was only set to a non-zero value after the add operation
returned.

This patch fixes this by passing the elems value to the add function. Then the
add function can set it before queuing the initial event.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-15 08:43:06 -03:00
Mauro Carvalho Chehab 69ecdbac14 Merge remote-tracking branch 'linus/master' into staging/for_v3.5
* linus/master: (805 commits)
  tty: Fix LED error return
  openvswitch: checking wrong variable in queue_userspace_packet()
  bonding: Fix LACPDU rx_dropped commit.
  Linux 3.4-rc7
  ARM: EXYNOS: fix ctrlbit for exynos5_clk_pdma1
  ARM: EXYNOS: use s5p-timer for UniversalC210 board
  ARM / mach-shmobile: Invalidate caches when booting secondary cores
  ARM / mach-shmobile: sh73a0 SMP TWD boot regression fix
  ARM / mach-shmobile: r8a7779 SMP TWD boot regression fix
  ARM: mach-shmobile: convert ag5evm to use the generic MMC GPIO hotplug helper
  ARM: mach-shmobile: convert mackerel to use the generic MMC GPIO hotplug helper
  MAINTAINERS: Add myself as the cpufreq maintainer
  dm mpath: check if scsi_dh module already loaded before trying to load
  dm thin: correct module description
  dm thin: fix unprotected use of prepared_discards list
  dm thin: reinstate missing mempool_free in cell_release_singleton
  gpio/exynos: Fix compiler warnings when non-exynos machines are selected
  gpio: pch9: Use proper flow type handlers
  powerpc/irq: Fix another case of lazy IRQ state getting out of sync
  ks8851: Update link status during link change interrupt
  ...

Conflicts:
	drivers/media/common/tuners/xc5000.c
	drivers/media/common/tuners/xc5000.h
	drivers/usb/gadget/uvc_queue.c
2012-05-15 08:39:25 -03:00
Linus Torvalds b6255ee3d8 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:
 "For a some fix patches for v3.4, including a regression fix at DVB core"

Fix up trivial conflicts in Documentation/feature-removal-schedule.txt

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] gspca - sonixj: Fix a zero divide in isoc interrupt
  [media] media: videobuf2-dma-contig: include header for exported symbols
  [media] media: videobuf2-dma-contig: quiet sparse noise about plain integer as NULL pointer
  [media] media: vb2-memops: Export vb2_get_vma symbol
  [media] s5p-fimc: Correct memory allocation for VIDIOC_CREATE_BUFS
  [media] s5p-fimc: Fix locking in subdev set_crop op
  [media] dvb_frontend: fix a regression with DVB-S zig-zag
  [media] fintek-cir: change || to &&
  [media] V4L: Schedule V4L2_CID_HCENTER, V4L2_CID_VCENTER controls for removal
  [media] rc: Postpone ISR registration
  [media] marvell-cam: fix an ARM build error
  [media] V4L: soc-camera: protect hosts during probing from overzealous user-space
2012-05-14 11:23:37 -07:00
Hans Verkuil 152a3a7320 [media] v4l2-dev: rename two functions
Rename the function v4l2_dont_use_lock to v4l2_disable_ioctl_locking,
and rename v4l2_dont_use_cmd to v4l2_disable_ioctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 15:06:50 -03:00
Hans Verkuil 47bd4bc1a2 [media] v4l2-dev.h: add comment not to use V4L2_FL_LOCK_ALL_FOPS in new drivers
This flag is for legacy drivers only and will go away in the future.

A note regarding commit 5126f2590b
(v4l2-dev: add flag to have the core lock all file operations):

That commit message suggests that by not taking the core lock for fops
other than unlocked_ioctl all problems relating to AB-BA locking and
mm->mmap_sem are solved. This is not the case.

More work needs to be done by moving the core lock further down into
video_ioctl2. It should only be taken after the copy_from/to_user calls
are done.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 15:06:25 -03:00
Hans Verkuil ab49ae0f20 [media] saa7146: fix querycap, vbi/video separation and g/s_register
The querycap ioctl returned an incorrect version number and incorrect
capabilities (mixing up vbi and video caps).

The reason for that was that video nodes could do vbi activities: that
should be separated between the vbi and video nodes.

There were also a few minor problems with dbg_g/s_register that have
been resolved. The mxb/saa7146 driver now passes the v4l2_compliance tests.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 15:00:49 -03:00
Hans Verkuil 537fa492e0 [media] saa7146: support control events and priority handling
Use v4l2_fh which gives you control events and priority handling for free.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 15:00:03 -03:00
Hans Verkuil 9bb601935b [media] saa7146: rename vbi/video_q to vbi/video_dmaq
There was also a vbi_q and video_q in saa7146_fh, so that was confusing.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 14:59:23 -03:00
Hans Verkuil 6694a5608f [media] saa7146: remove the unneeded type field from saa7146_fh
This information can also be retrieved from struct video_device.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 14:58:57 -03:00
Hans Verkuil fca3469aa8 [media] saa7146: move vbi fields from saa7146_fh to saa7146_vv
This fields are global and don't belong in a fh struct.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 14:58:39 -03:00
Hans Verkuil fd74d6eb4c [media] saa7146: move video_fmt from saa7146_fh to saa7146_vv
This is a global structure and does not belong to saa7146_fh.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 14:58:16 -03:00
Hans Verkuil 5da545ad08 [media] saa7146: move overlay information from saa7146_fh into saa7146_vv
This is global information, not per-filehandle information.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 14:57:51 -03:00
Hans Verkuil 6e65ca942b [media] mxb/saa7146: first round of cleanups
Convert to the control framework, fix the easy v4l2-compliance failures.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 14:54:58 -03:00
Sylwester Nawrocki 515f32879a [media] V4L: Add helper function for standard integer menu controls
This patch adds v4l2_ctrl_new_int_menu() helper function which can be used
in drivers for creating standard integer menu control with driver-specific
menu item list. It is similar to v4l2_ctrl_new_std_menu(), except it doesn't
have a mask parameter and an additional qmenu parameter allows passing
an array of signed 64-bit integers as the menu item list.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Tested-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 14:03:21 -03:00
Laurent Pinchart 528f0f785c [media] v4l: v4l2-ctrls: moves the forward declaration of struct file
This fixes the following warning:

In file included from drivers/media/video/v4l2-subdev.c:29:
include/media/v4l2-ctrls.h:501: warning: 'struct file' declared inside
parameter list
include/media/v4l2-ctrls.h:501: warning: its scope is only this
definition or declaration, which is probably not what you want
include/media/v4l2-ctrls.h:509: warning: 'struct file' declared inside
parameter list

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 13:41:07 -03:00
Laurent Pinchart 15693b5793 [media] mt9p031: Replace the reset board callback by a GPIO number
Use the GPIO from the sensor driver instead of calling back to board
code.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 13:33:44 -03:00
Laurent Pinchart 1c542ba854 [media] mt9p031: Identify color/mono models using I2C device name
Instead of passing a color/monochrome flag through platform data, rely
on the I2C device name to identify the chip model.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 13:32:22 -03:00
Hans Verkuil 5126f2590b [media] v4l2-dev: add flag to have the core lock all file operations
This used to be the default if the lock pointer was set, but now that lock is by
default only used for ioctl serialization. Those drivers that already used
core locking have this flag set explicitly, except for some drivers where
it was obvious that there was no need to serialize any file operations other
than ioctl.

The drivers that didn't need this flag were:

drivers/media/radio/dsbr100.c
drivers/media/radio/radio-isa.c
drivers/media/radio/radio-keene.c
drivers/media/radio/radio-miropcm20.c
drivers/media/radio/radio-mr800.c
drivers/media/radio/radio-tea5764.c
drivers/media/radio/radio-timb.c
drivers/media/video/vivi.c
sound/i2c/other/tea575x-tuner.c

The other drivers that use core locking and where it was not immediately
obvious that this flag wasn't needed were changed so that the flag is set
together with a comment that that driver needs work to avoid having to
set that flag. This will often involve taking the core lock in the fops
themselves.

Eventually this flag should go and it should not be used in new drivers.

There are a few reasons why we want to avoid core locking of non-ioctl
fops: in the case of mmap this can lead to a deadlock in rare situations
since when mmap is called the mmap_sem is held and it is possible for
other parts of the code to take that lock as well (copy_from_user()/copy_to_user()
perform a down_read(&mm->mmap_sem) when a page fault occurs).

It is very unlikely that that happens since the core lock serializes all
fops, but the kernel warns about it if lock validation is turned on.

For poll it is also undesirable to take the core lock as that can introduce
increased latency. The same is true for read/write.

While it was possible to make flags or something to turn on/off taking the
core lock for each file operation, in practice it is much simpler to just
not take it at all except for ioctl and leave it to the driver to take the
lock. There are only a handful fops compared to the zillion ioctls we have.

I also wanted to make it obvious which drivers still take the lock for all
fops, so that's why I chose to have drivers set it explicitly.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 09:19:38 -03:00
Hans Verkuil 48ea0be060 [media] v4l2-dev/ioctl: determine the valid ioctls upfront
Rather than testing whether an ioctl is implemented in the driver or not
every time the ioctl is called, do it upfront when the device is registered.

This also allows a driver to disable certain ioctls based on the capabilities
of the detected board, something you can't do today without creating separate
v4l2_ioctl_ops structs for each new variation.

For the most part it is pretty straightforward, but for control ioctls a flag
is needed since it is possible that you have per-filehandle controls, and that
can't be determined upfront of course.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 09:17:28 -03:00
Hans Verkuil 8ab75e3ecd [media] v4l2-dev: make it possible to skip locking for selected ioctls
Using the V4L2 core lock is a very robust method that is usually very good
at doing the right thing. But some drivers, particularly USB drivers, may
want to prevent the core from taking the lock for specific ioctls, particularly
buffer queuing ioctls.

The reason is that certain commands like S_CTRL can take a long time to process
over USB and all the time the core has the lock, preventing VIDIOC_DQBUF from
proceeding, even though a frame may be ready in the queue.

This introduces unwanted latency.

Since the buffer queuing commands often have their own internal lock it is
often not necessary to take the core lock. Drivers can now say that they don't
want the core to take the lock for specific ioctls.

As it is a specific opt-out it makes it clear to the reviewer that those
ioctls will need more care when reviewing.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 09:13:43 -03:00
Sakari Ailus ccfc97bdb5 [media] smiapp: Add driver
Add driver for SMIA++/SMIA image sensors. The driver exposes the sensor as
three subdevs, pixel array, binner and scaler --- in case the device has a
scaler.

Currently it relies on the board code for external clock handling. There is
no fast way out of this dependency before the ISP drivers (omap3isp) among
others will be able to export that clock through the clock framework
instead.

Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 09:06:00 -03:00
Sakari Ailus fe6adc1991 [media] omap3isp: Add lane configuration to platform data
Add lane configuration (order of clock and data lane) to platform data on
both CCP2 and CSI-2.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 08:50:23 -03:00
Sakari Ailus 618b055bc9 [media] omap3isp: Move definitions required by board code under include/media
XCLK definitions are often required by the board code. Move them to public
include file.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 08:48:55 -03:00
Sakari Ailus 77e7c4e624 [media] v4l: Allow changing control handler lock
Allow choosing the lock used by the control handler. This may be handy
sometimes when a driver providing multiple subdevs does not want to use
several locks to serialise its functions.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 08:46:27 -03:00
Sakari Ailus 8227c92b69 [media] v4l: Implement v4l2_subdev_link_validate()
v4l2_subdev_link_validate() is the default op for validating a link. In V4L2
subdev context, it is used to call a pad op which performs the proper link
check without much extra work.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 08:45:31 -03:00
Sakari Ailus af88be3887 [media] media: Add link_validate() op to check links to the sink pad
The purpose of the link_validate() op is to allow an entity driver to ensure
that the properties of the pads at the both ends of the link are suitable
for starting the pipeline. link_validate is called on sink pads on active
links which belong to the active part of the graph.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 08:44:11 -03:00
Hans de Goede 3e366149b8 [media] v4l2-ctrls: Use v4l2_subscribed_event_ops
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[hans.verkuil@cisco.com: Fix a locking bug]
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-07 16:29:35 -03:00
Hans de Goede c53c254933 [media] v4l2-event: Add v4l2_subscribed_event_ops
Just like with ctrl events, drivers may want to get called back on
listener add / remove for other event types too. Rather then special
casing all of this in subscribe / unsubscribe event it is better to
use ops for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-07 16:28:35 -03:00