Commit Graph

546505 Commits

Author SHA1 Message Date
Benoit Parrot a807773405 [media] media: v4l2-ctrls: Fix 64bit support in get_ctrl()
When trying to use v4l2_ctrl_g_ctrl_int64() to retrieve a
V4L2_CTRL_TYPE_INTEGER64 type value the internal helper function
get_ctrl() would prematurely exit because for this control type
the 'is_int' flag is not set. This would result in v4l2_ctrl_g_ctrl_int64
always returning 0.

Also v4l2_ctrl_g_ctrl_int64() is reading and returning the 32bit value
member instead of the 64bit version, so fixing that as well.

This patch extends the condition check to allow the V4L2_CTRL_TYPE_INTEGER64
type to continue processing instead of exiting.

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org>      # for v3.17 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:43:41 -03:00
Luis de Bethencourt d275d93590 [media] cx25821, cx88, tm6000: use SNDRV_DEFAULT_ENABLE_PNP
Instead of manually initializing the bool array enable, use the
SNDRV_DEFAULT_ENABLE_PNP macro. As most drivers do.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:42:52 -03:00
Hans Verkuil fc88dd16a0 [media] cobalt: fix Kconfig dependency
The cobalt driver should depend on VIDEO_V4L2_SUBDEV_API.

This fixes this kbuild error:

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   99bc7215bc
commit: 85756a069c [media] cobalt: add new driver
config: x86_64-randconfig-s0-09201514 (attached as .config)
reproduce:
  git checkout 85756a069c
  # save the attached .config to linux build tree
  make ARCH=x86_64

All error/warnings (new ones prefixed by >>):

   drivers/media/i2c/adv7604.c: In function 'adv76xx_get_format':
>> drivers/media/i2c/adv7604.c:1853:9: error: implicit declaration of function 'v4l2_subdev_get_try_format' [-Werror=implicit-function-declaration]
      fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
            ^
   drivers/media/i2c/adv7604.c:1853:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
      fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
          ^
   drivers/media/i2c/adv7604.c: In function 'adv76xx_set_format':
   drivers/media/i2c/adv7604.c:1882:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
      fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
          ^
   cc1: some warnings being treated as errors

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:42:32 -03:00
Javier Martinez Canillas c7d97499cc [media] tvp5150: add support for asynchronous probing
Allow the subdevice to be probed asynchronously.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:42:00 -03:00
Joe Perches f5b5fbd387 [media] s5p-mfc: Correct misuse of %0x<decimal>
Correct misuse of 0x%d in logging message.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:41:29 -03:00
Andrzej Pietrasiewicz 7d9f9bf45b [media] MAINTAINERS: add exynos jpeg codec maintainers
Add Andrzej Pietrasiewicz and Jacek Anaszewski
as maintainers of drivers/media/platform/s5p-jpeg.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:40:32 -03:00
Andrzej Pietrasiewicz 6c96dbbc2a [media] s5p-jpeg: add support for 5433
JPEG IP found in Exynos5433 is similar to what is in Exynos4, but
there are some subtle differences which this patch takes into account.

The most important difference is in what is processed by the JPEG IP and
what has to be provided to it. In case of 5433 the IP does not parse
Huffman and quantisation tables, so this has to be performed with the CPU
and the majority of the code in this patch does that.

A small but important difference is in what address is passed to the JPEG
IP. In case of 5433 it is the SOS (start of scan) position, which is
natural, because the headers must be parsed elsewhere.

There is also a difference in how the hardware is put to work in
device_run.

Data structures are extended as appropriate to accommodate the above
changes.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Reviewed-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:40:04 -03:00
Marek Szyprowski b95a24d6b1 [media] s5p-jpeg: generalize clocks handling
Allow jpeg codec variants declare clocks they need.
Before this patch is applied jpeg-core gets jpeg->sclk
"speculatively": if it is not there, we assume no problem.

This patch eliminates this by explicitly declaring
what clocks are needed for each variant.

This is a preparation for adding Exynos 5433 variant support, which
needs 4 clocks of names not compatible with any previous version of
jpeg hw module.

[Rebase and commit message]

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Reviewed-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:35:08 -03:00
Javier Martinez Canillas 5bcc0dd790 [media] go7007: Fix returned errno code in gen_mjpeghdr_to_package()
The driver is using -1 instead of the -ENOMEM defined macro to specify
that a buffer allocation failed. Since the error number is propagated,
the caller will get a -EPERM which is the wrong error condition.

Also, the smatch tool complains with the following warning:

gen_mjpeghdr_to_package() warn: returning -1 instead of -ENOMEM is sloppy

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:32:52 -03:00
Javier Martinez Canillas 5aa2ccfc37 [media] s5c73m3: Export OF module alias information
The SPI core always reports the MODALIAS uevent as "spi:<modalias>"
regardless of the mechanism that was used to register the device
(i.e: OF or board code) and the table that is used later to match
the driver with the device (i.e: SPI id table or OF match table).

