Commit Graph

14991 Commits

Author SHA1 Message Date
Antti Palosaari 70cf058aa9 [media] qt1010: remove debug register dump
I didn't found easy way to handle register dump only when needed so
remove it totally. It is quite useless and trivial function, every
developer could write new one in few minutes when needed.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 09:21:41 -03:00
Antti Palosaari 9d56f5d1ca [media] qt1010: convert for Kernel logging
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 09:21:07 -03:00
Antti Palosaari 0b8623cadd [media] gl861: reset_resume support
It survives now on reset_resume.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 09:19:43 -03:00
Antti Palosaari 7f12088798 [media] qt1010: do not change frequency during init
Changing cached frequency during init is something no-no.
Make it behave a little bit better. After that device could
survive from suspend/resume when streaming is ongoing.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 09:19:25 -03:00
Laurent Pinchart 3851c34a83 [media] uvcvideo: Remove outdated comment
The uvcvideo driver now supports USERPTR, and isn't limited to YUYV and
MJPEG anymore.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 09:17:36 -03:00
Richard Zhao 8d6214724b [media] media: coda: remove duplicated call of fh_to_ctx in vidioc_s_fmt_vid_out
Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Acked-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15 09:16:33 -03:00
Ben Hutchings 4b961180ef [media] rc: ite-cir: Initialise ite_dev::rdev earlier
ite_dev::rdev is currently initialised in ite_probe() after
rc_register_device() returns.  If a newly registered device is opened
quickly enough, we may enable interrupts and try to use ite_dev::rdev
before it has been initialised.  Move it up to the earliest point we
can, right after calling rc_allocate_device().

Reported-and-tested-by: YunQiang Su <wzssyqa@gmail.com>

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-14 14:04:16 -03:00
Julia Lawall 612cd9e874 [media] mt9m032.c: introduce missing initialization
The result of one call to a function is tested, and then at the second call
to the same function, the previous result, and not the current result, is
tested again.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression ret;
identifier f;
statement S1,S2;
@@

*ret = f(...);
if (\(ret != 0\|ret < 0\|ret == NULL\)) S1
... when any
*f(...);
if (\(ret != 0\|ret < 0\|ret == NULL\)) S2
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-14 11:10:59 -03:00
Julia Lawall b25b895805 [media] m5mols: introduce missing initialization
The result of one call to a function is tested, and then at the second call
to the same function, the previous result, and not the current result, is
tested again.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression ret;
identifier f;
statement S1,S2;
@@

