Commit Graph

16574 Commits

Author SHA1 Message Date
Mauro Carvalho Chehab 103fe2fb23 [media] r820t: Invert bits for read ops
On read, the bit order is inverted.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
2013-04-16 21:27:38 -03:00
Mauro Carvalho Chehab 884655ad2e [media] rtl2832: properly set en_bbin for r820t
DVBT_EN_BBIN should be set on both places where IF is set. So,
move it to a function and call it where needed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
2013-04-16 21:27:19 -03:00
Mauro Carvalho Chehab a7dd065f49 [media] r820t: use the right IF for the selected TV standard
IF is set at r820t_set_tv_standard(). So, we can't calculate
LO frequency before calling it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
2013-04-16 21:26:06 -03:00
Mauro Carvalho Chehab fa4bfd2bd0 [media] rtl2832: add code to bind r820t on it
There are some init stuff to be done for each new tuner at the
demod code. Add the code there for r820t.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
2013-04-16 21:25:52 -03:00
Mauro Carvalho Chehab f60f5bcbe4 [media] r820t: Fix IF scale
Scale used at get_if_freq and LO freq calculus is Hz.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
2013-04-16 21:25:24 -03:00
Mauro Carvalho Chehab da31934fb8 [media] rtl820t: Add a debug msg when PLL gets locked
[ 2255.342797] r820t 3-001a: generic_set_freq: PLL locked on frequency 725476191 Hz, gain=45

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
2013-04-16 21:25:13 -03:00
Mauro Carvalho Chehab 7a5ef30dc3 [media] r820t: proper lock and set the I2C gate
As this tuner can be used by analog and digital parts of the
driver, be sure that all ops that access the hardware will
be be properly locked.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
2013-04-16 21:24:10 -03:00
Mauro Carvalho Chehab 9e30edd890 [media] rtl28xxu: use r820t to obtain the signal strength
Now that we can get the strength from r820t, use it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
2013-04-16 21:23:01 -03:00
Mauro Carvalho Chehab 50786ddfa8 [media] r820t: Set gain mode to auto
This tuner works with 2 modes: automatic gain mode and manual
gain mode. Put it into automatic mode, as we currently don't
have any API for manual gain adjustment.
The logic to allow setting the manual mode is there, as it is
just a few extra code. This way, if/when we latter add support
for setting the gain mode, the code is already there.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
2013-04-16 21:22:41 -03:00
Mauro Carvalho Chehab f8fde0e045 [media] r820t: Give a better estimation of the signal strength
Instead of a binary signal strength measure, use the tuner gain
to obtain a better estimation of the signal strength.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
2013-04-16 21:20:12 -03:00
Mauro Carvalho Chehab 6889ab2a25 [media] rtl28xxu: add support for Rafael Micro r820t
This tuner is used on some rtl2882 dongles. Add it to the driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
2013-04-16 21:19:10 -03:00
Mauro Carvalho Chehab a80abc58fe [media] r820t: Add a tuner driver for Rafael Micro R820T silicon tuner
This driver was written from scratch, based on an existing driver
that it is part of rtl-sdr git tree, released under GPLv2:
	https://groups.google.com/forum/#!topic/ultra-cheap-sdr/Y3rBEOFtHug
	https://github.com/n1gp/gr-baz
	http://cgit.osmocom.org/rtl-sdr/plain/src/tuner_r820t.c
	(there are also other variants of it out there)
>From what I understood from the threads, the original driver was converted
to userspace from a Realtek tree. I couldn't find the original tree.
However, the original driver look awkward on my eyes. So, I decided to
write a new version from it from the scratch, while trying to reproduce
everything found there.
TODO:
- After locking, the original driver seems to have some routines to
  improve reception. This was not implemented here yet.
- RF Gain set/get is not implemented.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
2013-04-16 21:18:42 -03:00
Mauro Carvalho Chehab 098af4bde0 [media] sta2x11_vip: Fix compilation if I2C is not set
From Fengguang Wu <fengguang.wu@intel.com>:

> drivers/media/pci/sta2x11/sta2x11_vip.c: In function 'sta2x11_vip_init_one':
> drivers/media/pci/sta2x11/sta2x11_vip.c:1314:2: error: implicit declaration of function 'i2c_get_adapter' [-Werror=implicit-function-declaration]
> drivers/media/pci/sta2x11/sta2x11_vip.c:1314:15: warning: assignment makes pointer from integer without a cast [enabled by default]
> drivers/media/pci/sta2x11/sta2x11_vip.c:1330:2: error: implicit declaration of function 'i2c_put_adapter' [-Werror=implicit-function-declaration]

And also:

> warning: (STA2X11_VIP) selects VIDEO_ADV7180 which has unmet direct dependencies (MEDIA_SUPPORT && VIDEO_V4L2 && I2C)
> drivers/media/i2c/adv7180.c: In function '__adv7180_status':
> drivers/media/i2c/adv7180.c:194:2: error: implicit declaration of function 'i2c_smbus_read_byte_data' [-Werror=implicit-function-declaration]
> drivers/media/i2c/adv7180.c: In function 'adv7180_s_routing':
> drivers/media/i2c/adv7180.c:251:2: error: implicit declaration of function 'i2c_smbus_write_byte_data' [-Werror=implicit-function-declaration]
> drivers/media/i2c/adv7180.c: In function 'adv7180_probe':
> drivers/media/i2c/adv7180.c:551:2: error: implicit declaration of function 'i2c_check_functionality' [-Werror=implicit-function-declaration]
> drivers/media/i2c/adv7180.c:554:2: error: implicit declaration of function 'i2c_adapter_id' [-Werror=implicit-function-declaration]
> drivers/media/i2c/adv7180.c: At top level:
> drivers/media/i2c/adv7180.c:663:1: warning: data definition has no type or storage class [enabled by default]
> drivers/media/i2c/adv7180.c:663:1: warning: type defaults to 'int' in declaration of 'module_i2c_driver' [-Wimplicit-int]
> drivers/media/i2c/adv7180.c:663:1: warning: parameter names (without types) in function declaration [enabled by default]
> drivers/media/i2c/adv7180.c:649:26: warning: 'adv7180_driver' defined but not used [-Wunused-variable]

This is due to the lack of I2C support:

...
> CONFIG_I2C is not set
...

