Commit graph

783 commits

Author SHA1 Message Date
Lars-Peter Clausen b37135e395 [media] adv7180: Add support for the adv7280-m/adv7281-m/adv7281-ma/adv7282-m
This patch adds support for the adv7280-m/adv2781-m/adv7281-ma/adv7282-m
devices to the adv7180 driver. They are very similar to the
adv7280/adv7281/adv7282 but instead of parallel video out they feature a
MIPI CSI2 transmitter.

The CSI2 transmitter is configured via a separate I2C address, so we need to
register a dummy device for it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:49:20 -02:00
Lars-Peter Clausen bf7dcb8067 [media] adv7180: Add support for the adv7280/adv7281/adv7282
This patch adds support for the adv7280/adv7281/adv7282 devices to the
adv7180 driver. They are very similar to the adv7182, the main difference
from the drivers point of view are some different tuning constants for
improved video performance.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:48:38 -02:00
Lars-Peter Clausen c5ef8f8c5d [media] adv7180: Add support for the adv7182
This patch adds support for the adv7182 to the adv7180 driver. The adv7182
is similar to the adv7180, the main difference from the driver's point of
view is how the video input and how the input format are selected.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:47:52 -02:00
Lars-Peter Clausen f5dde49b8f [media] adv7180: Prepare for multi-chip support
The adv7180 is part of a larger family of device, which have all a very
similar register map layout. This patch prepares the adv7180 driver for
support for multiple different devices. For now the only difference we care
about is the number of input channel configurations. Also the way the input
format is configured slightly differs between some devices.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:47:19 -02:00
Lars-Peter Clausen 3e35e33c08 [media] adv7180: Consolidate video mode setting
We have basically the same code to set the video standard in init_device()
and adv7180_s_std(). Factor this out into a common helper function.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:46:33 -02:00
Lars-Peter Clausen d5d51a827b [media] adv7180: Add media controller support
Add media controller support to the adv7180 driver by registering a media
entity instance for it as well as implementing pad ops for configuring the
format.

As there currently don't seem to be any users of the video ops format
operations those are removed as well in this patch.

Also set the V4L2_SUBDEV_FL_HAS_DEVNODE flag for the subdevice so it is
possible to create a subdevice device node.

Since the driver now depends on VIDEO_V4L2_SUBDEV_API all drivers which
select the driver need to depend on that symbol as well.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:45:35 -02:00
Lars-Peter Clausen c18818e990 [media] adv7180: Reset the device before initialization
Reset the device when initializing it so it is in a good known state and the
assumed register settings matches the actual register settings.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:40:50 -02:00
Lars-Peter Clausen 3999e5d01d [media] adv7180: Do implicit register paging
The ad7180 has multiple register pages which can be switched between by
writing to a register. Currently the driver manually switches between pages
whenever a register outside of the default register map is accessed and
switches back after it has been accessed. This is a bit tedious and also
potential source for bugs.

This patch adds two helper functions that take care of switching between
pages and reading/writing the register. The register numbers for registers
are updated to encode both the page (in the upper 8-bits) and the register
(in the lower 8-bits) numbers.

Having multiple pages means that a register access is not a single atomic
i2c_smbus_write_byte_data() or i2c_smbus_read_byte_data() call and we need
to make sure that concurrent register access does not race against each
other.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:40:14 -02:00
Lars-Peter Clausen 029d617791 [media] adv7180: Cleanup register define naming
Consistently prefix register defines with ADV7180_REG. Also remove the "ADI"
from register names, the ADV7180 prefix should provide enough of a namespace
separation.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:30:32 -02:00
Lars-Peter Clausen f3e991d418 [media] adv7180: Pass correct flags to request_threaded_irq()
Most IRQ controllers support different types of interrupts. The adv7180
generates falling edge interrupts, so make sure to pass IRQF_TRIGGER_FALLING
to request_threaded_irq() so the IRQ controller is configured for the
correct mode.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:15:53 -02:00
Lars-Peter Clausen fa5721d159 [media] adv7180: Do not request the IRQ again during resume
Currently the IRQ is requested from within the init_device() function. This
function is not only called during device probe, but also during resume
causing the driver to try to request the IRQ again. Move requesting the IRQ
from init_device() to the probe function to make sure that it is only
requested once.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:15:03 -02:00
Josh Wu 650b1815ff [media] ov2640: use the v4l2 size definitions
Reuse the v4l2 size definitions from v4l2-image-sizes.h.
So we can remove the rudundent definitions from ov2640.c.

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-02-02 10:40:56 -02:00
Sakari Ailus cb88d7384e [media] smiapp: Don't compile of_read_number() if CONFIG_OF isn't defined
of_read_number() is defined in of.h but does not return an error code, so
that non-of implementation could simply return an error.

Temporarily work around this until of_read_number() can be replaced by
of_property_read_u64_array().

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 17:59:22 -02:00
Martin Bugge 09f90c53ac [media] adv7842: simplify InfoFrame logging
Use the new logging functions from the hdmi module.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:19:48 -02:00
Fabio Estevam 7657e0647c [media] adv7180: Remove the unneeded 'err' label
There is no need to jump to the 'err' label as we can simply return the error
code directly and make the code shorter.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:15:58 -02:00
Rickard Strandqvist 43abdd6b6b [media] media: i2c: adv7604: Remove some unused functions
Removes some functions that are not used anywhere:
test_read() edid_read_block() dpp_write() dpp_read()
esdp_write() esdp_read() cec_write_clr_set()

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:11:02 -02:00
Rickard Strandqvist 05a2ea7835 [media] media: i2c: adv7604.c: Remove some unused functions
Removes some functions that are not used anywhere:
vblanking() hblanking()

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:09:42 -02:00
Sakari Ailus 3b1635e02e [media] smiapp: Add parentheses to macro arguments used in macros
This makes the macros a little bit safer.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 11:51:30 -02:00
Sakari Ailus 0d825a1226 [media] smiapp: Replace pll_flags quirk with more generic init quirk
The pll_flags quirk just returned the extra PLL flags the sensor required,
but the init quirk is far more versatile. It can be used to perform any
extra initialisation needed by the sensor, including allocating memory for
sensor specific struct and creating sensor specific new controls.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 11:50:25 -02:00
Sakari Ailus 5313c00266 [media] smiapp: Move enumerating available media bus codes later
As the controls creation is separated in two sections, the available media
bus codes and link frequencies can be enumerated later on.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 11:49:01 -02:00
Sakari Ailus 2e9f3c1c44 [media] smiapp: Separate late controls from the rest
The default values and limits for certain controls need the knowledge of
available media bus codes or link frequencies. Create such controls later
on, so that most of the initialisation of the sensor has already been done
when the init quirk is called.

[mchehab@osg.samsung.com: make checkpatch.pl happier]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 11:47:51 -02:00
Sakari Ailus 6208aebd33 [media] smiapp: Clean up smiapp_init_controls()
Clean up smiapp_init_controls() by adding newlines to appropriate places and
by removing superfluous error handling. The caller will clean up control
handlers in any case if the function fails.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 11:44:32 -02:00
Sakari Ailus f7350a034a [media] smiapp: Free control handlers in sub-device cleanup
Also call smiapp_cleanup() in smiapp_remove(), replacing code that did the
same than the function.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 11:43:33 -02:00
Sakari Ailus 0691b40e88 [media] smiapp: Access flash capabilities through limits
The flash capability register is already read as part of the limit
registers. Do no access it separately; instead use the value from the
limits.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 11:42:56 -02:00
Sakari Ailus 4c94468459 [media] smiapp: Fully probe the device in probe
In the case of platform data, ISPs that provide clocks to the sensor must
probe before the sensor does. Accessing the sensor does require the clocks,
and thus, probe cannot access the sensor in such a system.

This limitation does not exist in the case of the DT. Perform all
initialisation except Media entity initialisation, link creation and
sub-device registration in probe.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 11:37:50 -02:00
Sakari Ailus 7095108b16 [media] smiapp: Split sub-device initialisation off from the registered callback
The registered callback is called by the V4L2 async framework after the
bound callback. This allows separating the functionality in the registered
callback so that on DT based systems only sub-device registration is done
there.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 11:36:11 -02:00
Sakari Ailus 390a5fa5bd [media] smiapp: Obtain device information from the Device Tree if OF node exists
Platform data support is retained.

of_property_read_u64_array() isn't used yet as it's not in yet.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 11:35:29 -02:00
Sakari Ailus 575ea5b3a4 [media] smiapp: The sensor only needs a single clock, name may be NULL
The SMIA compatible sensors only need a single clock.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 11:33:05 -02:00
Sakari Ailus f73108eb8e [media] smiapp: Register async subdev
Register and unregister async sub-device for DT.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 11:30:48 -02:00
Sakari Ailus 3d9bb7a620 [media] smiapp: Don't give the source sub-device a temporary name
The source sub-device's name will be overwritten shortly. Don't give it a
name in the meantime.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 11:30:09 -02:00
Sakari Ailus 8c20ee6e92 [media] smiapp-pll: include linux/device.h in smiapp-pll.c, not in smiapp-pll.h
struct device has a forward declaration in the header already. The header is
only needed in the .c file.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 11:29:01 -02:00
Sakari Ailus 29867e2feb [media] smiapp: Remove FSF's address from the license header
Remove FSF's address information from the license header in the smiapp
driver and the smiapp-pll PLL calculator. This should no longer be needed,
and would be rendered outdated in case the FSF chooses to relocate its
office.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Timo Ahonen <timo.ahonen@nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 11:27:47 -02:00
Hans Verkuil 0348bb1a7a [media] s5k5baf: fix sparse warnings
drivers/media/i2c/s5k5baf.c:1796:33: warning: duplicate const
drivers/media/i2c/s5k5baf.c:379:24: warning: cast to restricted __le16
drivers/media/i2c/s5k5baf.c:437:11: warning: incorrect type in assignment (different base types)
drivers/media/i2c/s5k5baf.c:445:16: warning: incorrect type in return expression (different base types)

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 10:47:15 -02:00
Hans Verkuil 7c7586bb3c [media] s5k6aa: fix sparse warnings
drivers/media/i2c/s5k6aa.c:351:16: warning: cast to restricted __be16
drivers/media/i2c/s5k6aa.c:351:16: warning: cast to restricted __be16
drivers/media/i2c/s5k6aa.c:351:16: warning: cast to restricted __be16
drivers/media/i2c/s5k6aa.c:351:16: warning: cast to restricted __be16

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 10:46:00 -02:00
Hans Verkuil b75f2d16cb [media] s5k4ecgx: fix sparse warnings
drivers/media/i2c/s5k4ecgx.c:223:16: warning: cast to restricted __be16
drivers/media/i2c/s5k4ecgx.c:223:16: warning: cast to restricted __be16
drivers/media/i2c/s5k4ecgx.c:223:16: warning: cast to restricted __be16
drivers/media/i2c/s5k4ecgx.c:223:16: warning: cast to restricted __be16
drivers/media/i2c/s5k4ecgx.c:344:20: warning: cast to restricted __le32
drivers/media/i2c/s5k4ecgx.c:354:20: warning: cast to restricted __le32
drivers/media/i2c/s5k4ecgx.c:364:24: warning: cast to restricted __le32
drivers/media/i2c/s5k4ecgx.c:366:23: warning: cast to restricted __le16