*ret = f(...);
if (\(ret != 0\|ret < 0\|ret == NULL\)) S1
... when any
*f(...);
if (\(ret != 0\|ret < 0\|ret == NULL\)) S2
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-14 11:08:40 -03:00
Arnd Bergmann 293b2da1b6 ARM: pxa: move platform_data definitions
Platform data for device drivers should be defined in
include/linux/platform_data/*.h, not in the architecture
and platform specific directories.

This moves such data out of the pxa include directories

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Paul Parsons <lost.distance@yahoo.com>
Acked-by: Vinod Koul <vinod.koul@linux.intel.com>
Acked-By: Stefan Schmidt <stefan@openezx.org>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Daniel Ribeiro <drwyrm@gmail.com>
Cc: Harald Welte <laforge@openezx.org>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Cc: Tomas Cech <sleep_walker@suse.cz>
Cc: Sergey Lapin <slapin@ossfans.org>
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Dan Williams <djbw@fb.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Chris Ball <cjb@laptop.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Liam Girdwood <lrg@ti.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: openezx-devel@lists.openezx.org
2012-09-14 11:18:10 +02:00
Arnd Bergmann 82906b13a6 ARM: imx: move platform_data definitions
Platform data for device drivers should be defined in
include/linux/platform_data/*.h, not in the architecture
and platform specific directories.

This moves such data out of the imx include directories

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Sascha Hauer <kernel@pengutronix.de>
Acked-by: Vinod Koul <vinod.koul@linux.intel.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Dan Williams <djbw@fb.com>
Cc: "Ben Dooks (embedded platforms)" <ben-linux@fluff.org>
Cc: "Wolfram Sang (embedded platforms)" <w.sang@pengutronix.de>
Cc: Chris Ball <cjb@laptop.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Liam Girdwood <lrg@ti.com>
Cc: Javier Martin <javier.martin@vista-silicon.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
2012-09-14 11:17:21 +02:00
Arnd Bergmann ec2a0833e5 ARM: davinci: move platform_data definitions
Platform data for device drivers should be defined in
include/linux/platform_data/*.h, not in the architecture
and platform specific directories.

This moves such data out of the davinci include directories

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
Cc: "Ben Dooks" <ben-linux@fluff.org>
Cc: "Wolfram Sang" <w.sang@pengutronix.de>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Chris Ball <cjb@laptop.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Liam Girdwood <lrg@ti.com>
Cc: davinci-linux-open-source@linux.davincidsp.com
2012-09-14 11:16:54 +02:00
Frank Schäfer 780d61704c [media] gspca_pac7302: extend register documentation
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:54:49 -03:00
Frank Schäfer 0e68785db5 [media] gspca_pac7302: avoid duplicate calls of the image quality adjustment functions on capturing start
There is no need to call the image quality adjustment functions in sd_start.
The gspca main driver calls v4l2_ctrl_handler_setup in gspca_init_transfer,
which already applies all image control values.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:54:34 -03:00
Frank Schäfer f58e5cdf12 [media] gspca_pac7302: increase default value for white balance temperature
The current white balance temperature default value is 4, which is much too small (possible values are 0-255).
Improve the picture quality by increasing the default value to 55, which is the default value used by the Windows driver.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:54:12 -03:00
Frank Schäfer b1a19c0165 [media] gspca_pac7302: add sharpness control
The Windows driver uses page 0 register 0xb6 for sharpness adjustment.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:53:57 -03:00
Frank Schäfer db43b9ca2f [media] gspca_pac7302: make red balance and blue balance controls work again
Fix a regression from kernel 3.4 which has been introduced with the conversion of the gspca driver to the v4l2 control framework.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Cc: stable@kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:53:42 -03:00
Frank Schäfer 97d2fbf501 [media] gspca_pac7302: add support for device 1ae7:2001 Speedlink Snappy Microphone SL-6825-SBK
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Cc: stable@kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:53:26 -03:00
Hans de Goede 36adfca94a [media] gspca: Fix input urb creation / destruction surrounding suspend resume
1) We always re-create the input-urb on resume, so we must also always
   destroy it on suspend to avoid leaking it
2) If we're going to do an init_transfer, then that will destroy the urb
   before starting the stream (nop if there is none), and (re-)create it
   once the stream is started. So there is little use in creating it, if
   we're going to do an init_transfer immediately afterward

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:53:10 -03:00
Hans de Goede 844db450e6 [media] gspca: Update / fix various comments wrt workqueue usb_lock usage
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:52:58 -03:00
Hans de Goede ff8f25d326 [media] gspca_finepix: Remove unnecessary lock/unlock call
gspca_main: init_transfer does not do anything between calling sd_start
(which starts the workqueue) and releasing the usb_lock, so this
synchronization is a nop, remove it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:44:34 -03:00
Hans de Goede 345321dc9c [media] gspca: Don't set gspca_dev->dev to NULL before stop0
In commit a3d6e8cc0e gspca_dev->dev is set
to NULL on disconnect, before calling stop0. The plan was to get rid of
gspca_dev->present and instead simply check for gspca_dev->dev everywhere
where we were checking for present. This should be race free since all users
of gspca_dev->dev hold the usb_lock, or so I thought.

But I was wrong, drivers which use a work-queue + synchronous bulk transfers
to get the video data don't hold the usb_lock while doing so, their stop0
callbacks stop the workqueue, so they won't be using gspca_dev->dev anymore
after the stop0 call, but they might be dereferincing it before, so we should
not set gspca_dev->dev to NULL on disconnect before calling stop0.

This also means that the workqueue functions in these drivers cannot
use gspca_dev->dev to check if they need to stop because of disconnection,
so we will need to keep gspca_dev->present around, and set that to 0 on
disconnect, before calling stop0. Unfortunately as part of the plan to remove
gspca_dev->present, these workqueues where already moved over to checking
for gspca_dev->dev instead of gspca_dev->present as part of commit
254902b01d, so this patch also reverts those
parts of that commit.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:42:17 -03:00
Peter Senna Tschudin 8c96f0a207 [media] drivers/media/usb/gspca/cpia1.c: fix error return code
Convert a nonnegative error return code to a negative one, as returned
elsewhere in the function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}

// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:42:16 -03:00
Emil Goode 50c457a950 [media] gspca: dubious one-bit signed bitfield
This patch changes some signed integers to unsigned because
they are not intended for negative values and sparse
is making noise about it.

Sparse gives eight of these errors:
drivers/media/usb/gspca/ov519.c:144:29: error: dubious one-bit signed bitfield

Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:42:15 -03:00
Ezequiel Garcia 4a7ec2db26 [media] pwc: Remove unneeded struct vb2_queue clearing
struct vb2_queue is allocated through kzalloc as part of a larger struct,
there's no need to clear it.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:42:15 -03:00
Ezequiel Garcia 0ab61196e5 [media] pwc: Use vb2 queue mutex through a single name
This lock was being taken using two different names
(pointers) in the same function.
Both names refer to the same lock,
so this wasn't an error; but it looked very strange.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:42:14 -03:00
Mauro Carvalho Chehab 1f71927ed5 [media] shark,shark2: declare resume/suspend functions as static
drivers/media/radio/shark2.o: In function `_GLOBAL__sub_I_65535_0_usb_shark_suspend':
drivers/media/radio/radio-shark2.c:344: multiple definition of `usb_shark_suspend'
drivers/media/radio/radio-shark.o:/home/v4l/v4l/patchwork/drivers/media/radio/radio-shark.c:379: first defined here
drivers/media/radio/shark2.o: In function `usb_shark_resume':
drivers/media/radio/radio-shark2.c:349: multiple definition of `usb_shark_resume'
drivers/media/radio/radio-shark.o:/home/v4l/v4l/patchwork/drivers/media/radio/radio-shark.c:384: first defined here

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:42:13 -03:00
Hans de Goede 559c200900 [media] radio-shark: Add support for suspend & resume
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:42:12 -03:00
Hans de Goede d1f280d615 [media] radio-shark2: Add support for suspend & resume
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:42:11 -03:00
Hans de Goede d7aab0bf9d [media] radio-tea5777: Add support for tuning AM
This completes my work on the Griffin radioSHARK2 driver, let me use this
opportunity to thank Hisaaki Shibata for his generous donation of a
Griffin radioSHARK2 to me, which has made this driver possible.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:42:10 -03:00
Hans de Goede 4fad5c474f [media] radio-tea5777.c: Get rid of do_div usage
freq fits easily into 32 bits until it gets shifted, so make it 32 bits,
and cast it to 64 bits before shifting.

[mchehab@redhat.com: also remove asm/div64.h header, as this is not
 needed anymore]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:42:09 -03:00
Hans de Goede fc488517cc [media] snd_tea575x: Add support for tuning AM
Add support for tuning AM (on devices with the necessary additional
hardware components), and advertise the available bands using the new
VIDIOC_ENUM_FREQ_BANDS ioctl.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
CC: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:42:09 -03:00
Reinhard Nissl 226143f96f [media] stb0899: return internally tuned frequency via get_frontend.
Am 14.08.2012 14:05, schrieb Manu Abraham:
>> My other device, a STB0899, always reports the set frequency. So it seems
>> driver dependent whether it reports the actually locked frequency found by
>> the zig-zag-algorithm or just the set frequency to tune to.
>
> The STV0299 blindly sets the value based on a software zigzag (due to simpler
> hardware), but this might not be accurate enough. On the other hand, the
> STB0899 internally does zig-zag in hardware for DVB-S2, and partly in
> software for DVB-S.
>
> In any event, the get_frontend callback should return the value that is read
> from the demodulator registers, rather than the cached original value that
> which was requested to be tuned.
>
> The stb0899 returns only the cached value IIRC. Maybe I will fix this soon,
> or maybe you can send a patch.
This is what I get after the patch:

Sat.    Pol.    Band    Freq (MHz) Set    Freq (MHz) Get    Delta (MHz)
S19,2E    H     L       10744             10748,474         4,474
S19,2E    H     L       10773             10777,944         4,944
S19,2E    H     L       10832             10836,953         4,953
S19,2E    H     L       10861             10868,774         7,774
...

Signed-off-by: Reinhard Nißl <rnissl@gmx.de>
Cc: Manu Abraham <abraham.manu@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:42:07 -03:00
Laurent Pinchart 5266c98b15 [media] mt9p031: Fix horizontal and vertical blanking configuration
Compute the horizontal blanking value according to the datasheet. The
value written to the hblank and vblank registers must be equal to the
number of blank columns and rows minus one.

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>
2012-09-13 16:29:49 -03:00
Laurent Pinchart 9ec670e2aa [media] mt9v032: Export horizontal and vertical blanking as V4L2 controls
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 16:29:31 -03:00
Laurent Pinchart e9a50e4c2d [media] mt9v032: Provide link frequency control
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>
2012-09-13 16:29:07 -03:00
Sakari Ailus 41a33a00e8 [media] mt9v032: Provide pixel rate control
Provide pixel rate control calculated from external clock and horizontal
binning factor.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 16:26:05 -03:00
Laurent Pinchart 03d5285b8b [media] v4l2-ctrls: Add v4l2_ctrl_[gs]_ctrl_int64()
These helper functions get and set a 64-bit control's value from within
a driver. They are similar to v4l2_ctrl_[gs]_ctrl() but operate on
64-bit integer controls instead of 32-bit controls.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 16:23:36 -03:00
Hans Verkuil 117a55b69d [media] ad9389b: driver for the Analog Devices AD9389B video encoder
Initial version of this driver.

The full datasheets are available from the Analog Devices website:

  http://ez.analog.com/docs/DOC-1741

Not all features of the receiver are supported by this driver for various
reasons. Most notably:

- No CEC support (the CEC API needs a lot more discussion)
- No HDCP repeater support (we don't use that either)

I'm sure that there are more things missing, but this driver does work
well for our hardware.

Note that I am using the register addresses instead of register names: the
datasheet containing the register descriptions is organized by register
address. Using names would make the datasheet lookup very hard. An attempt
was made to try and document what is being done when registers are used
instead.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 16:15:36 -03:00
Hans Verkuil 54450f591c [media] adv7604: driver for the Analog Devices ADV7604 video decoder
Initial version of this driver.

The full datasheets are available from the Analog Devices website:

  http://ez.analog.com/docs/DOC-1545

Not all features of the receiver are supported by this driver for various
reasons. Most notably:

- No CEC support (the CEC API needs a lot more discussion)
- Only port A of the four HDMI input ports is implemented (our hardware only
  uses that port)
- No HDCP repeater support (we don't use that either)

And since there are some 600-odd pages of datasheet for this single device,
I'm sure that there are many more things missing, but this driver does work
well for our hardware.

Note that I am using the register addresses instead of register names: the
datasheet containing the register descriptions is organized by register
address. Using names would make the datasheet lookup very hard. An attempt
was made to try and document what is being done when registers are used
instead.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 16:13:47 -03:00
Hans Verkuil c61bd6a0e2 [media] v4l2-common: add CVT and GTF detection functions
These two helper functions detect whether the analog video timings detected
by the video receiver match the VESA CVT or GTF standards.

They basically do the inverse of the CVT and GTF modeline calculations.

This patch also adds a helper function that will determine the aspect ratio
based on the provided EDID values. This aspect ratio can be given to the GTF
helper function.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 16:09:59 -03:00
Hans Verkuil c2a667fa2b [media] v4l2-common: add v4l_match_dv_timings
Add the v4l_match_dv_timings function that can be used to compare two
v4l2_dv_timings structs.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 16:08:22 -03:00
Hans Verkuil 977ebec754 [media] v4l2-ctrls.c: add support for the new DV controls
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 16:08:03 -03:00
Hans Verkuil ed45ce2cc0 [media] v4l2-subdev: add support for the new edid ioctls
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 16:07:24 -03:00
Antti Palosaari faedc36377 [media] dvb-usb: remove unused files
Those files were left from dvb-usb-v2 development as I have made
mistake during rebase operation.

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 13:37:36 -03:00
Antti Palosaari 7fa8694acf [media] dvb_usb_v2: use ratelimited debugs where appropriate
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 13:37:09 -03:00
Bjorn Helgaas 78890b5989 Merge commit 'v3.6-rc5' into next
* commit 'v3.6-rc5': (1098 commits)
  Linux 3.6-rc5
  HID: tpkbd: work even if the new Lenovo Keyboard driver is not configured
  Remove user-triggerable BUG from mpol_to_str
  xen/pciback: Fix proper FLR steps.
  uml: fix compile error in deliver_alarm()
  dj: memory scribble in logi_dj
  Fix order of arguments to compat_put_time[spec|val]
  xen: Use correct masking in xen_swiotlb_alloc_coherent.
  xen: fix logical error in tlb flushing
  xen/p2m: Fix one-off error in checking the P2M tree directory.
  powerpc: Don't use __put_user() in patch_instruction
  powerpc: Make sure IPI handlers see data written by IPI senders
  powerpc: Restore correct DSCR in context switch
  powerpc: Fix DSCR inheritance in copy_thread()
  powerpc: Keep thread.dscr and thread.dscr_inherit in sync
  powerpc: Update DSCR on all CPUs when writing sysfs dscr_default
  powerpc/powernv: Always go into nap mode when CPU is offline
  powerpc: Give hypervisor decrementer interrupts their own handler
  powerpc/vphn: Fix arch_update_cpu_topology() return value
  ARM: gemini: fix the gemini build
  ...

Conflicts:
	drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
	drivers/rapidio/devices/tsi721.c
2012-09-13 08:41:01 -06:00
Tony Lindgren ec2c0825ca ARM: OMAP2+: Remove hardcoded IRQs and enable SPARSE_IRQ
Remove hardcoded IRQs in irqs.h and related files as these
are no longer needed.

Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-09-12 18:06:30 -07:00
Mauro Carvalho Chehab 64cbeb2818 [media] au0828, cx231xx: remove dependency for DVB_CAPTURE_DRIVERS
This symbol got removed by menu reorganization; just depending on
DVB_CORE is enough.

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-12 08:13:13 -03:00
Alexey Khoroshilov f4e4a67a37 [media] ddbridge: fix error handling in module_init_ddbridge()
If pci_register_driver() failed, resources allocated in
ddb_class_create() are leaked. The patch fixes it
as well as it replaces -1 with correct error code
in ddb_class_create().

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

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-11 15:29:00 -03:00
Anton Nurkin 4b83a7a753 [media] cx23885: fix pointer to structure for CAM
Fixes problem with CAM, when  after re-iinitialization
CAM used old pointer to structure.

Signed-off-by: Anton Nurkin <ptqa@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-10 11:53:50 -03:00
Antti Palosaari 0a23dc24cd [media] rtl2832: remove dummy callback implementations
Let the dvb-frontend return -ENOTTY for those unimplemented IOCTLs.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-10 11:31:59 -03:00
Antti Palosaari 177ffe506c [media] dvb_frontend: return -ENOTTY for unimplement IOCTL
Earlier it was returning -EOPNOTSUPP.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-10 11:14:35 -03:00
Antti Palosaari 36bdbc3fff [media] dvb_frontend: use Kernel dev_* logging
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-10 11:13:23 -03:00
Stephen Hemminger 1d3520357d make drivers with pci error handlers const
Covers the rest of the uses of pci error handler.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-09-07 16:35:00 -06:00
Mauro Carvalho Chehab 1daae517b3 [media] move i2c files into drivers/media/i2c
Based on a patch from Sylvester Nawrocki

This fixes regression introduced with commmit cb7a01ac32,
"[media] move i2c files into drivers/media/i2c".

The linked order affect what drivers will be initialized first, when
they're built-in at Kernel. While there are macros that allow changing
the init order, like subsys_initcall(), late_initcall() & friends,
when all drivers  linked belong to the same subsystem, it is easier
to change the order at the Makefile.

All I2C modules must be linked before any drivers that actually use it,
in order to ensure proper module initialization order.

Also, the core drivers should be initialized before the drivers that use
them.

This patch reorders the drivers init, in order to fulfill the above
requirements.

Reported-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Acked-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-06 18:42:54 -03:00
Mauro Carvalho Chehab 79e8c7bebb Linux 3.6-rc3
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQEcBAABAgAGBQJQNUEyAAoJEHm+PkMAQRiGs+sH/iLtdAVcfBfUwdmGV0qDXbVE
 L3gCg3IERPCSaQo8qsT3zujdLAQ2HsiMs73jbqJaBWSV16ZMqkglRKbn+QMGpqJV
 bi/pf5Akrm9IL/u+427ycB8QxzyjGal8uJ6btuwXa03VROSfOsEiQbtsByFNaDv/
 8oq0/DaE8mWRedlcAaeN+l8nD4Enb2jSKp0UADkBMnUr4KCbwSVQ+ITXAggqVq23
 htA3Yt0oGf1JYq+k99D5k92h0I/4VwiorUgwPKhmS5DM9gVtJ4L+SigbekS/MFq+
 huyzOHRWlO++OxBlgSTMuJAE1k/G2B7tGeoERY0tEL/hAWcKYTfGIXSc7X6JvM0=
 =Dmsv
 -----END PGP SIGNATURE-----

Merge tag 'v3.6-rc3' into staging/for_v3.7

Linux 3.6-rc3

* tag 'v3.6-rc3': (764 commits)
  Linux 3.6-rc3
  task_work: add a scheduling point in task_work_run()
  fs: fix fs/namei.c kernel-doc warnings
  eventpoll: use-after-possible-free in epoll_create1()
  vfio: grab vfio_device reference *before* exposing the sucker via fd_install()
  vfio: get rid of vfio_device_put()/vfio_group_get_device* races
  vfio: get rid of open-coding kref_put_mutex
  introduce kref_put_mutex()
  vfio: don't dereference after kfree...
  fbcon: fix race condition between console lock and cursor timer (v1.1)
  mm: compaction: Abort async compaction if locks are contended or taking too long
  mm: have order > 0 compaction start near a pageblock with free pages
  rapidio/tsi721: fix unused variable compiler warning
  rapidio/tsi721: fix inbound doorbell interrupt handling
  drivers/rtc/rtc-rs5c348.c: fix hour decoding in 12-hour mode
  mm: correct page->pfmemalloc to fix deactivate_slab regression
  drivers/rtc/rtc-pcf2123.c: initialize dynamic sysfs attributes
  mm/compaction.c: fix deferring compaction mistake
  drivers/misc/sgi-xp/xpc_uv.c: SGI XPC fails to load when cpu 0 is out of IRQ resources
  string: do not export memweight() to userspace
  ...
2012-08-24 11:25:10 -03:00
Linus Torvalds a484147a52 Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab:
 "For bug fixes, at soc_camera, si470x, uvcvideo, iguanaworks IR driver,
  radio_shark Kbuild fixes, and at the V4L2 core (radio fixes)."

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] media: soc_camera: don't clear pix->sizeimage in JPEG mode
  [media] media: mx2_camera: Fix clock handling for i.MX27
  [media] video: mx2_camera: Use clk_prepare_enable/clk_disable_unprepare
  [media] video: mx1_camera: Use clk_prepare_enable/clk_disable_unprepare
  [media] media: mx3_camera: buf_init() add buffer state check
  [media] radio-shark2: Only compile led support when CONFIG_LED_CLASS is set
  [media] radio-shark: Only compile led support when CONFIG_LED_CLASS is set
  [media] radio-shark*: Call cancel_work_sync from disconnect rather then release
  [media] radio-shark*: Remove work-around for dangling pointer in usb intfdata
  [media] Add USB dependency for IguanaWorks USB IR Transceiver
  [media] Add missing logging for rangelow/high of hwseek
  [media] VIDIOC_ENUM_FREQ_BANDS fix
  [media] mem2mem_testdev: fix querycap regression
  [media] si470x: v4l2-compliance fixes
  [media] DocBook: Remove a spurious character
  [media] uvcvideo: Reset the bytesused field when recycling an erroneous buffer
2012-08-21 16:54:38 -07:00
Mauro Carvalho Chehab a47b6118e1 Makefile: Add missing soc_camera/ directory
drivers/built-in.o: In function `imx074_s_power':
imx074.c:(.text+0x1de93d0): undefined reference to `soc_camera_power_on'
imx074.c:(.text+0x1de93f3): undefined reference to `soc_camera_power_off'
drivers/built-in.o: In function `mt9m001_s_mbus_config':

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 19:49:50 -03:00
Mauro Carvalho Chehab b4c723e610 [media] saa7164: Add dependency for V4L2 core
As Reported by Randy:

> drivers/built-in.o: In function `fops_open':
> saa7164-encoder.c:(.text+0x68ed6f): undefined reference to `video_devdata'
> drivers/built-in.o: In function `fill_queryctrl.clone.4':
> saa7164-encoder.c:(.text+0x68f657): undefined reference to `v4l2_ctrl_query_fill'
> saa7164-encoder.c:(.text+0x68f6a9): undefined reference to `v4l2_ctrl_query_fill'
> saa7164-encoder.c:(.text+0x68f6e0): undefined reference to `v4l2_ctrl_query_fill'
> saa7164-encoder.c:(.text+0x68f71a): undefined reference to `v4l2_ctrl_query_fill'
> saa7164-encoder.c:(.text+0x68f73a): undefined reference to `v4l2_ctrl_query_fill'
> drivers/built-in.o:saa7164-encoder.c:(.text+0x68f757): more undefined references to `v4l2_ctrl_query_fill' follow
> drivers/built-in.o: In function `saa7164_encoder_register':
> (.text+0x68fff7): undefined reference to `video_device_alloc'
> drivers/built-in.o: In function `saa7164_encoder_register':
> (.text+0x690073): undefined reference to `video_device_release'
> drivers/built-in.o: In function `saa7164_encoder_register':
> (.text+0x6900a1): undefined reference to `__video_register_device'
> drivers/built-in.o: In function `saa7164_encoder_unregister':
> (.text+0x690243): undefined reference to `video_unregister_device'
> drivers/built-in.o: In function `saa7164_encoder_unregister':
> (.text+0x690269): undefined reference to `video_device_release'
> drivers/built-in.o: In function `fops_open':
> saa7164-vbi.c:(.text+0x69125f): undefined reference to `video_devdata'
> drivers/built-in.o: In function `fill_queryctrl.clone.4':
> saa7164-vbi.c:(.text+0x6919b4): undefined reference to `v4l2_ctrl_query_fill'
> saa7164-vbi.c:(.text+0x6919ee): undefined reference to `v4l2_ctrl_query_fill'
> saa7164-vbi.c:(.text+0x691a23): undefined reference to `v4l2_ctrl_query_fill'
> saa7164-vbi.c:(.text+0x691a47): undefined reference to `v4l2_ctrl_query_fill'
> saa7164-vbi.c:(.text+0x691a6a): undefined reference to `v4l2_ctrl_query_fill'
> drivers/built-in.o:saa7164-vbi.c:(.text+0x691a87): more undefined references to `v4l2_ctrl_query_fill' follow
> drivers/built-in.o: In function `saa7164_vbi_register':
> (.text+0x69220e): undefined reference to `video_device_alloc'
> drivers/built-in.o: In function `saa7164_vbi_register':
> (.text+0x69228a): undefined reference to `video_device_release'
> drivers/built-in.o: In function `saa7164_vbi_register':
> (.text+0x6922bb): undefined reference to `__video_register_device'
> drivers/built-in.o: In function `saa7164_vbi_unregister':
> (.text+0x6923de): undefined reference to `video_unregister_device'
> drivers/built-in.o: In function `saa7164_vbi_unregister':
> (.text+0x6923f9): undefined reference to `video_device_release'
> drivers/built-in.o:(.rodata+0xb1054): undefined reference to `video_ioctl2'
> drivers/built-in.o:(.rodata+0xb17d4): undefined reference to `video_ioctl2'

That's due to the lack of an explicit Kconfig dependency for the V4L2 core.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 08:41:08 -03:00
Mauro Carvalho Chehab 01b0c11a1b [media] Kconfig: Fix b2c2 common code selection
As reported by Randy:

> flexcop-pci.c:(.text+0x19af63): undefined reference to `flexcop_device_exit'
> flexcop-pci.c:(.text+0x19af77): undefined reference to `flexcop_device_kfree'
> flexcop-pci.c:(.text+0x19b10f): undefined reference to `flexcop_pass_dmx_packets'
> flexcop-pci.c:(.text+0x19b182): undefined reference to `flexcop_pass_dmx_data'
> flexcop-pci.c:(.text+0x19b1ae): undefined reference to `flexcop_pass_dmx_data'
> flexcop-pci.c:(.text+0x19b1f8): undefined reference to `flexcop_device_kmalloc'
> flexcop-pci.c:(.text+0x19b256): undefined reference to `flexcop_i2c_request'
> flexcop-pci.c:(.text+0x19b261): undefined reference to `flexcop_eeprom_check_mac_addr'
> flexcop-pci.c:(.text+0x19b2c6): undefined reference to `flexcop_device_initialize'
> flexcop-pci.c:(.text+0x19b332): undefined reference to `flexcop_sram_set_dest'
> flexcop-pci.c:(.text+0x19b348): undefined reference to `flexcop_sram_set_dest'
> flexcop-pci.c:(.text+0x19b3f8): undefined reference to `flexcop_device_exit'
> flexcop-pci.c:(.text+0x19b408): undefined reference to `flexcop_device_kfree'
> flexcop-pci.c:(.text+0x19b4a2): undefined reference to `flexcop_pid_feed_control'
> flexcop-pci.c:(.text+0x19b4d7): undefined reference to `flexcop_pid_feed_control'
>
> since it is possible to enable DVB_B2C2_FLEXCOP_PCI
> when CONFIG_I2C is not enabled, but then DVB_B2C2_FLEXCOP
> is not enabled because I2C is not enabled.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 08:38:31 -03:00
Hans Verkuil 090836dd81 [media] Fix vino compilation
A trivial fix so that vino can find the saa7191.h header.

[mchehab@redhat.com: Fix merge conflict]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 08:33:39 -03:00
Mauro Carvalho Chehab e9d2f0573e [media] Add missing help for some menuconfig items
Help was missing during some items reorganization. Add them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 08:17:37 -03:00
Mauro Carvalho Chehab 8511f8eaa8 [media] flexcop: Show the item to enable debug after the driver
Instead of showing the option to show debug at the end, show
it after each driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 08:05:33 -03:00
Mauro Carvalho Chehab fccea74ff8 [media] Kconfig: merge all customise options into just one
Instead of having 3 options to allow customizing the media
sub-drivers (tuners, I2C drivers, frontends), merge all of
them into just one.

That simplifies the life for users, as they can just keep
this untouched.

Life for developers is also simpler, as there's now just
one Kconfig item to remember, for the ancillary sub-drivers
providing supports for chips that could change from one
board design to another.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 08:05:06 -03:00
Mauro Carvalho Chehab fc2bbfb2c3 [media] Kconfig: use menuconfig instead of menu
This allows disabling all drivers of a certain type as a hole

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 08:01:43 -03:00
Mauro Carvalho Chehab b6334460f2 [media] Cleanup media Kconfig files
- get rid of ridden V4L2_COMMON symbol

  This symbol is not needed anymore; it can be folded with V4L2
  one, simplifying the Kconfig a little bit;

- Comment why some Kconfig items are needed;

- Remove if test for MEDIA_CAMERA_SUPPORT, replacing it by
  depends on.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 07:55:47 -03:00
Mauro Carvalho Chehab 7a46e188bf [media] Put the test devices together
Vivi is not that important to appear at the main menu, so move it
to its own submenu. Also, the mem2mem test device driver is
similar to vivi. So, put both at the same menu.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 07:51:49 -03:00
Mauro Carvalho Chehab 3c8c09b5ed [media] Kconfig reorganization
Reorganize the Kconfig order, for it to be a little more intuitive.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 07:50:55 -03:00
Mauro Carvalho Chehab b47ff4a3ed [media] move soc_camera to its own directory
That helps to better organize the soc_camera items.

While here, cleanup Makefiles, removing uneeded include dirs.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 07:49:12 -03:00
Mauro Carvalho Chehab 7ba2f84159 sh_mobile_csi2: move it to the right place
make[4]: *** No rule to make target `drivers/media/platform/sh_mobile_csi2.c',
	needed by `drivers/media/platform/sh_mobile_csi2.o'.  Stop.

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 07:39:30 -03:00
Tejun Heo 43829731dd workqueue: deprecate flush[_delayed]_work_sync()
flush[_delayed]_work_sync() are now spurious.  Mark them deprecated
and convert all users to flush[_delayed]_work().

If you're cc'd and wondering what's going on: Now all workqueues are
non-reentrant and the regular flushes guarantee that the work item is
not pending or running on any CPU on return, so there's no reason to
use the sync flushes at all and they're going away.

This patch doesn't make any functional difference.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Mattia Dongili <malattia@linux.it>
Cc: Kent Yoder <key@linux.vnet.ibm.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Bryan Wu <bryan.wu@canonical.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Alasdair Kergon <agk@redhat.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-wireless@vger.kernel.org
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: Sangbeom Kim <sbkim73@samsung.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Petr Vandrovec <petr@vandrovec.name>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Avi Kivity <avi@redhat.com>
2012-08-20 14:51:24 -07:00
Greg Kroah-Hartman e694d51888 USB: spca506: remove __devinit* from the struct usb_device_id table
This structure needs to always stick around, even if CONFIG_HOTPLUG
is disabled, otherwise we can oops when trying to probe a device that
was added after the structure is thrown away.

Thanks to Fengguang Wu and Bjørn Mork for tracking this issue down.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Bjørn Mork <bjorn@mork.no>
Cc: stable <stable@vger.kernel.org>
CC: Hans de Goede <hdegoede@redhat.com>
CC: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-17 17:50:44 -07:00
Greg Kroah-Hartman ec06335168 USB: jl2005bcd: remove __devinit* from the struct usb_device_id table
This structure needs to always stick around, even if CONFIG_HOTPLUG
is disabled, otherwise we can oops when trying to probe a device that
was added after the structure is thrown away.

Thanks to Fengguang Wu and Bjørn Mork for tracking this issue down.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Bjørn Mork <bjorn@mork.no>
Cc: stable <stable@vger.kernel.org>
CC: Hans de Goede <hdegoede@redhat.com>
CC: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-17 17:50:44 -07:00
Greg Kroah-Hartman d04dbd1c0e USB: smsusb: remove __devinit* from the struct usb_device_id table
This structure needs to always stick around, even if CONFIG_HOTPLUG
is disabled, otherwise we can oops when trying to probe a device that
was added after the structure is thrown away.

Thanks to Fengguang Wu and Bjørn Mork for tracking this issue down.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Bjørn Mork <bjorn@mork.no>
Cc: stable <stable@vger.kernel.org>
CC: Mauro Carvalho Chehab <mchehab@infradead.org>
CC: Michael Krufky <mkrufky@linuxtv.org>
CC: Paul Gortmaker <paul.gortmaker@windriver.com>
CC: Doron Cohen <doronc@siano-ms.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-17 17:50:44 -07:00
Mauro Carvalho Chehab 9b78c5a300 [media] b2c2: export b2c2_flexcop_debug symbol
ERROR: "b2c2_flexcop_debug" [drivers/media/pci/b2c2/b2c2-flexcop-pci.ko] undefined!

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-17 11:09:19 -03:00
Mauro Carvalho Chehab 88f8472c9f [media] Fix some Makefile rules
On a few places, := were using instead of +=, causing drivers to
not compile.

While here, standardize the usage of += on all cases where multiple
lines are needed, and for obj-y/obj-m targets, and := when just one
line is needed, on <module>-obj rules.

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Identified-by: Antti Polosaari <crope@iki.fi>
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-16 19:55:03 -03:00
Anton Nurkin 893430558e [media] cx23885-cards: fix netup card default revision
Netup cards revision 1 are not manufactured anymore.
So, rev. 4 should be default.

Signed-off-by: Anton Nurkin <ptqa@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 20:23:30 -03:00
Albert Wang a70a6c4330 [media] media: soc_camera: don't clear pix->sizeimage in JPEG mode
In JPEG mode, the size of image is variable due to different JPEG compression
rate. We only can get the pix->sizeimage from the user.

If we clear pix->sizeimage in soc_camera_try_fmt() then we will get it from:
	ret = soc_mbus_image_size(xlate->host_fmt, pix->bytesperline,
				pix->height);
	if (ret < 0)
		return ret;

	pix->sizeimage = max_t(u32, pix->sizeimage, ret);

In general, this sizeimage will be larger than the actul JPEG image size.

But vb2 will check the buffer and size of image in __qbuf_userptr():
	/* Check if the provided plane buffer is large enough */
	if (planes[plane].length < q->plane_sizes[plane])