So, Make sure that sta2x11_vip depends on I2C.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 20:06:34 -03:00
Mauro Carvalho Chehab 99ca5557ff [media] it913x: rename its tuner driver to tuner_it913x
There are three drivers with *it913x name on it, and they all
belong to the same device:
	a tuner, at it913x.c;
	a frontend: it913x-fe.c;
	a bridge: it913x.c, renamed to dvb_usb_it913x by the
building system.

This is confusing. Even more confusing are the two .c files with
the same name under different directories, with different contents
and different functions. So, prepend the tuner one.

This also breaks the out-of-tree compilation system.

Reported-by: Frederic Fays <frederic.fays@gmail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 20:06:05 -03:00
William Steidtmann 76dea4cf52 [media] mceusb: add some missing cmd sizes
Fix mceusb_cmdsize() which returns incorrect datasize=0 for
sub-commands MCE_RSP_GETPORTSTATUS, MCE_RSP_GETWAKESOURCE,
MCE_RSP_EQDEVDETAILS, MCE_RSP_EQEMVER, and MCE_RSP_EQIRNUMPORTS.

While here, change mceusb_cmdsize() name to reflect that it returns
data size not cmd size.

Signed-off-by: William Steidtmann <billstei@hbci.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:53:34 -03:00
David Howells bebe3c69de [media] zoran: Don't print proc_dir_entry data in debug [RFC]
Don't print proc_dir_entry data in debug as we're soon to have no direct
access to the contents of the PDE.  Print what was put in there instead.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:27:44 -03:00
Michal Marek 430c73fa47 [media] em28xx: Put remaining .vidioc_g_chip_info instance under ADV_DEBUG
Commit cd634f1 ("[media] v4l2: put VIDIOC_DBG_G_CHIP_NAME under
ADV_DEBUG") missed the initializer of radio_ioctl_ops:
drivers/media/usb/em28xx/em28xx-video.c:1830:2: error: unknown field 'vidioc_g_chip_info' specified in initializer
drivers/media/usb/em28xx/em28xx-video.c:1830:26: error: 'vidioc_g_chip_info' undeclared here (not in a function)

Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:26:08 -03:00
Hans Verkuil 486a7a2813 [media] cx25821: remove cx25821-audio-upstream.c from the Makefile
The audio output is currently not used as this should be rewritten as an
alsa driver. For the time being remove this source from the Makefile.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:13:06 -03:00
Hans Verkuil ea3f7ac6e9 [media] cx25821: replace custom ioctls with write()
Ideally this should be implemented with vb2, but it'll do for now.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:12:34 -03:00
Hans Verkuil 7087d31b0c [media] cx25821: drop cx25821-video-upstream-ch2.c/h
cx25821-video-upstream_ch2.c/h is practically identical to cx25821-video-upstream.c/h
so add support for ch2 into cx25821-video-upstream.c instead.
After this we can replace the custom ioctls with a proper write() interface.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:11:58 -03:00
Hans Verkuil e90878ab15 [media] cx25821: add output format ioctls
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:10:59 -03:00
Hans Verkuil 0df13d99f7 [media] cx25821: prepare querycap for output support
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:10:35 -03:00
Hans Verkuil 4c1d0f7302 [media] cx25821: group all fmt functions together
No other changes, just function reordering.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:10:21 -03:00
Hans Verkuil 1f1988706d [media] cx25821: setup output nodes correctly
Drop the custom ioctls and enable the video output nodes again, this time
using standard ioctls.
The next step will be to provide a proper write() interface.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:09:57 -03:00
Hans Verkuil a6aa0dc482 [media] cx25821: remove references to subdevices that aren't there
This driver does not have subdevices, so why call subdev ops? After
removing that it became apparent that only Composite is supported as
input, so remove also any reference to other inputs.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:09:18 -03:00
Hans Verkuil 7704cfb9cd [media] cx25821: remove custom ioctls that duplicate v4l2 ioctls
No idea why these custom ioctls exist: they have perfectly normal v4l2
counterparts which are already implemented.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:08:44 -03:00
Hans Verkuil 988f7b80ab [media] cx25821: g/s/try/enum_fmt related fixes and cleanups
- fill in colorspace
- zero priv
- delete unsupported formats
- fix field handling
- s_std should update width/height
- proper mapping of width/height to valid resolutions

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:08:13 -03:00
Hans Verkuil 8d125c507d [media] cx25821: switch to v4l2_fh, add event and prio handling
It is now possible to remove cx25821_fh and replace it with v4l2_fh,
which in turn makes event handling and core prio handling possible.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:07:43 -03:00
Hans Verkuil 84293f0843 [media] cx25821: replace resource management functions with fh ownership
Just remember which filehandle is streaming instead of using complicated
resource masks.
After this patch we can replace cx25821_fh with v4l2_fh.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:07:13 -03:00
Hans Verkuil 2efe2cc430 [media] cx25821: move vidq from cx25821_fh to cx25821_channel
This is not a per-filehandle object, it's a per-channel object.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:06:35 -03:00
Hans Verkuil 11f095aa41 [media] cx25821: remove 'type' field from cx25821_fh
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:05:49 -03:00
Hans Verkuil be178cb4f4 [media] cx25821: use core locking
This allows us to replace .ioctl with .unlocked_ioctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:05:22 -03:00
Hans Verkuil b6f8727e9f [media] cx25821: remove unnecessary debug messages
The v4l2 core already has support for debugging ioctls/file operations.
No need to do that again.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:05:00 -03:00
Hans Verkuil bad1f29d0f [media] cx25821: remove TRUE/FALSE/STATUS_(UN)SUCCESSFUL defines
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:04:37 -03:00
Hans Verkuil f8d7ee7091 [media] cx25821: convert to the control framework
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:04:12 -03:00
Hans Verkuil 467870ca26 [media] cx25821: embed video_device, clean up some kernel log spam
Embed the video_device struct instead of allocating it.
Remove some of the annoying and ugly kernel messages shown during
loading and unloading of the module.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:03:49 -03:00
Hans Verkuil 89c21389f2 [media] cx25821: remove bogus dependencies
This driver doesn't use DVB, RC, cx25840 or tveeprom.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:03:27 -03:00
Hans Verkuil de9ea4cf7f [media] cx25821: remove cropping ioctls
This driver does not implement cropping, so remove the cropping ioctls.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:03:09 -03:00
Hans Verkuil 95c232a24b [media] cx25821: make lots of externals static
A lot of functions and variables were external when they really can be
declared as static.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:02:54 -03:00
Hans Verkuil 6b1dce251f [media] cx25821: s_input didn't check for invalid input
The s_input implementation allowed input 1 even if that didn't exist.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:02:23 -03:00
Hans Verkuil a8f35ce3d6 [media] cx25821: remove unnecessary global devlist
This device list is not necessary. The kernel already has all that information,
so just use that instead.
Also remove a bogus refcount and some dead 'private_free' code in the alsa driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:02:02 -03:00
Hans Verkuil bfef0d35e5 [media] cx25821: make cx25821_sram_channels const
And get rid of the channel0-11 external pointers and two more unused fields
in cx25821.h.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 18:01:29 -03:00
Hans Verkuil 3dd473ca58 [media] cx25821: fix log_status, querycap
log_status shouldn't print LOG STATUS lines, the core does that already.
Fix querycap version number and add device_caps support.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 17:59:56 -03:00
Hans Verkuil 18c73af696 [media] cx25821: remove unused fields, ioctls
Do some spring cleaning:
- there are no board defines with tuners, so remove bogus tuner support.
- tv standard handling has nothing to do with tuners, so keep that.
- replace the deprecated current_norm by g_std.
- querystd isn't implemented, so remove the ioctl.
- remove a bunch of unused fields in cx25821.h

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 17:57:27 -03:00
Hans Verkuil ffd3c23304 [media] cx25821: remove bogus radio/vbi/'video-ioctl' support
This device does not support radio or vbi, so remove anything referring
to that.
In addition, the driver created an 'video ioctl' node, which was unused and
was effectively identical to the first video node.
This bogus video node is now removed, leaving us with 8 video capture nodes
and 2 video output nodes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 17:56:19 -03:00
Hans Verkuil 170bd53303 [media] cx25821: fix compiler warning
drivers/media/pci/cx25821/cx25821-video.c: In function ‘cx25821_video_register’:
drivers/media/pci/cx25821/cx25821-video.c:518:1: warning: the frame size of 1600 bytes is larger than 1024 bytes [-Wframe-larger-than=]
Fixed by just making the struct video_device template static const.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 16:28:26 -03:00
Hans Verkuil 31b320739b [media] cx25821: the audio channel was registered as a video node
Skip the audio channel when registering the video nodes. This fixes a bug
where that incorrectly registered 'video' node was never unregistered.
Note: this bug only surfaces if the video output nodes are enabled again
after the previous patch disabled them.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-15 08:35:21 -03:00
Hans Verkuil a877e2771a [media] cx25821: do not expose broken video output streams
The cx25821 driver has support for one audio output channel and two video
output channels.
This is implemented in a very ugly and very evil way through a custom ioctl
that passes the filename of a file containing the video data, which is then
read by the driver itself using vfs.
There are a number of problems with this:
1) it's very ugly and very evil (I can't say that often enough).
2) V4L2 supports video output, so why not use that?
3) it's very buggy, closing the filehandle through which you passed the ioctl
   will oops the kernel.