The get_unaligned_le*() functions return the value using cpu endianness,
so calling le*_to_cpu is wrong.

It hasn't been not noticed because this code has only been run on little
endian systems, so le*_to_cpu doesn't do anything.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 10:45:29 -02:00
Hans Verkuil d3acd83e6e [media] m5mols: fix sparse warnings
drivers/media/i2c/m5mols/m5mols_core.c:128:24: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:128:24: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:128:24: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:128:24: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:130:24: warning: cast to restricted __be32
drivers/media/i2c/m5mols/m5mols_core.c:130:24: warning: cast to restricted __be32
drivers/media/i2c/m5mols/m5mols_core.c:130:24: warning: cast to restricted __be32
drivers/media/i2c/m5mols/m5mols_core.c:130:24: warning: cast to restricted __be32
drivers/media/i2c/m5mols/m5mols_core.c:130:24: warning: cast to restricted __be32
drivers/media/i2c/m5mols/m5mols_core.c:130:24: warning: cast to restricted __be32
drivers/media/i2c/m5mols/m5mols_core.c:457:19: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:457:19: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:457:19: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:457:19: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:458:19: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:458:19: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:458:19: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:458:19: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:459:22: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:459:22: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:459:22: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:459:22: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:460:20: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:460:20: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:460:20: warning: cast to restricted __be16
drivers/media/i2c/m5mols/m5mols_core.c:460:20: warning: cast to restricted __be16

The be16_to_cpu conversions in m5mols_get_version() are not needed since the
data is already using cpu endianness. This was never noticed since these
version fields are never used.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 10:44:50 -02:00
Hans Verkuil 584ca0252a [media] media/i2c/Kconfig: drop superfluous MEDIA_CONTROLLER
These drivers depend on VIDEO_V4L2_SUBDEV_API, which in turn
depends on MEDIA_CONTROLLER. So it is sufficient to just depend
on VIDEO_V4L2_SUBDEV_API.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-22 18:15:45 -02:00
Hans Verkuil 1a023feb9c [media] v4l2 subdevs: replace get/set_crop by get/set_selection
The crop and selection pad ops are duplicates. Replace all uses of get/set_crop
by get/set_selection. This will make it possible to drop get/set_crop
altogether.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Prabhakar Lad <prabhakar.csengg@gmail.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-22 18:11:34 -02:00
Hans Verkuil 215cedec37 [media] media: remove emacs editor variables
1) This is not allowed by the kernel coding style
2) Just configure your editor correctly
3) It's really ugly

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>
2014-12-22 17:52:20 -02:00
Linus Torvalds 0ec28c37c2 media updates for v3.19-rc1
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJUksm/AAoJEAhfPr2O5OEV7GIP/1nm2rcf16+6Y7nhjWLgPmlU
 uG9fNUMm7qvFHryCr4RwmTBnCv63Nn/5BFRcXdpAA2gHOtADcHCDNJbtSX+GRN5F
 I0C5gbLbQVd7l/GFsiGTsBScInAQB+ZN0WNyPbF0OCGLuzzRlexadAYTZufnNiNN
 nYCINIBub0jUPJaIrbm/qDAbazS7fxTO9HAdMcJGtexPCO/Gj92+4s8NXI+N3hxk
 Cj87EPsk6i6GA1BM0oVmDWK0dQjgFm+ONMBc8vhFOyVzCXb7pjHg53n1zZ0e0TDt
 jm/h/oIJuWyH/isEuwcNPTBxf2E9EOv8g66V9mDN1i7zsTEf9Bs08fPigalfJ84x
 5S5GBaHEGIu8d2PgqaqxmFO1COyk+xoj9O0Iwx8uabYtyRtgUVaEtsfyHWU2ZiAh
 3wqmtHSK5mt835h9wzjxs18apnRhTwEhfQWzFdiCFxkDPz3vPmfWbm+8WHChtYJh
 j0oSJwzK9uAcYwG8WZi643WduIyrXiDqaglWyBg+7c2k3NhP76W5CpLhjZ+8PrYt
 I6Jf+gZL/Joq5bMQx6itajgE5IIhAfxmdyaYIBqmlXuQ/88zrw7JBwu6q22jSVbq
 +QaURaSJ6qOLYj6S/ip93KPVsUXmfdE1JttuLp4ie7r0Q8zOahr4dPQ/xAwATtY/
 Jeo+d7AI4tLWQcIDKIWi
 =1rPM
 -----END PGP SIGNATURE-----

Merge tag 'media/v3.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull second set of media updates from Mauro Carvalho Chehab:

 - Move drivers for really old legacy hardware to staging.  Those are
   using obsolete media kAPIs and are for hardware that nobody uses for
   years.  Simply not worth porting them to the new kAPIs.  Of course,
   if anyone pops up to fix, we can move them back from there

 - While not too late, do some API fixups at the new colorspace API,
   added for v3.19

 - Some improvements for rcar_vin driver

 - Some fixups at cx88 and vivid drivers

 - Some Documentation fixups

* tag 'media/v3.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] bq/c-qcam, w9966, pms: move to staging in preparation for removal
  [media] tlg2300: move to staging in preparation for removal
  [media] vino/saa7191: move to staging in preparation for removal
  [media] MAINTAINERS: vivi -> vivid
  [media] cx88: remove leftover start_video_dma() call
  [media] cx88: add missing alloc_ctx support
  [media] v4l2-ioctl: WARN_ON if querycap didn't fill device_caps
  [media] vivid: fix CROP_BOUNDS typo for video output
  [media] DocBook media: update version number and document changes
  [media] vivid.txt: document new controls
  [media] DocBook media: add missing ycbcr_enc and quantization fields
  [media] v4l2-mediabus.h: use two __u16 instead of two __u32
  [media] rcar_vin: Fix interrupt enable in progressive
  [media] rcar_vin: Enable VSYNC field toggle mode
  [media] rcar_vin: Add scaling support
  [media] rcar_vin: Add DT support for r8a7793 and r8a7794 SoCs
  [media] rcar_vin: Add YUYV capture format support
2014-12-18 20:14:49 -08:00
Hans Verkuil c1d9e03d4e [media] vino/saa7191: move to staging in preparation for removal
These drivers haven't been tested in a long, long time. The hardware is
ancient and hopelessly obsolete. These drivers also need to be converted
to newer media frameworks but due to the lack of hardware that's going
to be impossible.

So these drivers are a prime candidate for removal. If someone is
interested in working on these drivers to prevent their removal, then
please contact the linux-media mailinglist.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-16 23:21:42 -02:00
Linus Torvalds 2183a58803 media updates for v3.19-rc1
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJUhxhbAAoJEAhfPr2O5OEV4JwP/2I7D2KGz5tdNGDAh1H8+swR
 hoj3tX7HLhwBmF6XIUlMYbk5L/ClDace6kcjT6OjwJ9SktrrKks6ZSsYsBjCIyOC
 yS7xNQArUKzWk4vV+uJVAvtF8V57LLFul8dhHk0JJwAxrkWnPvDdfJNs4PhUAkgn
 1i0PPshNo5Ow/+4YMiOjEDR+q9TMSUUzaq5zkPF7AFCnykuJ1wUJwUE0qjTfGi+4
 gl1yMye0TEawTYSM8h/+Lh7wosNFZYcXg85r04A6a8h6GLgg0h6KSOJjyPITmQ+j
 hLdtyiYs8a6XT+Y8o416zxpbSozo7KXCUTtet/N5g+lgQMqZqSd9WxE52SOY+kfd
 UVeob0VfWR0xdDzaJp5rLQ/MQ16RTHaHppgUidFxxGe9D5f9JM/88I0OfwNzl4uO
 cv2cyeNktHH6bcjfOGqxSVmZWgAm6q6qU7MN07PoN+5TcUlYTAOi1WLE5K+7HGgw
 CxzOZ61oxi/OO1FapaVoipq6ycjltTql2kbcARvmrRrbge0ocAqHxHqFyUbDDhNw
 Wn/O6VzLfpW0vGTacC6+xcUSpIhwajJ80UJAOqJP8sw0Xtmian5Lcs6gVzxwkOdU
 36Po4RRGFqsG6Sq3HR+toNwKt/nHNEFkJwYcNFHdvBiXTEYYkMe6MccUxxb3i/iI
 KxB1s51zVy9t3PqjP+3J
 =i7gx
 -----END PGP SIGNATURE-----

Merge tag 'media/v3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media updates from Mauro Carvalho Chehab:
 - Two new dvb frontend drivers: mn88472 and mn88473
 - A new driver for some PCIe DVBSky cards
 - A new remote controller driver: meson-ir
 - One LIRC staging driver got rewritten and promoted to mainstream:
   igorplugusb
 - A new tuner driver (m88rs6000t)
 - The old omap2 media driver got removed from staging.  This driver
   uses an old DMA API and it is likely broken on recent kernels.
   Nobody cared enough to fix it
 - Media bus format moved to a separate header, as DRM will also use the
   definitions there
 - mem2mem_testdev were renamed to vim2m, in order to use the same
   naming convention taken by the other virtual test driver (vivid)
 - Added a new driver for coda SoC (coda-jpeg)
 - The cx88 driver got converted to use videobuf2 core
 - Make DMABUF export buffer to work with DMA Scatter/Gather and Vmalloc
   cores
 - Lots of other fixes, improvements and cleanups on the drivers.

* tag 'media/v3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (384 commits)
  [media] mn88473: One function call less in mn88473_init() after error
  [media] mn88473: Remove uneeded check before release_firmware()
  [media] lirc_zilog: Deletion of unnecessary checks before vfree()
  [media] MAINTAINERS: Add myself as img-ir maintainer
  [media] img-ir: Don't set driver's module owner
  [media] img-ir: Depend on METAG or MIPS or COMPILE_TEST
  [media] img-ir/hw: Drop [un]register_decoder declarations
  [media] img-ir/hw: Fix potential deadlock stopping timer
  [media] img-ir/hw: Always read data to clear buffer
  [media] redrat3: ensure dma is setup properly
  [media] ddbridge: remove unneeded check before dvb_unregister_device()
  [media] si2157: One function call less in si2157_init() after error
  [media] tuners: remove uneeded checks before release_firmware()
  [media] arm: omap2: rx51-peripherals: fix build warning
  [media] stv090x: add an extra protetion against buffer overflow
  [media] stv090x: Remove an unreachable code
  [media] stv090x: Some whitespace cleanups
  [media] em28xx: checkpatch cleanup: whitespaces/new lines cleanups
  [media] si2168: add support for firmware files in new format
  [media] si2168: debug printout for firmware version
  ...