So we shouldn't clear the pix->sizeimage and also shouldn't re-calculate
the pix->sizeimage in soc_mbus_image_size() in JPEG mode

We also shouldn't re-calculate pix->bytesperline:
	ret = soc_mbus_bytes_per_line(pix->width, xlate->host_fmt);
	if (ret < 0)
		return ret;

	pix->bytesperline = max_t(u32, pix->bytesperline, ret);

pix->bytesperline also should be set by the user or by the driver's
try_fmt() implementation.

Change-Id: I700690a2287346127a624b5260922eaa5427a596

Signed-off-by: Albert Wang <twang13@marvell.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 20:05:40 -03:00
Liu Ying c4ede4ceda [media] media: mx3_camera: Improve data bus width check code for probe
This patch contains code change only to use the present macro-
MX3_CAMERA_DATAWIDTH_MASK to check valid camera platform data
bus width instead of enumerating every possible data bus width.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 20:05:25 -03:00
Alex Gershgorin c078ac18f3 [media] mt9v022: Add support for mt9v024
Driver for mt9v022 camera sensor is fully compatible for mt9v024 camera sensor
with the exception of several registers which have been changed addresses.
mt9v024 also has improved and additional features, but they are currently not in use.

Signed-off-by: Alex Gershgorin <alexg@meprolight.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 20:04:08 -03:00
Javier Martin eb68faaf66 [media] media: mx2_camera: Fix clock handling for i.MX27
On i.MX27 two clocks are required: emma-ipg and emma-ahb. The ahb clock
has to be requested using both a device and a connection ID.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
[g.liakhovetski@gmx.de: rebase to the current media tree]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 20:00:02 -03:00
Alex Gershgorin c72f429f66 [media] media: mx3_camera: buf_init() add buffer state check
This patch checks the state of the buffer when calling .buf_init() method.
This is needed for the USERPTR buffer type, because in that case
.buf_init() is called every time a buffer is queued, and not only once
during the preparation stage, like in the MMAP case. Without this check
buffers get initialised repeatedly, which also leads to the allocation
of new DMA descriptors, of which there is only a final relatively small
number available. Both MMAP and USERPTR methods were successfully tested.

Signed-off-by: Alex Gershgorin <alexg@meprolight.com>
[g.liakhovetski@gmx.de: remove mx3_camera_buffer::state completely]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:59:03 -03:00
Albert Wang 991b3137f2 [media] media: soc_camera: don't clear pix->sizeimage in JPEG mode
In JPEG mode, the size of image is variable due to different JPEG compression
rate. We only can get the pix->sizeimage from the user.

If we clear pix->sizeimage in soc_camera_try_fmt() then we will get it from:
	ret = soc_mbus_image_size(xlate->host_fmt, pix->bytesperline,
				pix->height);
	if (ret < 0)
		return ret;

	pix->sizeimage = max_t(u32, pix->sizeimage, ret);

In general, this sizeimage will be larger than the actul JPEG image size.

But vb2 will check the buffer and size of image in __qbuf_userptr():
	/* Check if the provided plane buffer is large enough */
	if (planes[plane].length < q->plane_sizes[plane])

So we shouldn't clear the pix->sizeimage and also shouldn't re-calculate
the pix->sizeimage in soc_mbus_image_size() in JPEG mode

We also shouldn't re-calculate pix->bytesperline:
	ret = soc_mbus_bytes_per_line(pix->width, xlate->host_fmt);
	if (ret < 0)
		return ret;

	pix->bytesperline = max_t(u32, pix->bytesperline, ret);

pix->bytesperline also should be set by the user or by the driver's
try_fmt() implementation.

Change-Id: I700690a2287346127a624b5260922eaa5427a596

Signed-off-by: Albert Wang <twang13@marvell.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:24:28 -03:00
Javier Martin ad5b987031 [media] media: mx2_camera: Fix clock handling for i.MX27
On i.MX27 two clocks are required: emma-ipg and emma-ahb. The ahb clock
has to be requested using both a device and a connection ID.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
[g.liakhovetski@gmx.de: rebase to the current media tree]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:24:20 -03:00
Fabio Estevam f8afbf3caa [media] video: mx2_camera: Use clk_prepare_enable/clk_disable_unprepare
Prepare the clock before enabling it.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: <linux-media@vger.kernel.org>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:23:43 -03:00
Fabio Estevam 5c4dfc84a8 [media] video: mx1_camera: Use clk_prepare_enable/clk_disable_unprepare
Prepare the clock before enabling it.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: <linux-media@vger.kernel.org>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:23:20 -03:00
Alex Gershgorin 1690d86aa3 [media] media: mx3_camera: buf_init() add buffer state check
This patch checks the state of the buffer when calling .buf_init() method.
This is needed for the USERPTR buffer type, because in that case
.buf_init() is called every time a buffer is queued, and not only once
during the preparation stage, like in the MMAP case. Without this check
buffers get initialised repeatedly, which also leads to the allocation
of new DMA descriptors, of which there is only a final relatively small
number available. Both MMAP and USERPTR methods were successfully tested.

Signed-off-by: Alex Gershgorin <alexg@meprolight.com>
[g.liakhovetski@gmx.de: remove mx3_camera_buffer::state completely]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:23:10 -03:00
Antti Palosaari 78fa59038e [media] dvb_usb_v2: ce6230, rtl28xxu use .reset_resume
All these seems to survive .reset_resume.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:19:32 -03:00
Antti Palosaari 04966aa8dc [media] dvb_usb_v2: af9015, af9035, anysee use .reset_resume
All these seems to survive .reset_resume.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:19:24 -03:00
Antti Palosaari 15d0883663 [media] dvb_usb_v2: .reset_resume() support
Add .reset_resume() support.
Also some other small changes for suspend / resume.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:19:11 -03:00
Antti Palosaari 06bae1227a [media] dvb_frontend: implement suspend / resume
Move initial suspend / resume support from dvb_usb_v2 to dvb_frontend
as it is dvb general feature that could be used all dvb devices.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:18:43 -03:00
Antti Palosaari 0898b95409 [media] dvb_usb_v2: implement power-management for suspend
Put device full sleep on suspend, wake-up it on resume and acquire
retune in order to return same television channel.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:17:02 -03:00
Antti Palosaari 6304a60eb8 [media] dvb_core: export function to perform retune
We need to retune when resume from suspend.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:15:45 -03:00
Emil Goode c06d8752e7 [media] media: coda: add const qualifiers
The commit 98d7bbb9 changed *of_device_id.data to const
which introduced warnings in various places that have mostly
been fixed. This patch fixes one such warning by introducing
two const qualifiers.

GCC warning:
drivers/media/platform/coda.c:1785:16: warning:
        assignment discards ‘const’ qualifier
        from pointer target type [enabled by default]

Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:15:02 -03:00
Antti Palosaari 82026f9673 [media] anysee: convert Kernel dev_* logging
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:03:52 -03:00
Antti Palosaari f44e6b4223 [media] anysee: fix compiler warning
debug_dump macro was defined twice when CONFIG_DVB_USB_DEBUG was
not set. Move debug_dump macro to correct place.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:03:25 -03:00
Julia Lawall e839776f9d [media] drivers/media/usb/{s2255drv.c, tm6000/tm6000-alsa.c, tm6000/tm6000-input.c}: Remove potential NULL dereferences
If the NULL test is necessary, the initialization involving a dereference of
the tested value should be moved after the NULL test.

The sematic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
type T;
expression E;
identifier i,fld;
statement S;
@@

- T i = E->fld;
+ T i;
  ... when != E
      when != i
  if (E == NULL) S
+ i = E->fld;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:02:27 -03:00
Sachin Kamat 89e47e3568 [media] s5p-tv: Use devm_* functions in sii9234_drv.c file
devm_* functions are device managed functions and make error handling
and cleanup cleaner and simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:01:09 -03:00
Sachin Kamat f5c9903742 [media] s5p-tv: Replace printk with pr_* functions
Replace printk with pr_* functions to silence checkpatch warnings.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:00:19 -03:00
Sachin Kamat 00d98c1bd6 [media] s5p-tv: Use devm_regulator_get() in sdo_drv.c file
devm_regulator_get() is a device managed function and makes the exit code
a bit simpler and cleaner.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 19:00:00 -03:00
Julia Lawall d1bb4b29a7 [media] drivers/media/platform/mx2_emmaprp.c: use devm_kzalloc and devm_clk_get
Using devm_kzalloc simplifies the code and ensures that the use of
devm_request_irq is safe.  When kzalloc and kfree were used, the interrupt
could be triggered after the handler's data argument had been freed.

This also introduces some missing initializations of the return variable
ret, and uses devm_request_and_ioremap instead of the combination of
devm_request_mem_region and devm_ioremap.