4) it's a nasty security leak since this allows you to load any file in the
   system as a video or audio source, so in theory you can output /etc/passwd
   to audio or video out and record & decode it on another device.
Because of all these issues we no longer register those output video nodes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-15 08:34:37 -03:00
Mauro Carvalho Chehab a9af539252 [media] cxd2820r_t2: Fix a warning: stream_id is unsigned
drivers/media/dvb-frontends/cxd2820r_t2.c: In function 'cxd2820r_set_frontend_t2':
drivers/media/dvb-frontends/cxd2820r_t2.c:128:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-15 08:32:41 -03:00
Hans Verkuil c95789ecd5 [media] cx25821: do not expose broken video output streams
The cx25821 driver has support for one audio output channel and two video
output channels.
This is implemented in a very ugly and very evil way through a custom ioctl
that passes the filename of a file containing the video data, which is then
read by the driver itself using vfs.
There are a number of problems with this:
1) it's very ugly and very evil (I can't say that often enough).
2) V4L2 supports video output, so why not use that?
3) it's very buggy, closing the filehandle through which you passed the ioctl
   will oops the kernel.
4) it's a nasty security leak since this allows you to load any file in the
   system as a video or audio source, so in theory you can output /etc/passwd
   to audio or video out and record & decode it on another device.