2014-12-11 11:49:23 -08:00
Sakari Ailus b518d86609 [media] smiapp: Support V4L2_SEL_TGT_NATIVE_SIZE
Add support for selection target V4L2_SEL_TGT_NATIVE_SIZE. It is equivalent
of what V4L2_SEL_TGT_CROP_BOUNDS used to be. Support for
V4L2_SEL_TGT_CROP_BOUNDS is still supported by the driver as a compatibility
interface.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-04 12:39:35 -02:00
Sakari Ailus 21734b0643 [media] smiapp: Set left and top to zero for crop bounds selection
The fields were previously uninitialised, leaving the returned values to
where the user had set them. This was never the intention.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-04 12:38:41 -02:00
Hans Verkuil 1fb69bfd29 [media] adv7511: improve colorspace handling
Add support for YCbCr output and support setting colorspace,
YCbCr encoding and quantization for the AVI InfoFrame.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-02 11:18:10 -02:00
Markus Elfring 8f1aeedf78 [media] i2c: Deletion of an unnecessary check before the function call "rc_unregister_device"
The rc_unregister_device() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-25 13:30:35 -02:00
Boris BREZILLON f5fe58fd76 [media] i2c: Make use of media_bus_format enum
In order to have subsytem agnostic media bus format definitions we've
moved media bus definitions to include/uapi/linux/media-bus-format.h and
prefixed values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT.

Replace all references to the old definitions in i2c drivers.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14 17:52:48 -02:00
Sakari Ailus b31eb901c4 [media] smiapp: Only some selection targets are settable
Setting a non-settable selection target caused BUG() to be called. The check
for valid selections only takes the selection target into account, but does
not tell whether it may be set, or only get. Fix the issue by simply
returning an error to the user.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Cc: stable@vger.kernel.org	# for v3.10 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-11 09:13:36 -02:00
Hans Verkuil dd9ac11aef [media] adv7604: Correct G/S_EDID behaviour
In order to have v4l2-compliance tool pass the G/S_EDID some modifications
where needed in the driver.
In particular, the edid.reserved zone must be blanked.

Based on a patch from Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com>,
but reworked it a bit. It should use 'data' (which depends on edid.present)
instead of edid.blocks as the check whether edid data is present.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-11 09:02:05 -02:00
Hans Verkuil c81285ae47 [media] adv7511: fix G/S_EDID behavior
This fixes the v4l2-compliance failures.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-11 08:58:25 -02:00
Hans Verkuil c909e5ba6b [media] adv7842: fix G/S_EDID behavior
Make this pass the v4l2-compliance test.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-11 08:57:43 -02:00
Joe Perches 85273c382e [media] cx25840/cx18: Use standard ordering of mask and shift
Precedence of & and >> is not the same and is not left to right.
shift has higher precedence and should be done after the mask.

This use has a mask then shift which is not the normal style.

Move the shift before the mask to match nearly all the other
uses in kernel.

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>
2014-11-11 08:44:08 -02:00
Mauro Carvalho Chehab 6ac825cb3e [media] cx25840: convert max_buf_size var to lowercase
CodingStyle fix: vars should be in lowercase.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 15:56:49 -02:00
Mauro Carvalho Chehab a7119f8629 [media] cx25840: Don't report an error if max size is adjusted
There's no reason to report:
	cx25840 7-0044:  Firmware download size changed to 16 bytes max length

If the driver needs to adjust the buffer's maximum size.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 15:56:36 -02:00
Sakari Ailus 373fbbce54 [media] smiapp: Update PLL when setting format
The media bus format BPP does affect PLL. Recalculate PLL if the format
changes.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-28 13:44:34 -02:00
Sakari Ailus 602cbcaa8e [media] smiapp: Set valid link frequency range
Set supported link frequencies in the menu in control initialisation and
when the bpp changes.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-28 13:44:06 -02:00
Sakari Ailus e91cbeb299 [media] smiapp: Clean up smiapp_set_format()
smiapp_set_format() has accumulated a fair amount of changes without a
needed refactoring, do the cleanup now. There's also an unlocked version of
v4l2_ctrl_range_changed(), using that fixes a small serialisation issue with
the user space interface.

__v4l2_ctrl_modify_range() is used instead of v4l2_ctrl_modify_range() in
smiapp_set_format_source() since the mutex is now held during the function
call.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-28 13:43:31 -02:00
Sakari Ailus cd78b6afa7 [media] smiapp: Take valid link frequencies into account in supported mbus codes
Some media bus codes may be unavailable depending on the available media bus
codes.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-28 13:42:55 -02:00
Sakari Ailus 38a833c7fd [media] smiapp: Gather information on valid link rate and BPP combinations
Not all link rates are possible with all BPP values.

Also rearrange other initialisation a little. Obtaining possible PLL
configurations earlier requires that.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-28 13:42:16 -02:00
Sakari Ailus 183bec80ce [media] smiapp: Split calculating PLL with sensor's limits from updating it
The first one is handy for just trying out a PLL configuration without a
need to apply it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-28 13:40:41 -02:00
Sakari Ailus 83313d9ff6 [media] smiapp: Use actual pixel rate calculated by the PLL calculator
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-28 13:39:43 -02:00
Sakari Ailus e7c329a0a9 [media] smiapp-pll: Add pixel rate in pixel array as output parameters
The actual pixel array pixel rate may be something else than vt_pix_clk_freq
on some implementations. Add a new field which contains the corrected value.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-28 13:39:19 -02:00
Sakari Ailus 29391300f9 [media] smiapp: Remove validation of op_pix_clk_div
op_pix_clk_div is directly assigned and not calculated. There's no need to
verify it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-28 13:38:36 -02:00
Sakari Ailus 9249e9a4ca [media] smiapp: The PLL calculator handles sensors with VT clocks only
No need to pretend the OP limits are there anymore.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-28 13:37:53 -02:00
Sakari Ailus 63516b55e3 [media] smiapp-pll: Don't validate OP clocks if there are none
For profile 0 sensors (which have no OP clocks), the OP limits are in fact
VT limits. Do not verify them again.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-28 13:37:19 -02:00
Sakari Ailus 974abe4460 [media] smiapp-pll: Calculate OP clocks only for sensors that have them
Profile 0 sensors have no OP clock branck in the clock tree. The PLL
calculator still calculated them, they just weren't used for anything.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-28 13:36:56 -02:00
Sakari Ailus e3f8bc8c6e [media] smiapp-pll: Unify OP and VT PLL structs
Uniform representation for VT and OP clocks. This is preparation for
calculating the VT clocks using the OP clock code.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-28 13:35:48 -02:00
Sakari Ailus fff888c711 [media] smiapp-pll: External clock frequency isn't an output value
It's input. Move it elsewhere in the struct.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-28 13:35:19 -02:00
Sakari Ailus c859470ac1 [media] smiapp-pll: Separate bounds checking into a separate function
Enough work for this function already.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-28 13:34:57 -02:00
Sakari Ailus c37f9bf919 [media] smiapp-pll: The clock tree values are unsigned --- fix debug prints
These values are unsigned, so use %u instead of %d.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-28 13:34:25 -02:00
Sakari Ailus bc47150ab9 [media] smiapp-pll: Correct clock debug prints
The PLL flags were not used correctly.

Cc: stable@vger.kernel.org
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-28 13:33:48 -02:00
Sakari Ailus f85698cd29 [media] smiapp: Take mutex during PLL update in sensor initialisation
The mutex does not serialise anything in this case but avoids a lockdep
warning from the control framework.

Cc: stable@vger.kernel.org
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-28 13:32:46 -02:00
Mauro Carvalho Chehab a66d05d504 Merge branch 'patchwork' into v4l_for_linus
* patchwork: (544 commits)
  [media] ir-hix5hd2: fix build on c6x arch
  [media] pt3: fix DTV FE I2C driver load error paths
  Revert "[media] media: em28xx - remove reset_resume interface"
  [media] exynos4-is: fix some warnings when compiling on arm64
  [media] usb drivers: use %zu instead of %zd
  [media] pci drivers: use %zu instead of %zd
  [media] dvb-frontends: use %zu instead of %zd
  [media] s5p-mfc: Fix several printk warnings
  [media] s5p_mfc_opr: Fix warnings
  [media] ti-vpe: Fix typecast
  [media] s3c-camif: fix dma_addr_t printks
  [media] s5p_mfc_opr_v6: get rid of warnings when compiled with 64 bits
  [media] s5p_mfc_opr_v5: Fix lots of warnings on x86_64
  [media] em28xx: Fix identation
  [media] drxd: remove a dead code
  [media] saa7146: remove return after BUG()
  [media] cx88: remove return after BUG()
  [media] cx88: fix cards table CodingStyle
  [media] radio-sf16fmr2: declare some structs as static
  [media] radio-sf16fmi: declare pnp_attached as static
  ...

Conflicts:
	Documentation/DocBook/media/v4l/compat.xml
2014-10-09 14:00:54 -03:00
Hans Verkuil 77639ff2b3 [media] adv7604: fix inverted condition
The log_status function should show HDMI information, but the test checking for
an HDMI input was inverted. Fix this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: stable@vger.kernel.org      # for v3.12 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 20:54:43 -03:00
Hans Verkuil f8789e6d9c [media] adv7604/adv7842: fix il_vbackporch typo and zero the struct
Both adv7604 and adv7842 had the same typo in the code that sets
the vertical backporch for the second interlaced field: it was
assigned to vbackporch instead of il_vbackporch.

In addition, the timings struct wasn't zeroed in the adv7842 driver,
leaving several fields to undefined values causing the timing match
function to fail.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 20:41:00 -03:00
Rasmus Villemoes 825fd08dbb [media] drivers: media: i2c: adv7343_regs.h: Fix typo in #ifndef
Test for definedness of the macro which is actually defined, and which
matches the name of the file.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 20:12:13 -03:00
Axel Lin 18cb650338 [media] tvp7002: Don't update device->streaming if write to register fails
This ensures device->streaming has correct status.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 20:11:30 -03:00
Mauro Carvalho Chehab 3cf0c6bd68 Merge remote-tracking branch 'linus/master' into patchwork
There are some patches that depends on media-v3.16-rc6.
So, merge back from upstream before applying them.