The problem of a free after a devm_request_irq was found using the
following semantic match (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression e1,e2,x,a,b,c,d;
identifier free;
position p1,p2;
@@

  devm_request_irq@p1(e1,e2,...,x)
  ... when any
      when != e2 = a
      when != x = b
  if (...) {
    ... when != e2 = c
        when != x = d
    free@p2(...,x,...);
    ...
    return ...;
  }
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 18:58:52 -03:00
Dan Carpenter 0590c7130d [media] stk1160: remove unneeded check
"card" is a valid pointer here because we checked snd_card_create() for
error returns.  Checking after a dereference makes the static checkers
complain.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 18:53:29 -03:00
Dan Carpenter f367cc1efe [media] stk1160: unlock on error path stk1160_set_alternate()
There are some unlocks missing on error.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 18:52:13 -03:00
Dan Carpenter a7bd775628 [media] mem2mem_testdev: unlock and return error code properly
We recently added locking to this function, but there was an error path
which accidentally returned holding a lock.  Also we returned zero on
failure on some paths instead of the error code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 18:50:27 -03:00
Dan Carpenter e36c92fd63 [media] em28xx: use after free in em28xx_v4l2_close()
We need to move the unlock before the kfree(dev);

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 18:49:00 -03:00
Dan Carpenter 5359805193 [media] it913x-fe: use ARRAY_SIZE() as a cleanup
This code looks suspicious, but it turns out that "nv" is an array of u8
so sizeof() is the same as ARRAY_SIZE().  Using ARRAY_SIZE() is more
readable though.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 18:47:10 -03:00
Guennadi Liakhovetski 3bfb41001d [media] V4L: soc-camera: add selection API host operations
Add .get_selection() and .set_selection() soc-camera host driver
operations. Additionally check, that the user is not trying to change the
output sizes during a running capture.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 17:37:39 -03:00
Javier Martin 1cb7cf28c0 [media] media: mx2_camera: Add YUYV output format
Add explicit conversions from UYVY and YUYV to YUYV so that
csicr1 configuration can be set properly for each format.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 17:18:28 -03:00
Fabio Estevam 561d5d78cb [media] video: mx2_camera: Use clk_prepare_enable/clk_disable_unprepare
Prepare the clock before enabling it.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: <linux-media@vger.kernel.org>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 17:17:29 -03:00
Fabio Estevam 52cf3e4295 [media] video: mx1_camera: Use clk_prepare_enable/clk_disable_unprepare
Prepare the clock before enabling it.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: <linux-media@vger.kernel.org>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 17:16:19 -03:00
Laurent Pinchart dc5d598219 [media] ov772x: Stop sensor readout right after reset
The sensor starts streaming video as soon as it gets powered or is
reset. Disable the output in the reset function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 17:12:38 -03:00
Laurent Pinchart 4ead963009 [media] ov772x: Compute window size registers at runtime
Instead of hardcoding register arrays, compute the values at runtime.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[g.liakhovetski@gmx.de: keep (Q)VGA_* macros for now]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 17:12:23 -03:00
Laurent Pinchart f223d5b718 [media] ov772x: Add support for SBGGR10 format
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 17:11:54 -03:00
Laurent Pinchart 4a7b76f072 [media] ov772x: Add ov772x_read() and ov772x_write() functions
And use them instead of calling SMBus access functions directly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 17:11:29 -03:00
Laurent Pinchart 47de502b04 [media] ov772x: Make to_ov772x convert from v4l2_subdev to ov772x_priv
Conversion from i2c_client to ov772x_priv is only needed in a single
location, while conversion from v4l2_subdev to ov772x_priv is needed in
several locations. Perform the former manually, and use to_ov772x for
the later.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 17:10:49 -03:00
Laurent Pinchart 9f717e9022 [media] ov772x: try_fmt must not default to the current format
If the requested format isn't supported, return a fixed default format
instead of the current format.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 17:10:18 -03:00
Laurent Pinchart 69c80dc901 [media] ov772x: Don't fail in s_fmt if the requested format isn't supported
Select a default format instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 17:09:44 -03:00
Laurent Pinchart ca9ef7fa21 [media] ov772x: Select the default format at probe time
The format and window size are only initialized during the first g_fmt
call. This leaves the device in an inconsistent state after
initialization, which will cause problems when implementing pad
operations. Move the format and window size initialization to probe
time.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 17:08:36 -03:00
Laurent Pinchart edff996eb9 [media] ov772x: Fix memory leak in probe error path
The control handler isn't freed if its initialization fails. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 17:05:02 -03:00
Laurent Pinchart 4bbc6d52e6 [media] soc-camera: Push probe-time power management to drivers
Several client drivers access the hardware at probe time, for instance
to read the probe chip ID. Such chips need to be powered up when being
probed.

soc-camera handles this by powering chips up in the soc-camera probe
implementation. However, this will break with non soc-camera hosts that
don't perform the same operations.

Fix the problem by pushing the power up/down from the soc-camera core
down to individual drivers on a needs basis.

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

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[g.liakhovetski@gmx.de: fix compile breakage]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 17:03:29 -03:00
Laurent Pinchart 24592adce8 [media] soc-camera: Continue the power off sequence if one of the steps fails
Powering off a device is a "best effort" task: failure to execute one of
the steps should not prevent the next steps to be executed. For
instance, an I2C communication error when putting the chip in stand-by
mode should not prevent the more agressive next step of turning the
chip's power supply off.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 16:54:53 -03:00
Laurent Pinchart 37ad4e734b [media] soc_camera: Don't call .s_power() during probe
The .s_power() call only covers the .g_mbus_fmt() operation call.
Several clients required to be powered on to retrieve the current mbus
format but have now been fixed. The .s_power() call is thus not needed
anymore and can be removed.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 16:53:39 -03:00
Mauro Carvalho Chehab 2c3fb08b3f [media] rename drivers/media/video as .../platform
The remaining drivers are mostly platform drivers. Name the
dir to reflect it.

It makes sense to latter break it into a few other dirs.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 16:43:09 -03:00
Mauro Carvalho Chehab 2a2d1cf465 [media] move soc_camera i2c drivers into its own dir
Move all soc_camera i2c drivers into drivers/media/i2c/soc_camera/.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 16:42:46 -03:00
Mauro Carvalho Chehab cb7a01ac32 [media] move i2c files into drivers/media/i2c
Move ancillary I2C drivers into drivers/media/i2c, in order to
better organize them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 16:42:14 -03:00
Mauro Carvalho Chehab f0af8fa4da [media] reorganize the API core items
Reorganize the API core changes for them to appear closer to
the items that enable them, and not at the drivers part of
the menu.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 16:42:00 -03:00
Mauro Carvalho Chehab ec29a47834 [media] mmc/Kconfig: Improve driver name for siano mmc/sdio driver
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 16:41:47 -03:00
Mauro Carvalho Chehab d1677dc31a [media] move parallel port/isa video drivers to drivers/media/parport/
We should keep just the I2C drivers under drivers/media/video, and
then rename it to drivers/media/i2c.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 16:41:37 -03:00
Mauro Carvalho Chehab e5cdf69d36 [media] move the remaining PCI devices to drivers/media/pci
Move meye and sta2x11_vip into the drivers/media/pci subdirs.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 16:39:31 -03:00
Mauro Carvalho Chehab 3e7c99126f [media] move analog PCI saa7146 drivers to its own dir
Instead of having them under drivers/media/video, move them
to their own directory.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 16:37:25 -03:00
Mauro Carvalho Chehab b285192a43 [media] rename most media/video pci drivers to media/pci
Rename all PCI drivers with their own directory under
drivers/media/video into drivers/media/pci and update the
building system.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 16:36:22 -03:00
Mauro Carvalho Chehab 68de959f77 [media] bt8xx: move analog TV part to be together with DTV one
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 16:35:54 -03:00
Mauro Carvalho Chehab 0aa77f6c29 [media] move the remaining USB drivers to drivers/media/usb
Move the 3 remaining usb drivers to their proper space.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 16:34:46 -03:00
Mauro Carvalho Chehab 0c0d06cac6 [media] rename most media/video usb drivers to media/usb
Rename all USB drivers with their own directory under
drivers/media/video into drivers/media/usb and update the
building system.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 16:25:07 -03:00
Mauro Carvalho Chehab 84cfe9e79b [media] b2c2: fix driver's build due to the lack of pci DMA code
Fix a one-character typo at the makefile.

drivers/built-in.o: In function `flexcop_pci_remove':
flexcop-pci.c:(.text+0x20d1a28): undefined reference to `flexcop_dma_free'
flexcop-pci.c:(.text+0x20d1a3e): undefined reference to `flexcop_dma_free'
drivers/built-in.o: In function `flexcop_pci_stream_control':
flexcop-pci.c:(.text+0x20d2396): undefined reference to `flexcop_dma_config'
flexcop-pci.c:(.text+0x20d23b3): undefined reference to `flexcop_dma_config'
flexcop-pci.c:(.text+0x20d23cf): undefined reference to `flexcop_dma_config_timer'
flexcop-pci.c:(.text+0x20d23f5): undefined reference to `flexcop_dma_xfer_control'
flexcop-pci.c:(.text+0x20d244c): undefined reference to `flexcop_dma_control_timer_irq'
flexcop-pci.c:(.text+0x20d24b0): undefined reference to `flexcop_dma_control_timer_irq'
flexcop-pci.c:(.text+0x20d2507): undefined reference to `flexcop_dma_xfer_control'
drivers/built-in.o: In function `flexcop_pci_probe':
flexcop-pci.c:(.text+0x20d28d2): undefined reference to `flexcop_dma_allocate'
flexcop-pci.c:(.text+0x20d2907): undefined reference to `flexcop_dma_allocate'
flexcop-pci.c:(.text+0x20d2923): undefined reference to `flexcop_dma_free'

Reported-by: Fengguang Wu <wfg@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 12:14:12 -03:00
Lad, Prabhakar a1b3a6ce0f [media] media: davinci: fix section mismatch warnings
This patch fixes section mismatch warnings for
davinci video drivers.

[mchehab@redhat.com: applied it as a fixup over the previous (and wrong) changeset c6afbf2]
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-14 08:45:49 -03:00
Mauro Carvalho Chehab b3f52608ba [media] b2c2: frontends/tuners are not needed at the bridge binding
The frontends/tuners are used inside the common part of the driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 23:52:53 -03:00
Mauro Carvalho Chehab 0013ca8c52 [media] siano: break it into common, mmc and usb
siano is, in fact, 2 drivers: one for MMC and one for USB, plus
a common bus-independent code. Break it accordingly.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 23:52:52 -03:00
Mauro Carvalho Chehab ed0c8b5465 [media] saa7146: Move it to its own directory
In order to better organize the directory tree, move the
saa7146 common driver to its own directory.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 23:52:49 -03:00
Mauro Carvalho Chehab ccae7af2bf [media] common: move media/common/tuners to media/tuners
Move the tuners one level up, as the "common" directory will be used
by drivers that are shared between more than one driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 23:40:28 -03:00
Mauro Carvalho Chehab 3785bc170f [media] b2c2: break it into common/pci/usb directories
b2c2 is, in fact, 2 drivers: one for PCI and one for USB, plus
a common bus-independent code. Break it accordingly.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 23:38:31 -03:00
Mauro Carvalho Chehab 25aee3debe [media] Rename media/dvb as media/pci
The remaining dvb drivers are pci, so rename them to match the
bus.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 23:30:06 -03:00
Mauro Carvalho Chehab 786baecfe7 [media] dvb-usb: move it to drivers/media/usb/dvb-usb
As media/dvb will be removed, move it to a proper place.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 23:26:31 -03:00
Mauro Carvalho Chehab 616300bd51 [media] firewire: move it one level up
Move firewire to one level up, as the dvb subdirectory will be
removed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 23:20:36 -03:00
Mauro Carvalho Chehab 9a0bf528b4 [media] move the dvb/frontends to drivers/media/dvb-frontends
Raise the DVB frontends one level up, as the intention is to remove
the drivers/media/dvb directory.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 23:13:41 -03:00
Mauro Carvalho Chehab 3d6c2bc08a [media] dvb: move the dvb core one level up
just like the V4L2 core, move the DVB core to drivers/media, as the
intention is to get rid of both "video" and "dvb" directories.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 23:08:14 -03:00
Mauro Carvalho Chehab 5bc3cb743b [media] v4l: move v4l2 core into a separate directory
Currently, the v4l2 core is mixed together with other non-core drivers.
Move them into a separate directory.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 23:02:38 -03:00
Mauro Carvalho Chehab 2ea4b44258 [media] rc/Kconfig: Fix a warning
drivers/media/rc/Kconfig:291:warning: multi-line strings not supported

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 23:00:33 -03:00
Malcolm Priestley 04b8b21d2c [media] it913x ver 1.32 driver moved to dvb-usb-v2
Functional changes

PID filter is default to off and controlled from dvb-usb-v2

Driver now supports suspend and resume changes in dvb-usb-v2

USB bus repeater functions have been removed.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 22:24:31 -03:00
Javier Martin 087c78a8a2 [media] media: mx2_camera: Mark i.MX25 support as BROKEN
i.MX25 support is known to have been broken for almost a year.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 22:18:37 -03:00
Sachin Kamat dc9c94cd33 [media] s5k6aa: Use devm_kzalloc function
devm_kzalloc() eliminates the need to free explicitly thereby
making the code a bit simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 22:10:57 -03:00
Manoel Pinheiro b08deebebe [media] saa7134-dvb: Fix kworld sbtvd I2C gate control
The correct place to put i2c_gate_ctrl is before calling tda18271_attach,
because the driver tda18271 will use it to enable or disable the i2c-bus
from the demodulator to the tuner.

And thus eliminate the error message: "Unknown device (255) detected
@ 1-00c0, device not supported" in the driver tda18271.

In the device kworld_sbtvd (hybrid analog and digital TV) the control
of the i2c-bus to tuner is done in the analog demodulator and not in
the digital demodulator.

Signed-off-by: Manoel Pinheiro <pinusdtv@hotmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 21:14:59 -03:00
David Härdeman f8e00d5fa8 [media] rc-core: move timeout and checks to lirc
The lirc TX functionality expects the process which writes (TX) data to
the lirc dev to sleep until the actual data has been transmitted by the
hardware.

Since the same timeout calculation is duplicated in more than one driver
(and would have to be duplicated in even more drivers as they gain TX
support), it makes sense to move this timeout calculation to the lirc
layer instead.

At the same time, centralize some of the sanity checks.

Signed-off-by: David Härdeman <david@hardeman.nu>
Cc: Jarod Wilson <jwilson@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 19:59:41 -03:00
Malcolm Priestley 0a67fe4584 [media] lmedm04: fix data usage past the end of the buffer
On Mon, 2012-08-13 at 19:58 +0300, Dan Carpenter wrote:
> Hello Mauro Carvalho Chehab,
>
> The patch db6651a9ebb3: "[media] lmedm04: fix build" from Aug 12,
> 2012, leads to the following warning:
> drivers/media/dvb/dvb-usb-v2/lmedm04.c:769 lme2510_download_firmware()
> 	 error: usb_control_msg() 'data' too small (128 vs 265)
>
>    737          data = kzalloc(128, GFP_KERNEL);
>                                ^^^
> data is 128 bytes.

Control isn't used, so remove it.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 19:53:29 -03:00
Michael Krufky ae53020527 [media] DVB: improve handling of TS packets containing a raised TEI bit
When the TEI bit is raised, we should not trust any of the contents of
the packet in question, including but not limited to its PID number.

Considering that we don't trust the PID number of this packet, we should
not proceed to check the packet counter (if dvb_demux_tscheck is set).

We should expect to see at least one discontinuity after a bad packet is
received, so any time a TEI is detected, a following TS packet counter
mismatch is to be expected.

There is no real reason to ever allow bad packets to pass through the
kernel demux, other than for purposes of attempting error correction via
software or statistical information.

However, since we have always passed these bad packets though the demux,
we should not change this default behavior.

Without altering module options, this patch merely prevents the
TS packet counter check on packets containing a raised TEI.

If module option dvb_demux_feed_err_pkts is set to 0, the kernel demux
will drop these error packets entirely, preventing any possibility of
corruption caused by userspace programs that are expecting valid data.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 19:51:33 -03:00
Emil Goode d9bc8510c5 [media] cx88: Remove duplicate const
This patch fixes the following sparse warnings
by removing use of duplicate const.

drivers/media/video/cx88/cx88.h:152:40:
	warning: duplicate const
drivers/media/video/cx88/cx88-core.c:256:33:
	warning: duplicate const
drivers/media/video/cx88/cx88-alsa.c:769:41:
	warning: duplicate const

As commented by Jonathan Nieder:

	These double "const" were introduced in v2.6.37-rc1~64^2~464 (V4L/DVB:
	drivers/media: Make static data tables and strings const, 2010-08-25).

	The address of an array is already immutable by definition, so for
	what it's worth, with or without a clarified commit message,

[mchehab@redhat.com: Tested with "gcc -s" (version 4.7.0):
 the produced asm is indeed equal before and after this patch]
Signed-off-by: Emil Goode <emilgoode@gmail.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 19:47:56 -03:00
Timo Kokkonen c332e8472d [media] media: rc: Introduce RX51 IR transmitter driver
This is the driver for the IR transmitter diode found on the Nokia
N900 (also known as RX51) device. The driver is mostly the same as
found in the original 2.6.28 based kernel that comes with the device.

The following modifications have been made compared to the original
driver version:

- Adopt to the changes that has happen in the kernel during the past
  five years, such as the change in the include paths

- The OMAP DM-timers require much more care nowadays. The timers need
  to be enabled and disabled or otherwise many actions fail. Timers
  must not be freed without first stopping them or otherwise the timer
  cannot be requested again.

The code has been tested with sending IR codes with N900 device
running Debian userland. The device receiving the codes was Anysee
DVB-C USB receiver.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:53:45 -03:00
Antti Palosaari 65d9bc9236 [media] dvb_usb_v2: use %*ph to dump usb xfer debugs
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:42:57 -03:00
Andy Shevchenko 1d16e6d396 [media] dvb-usb: use %*ph to dump small buffers
[crope@iki.fi: fix trivial merge conflict]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:42:24 -03:00
Andy Shevchenko 6f28f75a6d [media] saa7127: use %*ph to print small buffers
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:40:07 -03:00
Andy Shevchenko 7c94c69d20 [media] ati_remote: use %*ph to dump small buffers
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:39:51 -03:00
Andy Shevchenko 090fdc17bc [media] dvb: use %*ph to hexdump small buffers
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:39:33 -03:00
Andy Shevchenko 70aa34569a [media] gspca: use %*ph to print small buffers
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:39:05 -03:00
Andy Shevchenko 9697b54f3d [media] radio-shark2: use %*ph to print small buffers
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:38:49 -03:00
Andy Shevchenko 4141e72068 [media] dvb: frontends: use %*ph to dump small buffers
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:38:19 -03:00
Andy Shevchenko c6480cccdb [media] common: tunners: use %*ph to dump small buffers
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:37:30 -03:00
Mauro Carvalho Chehab 9adf6132dc [media] dvb: get rid of fe_ioctl_override callback
This callback were meant to allow overriding a FE callback, before its
call, but it is not really needed, as the callback can be intercepted
after tuner attachment.

Worse than that, only DVBv3 calls are intercepted this way, so a DVBv5
application will produce different effects than a DVBv3 one.

So, get rid of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
2012-08-13 16:34:03 -03:00
Julia Lawall 28e9cc8056 [media] drivers/media/radio/radio-si4713.c: use devm_ functions
The various devm_ functions allocate memory that is released when a driver
detaches.  This patch uses these functions for data that is allocated in
the probe function of a platform device and is only freed in the remove
function.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:29:58 -03:00
Julia Lawall d91e013935 [media] drivers/media/radio/radio-wl1273.c: use devm_ functions
The various devm_ functions allocate memory that is released when a driver
detaches.  This patch uses these functions for data that is allocated in
the probe function of a platform device and is only freed in the remove
function.

In two cases, the original memory allocation function was kmalloc, which
has been changed to a zeroing allocation to benefit from the devm function.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:29:31 -03:00
Julia Lawall 2f20c490aa [media] drivers/media/radio/radio-timb.c: use devm_ functions
The various devm_ functions allocate memory that is released when a driver
detaches.  This patch uses these functions for data that is allocated in
the probe function of a platform device and is only freed in the remove
function.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:28:57 -03:00
Sean Young d07df223ab [media] rc: transmit on device which does not support it should fail
Currently write() will return 0 if an IR device does not support sending.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:19:14 -03:00
Sean Young 4da212e2ff [media] saa7134: simplify timer activation
This simplies the code and resolves a possible race condition between
ir_raw_decode_timer_end() and saa7134_raw_decode_irq().

If the interrupt handler is called after ir_raw_decode_timer_end()
calls ir_raw_event_handle() but before clearing ir->active, then the
timer won't be rearmed.

Compile tested only.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:19:13 -03:00
Sean Young b83bfd1b01 [media] rc: do not wake up rc thread unless there is something to do
The TechnoTrend USB IR Receiver sends 125 ISO URBs per second, even when
there is no IR activity. Reduce the number of wake ups from the other
drivers too.

This saves about 0.25ms/s on a 2.4GHz Core 2 according to powertop.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:19:12 -03:00
Sean Young 0938069fa0 [media] rc: Add support for the TechnoTrend USB IR Receiver
This driver adds support for TechnoTrend USB IR Receiver. It is a complete
rewrite of the staging/media/lirc/lirc_ttusbir driver. It adds more
accurate sample reporting and led control.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:19:11 -03:00
Sean Young 640583836b [media] iguanair: fix receiver overflow
The Pioneer CU-700 remote causes receiver overflows if you hold down any
button. The remote does not send NEC IR repeats, it repeats the entire
NEC code after 20ms.

The iguanair hardware advertises an interval of 10 which just not enough;
with 100 URBs per second and at most 7 edges per URB, we handle at most
700 edges per second. The remote generates about 900.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:19:10 -03:00
Sean Young 2eec676cd3 [media] iguanair: advertise the resolution and timeout properly
With the timeout supplied the interface can go idle. The keymap is
the same one as other drivers which do not come with a remote.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:19:10 -03:00
Sean Young 116e4f592a [media] iguanair: reset the IR state after rx overflow or receiver enable
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:07:19 -03:00
Sean Young 884bfd08e3 [media] iguanair: fix return value for transmit
Also fix error codes returned from open.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:07:00 -03:00
Sean Young 7c0bd96b76 [media] iguanair: support suspend and resume
Now unbind also stops the receiver.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:06:22 -03:00
Sean Young 0797b4802b [media] iguanair: ignore unsupported firmware versions
Firmware versions lower than 0x0205 use a different interface which is not
supported. Also report the firmware version in the standard format.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:05:57 -03:00
Sean Young e99a7cfe93 [media] iguanair: reuse existing urb callback for command responses
Rather than using usb_interrupt_msg() to receive responses, reuse the
urb callback we already have in place.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:04:18 -03:00
Lad, Prabhakar c6afbf298b [media] davinci: fix build warning when CONFIG_DEBUG_SECTION_MISMATCH is enabled
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:01:54 -03:00
Antti Palosaari 224b6642f5 [media] add DTMB support for DVB API
Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Cc: Andreas Oberritter <obi@linuxtv.org>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:01:17 -03:00
Antti Palosaari 991452a21b [media] rtl28xxu: generalize streaming control
Move rtl2831u LED from streaming control to power control. It
changes LED behavior slightly but who cares :)
After that same streaming control can be used for both rtl2831u
and rtl2832u.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 16:00:38 -03:00
Antti Palosaari c01a35955f [media] rtl28xxu: convert to new DVB USB
Tested-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 15:58:12 -03:00
Laurent Pinchart d584b8386e [media] uvcvideo: Add support for Ophir Optronics SPCAM 620U cameras
The camera requires the PROBE_MINMAX quirk. Add a corresponding entry in
the device IDs list.

Reported-by: Stefan Muenzel <stefanmuenzel@googlemail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 15:50:12 -03:00
Stefan Muenzel ca47e7192c [media] uvcvideo: Support 10bit, 12bit and alternate 8bit greyscale formats
The SPCAM SP620U camera uses the alternate "Y8  " GUID for the 8-bit
greyscale format, and supports a 12-bit greyscale format. Add support
for those in the driver, as well as for 10-bit greyscale formats.

Signed-off-by: Stefan Muenzel <stefanmuenzel@googlemail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 15:49:56 -03:00
Laurent Pinchart 6fd90db8df [media] uvcvideo: Support super speed endpoints
Compute the maximum number of bytes per interval using the burst and
multiplier values for super speed endpoints.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 15:47:56 -03:00
Evgeny Plehov da2cd767f5 [media] ttpci: add support for Omicom S2 PCI
Support for yet another SAA7146-based budget card (very similar to TT
S2-1600, but use LNBH23 instead ISL6423).

Signed-off-by: Evgeny Plehov <EvgenyPlehov@ukr.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 14:41:26 -03:00
Ezequiel García 9cb2173e6e [media] media: Add stk1160 new driver (easycap replacement)
This driver adds support for stk1160 usb bridge as used in some
video/audio usb capture devices.
It is a complete rewrite of staging/media/easycap driver and
it's meant as a replacement.

As stk1160 allows communication with an ac97 codec chip, this
driver allows to register a control-only sound card to allow the user
to access ac97 controls.

Two devices have been used for testing:
* 1-cvbs video and 1-audio ac97 input,
* 4-cvbs inputs
Both of these devices reports with the same id [05e1:0408],
so the driver tries to support a superset of the capabilities.

By using keep_buffers module parameter it's possible to prevent
the driver from releasing urb buffers when streaming is stopped.
The usage of this parameter can avoid memory fragmentation that may
cause the driver to stop working on low memory systems.
A similar mechanism is implemented in em28xx driver (see commit 86d38d).

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 14:04:04 -03:00
Hans de Goede be0c44fb48 [media] radio-shark2: Only compile led support when CONFIG_LED_CLASS is set
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 13:50:09 -03:00
Hans de Goede 3e3b92cac5 [media] radio-shark: Only compile led support when CONFIG_LED_CLASS is set
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 13:50:00 -03:00
Hans de Goede cfc1b2a06f [media] radio-shark*: Call cancel_work_sync from disconnect rather then release
This removes the need for shark_led_work to take the v4l2 lock.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 13:49:44 -03:00
Hans de Goede 820ddfa6ca [media] radio-shark*: Remove work-around for dangling pointer in usb intfdata
Recent kernels properly clear the usb intfdata pointer when another
driver fails to bind (in the radio-shark* case the usbhid driver would try
to bind first.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 13:49:19 -03:00
Dan Carpenter ffd491fd6f [media] qt1010: signedness bug in qt1010_init_meas1()
qt1010_init_meas2() returns zero on success and negative error codes on
failure so the return type should be int instead of u8.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 13:21:06 -03:00
Antti Palosaari e0e52d4e9f [media] tda18218: silence compiler warning
Trivial fix.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 13:01:45 -03:00
Antti Palosaari d46ddbe4bf [media] tda18212: use Kernel dev_* logging
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 13:01:33 -03:00
Antti Palosaari e666a44fa3 [media] tda18212: silence compiler warning
Trivial fix.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 12:38:52 -03:00
Alan Cox e1d45ae10a [media] mantis: fix silly crash case
If we set mantis->fe to NULL on an error its not a good idea to then try
passing NULL to the unregister paths and oopsing really.

Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=16473

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 12:22:43 -03:00
Andy Shevchenko 3a7503b55e [media] dvb: nxt200x: apply levels to the printk()s
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 11:58:58 -03:00
Andy Shevchenko 518c267f4c [media] saa7164: use native print_hex_dump() instead of custom one
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 07:58:54 -03:00
Nicolas THERY b17d39453b [media] media: fix MEDIA_IOC_DEVICE_INFO return code
The MEDIA_IOC_DEVICE_INFO ioctl was returning a positive value rather
than a negative error code when failing to copy output parameter to
user-space.

Tested by compilation only.

Signed-off-by: Nicolas Thery <nicolas.thery@st.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 07:57:57 -03:00
Antti Palosaari ff54298bc7 [media] m88rs2000: add missing FE_HAS_SYNC flag
Cc: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 07:55:57 -03:00
Mauro Carvalho Chehab db6651a9eb [media] lmedm04: fix build
Those files were at the wrong place, probably due to the usage of a
previous version of dvb-usb-v2 tree.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 07:53:33 -03:00
Malcolm Priestley e41543a2a9 [media] lmedm04 2.06 conversion to dvb-usb-v2 version 2
Conversion of lmedm04 to dvb-usb-v2

Functional changes m88rs2000 tuner now uses all callbacks.
TODO migrate other tuners to the callbacks.

This patch is applied on top of [BUG] Re: dvb_usb_lmedm04 crash Kernel (rs2000)
http://patchwork.linuxtv.org/patch/13584/

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 07:48:09 -03:00
Guenter Roeck ac6eb458f5 [media] Add USB dependency for IguanaWorks USB IR Transceiver
This patch fixes the error
	drivers/usb/core/hub.c:3753: undefined reference to `usb_speed_string'
seen in various random configurations.

Cc: Sean Young <sean@mess.org>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 07:35:00 -03:00
Mauro Carvalho Chehab 9468542bf2 [media] dvb core: remove support for post FE legacy ioctl intercept
This DVB_FE_IOCTL_POST isn't used, so remove it.

Also, intercepting ioctl's like that only works with legacy ioctl's,
due to the way it was implemented. so this design is broken.
Document it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 07:33:30 -03:00
Mauro Carvalho Chehab 0bc9c89464 [media] em28xx: Fix height setting on non-progressive captures
This was introduced on commit c2a6b54a9:
"em28xx: fix: don't do image interlacing on webcams"

The proposed patch by Ezequiel is wrong. The right fix here is to just
don't bother here if either the image is progressive or not.

Reported-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 07:09:06 -03:00
Tim Gardner 229fd7d2f1 [media] cpia2: Declare MODULE_FIRMWARE usage
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: linux-media@vger.kernel.org
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 05:49:03 -03:00
Nicolas THERY ddb9fa25be [media] videobuf2: fix sparse warning
Fix "symbol 'vb2_vmalloc_memops' was not declared. Should it be static?"
sparse warning.

Signed-off-by: Nicolas Thery <nicolas.thery@st.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 05:48:28 -03:00
Hans Petter Selasky 1e9c14f7d2 [media] tuner-xc2028: add missing else case
>From 59306435992d9349f10ad82a8adf14d98becbbe8 Mon Sep 17 00:00:00 2001

Signed-off-by: Hans Petter Selasky <hselasky@c2i.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 05:43:44 -03:00
Malcolm Priestley b50b3e0732 [media] dvb_usb_lmedm04: don't crash if firmware is not loaded
There is a missing error handling when no firmware file found.

It seems that this is more of a problem with udev-182+.

However, so far udev-182 is only a problem on first ever plug.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-12 05:42:57 -03:00
Hans Verkuil 5e78831756 [media] Add missing logging for rangelow/high of hwseek
struct v4l2_hw_freq_seek has two new fields that weren't printed in the
logging function. Added.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-11 23:30:36 -03:00
Patrice Chotard 397e972350 [media] ngene: add support for Terratec Cynergy 2400i Dual DVB-T
This code is based on ngene initial check-in (dae52d009f)

Signed-off-by: Patrice Chotard <patricechotard@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-11 23:27:00 -03:00
Patrice Chotard 5fb67074c6 [media] dvb: add support for Thomson DTT7520X
Add support for Thomson DTT7520X pll needed by
ngene card Terratec Cynergy 2400i DT

Signed-off-by: Patrice Chotard <patricechotard@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-11 23:26:37 -03:00
Hans Verkuil aa4d9b53f0 [media] VIDIOC_ENUM_FREQ_BANDS fix
When VIDIOC_ENUM_FREQ_BANDS is called for a driver that doesn't supply an
enum_freq_bands op, then it will fall back to reporting a single freq band
based on information from g_tuner or g_modulator.

Due to a bug this is an infinite list since the index field wasn't tested.

This patch fixes this and returns -EINVAL if index != 0.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-11 23:21:01 -03:00
Hans Verkuil 00424c7ec5 [media] mem2mem_testdev: fix querycap regression
Trival but important patch.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-11 23:17:01 -03:00
Sean Young 743135e7a5 [media] nec-decoder: fix NEC decoding for Pioneer Laserdisc CU-700 remote
This remote sends a header pulse of 8150us followed by a space of 4000us.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-11 17:31:22 -03:00
Michael Jones 9d380adf02 [media] v4l2: typos
[mchehab@redhat.com: fix a merge conflict at Documentation/video4linux/v4l2-framework.txt]
Signed-off-by: Michael Jones <michael.jones@matrix-vision.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-11 16:55:53 -03:00
Laurent Pinchart 8b34000377 [media] omap3isp: Mark the resizer output video node as the default video node
The resizer can output YUYV and UYVY in a wide range of sizes, making it
the best video node for regular V4L2 applications.

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>
2012-08-11 16:03:36 -03:00
Laurent Pinchart c51364cafa [media] omap3isp: ccdc: Add YUV input formats support
Enable the bridge automatically when the input format is YUYV8 or UYVY8.

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>
2012-08-11 16:02:56 -03:00
Laurent Pinchart 73ea57eb54 [media] omap3isp: ccdc: Remove ispccdc_syncif structure
The structure is only used to store configuration data and pass it to
CCDC configuration functions. Access the data directly from the
locations that need it.

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>
2012-08-11 16:02:01 -03:00
Laurent Pinchart cf7a3d91ad [media] omap3isp: ccdc: Remove support for interlaced data and master HS/VS mode
Those features are half-implemented and not used. Remove them.

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>
2012-08-11 16:01:43 -03:00
Ivaylo Petrov 73cdc79f93 [media] omap3isp: csi2: Add V4L2_MBUS_FMT_YUYV8_2X8 support
Tested with ov9740 and

struct isp_csi2_platform_data {
	.interface = ISP_INTERFACE_CSI2A_PHY2,
	.bus = {
		.csi2 = {
			.crc		= 1,
			.vpclk_div	= 1,
		}
	},
}

Signed-off-by: Ivaylo Petrov <ivpetrov@mm-sol.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-11 16:01:20 -03:00
Laurent Pinchart 0810fd9c53 [media] omap3isp: video: Add YUYV8_2X8 and UYVY8_2X8 support
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-11 16:00:56 -03:00
Laurent Pinchart 1697e49a0b [media] omap3isp: video: Split format info bpp field into width and bpp
The bpp field currently stores the sample width and is aligned to the
next multiple of 8 bits when computing data size in memory. This won't
work anymore for YUYV8_2X8 formats. Split the bpp field into a sample
width and a bytes per pixel value.

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>
2012-08-11 16:00:36 -03:00
Laurent Pinchart 6fd206cb6e [media] omap3isp: preview: Add support for non-GRBG Bayer patterns
Rearrange the CFA interpolation coefficients table based on the Bayer
pattern. Support for non-Bayer CFA patterns is dropped as they were not
correctly supported, and have never been tested.

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>
2012-08-11 15:59:54 -03:00
Laurent Pinchart ac9dad9316 [media] omap3isp: preview: Merge gamma correction and gamma bypass
Enabling gamma bypass disables gamma correction and vice versa. Merge
the two parameters.

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>
2012-08-11 15:58:58 -03:00
Laurent Pinchart 7bec7ef860 [media] omap3isp: preview: Reorder configuration functions
Reorder the configuration and enable functions to match the parameters
order.

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>
2012-08-11 15:58:41 -03:00
Laurent Pinchart 6f1dd566fd [media] omap3isp: preview: Pass a prev_params pointer to configuration functions
Instead of using void pointers and offset arithmetics to compute a
pointer to configuration parameters in a generic way, pass the complete
parameters structure to configuration functions and let them access the
parameters they need.

Also modify the enable functions to use a bool enable parameter instead
of a u8.

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>
2012-08-11 15:57:55 -03:00
Laurent Pinchart fbabfa8dde [media] omap3isp: preview: Remove lens shading compensation support
The feature isn't fully implemented and doesn't work, remove it.

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>
2012-08-11 15:57:09 -03:00
Michael Jones b1e71f31cb [media] omap3isp: queue: Fix omap3isp_video_queue_dqbuf() description comment
Signed-off-by: Michael Jones <michael.jones@matrix-vision.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-11 15:55:28 -03:00
Peter Meerwald 13eaaa7f2f [media] omap3isp: ccdc: No semicolon is needed after switch statement
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-11 15:55:13 -03:00
Laurent Pinchart 96d62ae2dc [media] omap3isp: Configure HS/VS interrupt source before enabling interrupts
This needs to be performed before enabling interrupts as the sensor
might be free-running and the ISP default setting (HS edge) would put an
unnecessary burden on the CPU.

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>
2012-08-11 15:55:04 -03:00
Laurent Pinchart be9a1b98f4 [media] omap3isp: Don't access ISP_CTRL directly in the statistics modules
Use the existing omap3isp_subclk_enable() and omap3isp_subclk_disable()
functions instead.

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>
2012-08-11 15:54:34 -03:00
Hans Verkuil 2f65f467b4 [media] vivi: zero fmt.pix.priv as per spec
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-11 15:51:35 -03:00
Hans Verkuil 77747f7960 [media] vivi: add frame size reporting
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-11 15:50:52 -03:00
Hans Verkuil 0a3a8a36d9 [media] vivi: fix colorspace setup
Two of the four possible YUV formats got the wrong colorspace.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-11 15:50:35 -03:00
Hans Verkuil 3273781068 [media] si470x: v4l2-compliance fixes
Just a few fixes for problems found after updating v4l2-compliance to check
the frequency band enumeration.

Note that the i2c driver doesn't fill in bus_info, but since I can't test that
driver I've decided not to fix that.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-11 15:41:25 -03:00
Jayakrishnan Memana 8a3f0ede2b [media] uvcvideo: Reset the bytesused field when recycling an erroneous buffer
Buffers marked as erroneous are recycled immediately by the driver if
the nodrop module parameter isn't set. The buffer payload size is reset
to 0, but the buffer bytesused field isn't. This results in the buffer
being immediately considered as complete, leading to an infinite loop in
interrupt context.

Fix the problem by resetting the bytesused field when recycling the
buffer.

Cc: <stable@vger.kernel.org>
Signed-off-by: Jayakrishnan Memana <jayakrishnan.memana@maxim-ic.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-11 12:58:16 -03:00
Devin Heitmueller 77fc286328 [media] au0828: fix possible race condition in usage of dev->ctrlmsg
The register read function is referencing the dev->ctrlmsg structure outside
of the dev->mutex lock, which can cause corruption of the value if multiple
callers are invoking au0828_readreg() simultaneously.

Use a stack variable to hold the result, and copy the buffer returned by
usb_control_msg() to that variable.

In reality, the whole recv_control_msg() function can probably be collapsed
into au0288_readreg() since it is the only caller.

Also get rid of cmd_msg_dump() since the only case in which the function is
ever called only is ever passed a single byte for the response (and it is
already logged).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-11 12:37:55 -03:00
Ezequiel García 1240ad56ed [media] em28xx: Remove useless runtime->private_data usage
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-10 17:04:59 -03:00
Igor M. Liplianin 9fa4d6a102 [media] mantis: Terratec Cinergy C PCI HD (CI)
This patch seems for rectifying a typo. But actually the difference between
mantis_vp2040.c and mantis_vp2033.c code is a card name only.

Signed-off-by: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-10 17:04:58 -03:00
Devin Heitmueller 3de5bffddb [media] xc5000: change filename to production/redistributable xc5000c firmware
The original xc5000c driver support was based on a beta version of the
firmware, and there were no redistribution rights.  Change over to using
the release version, for which freely redistributable firmware can be
found here:

http://kernellabs.com/firmware/xc5000/README.xc5000c
http://kernellabs.com/firmware/xc5000/dvb-fe-xc5000c-4.1.30.7.fw

Thanks to Ramon Cazares from Cresta Technology for making the firmware
available as well as working out the licensing issues.

[mchehab@redhat.com: Fix a merge conflict with the patch that added support
 for MODULE_FIRMWARE() macro]
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 21:01:44 -03:00
Devin Heitmueller ad03d300e8 [media] au0828: make xc5000 firmware speedup apply to the xc5000c as well
Make the firmware speedup work for the 5000c as well as the original
xc5000.  This cuts firmware load time in half.

Thanks to John Casey at Hauppauge for loaning me a board for testing.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:58:57 -03:00
Devin Heitmueller e58071f024 [media] au0828: fix a couple of missed edge cases for i2c gate with analog
This patch addresses a couple of cases where I forgot to pop open the
gate when in analog mode (a correlary to fix the change made in patch
1c58d5b4a5fca42dce5428bd79b9405878017735).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:58:31 -03:00
Devin Heitmueller ca60a45dd4 [media] xc5000: show debug version fields in decimal instead of hex
The driver prints out a dotted version number but it's in hex.  As a
result, the version doesn't visibly match the filename for the firmware,
and it caused a bunch of confusion while discussing different versions
with the chip manufacturer.

Change the firmware printout to be in decimal.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:58:05 -03:00
Devin Heitmueller 21dc61d3c0 [media] au0828: tweak workaround for i2c clock stretching bug
The hack I put in a couple of years ago to avoid clock stretching issues
when talking to the xc5000 worked fine for writes, but intermittently
fails for register reads, because the xc5000 may stretch the clock for
longer between bytes (I was seeing cases of 21 us on the analyzer).

The problem manifested itself as the xc5000 firmware version and PLL
lock register intermittently showing garbage values.

Slow down the i2c bus from 30 KHz to 20 KHz to accommodate.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:57:39 -03:00
Devin Heitmueller 22d5c6f585 [media] xc5000: add support for firmware load check and init status
The xc5000c and newer versions of the xc5000a firmware need minor revisions
to their initialization process.  Add support for validating the firmware
was properly loaded, as well as checking the init status after initialization.

Based on advice from CrestaTech support as well as xc5000 datasheet v2.3.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:56:45 -03:00
Devin Heitmueller de49bc6ee9 [media] xc5000: reset device if encountering PLL lock failure
It's possible for the xc5000 to enter an unknown state such that all
subsequent tuning requests fail.  The only way to recover is to reset the
tuner and reload the firmware.  This problem was detected after several days
straight of issuing tuning requests every five seconds.

Reset the firmware in the event that the PLL is in an unlocked state.  This
solution was provided by the engineer at CrestaTech (the company that acquired
Xceive).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:55:55 -03:00
Devin Heitmueller baede40c4d [media] au0828: tune retry interval for i2c interaction
Adjust the retry timeout and number of retries to speed up xc5000
firmware download.  With this change it goes from 4.2 seconds to 2.9.
The net time waited is pretty much the same, but we just poll more
often.

Tested at 250 KHz as well as 30 KHz.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:41:03 -03:00
Devin Heitmueller 8ff63de690 [media] au0828: remove control buffer from send_control_msg
There are no cases where a control message is ever sent to the au0828
with an actual buffer defined.  Remove the reference to dev->ctrlmsg,
which currently requires us to hold a mutex since it is shared with the
read function.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:40:20 -03:00
Devin Heitmueller faaf01b2f6 [media] au0828: speed up i2c clock when doing xc5000 firmware load
Put a hack in place to speed up the firmware load in the case that the
xc5000 has just been reset.  The chip can safely do 400 KHz in this mode,
while in normal operation it can only do 100 KHz.

This reduces the firmware load time from 6.9 seconds to 4.2.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:39:36 -03:00
Devin Heitmueller a595c1ce4c [media] au0828: fix case where STREAMOFF being called on stopped stream causes BUG()
We weren't checking whether the resource was in use before calling
res_free(), so applications which called STREAMOFF on a v4l2 device that
wasn't already streaming would cause a BUG() to be hit (MythTV).

Reported-by: Larry Finger <larry.finger@lwfinger.net>
Reported-by: Jay Harbeston <jharbestonus@gmail.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:38:35 -03:00
Devin Heitmueller 4a03dafc7b [media] au0828: prevent i2c gate from being kept open while in analog mode
The original implementation of the analog support would use an
i2c_gate_ctrl function when using the digital side of the au8522, but on
the analog side we would always just force the gate open and leave it
open all the time.

This can have adverse effects on the xc5000 given the tuner is receiving
all the spurious i2c traffic (a problem which can be exaggerated due to
bugs in the au0828 i2c hardware implementation).

Rework the existing hack to only open/close the gate when actually
talking to the tuner.

This logic might need to be reworked a bit if anybody ever tries to add
support for a board that has the au0828/au8522 but doesn't have digital
support implemented (because the i2c_gate_ctrl callback is being set in
the DVB attach).  However given how few different models are in
circulation, this can be deferred until such a situation arises (if
ever).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:37:56 -03:00
Devin Heitmueller fc7a74bad1 [media] xc5000: don't invoke auto calibration unless we really did reset tuner
The current code invokes the auto calibration of the tuner whenever the
init routine is called (whenever the DVB frontend opens the device).
However we should really only be invoking the calibration if we actually
did reset the device and reload the firmware.

Rework the routine to only do calibration if reset and firmware load was
performed.  Also because the called function is now a no-op if the
firmware is already loaded, the caller no longer needs to invoke
is_firmware_loaded().

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:36:43 -03:00
Devin Heitmueller d6b8267800 [media] au8522: fix regression in logging introduced by separation of modules
The au8522 driver was broken into three modules (dig, decoder, common),
and as a result the debug modprobe option doesn't work for any of the
common functions.

Copy the module macros over to the common module so that the debug
option works again.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:35:55 -03:00
Devin Heitmueller c98bc032c5 [media] au0828: make sure video standard is setup in tuner-core
If the user performs a tuning attempt without explicitly calling the
s_std ioctl(), a value of zero is sent from tuner-core to xc5000.  This
causes the xc5000 driver to leave the standard unchanged.  The problem
was masked by the fact that the xc5000 driver defaulted to NTSC, but if
you happened to perform an ATSC/ClearQAM tuning attempt and then do an
analog tune, the net effect is an analog tune with the standard still
set to DTV6.

Keep track of whether the standard has ever been sent to tuner-core.  We
don't make an s_std subdev call explicitly during probe because that
will cause a firmware load (which is very time consuming on the 950q).
With the logic in this patch, the s_std call will occur automatically on
the s_freq call if it hasn't already been set.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:35:26 -03:00
Devin Heitmueller 549ee4df19 [media] au0828: fix race condition that causes xc5000 to not bind for digital
In some cases users would see the xc5000_attach() call failing for the
digital side of the tuner on initialization.  This is because of udev
running v4l-id while the digital side of the board is still coming up.

This is the exact same race condition which was present in em28xx (not
surprising since I copied all the locking logic from that driver when I
added analog support).  Reproduce Mauro's fix from the em28xx driver in
au0828.

Reported-by: Rick Harding <rharding@mitechie.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:34:16 -03:00
Devin Heitmueller 0a3dabb15e [media] xc5000: properly report i2c write failures
The logic as written would *never* actually return an error condition,
since the loop would run until the counter hit zero but the check was
for a value less than zero.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:33:13 -03:00
Devin Heitmueller 7c287f1849 [media] xc5000: add support for showing the SNR and gain in the debug output
When debugging is enabled, also show the analog SNR and the total gain
status values.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:32:47 -03:00
Devin Heitmueller 1aa9c487ff [media] xc5000: properly show quality register values
The quality register only has relevant data in bits 2-0, so discard the
other bits (which results in a value being printed that is consistent
with the expected 0-7 range).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:32:24 -03:00
Devin Heitmueller 364d2db279 [media] au0828: Make the s_reg and g_reg advanced debug calls work against the bridge
The g_reg and s_reg calls worked properly if acting on subdev registers
(such as the au8522), but didn't work against the au0828 itself.  Copy
the logic over from em28xx.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:32:00 -03:00
Devin Heitmueller 43f2cccfc8 [media] au8522: properly recover from the au8522 delivering misaligned TS streams
There is an apparent bug in the au8522 TS clocking which can result in
it delivering a TS payload to the au0828 that is shifted by some number
of bits. For example, the device will announce a packet containing "FA
38 FF F8" which if you shift left one bit is "1F 47 1F FF F0..."

This presents itself as no TS stream being delivered from the kernel to
userland, since the kernel demux will drop every packet.

In the event that this condition occurs, restart the DVB stream.

Also, this patch includes a couple of lines of cleanup to not change the
FIFO configuration while the FIFO is running (which can screw up the
state machine), and dequeue the buffers before turning off the FIFO.
This puts the logic in sync with the Windows driver.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:31:30 -03:00
Devin Heitmueller b0c4878ebe [media] au8522: Fix off-by-one in SNR table for QAM256
The table of valid SNR values for QAM 256 is off by one, and as a result
if the SNR is oscillating between 40.0 and 39.9 dB, tools like azap show
it going back and forth between 40.0 and 0 (misleading some people,
including myself, to think signal lock is being lost or there is a
problem with register reads).

Fix the table so that 40.0 dB is properly represented.

Cc: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:29:43 -03:00
Devin Heitmueller a307cfa55e [media] au8522: fix intermittent lockup of analog video decoder
It turns up the autodetection for the video standard in the au8522 is
prone to hanging the chip until a reset is performed.  This condition is
trivial to reproduce simply by tuning to a station and then rapidly
unplugging/ replugging the coax feed.

Because we've never claimed to support anything other than NTSC-M, just
disable the video-standard autodetection logic and force it to always be
NTSC-M.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:29:15 -03:00
Hans Verkuil cf53373585 [media] v4l2-dev: remove V4L2_FL_LOCK_ALL_FOPS
All drivers that needed V4L2_FL_LOCK_ALL_FOPS have been converted,
so remove this flag altogether.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:18:16 -03:00
Hans Verkuil f46940399b [media] mem2mem_testdev: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:17:32 -03:00
Hans Verkuil 7224679a31 [media] vpif_capture: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:17:14 -03:00
Hans Verkuil 0b7286d92d [media] vpif_display: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:16:55 -03:00
Hans Verkuil bc738301ba [media] s5p-mfc: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:16:34 -03:00
Hans Verkuil 00ccdc3c33 [media] s5p-tv: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:16:20 -03:00
Hans Verkuil de40cb227d [media] s5p-g2d: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:13:08 -03:00
Hans Verkuil b0d5cd6b5f [media] s5p-jpeg: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:12:46 -03:00
Hans Verkuil 8422b08783 [media] soc_camera: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:12:17 -03:00
Hans Verkuil 1f7e073da5 [media] cx231xx: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:11:50 -03:00
Hans Verkuil 28c3682ac5 [media] bfin_capture: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:11:15 -03:00
Hans Verkuil f135a8a224 [media] sh_vou: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 20:10:10 -03:00
Hans Verkuil 954f5bcb39 [media] mx2_emmaprp: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 19:51:17 -03:00
Hans Verkuil cbc807dc8a [media] vpbe_display: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 19:49:54 -03:00
Hans Verkuil 0e1f0edfdd [media] s2255drv: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 19:49:30 -03:00
Hans Verkuil 87cb0278c9 [media] fsl-viu: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 19:48:53 -03:00
Hans Verkuil a2e10b5aee [media] wl128x: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 19:48:32 -03:00
Hans Verkuil 14a09dac53 [media] tm6000: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 19:47:45 -03:00
Hans Verkuil 876cb14db3 [media] em28xx: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 19:46:52 -03:00
Hans Verkuil 4d345708ca [media] usbvision: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 19:45:19 -03:00
Hans Verkuil d76ebb67cc [media] cpia2: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 19:44:33 -03:00
Hans Verkuil 6de7d14d7a [media] saa7146: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

I also removed some dead code in the form of the saa7146_devices list and
saa7146_devices_lock mutex: these were used once but that was a long time
ago.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 19:43:28 -03:00
Hans Verkuil 85397ef62a [media] ivtv: remove V4L2_FL_LOCK_ALL_FOPS
Add proper locking to the file operations, allowing for the removal
of the V4L2_FL_LOCK_ALL_FOPS flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09 19:42:08 -03:00
Mauro Carvalho Chehab c3707357c6 [media] az6007: Update copyright
Update copyright comments after dvb-usb-v2 conversion.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-06 09:25:12 -03:00
Mauro Carvalho Chehab 6da74b1da2 [media] az6007: handle CI during suspend/resume
The dvb-usb-v2 core doesn't know anything about CI. So, the
driver needs to handle it by hand. This patch stops CI just
before stopping URB's/RC, and restarts it before URB/RC start.

It should be noticed that suspend/resume is not yet working properly,
as the PM model requires the implementation of reset_resume:
	dvb_usb_az6007 1-6:1.0: no reset_resume for driver dvb_usb_az6007?
But this is not implemented there at dvb-usb-v2 yet.

Cc: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-06 09:25:07 -03:00
Mauro Carvalho Chehab 0ca477ea8d [media] az6007: make all functions static
There's no reason why those functions shouldn't be static.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-06 09:24:40 -03:00
Mauro Carvalho Chehab 3cb9f4e282 [media] az6007: rename "st" to "state" at az6007_power_ctrl()
On all other parts, this var is called state. So, use the same
name here, to be consistent.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-06 09:24:29 -03:00
Mauro Carvalho Chehab caeb5ac7f9 [media] az6007: Fix the number of parameters for QAM setup
Remove those warning messages:
[  121.696758] drxk: SCU_RESULT_INVPAR while sending cmd 0x0203 with params:
[  121.703401] drxk: 02 00 00 00 10 00 07 00 03 02                    ..........
[  121.703587] drxk: Warning -22 on QAMDemodulatorCommand

Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-06 09:24:21 -03:00
Mauro Carvalho Chehab 916c81422a [media] az6007: fix the I2C W+R logic
The test for I2C W+R will never be true. Fix it.

Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-06 09:24:04 -03:00
Mauro Carvalho Chehab 255d52f254 [media] az6007: convert it to use dvb-usb-v2
Change it to use dvb-usb-v2. The driver should be working as before.
The only functional changes should be at the driver debug logs.

This driver needs the cypress firmware load, so, auto-selects it.

Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-06 09:23:46 -03:00
Mauro Carvalho Chehab 115ad55e9c [media] dvb-usb-v2: Don't ask user to select Cypress firmware module
The dvb-usb-v2 cypress firmware module is not optional, as drivers
won't work without it. So, instead of opening a menu for the user to
manually select, let the drivers that need it to select, hiding this
option from the Kconfig menu.

Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-06 09:23:26 -03:00
Mauro Carvalho Chehab 69abe02e78 [media] dvb-usb-v2: Fix cypress firmware compilation
ERROR: "usbv2_cypress_load_firmware" [drivers/media/dvb/dvb-usb-v2/dvb-usb-az6007.ko] undefined!

Cypress fimware will never be compiled properly, as the Makefile rule
is wrong.

Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-06 09:23:15 -03:00
Javier Martin 33eb46a7c2 [media] media: i.MX27: Fix mx2_emmaprp mem2mem driver clocks
This driver wasn't converted to the new clock framework
(e038ed50a4).

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-06 09:10:36 -03:00
Mauro Carvalho Chehab 84b3bd4623 [media] m2m-deinterlace: fix two warnings
drivers/media/video/m2m-deinterlace.c: In function ‘deinterlace_issue_dma’:
drivers/media/video/m2m-deinterlace.c:363:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘dma_addr_t’ [-Wformat]
drivers/media/video/m2m-deinterlace.c:363:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘dma_addr_t’ [-Wformat]

Cc: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-06 09:06:34 -03:00
Javier Martin 8f0755c06b [media] media: Add mem2mem deinterlacing driver
Some video decoders such as tvp5150 provide separate
video fields (V4L2_FIELD_SEQ_TB/BT). This driver uses
dmaengine to convert this format to V4L2_FIELD_INTERLACED_TB/BT
(weaving) or V4L2_FIELD_NONE (line doubling) so that the
image can be displayed or processed.

Of course there will be combing effect in the image but this
can be accepted for some low quality applications.

Currently only YUV420 and YUYV formats are supported but
it can be extended later.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-06 09:02:55 -03:00
Javier Martin 186b250a07 [media] media: coda: Add driver for Coda video codec
Coda is a range of video codecs from Chips&Media that
support H.264, H.263, MPEG4 and other video standards.

Currently only support for the codadx6 included in the
i.MX27 SoC is added. H.264 and MPEG4 video encoding
are the only supported capabilities by now.

[mchehab@redhat.com: Add missing include linux/of.h]
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Reviewed-by: Philipp Zabel<p.zabel@pengutronix.de>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-06 09:02:23 -03:00
Mauro Carvalho Chehab ccc0e3483c [media] move dvb-usb-ids.h to dvb-core
While this header were meant to be used just by dvb-usb driver, it
is now being used also by dvb-usb-v2 and cx231xx. So, move it to a
better place.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-05 19:53:26 -03:00
Antti Palosaari 355b4b2b5e [media] dvb_usbv2: rename dvb_usb_firmware to cypress_firmware
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:40 -03:00
Antti Palosaari eb29fbeaed [media] af9015: remote controller fixes
1)
AF9015 remote controller query will fail rarely due to register
access failures and dvb_usb_v2 will stop rc polling when error
returned. Add logic to allow errors until two consecutive errors
occurs.