So drivers needs to export the SPI id table and this be built into
the module or udev won't have the necessary information to autoload
the needed driver module when the device is added.

But this means that OF-only drivers needs to have both OF and SPI id
tables that have to be kept in sync and also the dev node compatible
manufacturer prefix is stripped when reporting the MODALIAS. Which can
lead to issues if two vendors use the same SPI device name for example.

To avoid the above, the SPI core behavior may be changed in the future
to not require an SPI device table for OF-only drivers and report the
OF module alias. So, it's better to also export the OF table even when
is unused now to prevent breaking module loading when the core changes.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:32:20 -03:00
Hans Verkuil 60f4570de8 [media] DocBook/media: clarify control documentation
- Add missing V4L2_CTRL_TYPE_U32 documentation
- Remove 'which are actually different on the hardware' sentence which
  is confusing. I think the idea was to let the user know that the step can
  be different for different hardware, but that's obvious because otherwise
  you wouldn't need to specify the step value.
- Clarify that V4L2_CTRL_COMPOUND_TYPES also applies to arrays.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:31:57 -03:00
Hans Verkuil 35204e2e84 [media] v4l2-ctrls: arrays are also considered compound controls
Array controls weren't skipped when only V4L2_CTRL_FLAG_NEXT_CTRL was
provided (so no V4L2_CTRL_FLAG_NEXT_COMPOUND was set). This is wrong
since arrays are also considered compound controls (i.e. with more than
one value), and applications that do not know about arrays will not
be able to handle such controls.

Fix the test to include arrays.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Cc: <stable@vger.kernel.org>      # for v3.17 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:30:25 -03:00
Arnd Bergmann 5ba0e2c3ad [media] use v4l2_get_timestamp where possible
This is a preparation for a change to the type of v4l2 timestamps.
v4l2_get_timestamp() is a helper function that reads the monotonic
time and stores it into a 'struct timeval'. Multiple drivers implement
the same thing themselves for historic reasons.