* linus/master: (1123 commits)
  drm/nouveau: ltc/gf100-: fix cbc issues on certain boards
  drm/bochs: add missing drm_connector_register call
  drm/cirrus: add missing drm_connector_register call
  staging: vt6655: buffer overflow in ioctl
  USB: storage: Add quirks for Entrega/Xircom USB to SCSI converters
  USB: storage: Add quirk for Ariston Technologies iConnect USB to SCSI adapter
  USB: storage: Add quirk for Adaptec USBConnect 2000 USB-to-SCSI Adapter
  USB: EHCI: unlink QHs even after the controller has stopped
  [SCSI] fix for bidi use after free
  [SCSI] fix regression that accidentally disabled block-based tcq
  [SCSI] libiscsi: fix potential buffer overrun in __iscsi_conn_send_pdu
  drm/radeon: Fix typo 'addr' -> 'entry' in rs400_gart_set_page
  drm/nouveau/runpm: fix module unload
  drm/radeon/px: fix module unload
  vgaswitcheroo: add vga_switcheroo_fini_domain_pm_ops
  drm/radeon: don't reset dma on r6xx-evergreen init
  drm/radeon: don't reset sdma on CIK init
  drm/radeon: don't reset dma on NI/SI init
  drm/radeon/dpm: fix resume on mullins
  drm/radeon: Disable HDP flush before every CS again for < r600
  ...
2014-09-21 16:40:04 -03:00
Mauro Carvalho Chehab afb666d1e7 [media] lm3560: simplify boolean tests
Instead of using if (on == true), just use
if (on).

That allows a faster mental parsing when analyzing the
code.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 17:59:24 -03:00
Mauro Carvalho Chehab cdde1a9bae [media] ov9740: use true/false for boolean vars
Instead of using 0 or 1 for boolean, use the true/false
defines.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 17:59:18 -03:00
Mauro Carvalho Chehab 06e916b75a [media] smiapp-core: use true/false for boolean vars
Instead of using 0 or 1 for boolean, use the true/false
defines.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 17:59:17 -03:00
Mauro Carvalho Chehab bc39d69ae1 [media] s5k5baf: remove an uneeded semicolon
We don't use semicolons after curly braces in the middle of the
code.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 17:59:11 -03:00
Sakari Ailus 60b31b72d8 [media] smiapp: Set sub-device owner
The smiapp driver is the owner of the sub-devices exposed by the smiapp
driver. This prevents unloading the module whilst it's in use.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 08:50:25 -03:00
Sakari Ailus 58e43d90b9 [media] smiapp: Fix power count handling
The sensor may be powered by either one of its sub-devices being accessed
from the user space (an open file handle) or by its s_power() op being
called with non-zero on argument. The driver counts the users and if any
reason to keep the device powered exists it will be powered.

However, a faulty condition was used in recognising the need to power off
the sensor, leading it to be powered off every time any of its uses went
away.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 08:50:25 -03:00
Axel Lin 91ba0e59ba [media] tda7432: Fix setting TDA7432_MUTE bit for TDA7432_RF register
Fix a copy-paste bug when converting to the control framework.

Fixes: commit 5d478e0de8 ("[media] tda7432: convert to the control framework")

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21 15:25:36 -05:00
Axel Lin a14e55190b [media] soc_camera: ov772x: Include media/v4l2-image-sizes.h
So we can remove the same defines in the driver code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21 15:25:36 -05:00
Axel Lin 665152a4fb [media] soc_camera: mt9t112: Include media/v4l2-image-sizes.h
So we can remove the same defines in the driver code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21 15:25:36 -05:00
Axel Lin 37096b476b [media] vs6624: Include media/v4l2-image-sizes.h
So we can remove the same defines in the driver code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21 15:25:36 -05:00
Axel Lin 4721b3eb66 [media] ov7670: Include media/v4l2-image-sizes.h
So we can remove the same defines in the driver code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21 15:25:35 -05:00
Axel Lin 6af6e9c84f [media] saa6752hs: Convert to devm_kzalloc()
Using the managed function the kfree() calls can be removed from the
probe error path and the remove handler.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21 15:25:33 -05:00
Geert Uytterhoeven d720b7aff6 [media] cx25840: Spelling s/compuations/computations/
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21 15:25:32 -05:00
Sakari Ailus a328e7e3fd [media] smiapp: Set 64-bit integer control using v4l2_ctrl_s_ctrl_int64()
Don't manipulate struct v4l2_ctrl directly. Instead, use
v4l2_ctrl_s_ctrl_int64() to change the values.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21 15:25:27 -05:00
Sakari Ailus e47a81d888 [media] smiapp: Use unlocked __v4l2_ctrl_modify_range()
Instead of modifying the control ranges directly by manipulating struct
v4l2_ctrl, use __v4l2_ctrl_modify_range() for the purpose.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21 15:25:27 -05:00
Sakari Ailus 0e2a6b7f2b [media] smiapp: Implement the test pattern control
Add support for the V4L2_CID_TEST_PATTERN control. When the solid colour
mode is selected, additional controls become available for setting the
solid four solid colour components.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21 15:25:12 -05:00
Robert Jarzmik c5f176dc19 [media] media: mt9m111: add device-tree suppport
Add device-tree support for mt9m111 camera sensor.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-30 19:30:35 -03:00
David Härdeman c5540fbb9d [media] rc-core: remove protocol arrays
The basic API of rc-core used to be:

	dev = rc_allocate_device();
	dev->x = a;
	dev->y = b;
	dev->z = c;
	rc_register_device();

which is a pretty common pattern in the kernel, after the introduction of
protocol arrays the API looks something like:

	dev = rc_allocate_device();
	dev->x = a;
	rc_set_allowed_protocols(dev, RC_BIT_X);
	dev->z = c;
	rc_register_device();

There's no real need for the protocols to be an array, so change it
back to be consistent (and in preparation for the following patches).

[m.chehab@samsung.com: added missing changes at some files]
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-25 19:10:43 -03:00
David Härdeman 120703f9eb [media] rc-core: document the protocol type
Right now the protocol information is not preserved, rc-core gets handed a
scancode but has no idea which protocol it corresponds to.

This patch (which required reading through the source/keymap for all drivers,
not fun) makes the protocol information explicit which is important
documentation and makes it easier to e.g. support multiple protocols with one
decoder (think rc5 and rc-streamzap). The information isn't used yet so there
should be no functional changes.

[m.chehab@samsung.com: rebased, added cxusb and removed bad whitespacing]
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-23 21:50:48 -03:00
David Härdeman 4dd9bb91bb [media] rc-core: improve ir-kbd-i2c get_key functions
The arguments used for ir-kbd-i2c's get_key() functions are not
really suited for rc-core and the ir_raw/ir_key distinction is
just confusing.

Convert all of them to return a protocol/scancode/toggle triple instead.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-23 20:05:56 -03:00
Laurent Pinchart e35ce2e4b2 [media] tvp5150: Use i2c_smbus_(read|write)_byte_data
X-Patchwork-Delegate: mchehab@redhat.com
Replace the custom I2C read/write implementation with SMBUS functions to
simplify the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22 10:00:08 -03:00
Laurent Pinchart 385dded806 [media] tvp5150: Fix device ID kernel log message
X-Patchwork-Delegate: mchehab@redhat.com
The driver mistakenly prints the ROM version instead of the device ID to
the kernel log when detecting the chip. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22 09:59:05 -03:00
Laurent Pinchart 7ed0b291b4 [media] v4l: smiapp: Return V4L2_FIELD_NONE from pad-level get/set format
The SMIA++ sensors are progressive, always return the field order set to
V4L2_FIELD_NONE.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22 01:00:06 -03:00
Laurent Pinchart d53ce5acf8 [media] v4l: s5k6a3: Return V4L2_FIELD_NONE from pad-level set format
The sensor is progressive, always return the field order set to
V4L2_FIELD_NONE.

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>
2014-07-22 00:59:35 -03:00
Laurent Pinchart 2f7844ecb7 [media] v4l: s5k5baf: Return V4L2_FIELD_NONE from pad-level set format
The sensor is progressive, always return the field order set to
V4L2_FIELD_NONE.

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>
2014-07-22 00:59:18 -03:00
Laurent Pinchart 776a347df6 [media] v4l: s5k4ecgx: Return V4L2_FIELD_NONE from pad-level set format
The sensor is progressive, always return the field order set to
V4L2_FIELD_NONE.

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>
2014-07-22 00:59:02 -03:00
Laurent Pinchart fb3e0bc633 [media] v4l: noon010p30: Return V4L2_FIELD_NONE from pad-level set format
The sensor is progressive, always return the field order set to
V4L2_FIELD_NONE.

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>
2014-07-22 00:58:20 -03:00
Philipp Zabel 80b44ef23a [media] mt9v032: use regmap
This switches all register accesses to use regmap. It allows to
use the regmap cache, tracing, and debug register dump facilities,
and removes the need to open code read-modify-writes.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22 00:55:26 -03:00
Philipp Zabel 94b76ce83d [media] mt9v032: register v4l2 asynchronous subdevice
Add support for registering the sensor subdevice using the v4l2-async API.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22 00:52:43 -03:00
Philipp Zabel d8dde6c8dd [media] mt9v032: add support for mt9v022 and mt9v024
as are mt9v024 and mt9v034. With minimal changes it is possible
to support mt9v02[24] with the same driver.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22 00:52:03 -03:00
Philipp Zabel d131e54b68 [media] mt9v032: do not clear reserved bits in read mode register
The read mode register bits 8 and 9 are set and marked as reserved.
Don't clear them.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22 00:51:24 -03:00
Philipp Zabel f17bc3f470 [media] mt9v032: fix hblank calculation
Since (min_row_time - crop->width) can be negative, we have to do a signed
comparison here. Otherwise max_t casts the negative value to unsigned int
and sets min_hblank to that invalid value.

Cc: stable@vger.kernel.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22 00:50:34 -03:00
Ian Molton 632f2b0db9 [media] adv7180: Remove duplicate unregister call
This driver moved over to v4l2_async_unregister_subdev()
but still retained a call to v4l2_unregister_subdev(). Remove.

Signed-off-by: Ian Molton <ian.molton@codethink.co.uk>
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-21 19:30:48 -03:00
Hans Verkuil 0d5e8c4313 [media] Fix 64-bit division fall-out from 64-bit control ranges
Commit 0ba2aeb6da increased the internal control ranges
to 64 bit, but that caused problems in drivers that use the minimum/maximum/step/default_value
control values in a division or modulus operations since not all architectures support
those natively.

Luckily, in almost all cases it is possible to just cast to 32 bits (the control value
is known to be 32 bits, so it is safe to cast). Only in v4l2-ctrls.c was it necessary to
use do_div in one function.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17 12:44:38 -03:00
Hans Verkuil 2a9ec37311 [media] v4l2-ctrls: use ptrs for all but the s32 type
Rather than having two unions for all types just keep 'val' and
'cur.val' and use the p_cur and p_new unions to access all others.

The only reason for keeping 'val' and 'cur.val' is that it is used
all over, so converting this as well would be a huge job.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17 11:57:17 -03:00
Hans Verkuil 0ba2aeb6da [media] v4l2-ctrls: increase internal min/max/step/def to 64 bit
While VIDIOC_QUERYCTRL is limited to 32 bit min/max/step/def values
for controls, the upcoming VIDIOC_QUERY_EXT_CTRL isn't. So increase
the internal representation to 64 bits in preparation.