2)
Remote controller key map was not loaded in case of key map was set as
a device property. Fix it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:40 -03:00
Antti Palosaari ad6b9e517b [media] dvb_usb_v2: move from dvb-usb to dvb-usb-v2
Move to own directory.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:40 -03:00
Antti Palosaari 4d2e596ac8 [media] gl861: convert to new DVB USB
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:40 -03:00
Antti Palosaari 8572211842 [media] mxl111sf: convert to new DVB USB
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:39 -03:00
Antti Palosaari de73beeed0 [media] dvb_usb_v2: register device even no remote keymap defined
It failed to register device when remote keymap was not set.
Fix it to register device even keymap is NULL. In that case
just skip remote registration.

Driver should set RC_MAP_EMPTY to enable remote in case of
there is remote receiver but default keymap is unknown.

Reported-by: pierigno <pierigno@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:39 -03:00
Antti Palosaari 5674ca257c [media] dvb_usb_v2: remove usb_clear_halt() from stream
It works no longer as it was designed since we can change streaming
configuration during device operation.

Maybe it should be performed conditionally on cases when streaming
endpoint is changed. Anyhow, let it out now and add later if needed.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:39 -03:00
Antti Palosaari b62fd172ff [media] dvb_usb_v2: do not try to remove non-existent adapter
Check that adapter exists before trying to remove it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:39 -03:00
Antti Palosaari d10d1b9ac9 [media] dvb_usb_v2: use dev_* logging macros
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:39 -03:00
Antti Palosaari a13a6e1f9d [media] dvb_usb_v2: change streaming control callback parameter
Pass frontend instead of adapter as some drivers need to make
decisions based frontend.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:38 -03:00
Antti Palosaari 18cfe03d32 [media] dvb_usb_v2: fix power_ctrl() callback error handling
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:38 -03:00
Antti Palosaari 12042b0593 [media] dvb_usb_v2: update copyrights
Signed-off-by: Antti Palosaari <crope@iki.fi>
Cc: Patrick Boettcher <patrick.boettcher@desy.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:38 -03:00
Antti Palosaari edc7d44834 [media] dvb_usb_v2: remove unused variable
It was left from the legacy remote controller we do not support.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:38 -03:00
Antti Palosaari f93c802887 [media] dvb_usb_v2: update header dvb_usb.h comments
Comment briefly all used structures and variables.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:38 -03:00
Antti Palosaari 1162c7b383 [media] dvb_usb_v2: refactor dvb_usbv2_generic_rw()
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:37 -03:00
Antti Palosaari 831511bdee [media] dvb_usb_v2: multiple small tweaks around the code
Naming, small code changes, debug writings, etc.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:37 -03:00
Antti Palosaari 9f6f82ee61 [media] dvb_usb_v2: move dvb_usbv2_generic_rw() debugs behind define
It is nice to have this debug, but as it generates very huge amount
of traffic, better to make it conditional. Use define macro to disable
it as I did not find out how to use dynamic debugs to dump variable
length buffers like that.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:37 -03:00
Antti Palosaari 41a0abf710 [media] dvb_usb_v2: merge files dvb_usb_init.c and dvb_usb_dvb.c
Merge files dvb_usb_init.c and dvb_usb_dvb.c to dvb_usb_core.c.
It is still under 1000 lines of code after all the optimization
so put it one file.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:37 -03:00
Antti Palosaari 62a5f449ca [media] dvb_usb_v2: refactor dvb_usb_ctrl_feed() logic
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:37 -03:00
Antti Palosaari 5cd983200a [media] dvb_usb_v2: remove num_adapters_initialized variable
We can live easily without it so remove it, make code and binary
few bytes smaller.