Because of all these issues we no longer register those output video nodes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-15 08:28:41 -03:00
Antti Palosaari 4c41dab4d6 [media] rc: fix single line indentation of keymaps/Makefile
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 22:51:41 -03:00
Antti Palosaari 831378dbb6 [media] em28xx: map remote for 1b80:e425
Map RC_MAP_REDDO to that device.

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

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 22:48:35 -03:00
Seung-Woo Kim 068a0df760 [media] media: vb2: add length check for mmap
The length of mmap() can be bigger than length of vb2 buffer, so
it should be checked.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 22:37:26 -03:00
Wei Yongjun dbcd371b46 [media] rc: ene_ir: fix potential double free in ene_probe()
Since rc_unregister_device() frees its argument, the subsequently
call to rc_free_device() on the same variable will cause a double
free bug. Fix by set argument to NULL, thus when fall through to
rc_free_device(), nothing will be done there.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 21:38:17 -03:00
Wei Yongjun f73e1851c3 [media] rc: nuvoton-cir: fix potential double free in nvt_probe()
Since rc_unregister_device() frees its argument, the subsequently
call to rc_free_device() on the same variable will cause a double
free bug. Fix by set argument to NULL, thus when fall through to
rc_free_device(), nothing will be done there.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 21:38:05 -03:00
Wei Yongjun 408208fbf2 [media] rc: ite-cir: fix potential double free in ite_probe()
Since rc_unregister_device() frees its argument, the subsequently
call to rc_free_device() on the same variable will cause a double
free bug. Fix by set argument to NULL, thus when fall through to
rc_free_device(), nothing will be done there.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 21:37:53 -03:00
Wei Yongjun 4ec16da733 [media] rc: winbond-cir: fix potential double free in wbcir_probe()
Since rc_unregister_device() frees its argument, the subsequently
call to rc_free_device() on the same variable will cause a double
free bug. Fix by set argument to NULL, thus when fall through to
rc_free_device(), nothing will be done there.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 21:37:37 -03:00
Laurent Pinchart 9b28ee3c91 [media] omap3isp: Use the common clock framework
Expose the two ISP external clocks XCLKA and XCLKB as common clocks for
subdev drivers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 20:21:12 -03:00
Guennadi Liakhovetski abcb6b99f5 [media] soc-camera: fix typos in the default format-conversion table
The default format conversion table mbus_fmt[] in soc_mediabus.c lists
"natural" conversions between media-bus and fourcc pixel formats, that are
achieved by storing data from the bus in RAM exactly as it arrives, only
possibly padding missing high or low bits. Such data acquisition mode
cannot change data endianness, therefore two locations with opposite
endianness are erroneous. This change might affest the omap1-camera driver,
existing configurations should be verified.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 20:15:43 -03:00
Lad, Prabhakar 54d5e4beb8 [media] davinic: vpss: trivial cleanup
this patch removes unnecessary header file inclusions and
fixes the typo's.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 20:08:54 -03:00
Lad, Prabhakar 0815469507 [media] media: davinci: vpbe: venc: move the enabling of vpss clocks to driver
The vpss clocks were enabled by calling a exported function from a driver
in a machine code. calling driver code from platform code is incorrect way.
This patch fixes this issue and calls the function from driver code itself.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 20:08:29 -03:00
Lad, Prabhakar 9a3e89b10f [media] media: davinci: vpss: enable vpss clocks
By default the VPSS clocks were enabled in capture driver
for davinci family which creates duplicates for dm355/dm365/dm644x.
This patch adds support to enable the VPSS clocks in VPSS driver,
which avoids duplication of code and also adding clock aliases.
This patch uses PM runtime API to enable/disable clock, instead
of DaVinci clock framework. con_ids for master and slave clocks of
vpss is added in pm_domain.
This patch cleanups the VPSS clock enabling in the capture driver,
and also removes the clock alias in machine file. Along side adds
a vpss slave clock for DM365 as mentioned by Sekhar
(https://patchwork.kernel.org/patch/1221261/).
The Suspend/Resume in dm644x_ccdc.c which enabled/disabled the VPSS clock
is now implemented as part of the VPSS driver.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 20:08:09 -03:00
Lad, Prabhakar 407ccc65bf [media] davinci: vpif: add pm_runtime support
Add pm_runtime support to the TI Davinci VPIF driver.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@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@redhat.com>
2013-04-14 20:07:15 -03:00
Sekhar Nori 3778d05036 [media] media: davinci: kconfig: fix incorrect selects
drivers/media/platform/davinci/Kconfig uses selects where
it should be using 'depends on'. This results in warnings of
the following sort when doing randconfig builds.
warning: (VIDEO_DM6446_CCDC && VIDEO_DM355_CCDC && VIDEO_ISIF && VIDEO_DAVINCI_VPBE_DISPLAY) selects VIDEO_VPSS_SYSTEM which has unmet direct dependencies (MEDIA_SUPPORT && V4L_PLATFORM_DRIVERS && ARCH_DAVINCI)
The VPIF kconfigs had a strange 'select' and 'depends on' cross
linkage which have been fixed as well by removing unneeded
VIDEO_DAVINCI_VPIF config symbol.
Similarly, remove the unnecessary VIDEO_VPSS_SYSTEM and
VIDEO_VPFE_CAPTURE. They don't select any independent functionality
and were being used to manage code dependencies which can
be handled using makefile.
Selecting video modules is now dependent on all ARCH_DAVINCI
instead of specific EVMs and SoCs earlier. This should help build
coverage. Remove unnecessary 'default y' for some config symbols.
While at it, fix the Kconfig help text to make it more readable
and fix names of modules created during module build.
Rename VIDEO_ISIF to VIDEO_DM365_ISIF as per suggestion from
Prabhakar.
This patch has only been build tested; I have tried to not break
any existing assumptions. I do not have the setup to test video,
so any test reports welcome.

Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
[prabhakar.csengg@gmail.com: Fixed typo]
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 20:06:36 -03:00
Vladimir Barinov b294a19214 [media] adv7180: fix querystd() method for no input signal
When the input signal is not detected querystd() method should return
V4L2_STD_UNKNOWN instead of previously latched analog video standard.

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 20:05:05 -03:00
Frank Schaefer 61ff5d69dc [media] em28xx: improve em2710/em2820 distinction
Chip id 18 is used by the em2710 and em2820.
The current code assumes that if the device is a camera, the chip is an em2710
and an em2820 otherwise.
But it turned out that the em2820 is also used in camera devices.
"Silvercrest 1.3 MPix" webcams for example are available with both chips.
Fortunately both variants are using different generic USD IDs which give us a
hint about the used chip.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 20:04:36 -03:00
Frank Schaefer 2b64cbd1da [media] em28xx: fix snapshot button support
The snapshot button support is currently broken, because module em28xx-rc is
loaded only if the device has remote control support.
Fix it by also loading this module if the device has a snapshot button.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 20:04:22 -03:00
Randy Dunlap 7c15b715ef [media] media: Fix randconfig error
Fix randconfig error when USB is not enabled:
ERROR: "usb_control_msg" [drivers/media/common/cypress_firmware.ko] undefined!

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 20:04:08 -03:00
Hans Verkuil 5854bf8859 [media] hdpvr: allow g/s/enum/querystd when in legacy mode
Both MythTV and gstreamer expect that they can set/get/query/enumerate the
standards, even if the input is the component input for which standards
really do not apply.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 20:02:15 -03:00
Hans Verkuil 3315c59a45 [media] hdpvr: add dv_timings support
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 20:00:55 -03:00
Hans Verkuil 8f69da9558 [media] hdpvr: add g/querystd, remove deprecated current_norm
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:59:44 -03:00
Hans Verkuil c7a2c84af5 [media] hdpvr: recognize firmware version 0x1e
This is the latest firmware version and - it seems - the most reliable.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:59:18 -03:00
Hans Verkuil 280847b532 [media] hdpvr: register the video node at the end of probe
Video nodes can be used at once after registration, so make sure the full
initialization is done before registering them.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:58:59 -03:00
Hans Verkuil 97caa318b3 [media] hdpvr: small fixes
- return EBUSY instead of EAGAIN.
- add missing break.
- remove unnecessary buf type check (done by the core).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:58:42 -03:00
Hans Verkuil 41022fcb3d [media] hdpvr: support device_caps in querycap
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:58:13 -03:00
Hans Verkuil 65fe42d605 [media] hdpvr: add prio and control event support
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:57:51 -03:00
Hans Verkuil ede197aac0 [media] hdpvr: remove hdpvr_fh and just use v4l2_fh
This prepares the driver for priority and control event handling.
This patch also checks for correct streaming ownership and it makes a
small improvement to the encoder_cmd ioctls: always zero 'flags' and
drop the memset of 'raw' as that is already done by the v4l2 core.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:57:32 -03:00
Hans Verkuil 99c77aa428 [media] hdpvr: convert to the control framework
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:57:10 -03:00
Hans Verkuil cd29ed853f [media] radio-si4713: add prio checking and control events
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Tested-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:55:38 -03:00
Hans Verkuil 03aa1bcd92 [media] radio-si4713: convert to the control framework
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Tested-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:55:22 -03:00
Hans Verkuil b387754d72 [media] radio-si4713: fix g/s_frequency
- check for invalid modulators.
- clamp frequency to valid range.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Tested-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:53:17 -03:00
Hans Verkuil 55b2a312c2 [media] radio-si4713: use V4L2 core lock
Simplify locking by using the V4L2 core lock mechanism. This allows us to
remove all locking from the i2c module. This will also simplify the upcoming
conversion to the control framework.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Tested-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:52:56 -03:00
Hans Verkuil a58841d0dc [media] radio-si4713: improve querycap
Set bus_info and fill in device_caps.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Tested-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:49:43 -03:00
Hans Verkuil fdf51599c0 [media] radio-si4713: embed struct video_device instead of allocating it
Also set the v4l2_dev pointer in struct video_device as this was missing.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Tested-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:49:25 -03:00
Hans Verkuil 91e20e8108 [media] radio-si4713: remove audout ioctls
The audout ioctls are not appropriate for radio transmitters, they apply to
video output devices only. Remove them from this driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Tested-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:48:52 -03:00
Hans Verkuil 3de09fbbfa [media] em28xx: fix kernel oops when watching digital TV
dvb->adapter.priv should also be set to the i2c bus since that's what
em28xx_tuner_callback expects.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:48:12 -03:00
Hans Verkuil 96b03d2a30 [media] v4l2: rename VIDIOC_DBG_G_CHIP_NAME to _CHIP_INFO
This ioctl will be extended to return more information than just the name.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:47:33 -03:00
Hans Verkuil 0f0fe4b9f6 [media] v4l2-ioctl: fill in name before calling vidioc_g_chip_name
That way drivers do not need to fill in the name themselves for bridge address 0.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:46:49 -03:00
Hans Verkuil 3eef25107c [media] v4l2: drop V4L2_CHIP_MATCH_SUBDEV_NAME
After using the new VIDIOC_DBG_G_CHIP_NAME ioctl I realized that the matching
by name possibility is useless. Just drop it and rename MATCH_SUBDEV_IDX to
just MATCH_SUBDEV.
The v4l2-dbg utility is much better placed to match by name by just enumerating
all bridge and subdev devices until chip_name.name matches.

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

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:45:23 -03:00
Hans Verkuil dfc2e12df0 [media] tuner-core/simple: get_rf_strength can be tuner mode specific
The get_rf_strength op in tuner-simple is valid only for the radio mode.
But due to the way get_signal in analog_demod_ops was designed it would
overwrite the signal value with a bogus value when in TV mode.
Pass a pointer to the signal value instead, and when not in radio mode
leave it alone in the tuner-simple.
This broke in commit 030755bde4
(tuner-core: call has_signal for both TV and radio) in kernel 3.6. Before
that this was working correctly. That commit did the right thing, but what
wasn't realized at the time was that tuner-simple should have been updated
as well to restrict setting the signal strength to the radio mode only.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:44:50 -03:00
Hans Verkuil a2192cf47f [media] tuner-core/tda9887: get_afc can be tuner mode specific
The get_afc op in tda9887 is valid only for the radio mode.
But due to the way get_afc in analog_demod_ops was designed it would
overwrite the afc value with a bogus value when in TV mode.
Pass a pointer to the afc value instead, and when not in radio mode
leave it alone in the tda9887.
This broke a long time ago in 2.6.19 when the get_afc op was introduced.
Before that the afc was only set for radio mode in the tda9887.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:43:40 -03:00
Ondrej Zary d047795c59 [media] saa7134: v4l2-compliance: clear reserved part of VBI structure
Make saa7134 driver more V4L2 compliant: clear reserved space of VBI
structure to make sure no garbage is left there

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:41:34 -03:00
Ondrej Zary 9cf21c47ca [media] saa7134: v4l2-compliance: remove bogus g_parm
Make saa7134 driver more V4L2 compliant: remove empty g_parm function

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:41:14 -03:00
Ondrej Zary 90a60e9074 [media] saa7134: v4l2-compliance: remove bogus audio input support
Make saa7134 driver more V4L2 compliant: remove empty g_audio and s_audio
functions and don't set audioset in enum_input

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:40:06 -03:00
Ondrej Zary ce5bdd5262 [media] saa7134: v4l2-compliance: fix g_tuner/s_tuner
Make saa7134 driver more V4L2 compliant: return real frequency range in
g_tuner and fail in s_tuner for non-zero tuner

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:27:09 -03:00
Ondrej Zary 0a5ea88b31 [media] saa7134: v4l2-compliance: return real frequency
Make saa7134 driver more V4L2 compliant: don't cache frequency in
s_frequency/g_frequency but return real one instead

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 19:00:28 -03:00
Ondrej Zary 3bbaa3a601 [media] saa7134: v4l2-compliance: use v4l2_fh to fix priority handling
Make saa7134 driver more V4L2 compliant: remove broken priority handling
and use v4l2_fh instead

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
[hans.verkuil@cisco.com: fixed a merge conflict in saa7134.h]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 18:59:34 -03:00
Ondrej Zary 8245670838 [media] saa7134: v4l2-compliance: don't report invalid audio modes for radio
Make saa7134 driver more V4L2 compliant: filter audio modes that came from
tuner - keep only MONO/STEREO in radio mode

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 18:53:38 -03:00
Ondrej Zary c3b3e0c5fd [media] saa7134: v4l2-compliance: implement V4L2_CAP_DEVICE_CAPS
Make saa7134 driver more V4L2 compliant: implement V4L2_CAP_DEVICE_CAPS support
and fix all capabilities problems reported by v4l2-compliance.

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

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 16:03:22 -03:00
Laurent Pinchart 97f212767a [media] mt9p031: Add support for regulators
Enable the regulators when powering the sensor up, and disable them when
powering it down.
The regulators are mandatory. Boards that don't allow controlling the
sensor power lines must provide fixed voltage regulators.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 16:02:58 -03:00
Laurent Pinchart 37b9f2117f [media] mt9p031: Use devm_* managed helpers
Replace kzalloc and gpio_request_one by their managed equivalents.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 15:59:35 -03:00
Laurent Pinchart 73254c30db [media] mt9m032: Define MT9M032_READ_MODE1 bits
Replace hardcoded values with #define's.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 15:58:45 -03:00
Laurent Pinchart a54b80b17a [media] mt9m032: Fix PLL setup
The MT9M032 PLL was assumed to be identical to the MT9P031 PLL but
differs significantly. Update the registers definitions and PLL limits
according to the datasheet.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 15:55:41 -03:00
Sylwester Nawrocki b54373c549 [media] exynos4-is: Disable debug trace by default in fimc-isp.c
Make sure the debug level is properly set initially so any debug
information is not printed to the kernel log without explicitly
enabling it.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 15:52:57 -03:00
Sylwester Nawrocki 03385b8e9d [media] exynos4-is: Remove meaningless test before bit setting
There is no need to check same bit before setting it, since we
always end up with a bit set. Remove some of the tests and make
set unconditional, in every place where all that needs to be done
is just setting a bit.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 15:52:39 -03:00
Sylwester Nawrocki 3530ef0a6e [media] exynos4-is: Rename the ISP chain configuration data structure
More appropriate names for the ISP chain data structure.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 15:51:56 -03:00
Sylwester Nawrocki a6f5635e63 [media] exynos4-is: Improve the ISP chain parameter count calculation
Instead of incrementing p_region_num field each time we set a bit
in the parameter mask calculate the number of bits set only when
this information is needed.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 15:50:31 -03:00
Sylwester Nawrocki 4c8f0629f5 [media] exynos4-is: Make fimc-lite independent of struct fimc_sensor_info
Make the sensor subdevs host_data hold a pointer to struct fimc_source_info,
which is defined in the driver's public header, rather than a pointer to
struct fimc_sensor_info which is specific to exynos4-is media device driver.
The purpose of this change is to allow easier reuse of the fimc-lite module
in the exynos5-is driver, which should similarly store a pointer to struct
fimc_source_info instance in the sensor's subdev host_data.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 15:48:44 -03:00
Sylwester Nawrocki 756e6e1448 [media] exynos4-is: Make fimc-lite independent of the pipeline->subdevs array
Get the sensor subdev by walking media graph in both cases: when the
device is used as a subdev only and through video node. This allows
to not dereference the pipeline->subdevs[] array and makes the module
more generic and easier to re-use in other media driver.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 15:47:44 -03:00
Sylwester Nawrocki 488f29d00e [media] exynos4-is: Move the subdev group ID definitions to public header
Move the sub-device group ID definitions to the driver's public header
so they are available to other media drivers that need to share modules
found in exynos4-is.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 15:46:40 -03:00
Sylwester Nawrocki 65fccab560 [media] s5p-mfc: Remove potential uninitialized variable usage
Make sure mem_info[] array is not used uninitialized. This prevents
following compiler warning:
drivers/media/platform/s5p-mfc/s5p_mfc.c: In function s5p_mfc_probe:
drivers/media/platform/s5p-mfc/s5p_mfc.c:1032:33: warning: mem_info[0] may be used uninitialized in this function [-Wuninitialized]
drivers/media/platform/s5p-mfc/s5p_mfc.c:1021:15: note: mem_info[0] was declared here
drivers/media/platform/s5p-mfc/s5p_mfc.c:1032:33: warning: mem_info[1] may be used uninitialized in this function [-Wuninitialized]
drivers/media/platform/s5p-mfc/s5p_mfc.c:1021:15: note: mem_info[1] was declared here

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14 15:45:58 -03:00
Al Viro 3af0761307 cx25821: sanitize cx25821_openfile_audio() a bit...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-13 16:48:24 -04:00
Al Viro 2ce8fce2ea cx25821: sanitize cx25821_get_audio_data() a bit
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-13 16:35:35 -04:00
Hans Verkuil abd50853d9 [media] s5c73m3: Fix s5c73m3-core.c compiler warning
Fix for this compiler warning:
CC [M]  drivers/media/i2c/s5c73m3/s5c73m3-core.o
drivers/media/i2c/s5c73m3/s5c73m3-core.c: In function ‘s5c73m3_load_fw’:
drivers/media/i2c/s5c73m3/s5c73m3-core.c:360:2: warning: format ‘%d’ expects
argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat]

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-12 12:41:28 -03:00
Kamil Debski a34026e75b [media] s5p-mfc: Add support for EOS command and EOS event in video decoder
Add support for V4L2_DEC_CMD_STOP command which will instruct MFC device
to finish decoding and release all remaining frames kept for reference to
the user. After dequeueing last decoded frame the driver will generate an
V4L2_EVENT_EOS event.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyngmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-12 12:38:56 -03:00
Masanari Iida a895d57da0 treewide: Fix typo in printks
Correct spelling typos in printk and comments.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-04-12 15:21:36 +02:00
Al Viro 75ef9de126 constify a bunch of struct file_operations instances
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:16:20 -04:00
Al Viro d9dda78bad procfs: new helper - PDE_DATA(inode)
The only part of proc_dir_entry the code outside of fs/proc
really cares about is PDE(inode)->data.  Provide a helper
for that; static inline for now, eventually will be moved
to fs/proc, along with the knowledge of struct proc_dir_entry
layout.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:13:32 -04:00
Peter Wiese 81e096c8ac [media] budget: Add support for Philips Semi Sylt PCI ref. design
Add support for Philips Semiconductor (now NXP) SAA7146
reference design DVB Sat card, using ALPS BSRU6 tuner.