Because of these changes the msi3101 driver has been modified slightly
to fix a formatting issue (%d becomes %lld), vivi had to be modified
as well to cope with the new 64-bit min/max values and the PIXEL_RATE
control in a few sensor drivers required proper min/max/def values.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17 09:18:09 -03:00
Lars-Peter Clausen c41ad9c38e [media] adv7604: Update recommended writes for the adv7611
Update the recommended writes to those mentioned in the Rev 1.5 version of the
ADV7611 Register Settings Recommendations document released by Analog Devices.
The document does not mention why the recommended settings have been updated,
but presumably those are more fine tuned settings that can enhance performance
in some cases.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-04 16:13:57 -03:00
Sakari Ailus f8d36b8960 [media] smiapp: I2C address is the last part of the subdev name
The I2C address of the sensor device was in the middle of the sub-device
name and not in the end as it should have been. The smiapp sub-device names
will change from e.g. "vs6555 1-0010 pixel array" to "vs6555 pixel array
1-0010".

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-06-17 12:04:45 -03:00
Linus Torvalds 0bb4646241 Merge branches 'topic/vsp1' and 'topic/adv76xx' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media into next
Pull updates and DT support for media engines from Mauro Carvalho Chehab.

For Analog Devices ADV7604 and the Renesas VSP1 video processing engines.

* 'topic/vsp1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] v4l: vsp1: Add DT support
  [media] v4l: vsp1: Add DT bindings documentation
  [media] v4l: vsp1: Add BRU support
  [media] v4l: vsp1: Support multi-input entities
  [media] v4l: vsp1: uds: Enable scaling of alpha layer
  [media] v4l: vsp1: Remove unexisting rt clocks

* 'topic/adv76xx' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (21 commits)
  [media] adv7604: Add LLC polarity configuration
  [media] adv7604: Set HPD GPIO direction to output
  [media] adv7604: Add endpoint properties to DT bindings
  [media] adv7604: Add DT support
  [media] adv7604: Specify the default input through platform data
  [media] adv7604: Support hot-plug detect control through a GPIO
  [media] adv7604: Sort headers alphabetically
  [media] adv7604: Replace *_and_or() functions with *_clr_set()
  [media] adv7604: Store I2C addresses and clients in arrays
  [media] adv7604: Inline the to_sd function
  [media] v4l: subdev: Remove deprecated video-level DV timings operations
  [media] adv7604: Remove deprecated video-level DV timings operations
  [media] adv7604: Add pad-level DV timings support
  [media] adv7604: Make output format configurable through pad format operations
  [media] adv7604: Add sink pads
  [media] adv7604: Remove subdev control handlers
  [media] adv7604: Add adv7611 support
  [media] adv7604: Cache register contents when reading multiple bits
  [media] adv7604: Add 16-bit read functions for CP and HDMI
  [media] adv7604: Don't put info string arrays on the stack
  ...
2014-06-06 11:58:47 -07:00
Laurent Pinchart 39ad9bbe5c [media] m5mols: Replace missing header
The include/media/s5p_fimc.h header has been removed in commit
49b2f4c56f ("exynos4-is: Remove support
for non-dt platforms"). This broke compilation of the m5mols driver.

Include the include/media/exynos-fimc.h header instead, which contains
the S5P_FIMC_TX_END_NOTIFY definition required by the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 17:00:01 -03:00
Laurent Pinchart 1b5ab8755e [media] adv7604: Add LLC polarity configuration
Add an inv_llc_pol field to platform data to control the clock polarity.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 13:10:16 -03:00
Laurent Pinchart 9b2c38239d [media] adv7604: Set HPD GPIO direction to output
The HPD GPIO is used as an output but its direction is never set. Fix
it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 13:09:13 -03:00
Laurent Pinchart 6fa88045ef [media] adv7604: Add endpoint properties to DT bindings
Add support for the hsync-active, vsync-active and pclk-sample
properties to the DT bindings and control BT.656 mode implicitly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 13:08:51 -03:00
Laurent Pinchart f82f313e97 [media] adv7604: Add DT support
Parse the device tree node to populate platform data. Only the ADV7611
is currently support with DT.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 13:04:00 -03:00
Laurent Pinchart 5ef54b5955 [media] adv7604: Specify the default input through platform data
And set input routing when initializing the device.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 13:03:02 -03:00
Laurent Pinchart e9d50e9e70 [media] adv7604: Support hot-plug detect control through a GPIO
Add support for optional GPIO-controlled HPD pins in addition to the
ADV7604-specific hotplug notifier.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 13:02:45 -03:00
Laurent Pinchart c72a53ce05 [media] adv7604: Sort headers alphabetically
This helps locating duplicates and inserting new headers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 13:02:23 -03:00
Laurent Pinchart 22d97e561d [media] adv7604: Replace *_and_or() functions with *_clr_set()
The *_and_or() functions take an 'and' bitmask to be ANDed with the
register value before ORing it with th 'or' bitmask. As the functions
are used to mask and set bits selectively, this requires the caller to
invert the 'and' bitmask and is thus error prone. Replace those
functions with a *_clr_set() variant that takes a mask of bits to be
cleared instead of a mask of bits to be kept.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 13:02:05 -03:00
Laurent Pinchart 05cacb1767 [media] adv7604: Store I2C addresses and clients in arrays
This allows replacing duplicate code blocks by loops over the arrays.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 13:00:21 -03:00
Laurent Pinchart c269887c2d [media] adv7604: Inline the to_sd function
This one line function is called in a single location. Inline it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 12:59:29 -03:00
Laurent Pinchart 7515e09693 [media] adv7604: Remove deprecated video-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated
and unused. Remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 12:58:46 -03:00
Laurent Pinchart afec55992e [media] adv7604: Add pad-level DV timings support
The video enum_dv_timings and dv_timings_cap operations are deprecated.
Implement the pad-level version of those operations to prepare for the
removal of the video version.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 12:58:27 -03:00
Laurent Pinchart 539b33b059 [media] adv7604: Make output format configurable through pad format operations
Replace the dummy video format operations by pad format operations that
configure the output format.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 12:57:26 -03:00
Laurent Pinchart c784b1e2ec [media] adv7604: Add sink pads
The ADV7604 has sink pads for its HDMI and analog inputs. Report them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 12:56:15 -03:00
Laurent Pinchart 454378923a [media] adv7604: Remove subdev control handlers
Control operations are handled by the control framework and the subdev
control handlers are never called directly. Remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 12:55:37 -03:00
Lars-Peter Clausen d42010a1d2 [media] adv7604: Add adv7611 support
This patch adds support for the Analog Devices ADV7611 HDMI receiver.
The adv7611 is quite similar to the adv7604. It has only one instead of four
HDMI inputs and no analog frontend though. Also some register bits have been
shuffled around, but large parts of their register maps are compatible.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 12:55:16 -03:00
Laurent Pinchart 4a2ccdd257 [media] adv7604: Cache register contents when reading multiple bits
When extracting multiple bits from a single register read the register
once and extract the bits on the read value.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 12:52:33 -03:00
Laurent Pinchart 51182a945c [media] adv7604: Add 16-bit read functions for CP and HDMI
16-bit registers are read through two 8-bit read operations. Factorize
that common pattern into 16-bit read accessors to simplify the code.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 12:52:02 -03:00
Lars-Peter Clausen f216ccb3d9 [media] adv7604: Don't put info string arrays on the stack
We do not want to modify the info string arrays ever, so no need to
waste stack space for them. While we are at it also make them const.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 12:51:35 -03:00
Lars-Peter Clausen bedc3939dc [media] adv7604: Add support for asynchronous probing
Register the device with the v4l2 asynchronous probing framework to
support asynchronous instantiation systems such as DT.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 12:50:10 -03:00
Laurent Pinchart f2e9084779 [media] v4l: Validate fields in the core code for subdev EDID ioctls
The subdev EDID ioctls receive a pad field that must reference an
existing pad and an EDID field that must point to a buffer. Validate
both fields in the core code instead of duplicating validation in all
drivers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 12:48:33 -03:00
Laurent Pinchart 96278922f6 [media] tvp7002: Remove deprecated video-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated
and unused. Remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-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>
2014-05-25 12:46:47 -03:00
Laurent Pinchart 105534054f [media] ths8200: Remove deprecated video-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated
and unused. Remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-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>
2014-05-25 12:46:18 -03:00
Laurent Pinchart 0dd3e36c8c [media] adv7842: Remove deprecated video-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated
and unused. Remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 12:44:39 -03:00
Laurent Pinchart 8f8d2fecd9 [media] adv7511: Remove deprecated video-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated
and unused. Remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 12:43:52 -03:00
Laurent Pinchart 8846e93992 [media] ad9389b: Remove deprecated video-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated
and unused. Remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 12:43:39 -03:00
Laurent Pinchart 307d3bd497 [media] tvp7002: Add pad-level DV timings operations
The video enum_dv_timings operation is deprecated. Implement the
pad-level version of the operation to prepare for the removal of the
video version.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-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>
2014-05-25 12:42:10 -03:00
Laurent Pinchart 553bca82ed [media] ths8200: Add pad-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated.
Implement the pad-level version of those operations to prepare for the
removal of the video version.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-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>
2014-05-25 12:41:55 -03:00
Laurent Pinchart c916194caf [media] adv7842: Add pad-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated.
Implement the pad-level version of those operations to prepare for the
removal of the video version.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 12:40:26 -03:00
Laurent Pinchart 9646171fac [media] adv7511: Add pad-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated.
Implement the pad-level version of those operations to prepare for the
removal of the video version.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 12:40:04 -03:00
Laurent Pinchart 22c25b4861 [media] ad9389b: Add pad-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated.
Implement the pad-level version of those operations to prepare for the
removal of the video version.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 12:38:59 -03:00
Laurent Pinchart 8774bed9ce [media] v4l: subdev: Move [gs]_std operation to video ops
The g_std and s_std operations are video-related, move them to the video
ops where they belong.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.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 <m.chehab@samsung.com>
2014-05-24 17:11:26 -03:00
Laurent Pinchart 12bd10c79b [media] tvp5150: Replace container_of() with to_tvp5150()
Use the driver-specific inline function to cast from a subdev pointer to
a tvp5150 pointer instead of the generic container_of().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23 19:51:26 -03:00
Laurent Pinchart 535ec214e2 [media] mt9p031: Fix BLC configuration restore when disabling test pattern
Auto BLC and BLC digital offset are disabled when enabling the test
pattern and must be restored when disabling it. The driver does so by
calling the set control handler on the auto BLC and BLC offset controls,
but this programs the hardware with the new value of those controls, not
the current value. Fix this by writing to the registers directly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23 14:54:04 -03:00
Laurent Pinchart 8bf54c4321 [media] mt9p031: Really disable Black Level Calibration in test pattern mode
The digital side of the Black Level Calibration (BLC) function must be
disabled when generating a test pattern to avoid artifacts in the image.
The driver disables BLC correctly at the hardware level, but the feature
gets reenabled by v4l2_ctrl_handler_setup() the next time the device is
powered on.

Fix this by marking the BLC controls as inactive when generating a test
pattern, and ignoring control set requests on inactive controls.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23 14:53:31 -03:00
Sakari Ailus 24644035d5 [media] smiapp: Return correct return value in smiapp_registered()
Prepare for supporting systems using the Device tree. Should the resources
not be available at the time of driver probe(), the EPROBE_DEFER error code
must be also returned from its probe function.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23 11:41:28 -03:00
Sakari Ailus 9945374e6d [media] smiapp: Check for GPIO validity using gpio_is_valid()
Do not use our special value, SMIAPP_NO_XSHUTDOWN.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23 11:31:19 -03:00
Sakari Ailus 5fba9888c1 [media] smiapp: Use better regulator name for the Device tree
Rename "VANA" regulator as "vana".

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23 11:30:52 -03:00
Sakari Ailus aca6bf5432 [media] smiapp: Scaling goodness is signed
The "best" value was unsigned however, leading to signed-to-unsigned
comparison and wrong results. Possibly only on a newer GCC. Fix this by
making the best value signed as well.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23 11:30:22 -03:00
Sakari Ailus e5a3f7b882 [media] smiapp: Call limits quirk immediately after retrieving the limits
Some of the limits are used before the limits quirk is called. Move the call
immediately after obtaining the limits.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23 11:29:56 -03:00
Sakari Ailus 48cb4a5d24 [media] smiapp: Print the index of the format descriptor
This makes constructing quirks easier.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23 11:29:22 -03:00
Guennadi Liakhovetski 322e6d19ed [media] V4L2: ov7670: fix a wrong index, potentially Oopsing the kernel from user-space
Commit 75e2bdad89 "ov7670: allow
configuration of image size, clock speed, and I/O method" uses a wrong
index to iterate an array. Apart from being wrong, it also uses an
unchecked value from user-space, which can cause access to unmapped
memory in the kernel, triggered by a normal desktop user with rights to
use V4L2 devices.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-13 19:58:08 -03:00
Hans Verkuil dc5730f5aa [media] tw9910: add g_tvnorms video op
Report to soc_camera which standards are supported by tw9910.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-13 19:55:38 -03:00
Sakari Ailus 393cbd8dc5 [media] smiapp: Use %u for printing u32 value
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23 16:05:06 -03:00
Sakari Ailus f5d65070d4 [media] smiapp: Define macros for obtaining properties of register definitions
The register address, width and flags are encoded as a 32-bit value. Add
macros for obtaining these separately. Use the macros in register access
functions.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23 11:32:22 -03:00
Sakari Ailus 6f7481b668 [media] smiapp: Add register diversion quirk
Add a quirk for diverting registers for on some sensors, even the standard
registers are not where they can be expected to be found. Add a quirk to
to help using such sensors.

smiapp_write_no_quirk() and smiapp_read_no_quirk() functions are provided
for the use of quirk implementations.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23 11:31:33 -03:00
Sakari Ailus 03efb2a067 [media] smiapp: Make PLL (quirk) flags a function
This is more flexible. Quirk flags may be affected by configuration.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23 11:30:32 -03:00
Sakari Ailus 19e9f5f539 [media] smiapp: Make PLL flags unsigned long
No reason to keep this u8, really.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23 11:29:21 -03:00
Sakari Ailus caf447bf74 [media] smiapp: Make PLL flags separate from regular quirk flags
It doesn't make sense to just copy the information to the PLL flags. Add a
new fields for the quirks to contain the PLL flags.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23 11:12:33 -03:00
Sakari Ailus 3c9e7ea377 [media] smiapp: Use I2C adapter ID and address in the sub-device name
The sub-device names should be unique. Should two identical sensors be
present in the same media device they would be indistinguishable. The names
will change e.g. from "vs6555 pixel array" to "vs6555 1-0010 pixel array".

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23 11:11:43 -03:00
Sakari Ailus 125a1c0696 [media] smiapp: Add a macro for constructing 8-bit quirk registers
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23 11:10:47 -03:00
Sakari Ailus b05cd219ec [media] smiapp: Fix determining the need for 8-bit read access
8-bit reads are needed in some cases; however the condition used was wrong.
Regular access (register width) was used if:

	len == SMIAPP_REG_8BIT && !only8

This causes 8-bit read access to be used always. The operator should be ||
instead: regular access can be used for 8-bit reads OR if allowed otherwise.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23 11:10:27 -03:00
Sakari Ailus 6fcc7a528d [media] smiapp: Rename SMIA_REG to SMIAPP_REG for consistency
SMIAPP_REG_ is the common prefix used in the driver for register related
definitions. Use it consistently.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23 11:10:03 -03:00
Sakari Ailus d4f79a80e6 [media] smiapp: Remove unused quirk register functionality
The quirk registers mechanism which allows register to have a static read
access value from the sensor specific quirks, is not used. Remove it. It is
to be replaced by a more generic register diversion quirk soon.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23 11:08:44 -03:00
Martin Bugge 2ff0f16ded [media] adv7842: Disable access to EDID DDC lines before chip power up
In core_init make sure access to EDID DDC lines are disabled
before chip is powered up. Also DISABLE_AUTO_EDID before power up.
The correct setting is applied later when setting the EDID.
Some sources (MAC) kept on reading EDID even when Hotplug was low
and in the short period in core_init before the DDC lines was enabled
read a corrupt EDID.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16 18:22:02 -03:00
Martin Bugge 5046f26b7b [media] adv7842: update RGB quantization range on HDMI/DVI-D mode irq
This was the reason for enabling the HDMI/DVI-D mode irq in the first place.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16 18:21:34 -03:00
Sylwester Nawrocki 41f484d12c [media] s5c73m3: Add missing rename of v4l2_of_get_next_endpoint() function
This fixes following build error:

  CC      drivers/media/i2c/s5c73m3/s5c73m3-core.o
  CC      drivers/md/dm-ioctl.o
  CC      net/ipv4/inet_lro.o
drivers/media/i2c/s5c73m3/s5c73m3-core.c: In function ‘s5c73m3_get_platform_data’:
drivers/media/i2c/s5c73m3/s5c73m3-core.c:1619:2: error: implicit declaration of function ‘v4l2_of_get_next_endpoint’ [-Werror=implicit-function-declaration]
drivers/media/i2c/s5c73m3/s5c73m3-core.c:1619:10: warning: assignment makes pointer from integer without a cast [enabled by default]

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-15 09:49:54 -03:00
Linus Torvalds 463b21fb27 Merge branch 'topic/exynos' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull exynos media updates from Mauro Carvalho Chehab:
 "These are the remaining patches I have for the merge windows.  It
  basically adds a new sensor and adds the needed DT bits for it to
  work"

* 'topic/exynos' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] s5p-fimc: Remove reference to outdated macro
  [media] s5p-jpeg: Fix broken indentation in jpeg-regs.h
  [media] exynos4-is: Add the FIMC-IS ISP capture DMA driver
  [media] exynos4-is: Add support for asynchronous subdevices registration
  [media] exynos4-is: Add clock provider for the SCLK_CAM clock outputs
  [media] exynos4-is: Use external s5k6a3 sensor driver
  [media] V4L: s5c73m3: Add device tree support
  [media] V4L: Add driver for s5k6a3 image sensor
  [media] Documentation: devicetree: Update Samsung FIMC DT binding
  [media] Documentation: dt: Add binding documentation for S5C73M3 camera
  [media] Documentation: dt: Add binding documentation for S5K6A3 image sensor