>From struct dvb_usb_device variable int num_adapters_initialized.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:37 -03:00
Antti Palosaari a0921af7eb [media] dvb_usb_v2: use identify_state() to resolve firmware name
Merge get_firmware_name() to identify_state().

It is wise to resolve firmware name in that routine as it does
decision wether or not to load firmware at all. It is one very
rarely needed callback less.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:36 -03:00
Antti Palosaari b905a2a133 [media] dvb_usb_v2: merge get_ts_config() to get_usb_stream_config()
Piggypag TS type callback to USB stream callback and change
callback name slightly to fit better.
Both of those are rather rare callback and has a relation. Transport
Stream, TS, is input stream and USB stream is output stream of
DVB USB bridge.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:36 -03:00
Antti Palosaari ec0dd2f20c [media] dvb_usb_v2: use container_of() for adapter to device
We dont need that pointer as we can use container_of() macro thus
remove it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:36 -03:00
Antti Palosaari 2731d4ed77 [media] ec168: use DVB UDB macros
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:36 -03:00
Antti Palosaari 232b6968b1 [media] ce6230: use DVB USB macros
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:36 -03:00
Antti Palosaari a1da814642 [media] au6610: use DVB USB macros
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:35 -03:00
Antti Palosaari 05cd62e0f8 [media] anysee: use DVB USB macros
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:35 -03:00
Antti Palosaari 4edcf22bf2 [media] dvb_usb_v2: git rid of dvb_usb_adapter state variable
We can live without it easily.