[mchehab@redhat.com: Merge conflicts fix; email whitespacing unmangling]
Signed-off-by: Peter Wiese <peter.wiese@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 07:28:01 -03:00
Evgeny Plehov 4a74772e6d [media] cxd2820r_t2: Multistream support (MultiPLP)
MultiPLP filtering support for CXD2820r.

Signed-off-by: Evgeny Plehov <EvgenyPlehov@ukr.net>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 07:13:02 -03:00
Mauro Carvalho Chehab 752a62b2ec [media] cx24123: improve precision when calculating symbol rate ratio
Symbol rate ratio were using a rough calculus, as the code was
limited to 32 bits arithmetic. Change it to 64 bits, in order
to better estimate the bandwidth low-pass filter on the demod.
This should reduce the noise and improve reception.

Reported-by: Hans-Peter Jansen <hpj@urpla.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 07:12:44 -03:00
Mauro Carvalho Chehab 0562aef296 [media] mb86a20s: better name temp vars at mb86a20s_layer_bitrate()
Using 'i' for the guard interval temporary var is a bad idea, as
'i' is generally used by "anonymous" indexes.
Let's rename modulation, fec and guard interval temp vars with
a meaningful name, as that makes easier to understand the code
and avoids cut-and-paste types of error.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 07:12:19 -03:00
Mauro Carvalho Chehab b1f8933119 [media] mb86a20s: Fix estimate_rate setting
As reported by Dan Carpenter <dan.carpenter@oracle.com>:
        Smatch warnings:
        drivers/media/dvb-frontends/mb86a20s.c:644 mb86a20s_layer_bitrate() error: buffer overflow 'state->estimated_rate' 3 <= 3