2014-04-05 13:10:00 -07:00
Linus Torvalds 3c83e61e67 Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab:
 "The main set of series of patches for media subsystem, including:
   - document RC sysfs class
   - added an API to setup scancode to allow waking up systems using the
     Remote Controller
   - add API for SDR devices.  Drivers are still on staging
   - some API improvements for getting EDID data from media
     inputs/outputs
   - new DVB frontend driver for drx-j (ATSC)
   - one driver (it913x/it9137) got removed, in favor of an improvement
     on another driver (af9035)
   - added a skeleton V4L2 PCI driver at documentation
   - added a dual flash driver (lm3646)
   - added a new IR driver (img-ir)
   - added an IR scancode decoder for the Sharp protocol
   - some improvements at the usbtv driver, to allow its core to be
     reused.
   - added a new SDR driver (rtl2832u_sdr)
   - added a new tuner driver (msi001)
   - several improvements at em28xx driver to fix PM support, device
     removal and to split the V4L2 specific bits into a separate
     sub-driver
   - one driver got converted to videobuf2 (s2255drv)
   - the e4000 tuner driver now follows an improved binding model
   - some fixes at V4L2 compat32 code
   - several fixes and enhancements at videobuf2 code
   - some cleanups at V4L2 API documentation
   - usual driver enhancements, new board additions and misc fixups"