Also USB data stream complete callback checks for feedcount
seems to be quite redundant so remove those also.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:35 -03:00
Antti Palosaari 5da2aecb46 [media] af9035: convert to new DVB USB
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:35 -03:00
Antti Palosaari 191f79a4d7 [media] dvb_usb_v2: use lock to sync feed and frontend control
There was synchronization problem when streaming was stopped.
Frontend was ran down before stream which causes problems.
Use mutex to synchronization. Now it looks like that:
LOCK
start frontend
UNLOCK
LOCK
start streaming
[...]
stop streaming
UNLOCK
LOCK
stop frontend
UNLOCK

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:35 -03:00
Antti Palosaari e80896616c [media] af9015: use helper macros for some pointers
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:35 -03:00
Antti Palosaari f89f9ff883 [media] dvb_usb_v2: helper macros for device/adapter/frontend pointers
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:34 -03:00
Antti Palosaari 1a590010a2 [media] af9015: update USB streaming configuration logic
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:34 -03:00
Antti Palosaari 6400a8c5af [media] dvb_usb_v2: change USB stream config logic
Initial / default USB stream configuration is now set always as a
dvb_usb_device_properties. Dynamic configuration is done top of
that if callback .get_usb_stream_config() exists. Default values
are set when callback is called so callback needs only change
values that are different than default.