What happens there is that estimate_rate index should be the layer
number, and not the guard interval.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 07:11:06 -03:00
Mauro Carvalho Chehab 5cb88ca84a [media] mb86a20s: Use 'layer' instead of 'i' on all places
We're using the anonymous 'i' to indicate the layer number
on several places on the driver. That's not good, as some
cut-and-paste type of change might be doing the wrong thing.
So, call it as "layer" everywhere.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 07:10:53 -03:00
Mauro Carvalho Chehab 41c6e9dd09 [media] mb86a20s: fix audio sub-channel check
As reported by Dan Carpenter <dan.carpenter@oracle.com>
FYI, there are new smatch warnings show up in:
	tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next master
	head:   da17d7bda957ae4697b6abc0793f74fb9b50b58f
	commit: 04fa725e7b [media] mb86a20s: Implement set_frontend cache logic
	New smatch warnings:
	drivers/media/dvb-frontends/mb86a20s.c:1897 mb86a20s_set_frontend() error: buffer overflow 'mb86a20s_subchannel' 8 <= 8
	04fa725e Mauro Carvalho Chehab 2013-03-04  1894  		if (c->isdbt_sb_subchannel > ARRAY_SIZE(mb86a20s_subchannel))
	04fa725e Mauro Carvalho Chehab 2013-03-04  1895  			c->isdbt_sb_subchannel = 0;
	04fa725e Mauro Carvalho Chehab 2013-03-04  1896
	04fa725e Mauro Carvalho Chehab 2013-03-04 @1897  		state->subchannel = mb86a20s_subchannel[c->isdbt_sb_subchannel];

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 07:10:33 -03:00
Mauro Carvalho Chehab 4f62a20dfb [media] mb86a20s: Use a macro for the number of layers
Instead of using the magic number "3", use NUM_LAYERS macro
on all places that are related to the ISDB-T layers.
This makes the source code a little more readable.
No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 07:10:17 -03:00
Ondrej Zary 1bacb2df3b [media] tda8290: change magic LNA config values to enum
Use enum instead of magic values for LNA config in tda8290.
Update tda827x, tda18271 and saa7134 to use the enum too.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 07:05:15 -03:00
Ondrej Zary 34fe2784b4 [media] saa7134: Add AverMedia A706 AverTV Satellite Hybrid+FM
Add AverMedia AverTV Satellite Hybrid+FM (A706) card to saa7134 driver.
Working: analog inputs, TV, FM radio and IR remote control.
Untested: DVB-S.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 07:04:30 -03:00
Ondrej Zary cdcd141c95 [media] tuner-core: Change config from unsigned int to void *
config looks like a hack that was added to tuner-core to allow some
configuration of TDA8290 tuner (it's not used by any other driver).
But with the new configuration options of tda8290 driver (no_i2c_gate
and std_map), it's no longer sufficient.
Change config to be void * instead, which allows passing tuner-dependent
config struct to drivers.
Also update saa7134 driver to reflect this change (no other driver uses this).

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 07:01:36 -03:00
Ondrej Zary 5b0e5350ce [media] tda8290: Allow custom std_map for tda18271
Allow specifying a custom std_map for tda18271 by external configuration.
This is required by cards that require custom std_map for analog TV or radio,
like AverMedia A706.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 07:01:15 -03:00
Ondrej Zary 2f719f7a9a [media] tda8290: Allow disabling I2C gate
Allow disabling I2C gate handling by external configuration.
This is required by cards that have all devices on a single I2C bus,
like AverMedia A706.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 07:00:47 -03:00
Mauro Carvalho Chehab 48a8a03b58 [media] cx88: kernel bz#9476: Fix tone setting for Nova-S+ model 92001
Hauppauge Nova-S-Plus DVB-S model 92001 does not lock on horizontal
polarisation. According with the info provided at the BZ, model
92002 does.

The difference is that, on model 92001, the tone select is done via
isl6421, while, on other devices, this is done via cx24123 code.
This patch adds a way to override the demod's set_tone at isl6421
driver. In order to avoid regressions, the override is enabled
only for cx88 Nova S plus model 92001. For all other models and
devices, the set_tone is provided by the demod driver.

Patch originally proposed at bz@9476[1] by Michel Meyers and
John Donoghue but applying the original patch would break support
for all other devices based on isl6421.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=9476

Tested-by: Adam Sampson <ats@offog.org>
Tested-by: Hans-Peter Jansen <hpj@urpla.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 06:56:47 -03:00
Jiri Slaby a9bd87c232 [media] MEDIA: ttusbir, fix double free
rc_unregister_device already calls rc_free_device to free the passed
device. But in one of ttusbir's probe fail paths, we call
rc_unregister_device _and_ rc_free_device. This is wrong and results
in a double free.
Instead, set rc to NULL resulting in rc_free_device being a noop.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 06:54:01 -03:00
Mauro Carvalho Chehab fde04ab95d [media] demux.h: Remove duplicated enum
"enum dmx_ts_pes" and "typedef enum dmx_pes_type_t" are just the
same enum declared twice, since Kernel (2.6.12). There's no reason
to duplicate it there, and sparse complains about that:
	drivers/media/dvb-core/dmxdev.c:600:55: warning: mixing different enum types
So, remove the internal define, keeping just the external one.
Internally, use only "enum dmx_ts_pes", as it is too late to drop
dmx_pes_type_t from the userspace API.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 06:53:15 -03:00
David S. Miller d978a6361a Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
	drivers/nfc/microread/mei.c
	net/netfilter/nfnetlink_queue_core.c

Pull in 'net' to get Eric Biederman's AF_UNIX fix, upon which
some cleanups are going to go on-top.

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-04-07 18:37:01 -04:00
Sylwester Nawrocki 9ea89e2b62 [media] exynos4-is: Ensure proper media pipeline state on device close
Make sure media_entity_pipeline_stop() is called on video device
close in cases where there was VIDIOC_STREAMON ioctl and no
VIDIOC_STREAMOFF. This patch fixes media entities stream_count
state which could prevent links from being disconnected, due to
non-zero stream_count.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-04 20:24:32 -03:00
Sylwester Nawrocki 439797980a [media] exynos4-is: Correct input DMA YUV order configuration
This patch fixes erroneous setup of the YUV order caused by not
clearing FIMC_REG_MSCTRL_ORDER422_MASK bit field before setting
proper FIMC_REG_MSCTRL_ORDER422 bits. This resulted in false
colors for YUYV, YVYU, UYVY, VYUY color formats, depending in
what sequence those were configured by user space.
YUV order definitions are corrected so that following convention
is used:
        | byte3 | byte2 | byte1 | byte0
 -------+-------+-------+-------+------
 YCBYCR | CR    | Y     | CB    | Y
 YCRYCB | CB    | Y     | CR    | Y
 CBYCRY | Y     | CR    | Y     | CB
 CRYCBY | Y     | CB    | Y     | CR

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

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-04 20:23:24 -03:00
Sylwester Nawrocki 9c8399c86c [media] exynos4-is: Use common driver data for all FIMC-LITE IP instances
There is no need to use separate variant data structure for each
FIMC-LITE IP instance. According to my knowledge there are no
differences across them on Exynos4 as well as Exynos5 SoCs. Drop
flite_variant data structure and use struct flite_drvdata instead.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-04 20:20:48 -03:00
Sylwester Nawrocki 8cec74c60b [media] exynos4-is: Remove static driver data for Exynos4210 FIMC variants
The Exynos platform will support only device tree based booting
from v3.10. The FIMC variant data will be parsed directly from
the device tree, hence the now unused static data can be removed.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-04 20:19:55 -03:00
Sylwester Nawrocki f998bb7ba9 [media] exynos4-is: Create media links for the FIMC-IS entities
Create disabled links from the FIMC-LITE subdevs to the FIMC-IS-ISP
subdev and from FIMC-IS-ISP to all FIMC subdevs.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-04 20:19:06 -03:00
Sylwester Nawrocki e781bbe3fe [media] exynos4-is: Add fimc-is subdevs registration
This patch adds support for registration of the FIMC-IS device
represented by the FIMC-IS-ISP subdev to the top level media device
driver. The FIMC-IS subsystem is available on Exynos4x12 SoCs which
support only device tree based booting.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-04 20:17:27 -03:00
Sylwester Nawrocki b8d9834a12 [media] exynos4-is: Add common FIMC-IS image sensor driver
This patch adds a common image sensor driver and Makefile/Kconfig
to enable compilation of the whole IS driver.
The sensor subdev driver currently only handles an image sensor's
power supplies and reset signal. There is no I2C communication as
it is handled by the ISP's firmware.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-04 20:14:01 -03:00
Sylwester Nawrocki 294781db46 [media] exynos4-is: Add FIMC-IS parameter region definitions
This patch adds the ISP processing parameters interface files.

Signed-off-by: Younghwan Joo <yhwan.joo@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-04 20:06:46 -03:00
Sylwester Nawrocki da114376d3 [media] exynos4-is: Add FIMC-IS ISP I2C bus driver
This patch adds the ISP I2C bus controller driver files.
Creating a standard I2C bus adapter, even if the driver doesn't
actually communicate with the hardware and it is instead
controlled by the ISP firmware running on the Cortex-A5, allows
to use standard hardware description in the device tree. As the
sensor would have actually had a standard V4L2 sub-device driver
run on the host CPU.
This approach allows to adapt the driver with a relatively small
effort should the Imaging Subsystem architecture change so that
the I2C bus is handled by the host's CPU OS, rather than the
internal FIMC-IS ARM CPU firmware. The image sensor driver could
be a standard I2C client driver, as in case of most existing
image sensors.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-04 20:04:49 -03:00
Sylwester Nawrocki 9a761e4368 [media] exynos4-is: Add Exynos4x12 FIMC-IS driver
This patch adds a set of core files of the Exynos4x12 FIMC-IS
V4L2 driver. This includes main functionality like allocating
memory, loading the firmware, FIMC-IS register interface and
host CPU <-> IS command and error code definitions.
The driver currently exposes a single subdev named FIMC-IS-ISP,
which corresponds to the FIMC-IS ISP and DRC IP blocks.
The FIMC-IS-ISP subdev currently supports only a subset of user
controls. For other controls we need several extensions at the
V4L2 API. The supported standard controls are:
brightness, contrast, saturation, hue, sharpness, 3a_lock,
exposure_time_absolute, white_balance_auto_preset,
iso_sensitivity, iso_sensitivity_auto, exposure_metering_mode.

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

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-04 19:57:13 -03:00