[ NOTE! This merge effective drops commit 4329b93b28 ("of: Reduce
  indentation in of_graph_get_next_endpoint").

  The of_graph_get_next_endpoint() function was moved and renamed by
  commit fd9fdb78a9 ("[media] of: move graph helpers from
  drivers/media/v4l2-core to drivers/of").  It was originally called
  v4l2_of_get_next_endpoint() and lived in the file
  drivers/media/v4l2-core/v4l2-of.c.

  In that original location, it was then fixed to support empty port
  nodes by commit b9db140c1e ("[media] v4l: of: Support empty port
  nodes"), and that commit clashes badly with the dropped "Reduce
  intendation" commit.  I had to choose one or the other, and decided
  that the "Support empty port nodes" commit was more important ]

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (426 commits)
  [media] em28xx-dvb: fix PCTV 461e tuner I2C binding
  Revert "[media] em28xx-dvb: fix PCTV 461e tuner I2C binding"
  [media] em28xx: fix PCTV 290e LNA oops
  [media] em28xx-dvb: fix PCTV 461e tuner I2C binding
  [media] m88ds3103: fix bug on .set_tone()
  [media] saa7134: fix WARN_ON during resume
  [media] v4l2-dv-timings: add module name, description, license
  [media] videodev2.h: add parenthesis around macro arguments
  [media] saa6752hs: depends on CRC32
  [media] si4713: fix Kconfig dependencies
  [media] Sensoray 2255 uses videobuf2
  [media] adv7180: free an interrupt on failure paths in init_device()
  [media] e4000: make VIDEO_V4L2 dependency optional
  [media] af9033: Don't export functions for the hardware filter
  [media] af9035: use af9033 PID filters
  [media] af9033: implement PID filter
  [media] rtl2832_sdr: do not use dynamic stack allocation
  [media] e4000: fix 32-bit build error
  [media] em28xx-audio: make sure audio is unmuted on open()
  [media] DocBook media: v4l2_format_sdr was renamed to v4l2_sdr_format
  ...
2014-04-04 09:50:07 -07:00
Hans Verkuil d984d325cd [media] saa6752hs: depends on CRC32
Have saa6752hs select CRC32.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-28 18:06:55 -03:00
Alexey Khoroshilov df065b373f [media] adv7180: free an interrupt on failure paths in init_device()
There is request_irq() in init_device(), but the interrupt is not removed
on failure paths. The patch adds proper error handling.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-24 17:23:09 -03:00
Sylwester Nawrocki bce6744deb [media] V4L: s5c73m3: Add device tree support
This patch adds the V4L2 asynchronous subdev registration and
device tree support. Common clock API is used to control the
sensor master clock from within the subdev.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-14 10:33:19 -03:00
Sylwester Nawrocki 814b4dd9aa [media] V4L: Add driver for s5k6a3 image sensor
This patch adds subdev driver for Samsung S5K6A3 raw image sensor.
As it is intended at the moment to be used only with the Exynos
FIMC-IS (camera ISP) subsystem it is pretty minimal subdev driver.
It doesn't do any I2C communication since the sensor is controlled
by the ISP and its own firmware.
This driver, if needed, can be updated in future into a regular
subdev driver where the main CPU communicates with the sensor
directly.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-14 10:32:17 -03:00
James Hogan 1a1934fab0 [media] rc: abstract access to allowed/enabled protocols
The allowed and enabled protocol masks need to be expanded to be per
filter type in order to support wakeup filter protocol selection. To
ease that process abstract access to the rc_dev::allowed_protos and
rc_dev::enabled_protocols members with inline functions.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Antti Seppälä <a.seppala@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11 13:24:39 -03:00
Marcus Folkesson e01c15dbbd [media] media: i2c: Kconfig: create dependency to MEDIA_CONTROLLER for adv7*
These chips makes use of the media_entity in the v4l2_subdev struct
and is therefor dependent of the  MEDIA_CONTROLLER config.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11 10:53:29 -03:00
Lars-Peter Clausen e246c3332d [media] adv7180: Add support for power down
The adv7180 has a low power mode in which the analog and the digital processing
section are shut down. Implement the s_power callback to let bridge drivers put
the part into low power mode when not needed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11 10:26:38 -03:00
Lars-Peter Clausen fa5b7945ae [media] adv7180: Add support for async device registration
Add support for async device registration to the adv7180 driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11 10:26:15 -03:00
Lars-Peter Clausen 0c25534d45 [media] adv7180: Use threaded IRQ instead of IRQ + workqueue
The proper way to handle IRQs that need to be able to sleep in their IRQ handler
is to use a threaded IRQ.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11 10:25:58 -03:00
Lars-Peter Clausen 7933c177fa [media] adv7180: Remove duplicated probe error message
The device driver core already prints out a very similar message when a driver
fails to probe. No need to print one in the driver itself.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11 10:25:05 -03:00
Lars-Peter Clausen 3de0a91156 [media] adv7180: Remove unnecessary v4l2_device_unregister_subdev() from probe error path
The device can't possibly be registered at this point, so no need to to call
v4l2_device_unregister_subdev().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11 10:24:49 -03:00
Lars-Peter Clausen b13f4af25c [media] adv7180: Free control handler on remove()
Make sure to free the control handler when the device is removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11 10:23:35 -03:00
Lars-Peter Clausen 297a0ae32b [media] adv7180: Fix remove order
The mutex is used in the subdev callbacks, so unregister the subdev before the
mutex is destroyed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11 10:21:55 -03:00
Hans Verkuil b09dfac832 [media] adv*: replace the deprecated v4l2_subdev_edid by v4l2_edid
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11 10:13:15 -03:00
Daniel Jeong dc76df5d48 [media] lm3646: add new dual LED Flash driver
This patch adds the driver for the LM3646, dual LED Flash driver.
The LM3646 has two 1.5A sync. boost converter with dual white current source.
It is controlled via an I2C compatible interface.
Each flash brightness, torch brightness and enable/disable can be controlled.
Under voltage, input voltage monitor and thermal threshhold Faults are added.
Please refer the datasheet http://www.ti.com/lit/ds/snvs962/snvs962.pdf

Signed-off-by: Daniel Jeong <gshark.jeong@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11 10:00:26 -03:00
Andy Shevchenko 341ef565f8 [media] lm3560: prevent memory leak in case of pdata absence
If we have no pdata defined and driver fails to register we leak memory.
Converting to devm_kzalloc prevents this to happen.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11 09:56:39 -03:00
Andy Shevchenko d1166b0f17 [media] lm3560: keep style for the comments
Let's keep the style for all comments in the code, namely using small letters
whenever it's possible.

There is no functional change.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11 09:56:26 -03:00
Andy Shevchenko bc46263b84 [media] lm3560: remove FSF address from the license
There is no need to keep the FSF address inside each file. Moreover, it might
change in future which will make this one obsolete.

There is no functional change.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11 09:56:08 -03:00
Philipp Zabel 2a0489d351 [media] tvp5150: Make debug module parameter visible in sysfs
Set permissions on the debug module parameter to make it appear in sysfs.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11 09:27:49 -03:00
Philipp Zabel 785a3de18b [media] tvp5150: Fix type mismatch warning in clamp macro
This patch fixes the following warning:

drivers/media/i2c/tvp5150.c: In function '__tvp5150_try_crop':
include/linux/kernel.h:762:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
  (void) (&__val == &__min);  \
                 ^
drivers/media/i2c/tvp5150.c:886:16: note: in expansion of macro 'clamp'
  rect->width = clamp(rect->width,
                ^
include/linux/kernel.h:763:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
  (void) (&__val == &__max);  \
                 ^
drivers/media/i2c/tvp5150.c:886:16: note: in expansion of macro 'clamp'
  rect->width = clamp(rect->width,
                ^
include/linux/kernel.h:762:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
  (void) (&__val == &__min);  \
                 ^
drivers/media/i2c/tvp5150.c:904:17: note: in expansion of macro 'clamp'
  rect->height = clamp(rect->height,
                 ^
include/linux/kernel.h:763:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
  (void) (&__val == &__max);  \
                 ^
drivers/media/i2c/tvp5150.c:904:17: note: in expansion of macro 'clamp'
  rect->height = clamp(rect->height,
                 ^

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11 09:27:38 -03:00
Mauro Carvalho Chehab c897df0e2d Linux 3.14-rc5
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJTE+9XAAoJEHm+PkMAQRiGrMQIAKI2V49Kj8WlnwGchFvsbGJB
 SLALwNi33T/IBKdZRhrfryBu02Zj7eVvZ2ML35dJEnmF88O+dJBDMTkKV1xalrip
 mtkBrjUnfAI04fq/daLQ1TsAy4qqlra5tSTuDCw8ILOnGPwT0VydIEHNdtmoUIfw
 xlZLxHzny1MslZ78d7uR/cUnV9ylKRRajWzfw1HT8hL51fCt8nRWY0sCvwvl+kMJ
 LsK+6I7mHDUuzA7QBmBI+dhzQgos5+JkkrnpmqHAqwmIh+AI3ksmjUCQ4dM7owrO
 IvEx+ZNDqxAdLcm1WAxATNfxddFXHc62JTvKuuKqTVWuaxVfK1Aqt8MjDMIPeAQ=
 =yV5u
 -----END PGP SIGNATURE-----

Merge tag 'v3.14-rc5' into patchwork

Linux 3.14-rc5

* tag 'v3.14-rc5': (1117 commits)
  Linux 3.14-rc5
  drm/vmwgfx: avoid null pointer dereference at failure paths
  drm/vmwgfx: Make sure backing mobs are cleared when allocated. Update driver date.
  drm/vmwgfx: Remove some unused surface formats
  MAINTAINERS: add maintainer entry for Armada DRM driver
  arm64: Fix !CONFIG_SMP kernel build
  arm64: mm: Add double logical invert to pte accessors
  dm cache: fix truncation bug when mapping I/O to >2TB fast device
  perf tools: Fix strict alias issue for find_first_bit
  powerpc/powernv: Fix indirect XSCOM unmangling
  powerpc/powernv: Fix opal_xscom_{read,write} prototype
  powerpc/powernv: Refactor PHB diag-data dump
  powerpc/powernv: Dump PHB diag-data immediately
  powerpc: Increase stack redzone for 64-bit userspace to 512 bytes
  powerpc/ftrace: bugfix for test_24bit_addr
  powerpc/crashdump : Fix page frame number check in copy_oldmem_page
  powerpc/le: Ensure that the 'stop-self' RTAS token is handled correctly
  kvm, vmx: Really fix lazy FPU on nested guest
  perf tools: fix BFD detection on opensuse
  drm/radeon: enable speaker allocation setup on dce3.2
  ...
2014-03-11 06:55:49 -03:00
Philipp Zabel fd9fdb78a9 [media] of: move graph helpers from drivers/media/v4l2-core to drivers/of
This patch moves the parsing helpers used to parse connected graphs
in the device tree, like the video interface bindings documented in
Documentation/devicetree/bindings/media/video-interfaces.txt, from
drivers/media/v4l2-core/v4l2-of.c into drivers/of/base.c.

This allows to reuse the same parser code from outside the V4L2
framework, most importantly from display drivers.
The functions v4l2_of_get_next_endpoint, v4l2_of_get_remote_port,
and v4l2_of_get_remote_port_parent are moved. They are renamed to
of_graph_get_next_endpoint, of_graph_get_remote_port, and
of_graph_get_remote_port_parent, respectively.
Since there are not that many current users yet, switch all of
them to the new functions right away.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2014-03-06 17:41:22 +01:00
Martin Bugge 2dfb1c939c [media] ths8200: Format adjustment
Closer inspection on exact transmitted format showed that
we needed to add 1 on vertical sync.

Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-02-28 14:29:05 -03:00
Martin Bugge 00b9f51e1f [media] ths8200: Corrected sync polarities setting
HS_IN/VS_IN was always set to positive.

Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-02-28 14:28:13 -03:00
Martin Bugge 8a027faf4c [media] ths8200: Zero blanking level for RGB
Currently only RGB444 input data is supported so set to zero.

Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-02-28 14:27:57 -03:00
Lad, Prabhakar 79019190a4 [media] mt9v032: Check return value of clk_prepare_enable/clk_set_rate
clk_set_rate(), clk_prepare_enable() functions can fail, so check the return
values to avoid surprises.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-02-24 13:14:12 -03:00
Lad, Prabhakar ee2d16d7b3 [media] mt9p031: Check return value of clk_prepare_enable/clk_set_rate
clk_set_rate(), clk_prepare_enable() functions can fail, so check the return
values to avoid surprises.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-02-24 13:12:53 -03:00
Laurent Pinchart a970449e40 [media] mt9p031: Add support for PLL bypass
When the input clock frequency is out of bounds for the PLL, bypass the
PLL and just divide the input clock to achieve the requested output
frequency.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-02-24 13:12:36 -03:00
Laurent Pinchart e8e45593c9 [media] mt9p031: Fix typo in comment
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-02-24 13:11:49 -03:00
Laurent Pinchart b16fdd53de [media] mt9t001: Add clock support
The sensor needs a master clock, handle it explictly in the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-02-24 13:11:40 -03:00
Laurent Pinchart b2b3593e33 [media] mt9t001: Add regulator support
The sensor needs two power supplies, VAA and VDD. Require a regulator
for each of them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-02-24 13:11:17 -03:00
Mauro Carvalho Chehab 37e59f876b [media, edac] Change my email address
There are several left overs with my old email address.
Remove their occurrences and add myself at CREDITS, to
allow people to be able to reach me on my new addresses.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-02-07 08:03:07 -02:00
Martin Bugge ce2d2b2d7a [media] adv7842: platform-data for Hotplug Active (HPA) manual/auto
This applies to HDMI-map register 0x69.
So far we have been using HPA manual mode.
This way we had control of HPA which could be
set after EDID had been programmed.

Using a Mac Mini with mini-displayport to DVI-D converter as source
caused the adv7842 to lock up and fail to detect any further signals.

After experimenting with different configurations it was found that
using the HPA auto mode and in addition letting RX-termination
be controlled by HPA prevented this error from occuring.

I was not able to re-create this problem on the adv7604.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-02-04 09:57:36 -02:00
Martin Bugge b60908a4e5 [media] adv7842: log-status for Audio Video Info frames (AVI)
Clear any pending AVI checksum-errors.
To be able to display last received AVI.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-02-04 09:57:18 -02:00
Martin Bugge 81ba0a4e0b [media] adv7842: pixelclock read-out
Incorrect registers used for pixelclock read-out.
Same registers as for adv7604 which actually gave an almost
correct read-out, even they are not documented for adv7842.
Corrected deep-color pixel-clock correction.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-02-04 09:57:00 -02:00
Martin Bugge 933913da02 [media] adv7842: adjust gain and offset for DVI-D signals
If the input signal is DVI-D and quantization range is RGB full range,
gain and offset must be adjusted to get the right range on the output.
Copied and adopted from adv7604.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-02-04 09:55:55 -02:00
Martin Bugge 57f0547fbc [media] adv7842: Composite free-run platfrom-data fix
Incorrectly setting of free-run for Composite.
Copy/paste regression fix.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-02-04 06:46:10 -02:00
Andrzej Hajda 7e8f15c5aa [media] s5k5baf: allow to handle arbitrary long i2c sequences
Using variable length array in s5k5baf_write_arr_seq caused
an implicit assumption that i2c sequences should be short.
The patch rewrites the function so it can handle sequences
of any length and does not use variable length array.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-02-04 05:52:48 -02:00
Sachin Kamat c0ee62734e [media] s5k5baf: Fix potential NULL pointer dereferencing
Dereference 'fw' after the NULL check.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 08:48:46 -02:00
Sachin Kamat 7296e158b5 [media] s5k5baf: Fix checkpatch error
Fixes the following error:
ERROR: return is not a function, parentheses are not required
FILE: drivers/media/i2c/s5k5baf.c:1353:

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 08:48:29 -02:00
Sachin Kamat 383cc04c60 [media] s5k5baf: Fix build warning
Fixes the following warnings:
drivers/media/i2c/s5k5baf.c: In function 's5k5baf_fw_parse':
drivers/media/i2c/s5k5baf.c:362:3: warning:
format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Wformat=]
drivers/media/i2c/s5k5baf.c:383:4: warning:
format '%d' expects argument of type 'int', but argument 4 has type 'size_t' [-Wformat=]

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 08:48:11 -02:00
Ricardo Ribalda f90580ca01 [media] videodev2: Set vb2_rect's width and height as unsigned
As discussed on the media summit 2013, there is no reason for the width
and height to be signed.

Therefore this patch is an attempt to convert those fields from __s32 to
__u32.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi> (documentation and smiapp)
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 08:02:39 -02:00
Hans Verkuil 09092787e0 [media] saa6588: add support for non-blocking mode
saa6588 always blocked while waiting for data, even if the filehandle
was in non-blocking mode.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 07:42:19 -02:00
Hans Verkuil a101b947d4 [media] saa6588: remove unused CMD_OPEN
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 07:40:59 -02:00
Hans Verkuil af2c5debe1 [media] saa6588: after calling CMD_CLOSE, CMD_POLL is broken
CMD_CLOSE sets data_available_for_read to 1, which is necessary to do the
wakeup call, but it is never reset to 0.

Because of this calling CMD_POLL afterwards will always return that data is
available, even if there isn't any.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 07:40:44 -02:00
Hans Verkuil 6052ba3520 [media] saa6752hs: move to media/i2c
This driver is independent from saa7134, so there is no reason why this
shouldn't be in media/i2c like all other i2c media drivers.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 07:39:17 -02:00
Hans Verkuil 7f95c904b9 [media] adv7842: add drive strength enum and sync names with adv7604
Add a proper driver strength enum and use the same names in the platform
data as with adv7604.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:47:46 -02:00
Hans Verkuil 0bb4e7ab64 [media] adv7842: initialize timings to CEA 640x480p59.94
This timing must be supported by all HDMI equipment, so that's a
reasonable default.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:47:32 -02:00
Hans Verkuil fe808f3c93 [media] adv7842: set LLC DLL phase from platform_data
The correct LLC DLL phase depends on the board layout, so this
should be part of the platform_data.

Also updated the platform_data in ezkit to ensure that what was the old
default value is now explicitly specified, so the behavior for that board
is unchanged.

Tested-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:47:19 -02:00
Martin Bugge 834a8be156 [media] adv7842: return 0 if no change in s_dv_timings
Return 0 if the new timings are equal to the current timings as
it caused extra cp-loss/lock interrupts.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:46:57 -02:00
Martin Bugge 15058aac06 [media] adv7842: Composite sync adjustment
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:46:43 -02:00
Martin Bugge f0ec17420e [media] adv7842: obtain free-run mode from the platform_data
The free-run mode can be board-specific.

Also updated the platform_data in ezkit to ensure that what was the old
default value is now explicitly specified, so the behavior for that board
is unchanged.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:46:28 -02:00
Martin Bugge 1961b7203f [media] adv7842: composite sd-ram test, clear timings before setting
Must clear timings before setting after test to recover.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:42:50 -02:00
Martin Bugge 019aa8be84 [media] adv7842: enable HDMI/DVI mode irq
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:42:20 -02:00
Martin Bugge b82e279347 [media] adv7842: i2c dummy clients registration
Clear i2c_clients ptr when unregistered.
Warn if configured i2c-addr is zero.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:37:08 -02:00
Martin Bugge 245b2b678c [media] adv7842: support g_edid ioctl
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:36:03 -02:00
Martin Bugge 6e9071f268 [media] adv7842: restart STDI once if format is not found
The STDI block may measure wrong values, especially for lcvs and lcf.
If the driver can not find any valid timing, the STDI block is restarted
to measure the video timings again. The function will return an error,
but the restart of STDI will generate a new STDI interrupt and the format
detection process will restart.

Copied from adv7604.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:35:46 -02:00
Martin Bugge fc2e991e86 [media] adv7842: clear edid, if no edid just disable Edid-DDC access
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:35:06 -02:00
Mats Randgaard 5b64b20539 [media] adv7842: mute audio before switching inputs to avoid noise/pops
Signed-off-by: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:34:52 -02:00
Mats Randgaard 7de6fab1fd [media] adv7842: Use defines to select EDID port
Signed-off-by: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:34:22 -02:00
Mats Randgaard 77a09f8bf1 [media] adv7842: remove connector type. Never used for anything useful
May also be wrong if the receiver is connected to more than one connector.

Signed-off-by: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:33:12 -02:00
Martin Bugge 84aeed5310 [media] adv7842: increase wait time
Wait 5ms after main reset. The data-sheet doesn't specify the wait
after i2c-controlled reset, so using same value as after pin-controlled
reset.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:31:19 -02:00
Martin Bugge 8e4e363153 [media] adv7842: set default input in platform-data
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:30:55 -02:00
Martin Bugge 3c4da74fe5 [media] adv7842: 625/525 line standard jitter fix
Both the PAL and NTSC standards are interlaced where a
frame consist of two fields. Total number of lines in a frame in both systems
are an odd number so the two fields will have different length.

In the 625 line standard ("PAL") the odd field of the frame is transmitted first,
while in the 525 standard ("NTSC") the even field is transmitted first.

This adds the possibility to change output config between the fields and standards.

This setting will reduce the "format-jitter" on the signal sent by the pixelport
moving the difference between the fields to vertical front/back-porch only.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:30:41 -02:00
Martin Bugge b38a1c4cf2 [media] adv7842: set defaults spa-location
For edid with no Source Physical Address (spa), set
spa-location to default and use correct values from edid.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:29:54 -02:00
Hans Verkuil 69e9ba6f31 [media] adv7842: support YCrCb analog input, receive CEA formats as RGB on VGA input
Added support for YCrCb analog input.

If input is ADV7842_MODE_RGB and RGB quantization range is set to
V4L2_DV_RGB_RANGE_AUTO, then video with CEA timings will be received
as RGB. For ADV7842_MODE_COMP, automatic CSC mode will be selected.

See table 48 on page 281 in "ADV7842 Hardware Manual, Rev. 0, January 2011"
for details.

Make sure that when switching inputs the RGB quantization range is
updated as well.

Also updated the platform_data in ezkit to ensure that what was the old
default value is now explicitly specified, so the behavior for that board
is unchanged.

Signed-off-by: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:28:26 -02:00
Martin Bugge 32dbc8d4d5 [media] adv7842: added DE vertical position in SDP-io-sync
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:23:18 -02:00
Martin Bugge 7de5be44a5 [media] adv7842: save platform data in state struct
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:22:26 -02:00
Martin Bugge c9f1f271d4 [media] adv7842: properly enable/disable the irqs
The method of disabling the irq-output pin caused many "empty"
interrupts. Instead, actually disable/enable the interrupts by
changing the interrupt masks.

Also enable STORE_MASKED_IRQ in INT1 configuration, otherwise when HDMI
events happen while the interrupt is masked those events will be ignored
when the interrupt is unmasked.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:22:12 -02:00
Martin Bugge 6251e65f1b [media] adv7842: corrected setting of cp-register 0x91 and 0x8f
Bit 6 of register 0x8f was cleared incorrectly (must be 1), and bit 4
of register 0x91 was set incorrectly (must be 0).

These bits are undocumented, so we shouldn't modify them to values different
from what the datasheet specifies.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:21:30 -02:00
Martin Bugge e78d834a2e [media] adv7842: Re-worked query_dv_timings()
This simplified the code quite a bit.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:21:18 -02:00
Hans Verkuil 591b72fe73 [media] adv7604: initialize timings to CEA 640x480p59.94
This timing must be supported by all HDMI equipment, so that's a
reasonable default.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:20:33 -02:00
Martin Bugge 9890869651 [media] adv7604: sync polarities from platform data
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:16:54 -02:00