In addition of that define two macros DVB_USB_STREAM_BULK() and
DVB_USB_STREAM_ISOC() for filling struct usb_data_stream_properties

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:34 -03:00
Antti Palosaari 12077a3aa4 [media] dvb_usb_v2: add macros to fill USB stream properties
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:34 -03:00
Antti Palosaari ddee56943a [media] dvb_usb_v2: .read_mac_address() callback changes
Give DVB adapter as a parameter for callback. MAC address is
adapter property and it could be (at least in theory) there
is devices having multiple adapters and all has own MAC.

Also add error handling. If callback fails error is returned
which leads device unregister.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:34 -03:00
Antti Palosaari dd5e52cdf9 [media] dvb_usb_v2: remove num_frontends_initialized from dvb_usb_adapter
We can live easily without that variable.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:34 -03:00
Antti Palosaari 6dca4ea3ec [media] dvb_usb_v2: move fe_ioctl_override() callback
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:33 -03:00
Antti Palosaari d70521a396 [media] dvb_usb_v2: get rid of dvb_usb_device state
Remove state from struct dvb_usb_device as we can live without.
Add some debug logs.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:33 -03:00
Antti Palosaari ad26183931 [media] dvb_usb_v2: simplify remote init/exit logic
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:33 -03:00
Antti Palosaari 6e3a5daa6e [media] dvb_usb_v2: try to remove all adapters on exit
It did not removed adapter on error case as .num_adapters_initialized
was set after success adapter initialization. It should be safe to
try remove all possible adapters in any-case.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:33 -03:00
Antti Palosaari ffe4ac92ee [media] dvb_usb_v2: do not release USB interface when device reconnects
USB core will call disconnect and remove driver for us as device
will disconnect itself. After that it is loaded again as a new
device but it is warm and no firmware loading needed.

Reported-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:32 -03:00
Malcolm Priestley c65bcb95be [media] dvb_usb_v2: return the download ret in dvb_usb_download_firmware
The first being this patch, no return value from dvb_usb_download_firmware
causes system wide dead lock with COLD disconnect as system attempts to continue
to warm state.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:32 -03:00
Antti Palosaari a4e7c51edd [media] anysee: convert to new DVB USB
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:32 -03:00
Antti Palosaari 2cc53dc828 [media] dvb_usb_v2: attach tuners later
It is more than nice to have all those frontend pointers when
attaching tuner to the frontend in question. Make that possible
attaching tuners after dvb_register_frontend()

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:32 -03:00
Antti Palosaari ec04745790 [media] ce6230: various small changes
Small changes like log writings. No functionality changes.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:32 -03:00
Antti Palosaari ab84f182f0 [media] ce6230: convert to new DVB USB
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:32 -03:00
Antti Palosaari 877e0aa790 [media] dvb_usb_v2: move remote controller to the main file
It is only three functions so move it to the main.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:31 -03:00
Antti Palosaari cb4f77a385 [media] au6610: convert to new DVB USB
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:31 -03:00
Antti Palosaari 77e28ec279 [media] ec168: re-implement firmware loading
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:31 -03:00
Antti Palosaari d32be21800 [media] dvb_usb_v2: do not check active fe when stop streaming
Do not check active frontend as it could be already shutdown.
Add some more debugs.

It turns out that device is put sleep earlier than streaming
is stopped in some cases. That is because streaming is running
different task and there is no locking.

Maybe some locking could be good idea to force stop streaming
before device is shut down. I can guess there could be problems
in someday cases like chip is sleep but streaming control is
requested after that...

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:31 -03:00
Antti Palosaari ce6ea9a942 [media] ec168: switch Kernel pr_* logging
Change logging.
Some minor text and error number changes.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:31 -03:00
Antti Palosaari 3eee04722f [media] ec168: convert to new DVB USB
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:31 -03:00
Antti Palosaari f093c388ef [media] dvb_usb_v2: use pointers to properties
Use pointers to properties as device and adapter properties are
constant. No need to embed and copy those structures.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:30 -03:00
Antti Palosaari 53dc194f0c [media] af9015: suspend/resume
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:30 -03:00
Antti Palosaari acaec14f3e [media] dvb_usb_v2: use keyword const for USB ID table
Let optimize that code to the text segment.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:30 -03:00
Antti Palosaari 2d2b37c75a [media] dvb_usb_v2: move few callbacks one level up
Move frontend_attach, tuner_attach, frontend_ctrl and streaming_ctrl
from adapter to device.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:30 -03:00
Antti Palosaari b00a901801 [media] dvb_usb_v2: Cypress firmware download module
Firmware handling routines for various Cypress chips.
Cypress AN2135
Cypress AN2235
Cypress FX2

These were split out from general DVB USB module by
Patrick Boettcher. I did only small changes.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:30 -03:00
Antti Palosaari ef81e9ebbe [media] dvb_usb_v2: suspend/resume stop/start USB streaming
Stop remote polling and USB streaming before suspend and resume
those when back to normal operation.

It is far away from complete implementation, but at least it does
not hang system anymore on suspend while streaming is ongoing.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:29 -03:00
Antti Palosaari 5b6a63cc2f [media] dvb_usb_v2: add .disconnect() callback
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:29 -03:00
Antti Palosaari 823eebac89 [media] dvb_usb_v2: probe/disconnect error handling
In my understanding we never call .disconnect() when .probe()
returns error. Change .probe() to return error all cases it cannot
handle given interface and simplify .disconnect() handling.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:29 -03:00
Antti Palosaari d496eb8ae4 [media] dvb_usb_v2: misc cleanup changes
Error handling, remove unneeded stuff, renaming, etc.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:29 -03:00
Antti Palosaari 0fba999f13 [media] dvb_usb_v2: I2C adapter cleanup changes
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:28 -03:00
Antti Palosaari 77f54517fd [media] af9015: use USB core soft_unbind
I think it is better to allow driver finish pending operations and
disconnect device. Killing all ongoing USB transfers could have very
bad effect, even break hardware in worst case.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:28 -03:00
Antti Palosaari a3645e5430 [media] af9015: switch to new DVB-USB
Almost all hacks are now removed and much less code.
Reducing af9015 driver code from 2084 to 1609, it is almost
500 LOC less!

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:28 -03:00
Antti Palosaari 597843435c [media] dvb_usb_v2: enable compile
Compilation was disabled as it was failing with allyesconfig.
Rename duplicate functions and enable building.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:28 -03:00
Antti Palosaari 3238aafbc3 [media] dvb_usb_v2: do not free resources until delayed init is done
It was possible to free resources by unloading module while
initialization was still ongoing on delayed work.

Use PID to make decision on .disconnect() if caller is our
work or some other as work also calls .disconnect() in error
case. There could be better solution still...

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:28 -03:00
Antti Palosaari 36a5c2bded [media] dvb_usb_v2: fix dvb_usb_generic_rw() debug
Debug prints write operation data instead of read data was
intention.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:28 -03:00
Antti Palosaari 65de8f978f [media] dvb_usb_v2: add missing new line for log writings
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:27 -03:00
Antti Palosaari 3676403764 [media] dvb_usb_v2: add .bInterfaceNumber match
There is no USB match flag for used USB interface. It is rather
common there is multiple interfaces offering different services.
For example one for television and one for remote controller.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:27 -03:00
Antti Palosaari 6b8c8c4089 [media] dvb_usb_v2: rename device_init/device_exit to probe/disconnect
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:27 -03:00
Antti Palosaari a177c72bf5 [media] dvb_usb_v2: move I2C adapter code to different file
No worth to keep it on own file as it is only 30 LOC.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:27 -03:00
Antti Palosaari 23d8e63a90 [media] dvb_usb_v2: use Kernel logging (pr_debug/pr_err/pr_info)
Use Kernel logging insteads of own macros.
Get rid of old debugs and use dynamic debug.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:27 -03:00
Antti Palosaari cce99cf933 [media] dvb_usb_v2: unregister all frontends in error case
Unregister all if there is any error meet during
frontend initialization.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:27 -03:00
Antti Palosaari 96ffea88cd [media] dvb_usb_v2: remove usb_clear_halt()
Calling usb_clear_halt() during device init is not correct.
2 of 7 AF9015 devices I have timeouts next USB control message
after usb_clear_halt(). It was originally performed between
tuner_attach() and rc_query() and likely not causing problems
since rc_query() is repeated continously. None could see it when
first rc_query() failed...

Secondly it was not called for .generic_bulk_ctrl_endpoint_response.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:26 -03:00
Antti Palosaari 4f208d4e2d [media] dvb_usb_v2: refactor delayed init
Move work to the struct dvb_usb_device that we can access
it inside .disconnect().

Also many other minor changes.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:26 -03:00
Antti Palosaari 0a8673569f [media] dvb_usb_v2: ensure driver_info is not null
It could be null in case of driver does not set it
properly, like missing dynamic ID handling.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:26 -03:00
Antti Palosaari e48b2a6861 [media] dvb_usb_v2: frontend switching changes
Some error checking changes and refactoring.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:26 -03:00
Antti Palosaari e80e9af308 [media] dvb_usb_v2: remove various unneeded variables
Adapter priv is not really needed, use device priv instead.
There is only driver or two using that.

Device caps are not needed. There was only "has I2C adapter"
capability defined. It is useless as we can see same just
checking existence of i2c_algo callback.

And also remove some totally not used at all variables.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:26 -03:00
Antti Palosaari 19ec2728d7 [media] dvb_usb_v2: use dynamic debugs
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:26 -03:00
Antti Palosaari 0359b5fa9e [media] dvb_usb_v2: add macro for filling usb_device_id table entry
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:25 -03:00
Antti Palosaari a0d72d246d [media] dvb_usb_v2: clean firmware downloading routines
Remove Cypress USB-interface firmware downloading routines.
That is common module and having single vendor chip routines
in common module is wrong. Just move those elsewhere.

Move single function out from the dvb_usb_firmware.c and
remove that file.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:25 -03:00
Antti Palosaari 21f5a32e1f [media] dvb_usb_v2: delay firmware download as it blocks module init
Delay firmware download and whole driver initialization using
workqueue. udev causes problems when blocking firmware download
was done during module init. This will likely resolve all
DVB USB firmware downloading issues we have had during recent years.

Fixes bug in case of DVB USB driver:
https://bugzilla.redhat.com/show_bug.cgi?id=827538

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:25 -03:00
Antti Palosaari 1c9c73b7db [media] dvb_usb_v2: remove .num_frontends
It is no longer needed because all frontends are attached as a one go.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:25 -03:00
Antti Palosaari 20bb9cc483 [media] dvb_usb_v2: get rid of (struct dvb_usb_adapter_fe_properties)
Get rid of (struct dvb_usb_adapter_fe_properties) as we no longer
need it. Frontends are now defined as a array of pointers inside
adapter struct.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:24 -03:00
Antti Palosaari fec88df01d [media] dvb_usb_v2: move 3 callbacks from the frontend to adapter
Move .frontend_attach(), .tuner_attach() and .streaming_ctrl()
from the frontend to adapter.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:24 -03:00
Antti Palosaari e46c5b66da [media] dvb_usb_v2: move PID filters from frontend to adapter
Filtering given PIDs from the transport stream is done by the
DVB USB bridge. It is highly possible there is limitations what
kind of stream DVB USB bridge can PID filter, but it still does
not make sense to define filters for each frontend as frontend
could offer different stream types for different standards.

Likely new way is to enable / disable PID filters are needed to
make decision at runtime (callback). PID filters are quite legacy
stuff as those are aimed cut stream smaller to fit for the USB1.1...

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:24 -03:00
Antti Palosaari 3024985d15 [media] dvb_usb_v2: move (struct usb_data_stream_properties) to upper level
Move USB stream properties from frontend to adapter.
It is property of adapter.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:24 -03:00
Antti Palosaari b6ecf8bb4e [media] dvb_usb_v2: add .get_ts_config() callback
Add new callback in order to resolve used TS (MPEG transport stream)
configuration. Normal TS is 188 byte payload only but there is
currently 204 byte TS and raw TS supported too.

Traditionally TS type was mapped as a frontend property but it
does not work no longer after we changed from MFE (multi-frontend)
to SFE (single-frontend). So it is not possible to map TS for the
given FE as there could be only one FE instead of multiple.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:23 -03:00
Antti Palosaari 3256cdef6e [media] dvb_usb_v2: move (struct usb_data_stream) to one level up
Move stream from the frontend to adapter. There could be only
one stream per adapter. One adapter can has multiple frontends
but only one can stream at the time.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:23 -03:00
Antti Palosaari 39831f094f [media] dvb_usb_v2: add .get_usb_stream_config()
New callback to resolve current USB stream configuration.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:23 -03:00
Antti Palosaari 15072bba79 [media] dvb_usb_v2: usb_urb.c use dynamic debugs
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:23 -03:00
Antti Palosaari bce1c02902 [media] dvb_usb_v2: dynamic USB stream URB configuration
Change URB count, buffer size and type [BULK/ISOC]
dynamically when needed if existing URB buffers are
big enough.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:22 -03:00
Antti Palosaari 0575289041 [media] dvb_usb_v2: remote controller changes
Add .get_rc_config() callback and remove old static configs.
Refactor remote controller routines.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:22 -03:00
Antti Palosaari 19b308c035 [media] dvb_usb_v2: init I2C and USB mutex earlier
Those must be initialized earlier as we now pass
(struct dvb_usb_device *) to the firmware download
callbacks too.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:22 -03:00