Changing them all to use v4l2_get_timestamp() is more consistent
and reduces the amount of code duplication, and most importantly
simplifies the following changes.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
[hans.verkuil@cisco.com: dropped the v4l2-dev.c patch that didn't belong here]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:29:23 -03:00
Arnd Bergmann 2ef3b6fe9e [media] exynos4-is: use monotonic timestamps as advertized
The exynos4 fimc capture driver claims to use monotonic
timestamps but calls ktime_get_real_ts(). This is both
an incorrect API use, and a bad idea because of the y2038
problem and the fact that the wall clock time is not reliable
for timestamps across suspend or settimeofday().

This changes the driver to use the normal v4l2_get_timestamp()
function like all other drivers.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:27:59 -03:00
Sergei Shtylyov 280e87b2e6 [media] ml86v7667: implement g_std() method
The driver was written with the 'soc_camera' use in mind, however the g_std()
video method was forgotten. Implement it at last...

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:27:22 -03:00
Hans Verkuil 225b783b38 [media] saa7164: video and vbi ports share the same input/tuner/std
The vbi port should pass any tuner/input/standard information on
to the video port since in the input and tuner are shared between
the two.

There is no reason to duplicate this code, just pass the ioctls on
to the video encoder port.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:26:53 -03:00
Hans Verkuil 6b99612606 [media] saa7164: fix input and tuner compliance problems
- the frequency range was never set
- there was no initial frequency
- missing index/tuner checks
- inconsistent standard reporting
- removed unnecessary tuner type checks (the core handles that)
- clamp frequency to the valid frequency range as per the V4L2 spec

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:25:53 -03:00
Hans Verkuil 4e203f7fdd [media] saa7164: remove unused videobuf references
This driver includes videobuf headers and selects VIDEOBUF_DVB, but
videobuf isn't used at all.

Remove this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:25:06 -03:00
Hans Verkuil 031d229772 [media] saa7164: fix format ioctls
Fix various v4l2-compliance issues in the formatting ioctls:

- the vbi device implemented video format ioctls which make no senses
  for a vbi device, remove them.
- remove the unused ts_packet_size and ts_packet_count fields.
- fill in colorspace and field.
- fill in sizeimage with a default value.
- for the video node the get, set and try format functions all do the
  same thing, so combine into a single function.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:24:40 -03:00
Hans Verkuil 245b5ae95f [media] saa7164: add support for control events
Now that saa7164 uses v4l2_fh and that poll() has been fixed, it is
trivial to add support for control events.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:23:29 -03:00
Hans Verkuil 45053edc05 [media] saa7164: fix poll bugs
- poll doesn't return negative values, so you can't return -EINVAL.
  Instead return POLLERR.
- poll can't be called if !video_is_registered(), so this test can
  be dropped.
- poll can never do a blocking wait, so remove that check.
- poll shouldn't attempt to start streaming if the caller isn't interested
  in read events.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:22:41 -03:00
Hans Verkuil d6d3fe2fe1 [media] saa7164: add v4l2_fh support
Control events require the use of struct v4l2_fh. Add this to saa7164.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:13:58 -03:00
Hans Verkuil 1a708ea013 [media] saa7164: convert to the control framework
Convert this driver to the control framework. Note that the VBI device
nodes have no controls as there is nothing to control.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:13:26 -03:00
Ricardo Ribalda 28c5029275 [media] media/v4l2-compat-ioctl32: Simple stylechecks
The next patches on the series need this modifications to pass clean
checkpath.pl.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 07:51:43 -03:00
Ricardo Ribalda d9e7d2285a [media] videodev2.h: Fix typo in comment
Referenced file has moved

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 07:50:37 -03:00
Hans Verkuil b96c544f44 [media] vivid: add 10 and 12 bit Bayer formats
Add support for 10 and 12 bit Bayer formats to the test pattern generator
and the vivid driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 07:49:45 -03:00
Hans Verkuil d5beb67bc7 [media] v4l2-compat-ioctl32: add missing SDR support
Add the missing support for v4l2_sdr_format (V4L2_BUF_TYPE_SDR_CAPTURE).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 07:48:35 -03:00
Geliang Tang fd4b0d7518 [media] media: fix kernel-doc warnings in v4l2-dv-timings.h
Fix the following 'make htmldocs' warnings:

  .//include/media/v4l2-dv-timings.h:147: warning: No description found for parameter 'frame_height'
  .//include/media/v4l2-dv-timings.h:147: warning: No description found for parameter 'hfreq'
  .//include/media/v4l2-dv-timings.h:147: warning: No description found for parameter 'vsync'
  .//include/media/v4l2-dv-timings.h:147: warning: No description found for parameter 'active_width'
  .//include/media/v4l2-dv-timings.h:147: warning: No description found for parameter 'polarities'
  .//include/media/v4l2-dv-timings.h:147: warning: No description found for parameter 'interlaced'
  .//include/media/v4l2-dv-timings.h:147: warning: No description found for parameter 'fmt'
  .//include/media/v4l2-dv-timings.h:171: warning: No description found for parameter 'frame_height'
  .//include/media/v4l2-dv-timings.h:171: warning: No description found for parameter 'hfreq'
  .//include/media/v4l2-dv-timings.h:171: warning: No description found for parameter 'vsync'
  .//include/media/v4l2-dv-timings.h:171: warning: No description found for parameter 'polarities'
  .//include/media/v4l2-dv-timings.h:171: warning: No description found for parameter 'interlaced'
  .//include/media/v4l2-dv-timings.h:171: warning: No description found for parameter 'aspect'
  .//include/media/v4l2-dv-timings.h:171: warning: No description found for parameter 'fmt'
  .//include/media/v4l2-dv-timings.h:184: warning: No description found for parameter 'hor_landscape'
  .//include/media/v4l2-dv-timings.h:184: warning: No description found for parameter 'vert_portrait'

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 07:47:57 -03:00
Hans Verkuil d006a9791d [media] vim2m: small cleanup: use assignment instead of memcpy
Use a type-safe assignment instead of memcpy. And it is easier to read as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 07:47:33 -03:00
Hans Verkuil 00507a8d6a [media] DocBook media: Document the SMPTE 2084 transfer function
Document this new transfer function used by High Dynamic Range content.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 07:46:55 -03:00
Hans Verkuil c732e647ba [media] vivid: add support for SMPTE 2084 transfer function
Support the new SMPTE 2084 transfer function in the vivid test driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-30 19:49:41 -03:00
Hans Verkuil b258480aa7 [media] vivid-tpg: add support for SMPTE 2084 transfer function
Support the new SMPTE 2084 transfer function in the test pattern generator.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-30 19:49:16 -03:00
Hans Verkuil 2bdd28017e [media] videodev2.h: add SMPTE 2084 transfer function define
CEA-861.3 adds support for the SMPTE 2084 Electro-Optical Transfer Function
as can be used in HDR displays. Add a define for this in videodev2.h.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-30 19:48:27 -03:00
Hans Verkuil 1d78053549 [media] vivid: add support for the DCI-P3 colorspace
Support this new colorspace in vivid.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-30 19:47:17 -03:00
Hans Verkuil b592b52e2b [media] vivid-tpg: support the DCI-P3 colorspace
Add support to the test pattern generator for the DCI-P3 colorspace.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-30 19:46:39 -03:00
Hans Verkuil 7146a9cfa4 [media] DocBook media: document the new DCI-P3 colorspace
Document this colorspace.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-30 19:43:35 -03:00
Hans Verkuil 529a796030 [media] videodev2.h: add support for the DCI-P3 colorspace
This colorspace is used for cinema projectors and is supported by
the DisplayPort standard.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-30 19:42:18 -03:00
Hans Verkuil 2e94c19c07 [media] vivid: use Bradford method when converting Rec. 709 to NTSC 1953
The V4L2_COLORSPACE_470_SYSTEM_M (aka NTSC 1953) colorspace has a different
whitepoint (C) compared to Rec. 709 (D65). The Bradford method is the
recommended method to compensate for that when converting a Rec. 709 color
to an NTSC 1953 color.

See http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html for more
details on the Bradford method.

This patch updates the Rec. 709 to NTSC 1953 matrix so that it includes the
chromatic adaptation as calculated by the Bradford method, and it recalculates
the tpg_csc_colors table accordingly.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-30 19:41:06 -03:00
Hans Verkuil ff1447267b [media] vivid: use ARRAY_SIZE to calculate max control value
The max value of various menu controls is hardcoded, and it is easy to forget
to update it after adding a new menu item.

So use ARRAY_SIZE instead to calculate this value.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-30 19:39:04 -03:00
Hans Verkuil 9ec32cc703 [media] v4l2-compat-ioctl32: replace pr_warn by pr_debug
Every time compat32 encounters an unknown ioctl it will call pr_warn.
However, that's very irritating since it is perfectly normal that this
happens. For example, applications often try to call an ioctl to see if
it exists, and if that's used with an older kernel where compat32 doesn't
support that ioctl yet, then it starts spamming the kernel log.

So replace pr_warn by pr_debug.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:44:14 -03:00
Josh Wu ac4033e02a [media] atmel-isi: parse the DT parameters for vsync/hsync/pixclock polarity
This patch will get the DT parameters of vsync/hsync/pixclock polarity, and
pass to driver.

Also add a debug information for test purpose.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:42:12 -03:00
Laurent Pinchart d32dd315ff [media] v4l: atmel-isi: Remove unused platform data fields
The emb_crc_sync, mck_hz, asd and asd_sizes platform data fields are
unused, remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:41:23 -03:00
Laurent Pinchart 40a78f36fc [media] v4l: atmel-isi: Remove support for platform data
All in-tree users have migrated to DT, remove support for platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[josh.wu@atmel.com: squash the commit to remove the unused variable: dev]
Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:37:07 -03:00
Laurent Pinchart 375123976f [media] v4l: atmel-isi: Simplify error handling during DT parsing
Put the endpoint DT node earlier to avoid the need for goto statements
to a cleanup code block in case of errors.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:36:32 -03:00
Josh Wu 9626d03e8d [media] atmel-isi: add sanity check for supported formats in try/set_fmt()
After adding the format check in try_fmt()/set_fmt(), we don't need any
format check in configure_geometry(). So make configure_geometry() as
void type.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:36:09 -03:00
Josh Wu f653da3457 [media] atmel-isi: move configure_geometry() to start_streaming()
As in set_fmt() function we only need to know which format is been set,
we don't need to access the ISI hardware in this moment.

So move the configure_geometry(), which access the ISI hardware, to
start_streaming() will make code more consistent and simpler.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:35:47 -03:00
Josh Wu ad5f9d1968 [media] atmel-isi: setup the ISI_CFG2 register directly
In the function configure_geometry(), we will setup the ISI CFG2
according to the sensor output format.

It make no sense to just read back the CFG2 register and just set part
of it.

So just set up this register directly makes things simpler.
Currently only support YUV format from camera sensor.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:35:15 -03:00
Josh Wu d67b48824f [media] atmel-isi: increase timeout to disable/enable isi
If ISI is working on a 1024x768 or higher resolution, it needs longer
time to disable ISI. So this patch will increase timeout to 500ms.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:34:03 -03:00
Geert Uytterhoeven 18baba6458 [media] atmel-isi: Protect PM-only functions to kill warning
If CONFIG_PM=n:

    drivers/media/platform/soc_camera/atmel-isi.c:1044: warning: 'atmel_isi_runtime_suspend' defined but not used
    drivers/media/platform/soc_camera/atmel-isi.c:1054: warning: 'atmel_isi_runtime_resume' defined but not used

Protect the unused functions by #ifdef CONFIG_PM to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:33:21 -03:00
Sergei Shtylyov f00ae754c5 [media] rcar_vin: call g_std() instead of querystd()
Hans Verkuil says: "The only place querystd can be called  is in the QUERYSTD
ioctl, all other ioctls should use the last set standard." So call the g_std()
subdevice method instead of querystd() in the driver's set_fmt() method.

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25 17:32:42 -03:00