pandora-kernel.git
9 years ago[media] vmalloc_sg: off by one in error handling
Dan Carpenter [Tue, 5 Aug 2014 08:11:13 +0000 (05:11 -0300)]
[media] vmalloc_sg: off by one in error handling

The "i--" needs to happen at the start of the loop or it will try to
release something bogus (probably it will crash) and it won't release
the first ->vaddr_page[].

Fixes: 7b4eeed174b7 ('[media] vmalloc_sg: make sure all pages in vmalloc area are really DMA-ready')

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] as102-fe: Add a release function
Mauro Carvalho Chehab [Wed, 13 Aug 2014 00:35:44 +0000 (21:35 -0300)]
[media] as102-fe: Add a release function

This is needed to free state and for dvb_detach() to be
called.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] as102: add missing viterbi lock
Mauro Carvalho Chehab [Tue, 12 Aug 2014 21:50:24 +0000 (18:50 -0300)]
[media] as102: add missing viterbi lock

In order to get FE_HAS_SYNC, the viterbi should already be
locked too. So, add the missing FE_HAS_VITERBI lock.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] as102-fe: make it an independent driver
Mauro Carvalho Chehab [Tue, 12 Aug 2014 21:50:23 +0000 (18:50 -0300)]
[media] as102-fe: make it an independent driver

Move as102-fe to dvb-frontends directory and make it an
independent driver.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] as102: prepare as102_fe to be compiled as a module
Mauro Carvalho Chehab [Tue, 12 Aug 2014 21:50:22 +0000 (18:50 -0300)]
[media] as102: prepare as102_fe to be compiled as a module

Remove the dependencies of as102_cmd from as102, in order to
allow it to be compiled as a separate module.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] as102: get rid of as10x_fe_copy_tps_parameters()
Mauro Carvalho Chehab [Tue, 12 Aug 2014 21:50:21 +0000 (18:50 -0300)]
[media] as102: get rid of as10x_fe_copy_tps_parameters()

This function just converts from the as10x internal data into
the DVBv5 cache. Get rid of it.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] as102: get rid of as102_fe_copy_tune_parameters()
Mauro Carvalho Chehab [Tue, 12 Aug 2014 21:50:20 +0000 (18:50 -0300)]
[media] as102: get rid of as102_fe_copy_tune_parameters()

This function just parses the frontend cache and converts
to the as102 internal format message. Get rid of it.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] as102: Move ancillary routines to the beggining
Mauro Carvalho Chehab [Tue, 12 Aug 2014 21:50:19 +0000 (18:50 -0300)]
[media] as102: Move ancillary routines to the beggining

Avoid having function prototypes by moving some
ancillary routines to the beginning of the file.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] as102: better name the unknown frontend
Mauro Carvalho Chehab [Tue, 12 Aug 2014 21:50:18 +0000 (18:50 -0300)]
[media] as102: better name the unknown frontend

Make the frontend .name more coherent with DVB namespace.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] as102: CodingStyle fixes
Mauro Carvalho Chehab [Tue, 12 Aug 2014 21:50:17 +0000 (18:50 -0300)]
[media] as102: CodingStyle fixes

Fix this warning:

WARNING: quoted string split across lines
566: FILE: drivers/media/usb/as102/as102_fe.c:141:
+ "demod status: fc: 0x%08x, bad fc: 0x%08x, "
+ "bytes corrected: 0x%08x , MER: 0x%04x\n",

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] as102: get rid of FSF mail address
Mauro Carvalho Chehab [Tue, 12 Aug 2014 21:50:16 +0000 (18:50 -0300)]
[media] as102: get rid of FSF mail address

Make checkpatch happier by removing FSF mail address.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] as102: promote it out of staging
Mauro Carvalho Chehab [Tue, 12 Aug 2014 21:50:15 +0000 (18:50 -0300)]
[media] as102: promote it out of staging

This driver is stable and doesn't contain any really serious
issue. Move it out of staging.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] staging: media: as102: replace custom dprintk() with dev_dbg()
Martin Kepplinger [Mon, 4 Aug 2014 11:13:16 +0000 (08:13 -0300)]
[media] staging: media: as102: replace custom dprintk() with dev_dbg()

remove dprintk() and replace it with dev_dbg() or pr_debug()
in order to use the common kernel coding style.

Signed-off-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] siano: add support for PCTV 77e
Mauro Carvalho Chehab [Mon, 11 Aug 2014 21:09:32 +0000 (18:09 -0300)]
[media] siano: add support for PCTV 77e

Add support for PCTV microStick (77e) device that uses a sms1140
chipset.

Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] smiapp: Set 64-bit integer control using v4l2_ctrl_s_ctrl_int64()
Sakari Ailus [Wed, 11 Jun 2014 13:37:36 +0000 (10:37 -0300)]
[media] smiapp: Set 64-bit integer control using v4l2_ctrl_s_ctrl_int64()

Don't manipulate struct v4l2_ctrl directly. Instead, use
v4l2_ctrl_s_ctrl_int64() to change the values.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] smiapp: Use unlocked __v4l2_ctrl_modify_range()
Sakari Ailus [Wed, 11 Jun 2014 13:34:35 +0000 (10:34 -0300)]
[media] smiapp: Use unlocked __v4l2_ctrl_modify_range()

Instead of modifying the control ranges directly by manipulating struct
v4l2_ctrl, use __v4l2_ctrl_modify_range() for the purpose.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: checkpatch cleanup
Philipp Zabel [Wed, 6 Aug 2014 11:02:23 +0000 (08:02 -0300)]
[media] coda: checkpatch cleanup

This patch breaks most long lines, concatenates broken up text strings,
and adds or removes parentheses where needed to make checkpatch happy.
The long codec list lines and a few 81-wide lines remain.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: disable old cropping ioctls
Philipp Zabel [Tue, 5 Aug 2014 17:00:20 +0000 (14:00 -0300)]
[media] coda: disable old cropping ioctls

Since we neither support composing on the OUTPUT side, nor cropping
on the CAPTURE side, disable VIDIOC_CROPCAP and VIDIOC_G/S_CROP
altogether. This silences a GStreamer warning when GStreamer tries
to obtain the pixel aspect ratio using VIDIOC_CROPCAP.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: set capture frame size with output S_FMT
Philipp Zabel [Tue, 5 Aug 2014 17:00:19 +0000 (14:00 -0300)]
[media] coda: set capture frame size with output S_FMT

This patch makes coda_s_fmt_vid_out propagate the output frame size
to the capture side.
The GStreamer v4l2videodec only ever calls S_FMT on the output side
and then expects G_FMT on the capture side to return a valid format.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: fix coda_s_fmt_vid_out
Philipp Zabel [Tue, 5 Aug 2014 17:00:18 +0000 (14:00 -0300)]
[media] coda: fix coda_s_fmt_vid_out

Set the context color space when s_fmt succeeded, not when it failed.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: fix timestamp list handling
Philipp Zabel [Tue, 5 Aug 2014 17:00:17 +0000 (14:00 -0300)]
[media] coda: fix timestamp list handling

Lock modification of the timestamp list with bitstream_mutex and do not
try to remove a timestamp element if the list is empty. This can happen
if the userspace feeds us garbage or multiple encoded frames in a single
buffer.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: improve allocation error messages
Philipp Zabel [Tue, 5 Aug 2014 17:00:16 +0000 (14:00 -0300)]
[media] coda: improve allocation error messages

Produce some error messages when internal buffer allocation
fails, for example because the CMA region is too small.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: add an intermediate debug level
Philipp Zabel [Tue, 5 Aug 2014 17:00:15 +0000 (14:00 -0300)]
[media] coda: add an intermediate debug level

Dumping all register accesses drowns other debugging messages
in the log. Add a less verbose debug level.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: increase max vertical frame size to 1088
Philipp Zabel [Tue, 5 Aug 2014 17:00:14 +0000 (14:00 -0300)]
[media] coda: increase max vertical frame size to 1088

This patch increases the maximum vertical frame size reported
by enum_fmt and accepted by try_fmt/s_fmt from 1080 to 1088.
Since for 16x16-pixel macroblocks 1080p will be rounded up to
this anyway, we may as well admit that we support it.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: allow running coda without iram on mx6dl
Philipp Zabel [Tue, 5 Aug 2014 17:00:13 +0000 (14:00 -0300)]
[media] coda: allow running coda without iram on mx6dl

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: skip calling coda_find_codec in encoder try_fmt_vid_out
Philipp Zabel [Tue, 5 Aug 2014 17:00:12 +0000 (14:00 -0300)]
[media] coda: skip calling coda_find_codec in encoder try_fmt_vid_out

We know that it will return NULL in this case, so we can just as well
skip it altogether.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: dequeue buffers on streamoff
Philipp Zabel [Tue, 5 Aug 2014 17:00:11 +0000 (14:00 -0300)]
[media] coda: dequeue buffers on streamoff

This is needed to decrease the q->owned_by_drv_count to zero before
__vb2_queue_cancel is called, to avoid the WARN_ON therein.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: dequeue buffers if start_streaming fails
Philipp Zabel [Tue, 5 Aug 2014 17:00:10 +0000 (14:00 -0300)]
[media] coda: dequeue buffers if start_streaming fails

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: request BIT processor interrupt by name
Philipp Zabel [Tue, 5 Aug 2014 17:00:09 +0000 (14:00 -0300)]
[media] coda: request BIT processor interrupt by name

Request the main coda interrupt using its name, "bit", if available.
Fall back to requesting the first interrupt for backwards compatibility.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: remove unnecessary peek at next destination buffer from coda_finish_decode
Philipp Zabel [Tue, 5 Aug 2014 17:00:08 +0000 (14:00 -0300)]
[media] coda: remove unnecessary peek at next destination buffer from coda_finish_decode

The return value of this call to v4l2_m2m_next_dst_buf() is never used.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: include header for memcpy
Philipp Zabel [Tue, 5 Aug 2014 17:00:06 +0000 (14:00 -0300)]
[media] coda: include header for memcpy

coda_h264_padding uses memcpy, we should include string.h for that.

Reported-by: Ian Jamison <ian.dev@arkver.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: move BIT specific functions into separate file
Philipp Zabel [Wed, 23 Jul 2014 15:28:45 +0000 (12:28 -0300)]
[media] coda: move BIT specific functions into separate file

This patch moves the BIT processor specific coda_context_ops, the firmware
upload and other related functions from coda-common.c into coda-bit.c.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: move H.264 helper function into separate file
Philipp Zabel [Wed, 23 Jul 2014 15:28:44 +0000 (12:28 -0300)]
[media] coda: move H.264 helper function into separate file

Currently there is only the coda_h264_padding function, but
we will have to add more H.264 specific helpers later.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: move per-instance buffer allocation and cleanup
Philipp Zabel [Wed, 23 Jul 2014 15:28:43 +0000 (12:28 -0300)]
[media] coda: move per-instance buffer allocation and cleanup

This patch moves the context buffer allocation into the context start_streaming
callbacks. The context buffer and internal framebuffer cleanup is moved into
the context release callback.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: add coda_bit_stream_set_flag helper
Philipp Zabel [Wed, 23 Jul 2014 15:28:42 +0000 (12:28 -0300)]
[media] coda: add coda_bit_stream_set_flag helper

This adds a helper function to consolidate three occurences where
the bitstream parameter stream end flag is set during operation.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: move BIT processor command execution out of pic_run_work
Philipp Zabel [Wed, 23 Jul 2014 15:28:41 +0000 (12:28 -0300)]
[media] coda: move BIT processor command execution out of pic_run_work

In preparation for the split, move the AXI_SRAM_USE register access and the
PIC_RUN command execution out of pic_run_work into prepare_encode/decode.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: add context ops
Philipp Zabel [Wed, 23 Jul 2014 15:28:40 +0000 (12:28 -0300)]
[media] coda: add context ops

Add a struct coda_context_ops that encapsulates context specific operations.
This will simplify adding JPEG support in the future and helps to avoid
exporting all functions individually when they move out of the main code
file.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: move defines, enums, and structs into shared header
Philipp Zabel [Wed, 23 Jul 2014 15:28:39 +0000 (12:28 -0300)]
[media] coda: move defines, enums, and structs into shared header

These will have to be shared between multiple code files.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: move coda driver into its own directory
Philipp Zabel [Wed, 23 Jul 2014 15:28:38 +0000 (12:28 -0300)]
[media] coda: move coda driver into its own directory

The coda driver has grown significantly and will continue to grow.
Move the coda driver into its own directory so it can be split.
Rename coda.h to coda_regs.h as it contains the register defines.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: mark constant structures as such
Philipp Zabel [Fri, 18 Jul 2014 10:22:45 +0000 (07:22 -0300)]
[media] coda: mark constant structures as such

The format and codec lists and the ops structures are read-only.
Mark them as const.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: default to h.264 decoder on invalid formats
Philipp Zabel [Fri, 18 Jul 2014 10:22:44 +0000 (07:22 -0300)]
[media] coda: default to h.264 decoder on invalid formats

If the user provides an invalid format, let the decoder device
default to h.264.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: split format enumeration for encoder end decoder device
Philipp Zabel [Fri, 18 Jul 2014 10:22:43 +0000 (07:22 -0300)]
[media] coda: split format enumeration for encoder end decoder device

Let the decoder capture side and encoder output side only list
uncompressed formats, and the decoder output and encoder capture
side only list compressed formats.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: split userspace interface into encoder and decoder device
Philipp Zabel [Fri, 18 Jul 2014 10:22:42 +0000 (07:22 -0300)]
[media] coda: split userspace interface into encoder and decoder device

Userspace has a hard time making sense of format enumerations on V4L2
mem2mem devices if there are restrictions on which input and output
formats can be used together. Alleviate the problem by splitting the
video4linux device into separate encoder and decoder devices which list
only raw formats on one side and only encoded formats on the other side.
With this patch, the instance type (encoder or decoder) is already
determined by the open file operation.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: lock capture frame size to output frame size when streaming
Philipp Zabel [Fri, 18 Jul 2014 10:22:41 +0000 (07:22 -0300)]
[media] coda: lock capture frame size to output frame size when streaming

As soon as the output queue is streaming, let try_fmt on the capture side
only allow the frame size that was set on the output side.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: delay coda_fill_bitstream()
Michael Olbrich [Fri, 18 Jul 2014 10:22:40 +0000 (07:22 -0300)]
[media] coda: delay coda_fill_bitstream()

coda_fill_bitstream() calls v4l2_m2m_buf_done() which is no longer allowed
before streaming was started.
Delay coda_fill_bitstream() until coda_start_streaming() and explicitly set
'start_streaming_called' before calling coda_fill_bitstream()

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: use CODA_MAX_FRAME_SIZE everywhere
Michael Olbrich [Fri, 18 Jul 2014 10:22:39 +0000 (07:22 -0300)]
[media] coda: use CODA_MAX_FRAME_SIZE everywhere

Without this changing CODA_MAX_FRAME_SIZE to anything other than 0x100000
can break the bitstram handling

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: remove VB2_USERPTR from queue io_modes
Philipp Zabel [Fri, 18 Jul 2014 10:22:38 +0000 (07:22 -0300)]
[media] coda: remove VB2_USERPTR from queue io_modes

Disallow USERPTR buffers, videobuf2-dma-contig doesn't support them.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: remove CAPTURE and OUTPUT caps
Philipp Zabel [Fri, 18 Jul 2014 10:22:37 +0000 (07:22 -0300)]
[media] coda: remove CAPTURE and OUTPUT caps

This is a mem2mem driver, pure capture or output modes are not
supported.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: initialize hardware on pm runtime resume only if firmware available
Philipp Zabel [Fri, 18 Jul 2014 10:22:36 +0000 (07:22 -0300)]
[media] coda: initialize hardware on pm runtime resume only if firmware available

If no firmware was found and the coda module is unloaded, coda_runtime_resume
will be called without an allocated code buffer. Do not call coda_hw_init in
this case.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: fix CODA7541 hardware reset
Philipp Zabel [Fri, 18 Jul 2014 10:22:35 +0000 (07:22 -0300)]
[media] coda: fix CODA7541 hardware reset

Do not try to read the CODA960 GDI status register on CODA7541.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: resizer: Protect against races when updating crop
Laurent Pinchart [Wed, 23 Jul 2014 13:30:57 +0000 (10:30 -0300)]
[media] omap3isp: resizer: Protect against races when updating crop

When updating the crop rectangle during streaming, the IRQ handler will
reprogram the resizer after the current frame. A race condition
currently exists between the set selection operation and the IRQ
handler: if the set selection operation is called twice in a row and the
IRQ handler runs only during the second call, it could reprogram the
hardware with partially updated values. Use a spinlock to protect
against that.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: resizer: Remove slow debugging message from interrupt handler
Laurent Pinchart [Wed, 23 Jul 2014 13:30:57 +0000 (10:30 -0300)]
[media] omap3isp: resizer: Remove slow debugging message from interrupt handler

The resizer_set_input_size() function prints a debugging message with
the input width and height values. As the function is called from
interrupt context, printing that message to the serial console could
slow down the interrupt handler and cause it to miss the start of the
next frame, causing image corruption.

Fix this by reorganizing the resizer debug messages. The driver now
prints the input size, the crop rectangle and the output size in the set
selection handler instead of scattering debug messages in various
places.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: resizer: Remove needless variable initializations
Laurent Pinchart [Wed, 23 Jul 2014 13:30:57 +0000 (10:30 -0300)]
[media] omap3isp: resizer: Remove needless variable initializations

There's no need to initialize local variables to zero when they're
explicitly assigned another value right after. Remove the needless
initializations.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: ccdc: Restart the CCDC immediately after an underrun in BT.656
Laurent Pinchart [Tue, 10 Jun 2014 13:28:48 +0000 (10:28 -0300)]
[media] omap3isp: ccdc: Restart the CCDC immediately after an underrun in BT.656

As the CCDC doesn't generate interrupts when stopped in BT.656 mode,
restart it immediately when the next buffer after an underrun is queued
instead of relying on the interrupt handler to restart the CCDC.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: ccdc: Don't timeout on stream off when the CCDC is stopped
Laurent Pinchart [Tue, 10 Jun 2014 13:26:28 +0000 (10:26 -0300)]
[media] omap3isp: ccdc: Don't timeout on stream off when the CCDC is stopped

When the CCDC is already stopped due to a buffer underrun, the stop
state machine won't advance in BT.656 mode as no interrupt are generated
by the stopped CCDC in that mode. Handle this case explicitly in the
ccdc_disable() function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: ccdc: Fix freeze when a short frame is received
Laurent Pinchart [Tue, 10 Jun 2014 12:41:57 +0000 (09:41 -0300)]
[media] omap3isp: ccdc: Fix freeze when a short frame is received

In BT.656 mode the synchronization signals are generated by the CCDC
from the embedded sync codes. The VD0 and VD1 interrupts are thus only
triggered when the CCDC is enabled, unlike external sync mode where the
line counter runs even when the CCDC is stopped. We can't disable the
CCDC at VD1 time, as no VD0 interrupt would be generated for a short
frame, which would result in the CCDC being stopped and no VD interrupt
generated anymore. The CCDC is stopped from the VD0 interrupt handler
instead for BT.656.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: ccdc: Increment the frame number at VD0 time for BT.656
Laurent Pinchart [Tue, 10 Jun 2014 12:16:08 +0000 (09:16 -0300)]
[media] omap3isp: ccdc: Increment the frame number at VD0 time for BT.656

We will stop using VD1 in BT.656 mode, move frame number increment to
the VD0 interrupt handler.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: ccdc: Simplify ccdc_lsc_is_configured()
Laurent Pinchart [Tue, 10 Jun 2014 09:15:33 +0000 (06:15 -0300)]
[media] omap3isp: ccdc: Simplify ccdc_lsc_is_configured()

Use a local variable to avoid the duplicate spin_unlock_irqrestore()
call.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: ccdc: Rename __ccdc_handle_stopping to ccdc_handle_stopping
Laurent Pinchart [Sat, 7 Jun 2014 23:57:07 +0000 (20:57 -0300)]
[media] omap3isp: ccdc: Rename __ccdc_handle_stopping to ccdc_handle_stopping

There's no need for a double underscore in the function name, remove it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: ccdc: Only complete buffer when all fields are captured
Laurent Pinchart [Sat, 7 Jun 2014 23:57:07 +0000 (20:57 -0300)]
[media] omap3isp: ccdc: Only complete buffer when all fields are captured

Checking that the captured field corresponds to the last required field
depending on the requested field order before completing the buffer
isn't enough. When the first field at stream start corresponds to the
last required field, this would result in returning an interlaced buffer
containing a single field.

Fix this by keeping track of the fields captured in the buffer, and make
sure that both fields are present for alternate field orders.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: ccdc: Disable the video port when unused
Laurent Pinchart [Tue, 10 Jun 2014 14:51:34 +0000 (11:51 -0300)]
[media] omap3isp: ccdc: Disable the video port when unused

The video port doesn't support YUV formats. Disable it when the CCDC
sink pad format is set to YUV instead of leaving it enabled and relying
on downstream modules not to process data they receive from the video
port.

Experiments showed that this fixes some of the CCDC failures to stop,
especially in BT.656 mode.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: ccdc: Add support for BT.656 YUV format at the CCDC input
Laurent Pinchart [Tue, 20 May 2014 17:18:53 +0000 (14:18 -0300)]
[media] omap3isp: ccdc: Add support for BT.656 YUV format at the CCDC input

Query the CCDC input media bus type from the subdev connected to the
CCDC sink pad and configure the CCDC accordingly to support BT.656
synchronization.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: ccdc: Support the interlaced field orders at the CCDC output
Laurent Pinchart [Mon, 19 May 2014 22:40:04 +0000 (19:40 -0300)]
[media] omap3isp: ccdc: Support the interlaced field orders at the CCDC output

The CCDC can interleave fields into a single buffer when writing to
memory. Support it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: ccdc: Add basic support for interlaced video
Laurent Pinchart [Mon, 19 May 2014 19:37:38 +0000 (16:37 -0300)]
[media] omap3isp: ccdc: Add basic support for interlaced video

When the CCDC input is interlaced enable the alternate field order on
the CCDC output video node. The field signal polarity is specified
through platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: ccdc: Simplify the ccdc_isr_buffer() function
Laurent Pinchart [Tue, 20 May 2014 00:46:33 +0000 (21:46 -0300)]
[media] omap3isp: ccdc: Simplify the ccdc_isr_buffer() function

Instead of using goto statements to a single line return, return the
correct value immediately.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: ccdc: Simplify the configuration function
Laurent Pinchart [Mon, 19 May 2014 18:05:51 +0000 (15:05 -0300)]
[media] omap3isp: ccdc: Simplify the configuration function

Assign the format variable to the sink pad format earlier and use it
instead of accessing the sink pad format directly from the ISP
structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: video: Validate the video node field order
Laurent Pinchart [Mon, 19 May 2014 15:14:42 +0000 (12:14 -0300)]
[media] omap3isp: video: Validate the video node field order

The field order requested on the video node must match the field order
at the connected subdevice source pad.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: Default to progressive field order when setting the format
Laurent Pinchart [Mon, 19 May 2014 13:49:58 +0000 (10:49 -0300)]
[media] omap3isp: Default to progressive field order when setting the format

If the requested field order is not supported default to progressive as
we can't guess how the user will configure the pipeline later on.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: Move non-critical code out of the mutex-protected section
Laurent Pinchart [Mon, 19 May 2014 13:33:15 +0000 (10:33 -0300)]
[media] omap3isp: Move non-critical code out of the mutex-protected section

The isp_video_pix_to_mbus() and isp_video_mbus_to_pix() calls in
isp_video_set_format() only access static fields of the isp_video
structure. They don't need to be protected by a mutex.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: Remove boilerplate disclaimer and FSF address
Laurent Pinchart [Mon, 19 May 2014 21:17:55 +0000 (18:17 -0300)]
[media] omap3isp: Remove boilerplate disclaimer and FSF address

We don't want to modify all source files the day the FSF moves.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] omap3isp: Don't ignore subdev streamoff failures
Laurent Pinchart [Tue, 20 May 2014 21:21:13 +0000 (18:21 -0300)]
[media] omap3isp: Don't ignore subdev streamoff failures

Record the value returned by subdevs from s_stream(0) and handle stop
failures when an error occurs.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: subdev: Extend default link validation to cover field order
Laurent Pinchart [Mon, 19 May 2014 14:36:23 +0000 (11:36 -0300)]
[media] v4l: subdev: Extend default link validation to cover field order

The field order must match between the source and sink pads, or the sink
pad field order must be NONE. This allows connecting an interlaced
source to a bridge that has no hardware support for interlaced formats.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] smiapp: Implement the test pattern control
Sakari Ailus [Wed, 21 May 2014 19:58:11 +0000 (16:58 -0300)]
[media] smiapp: Implement the test pattern control

Add support for the V4L2_CID_TEST_PATTERN control. When the solid colour
mode is selected, additional controls become available for setting the
solid four solid colour components.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] smiapp: Add driver-specific test pattern menu item definitions
Sakari Ailus [Mon, 26 May 2014 12:46:18 +0000 (09:46 -0300)]
[media] smiapp: Add driver-specific test pattern menu item definitions

Add numeric definitions for menu items used in the smiapp driver's test
pattern menu.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: Add test pattern colour component controls
Sakari Ailus [Wed, 28 May 2014 12:38:21 +0000 (09:38 -0300)]
[media] v4l: Add test pattern colour component controls

In many cases the test pattern has selectable values for each colour
component. Implement controls for raw bayer components. Additional controls
should be defined for colour components that are not covered by these
controls.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] xc5000: be sure that the firmware is there before set params
Mauro Carvalho Chehab [Sun, 10 Aug 2014 02:14:22 +0000 (23:14 -0300)]
[media] xc5000: be sure that the firmware is there before set params

Now that xc5000_set_params() is also called during resume,
move the code that checks for the firmware to happen there.

This way, the firmware will be loaded either for analog or
digital TV when .resume callback is called.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828: Fix DVB resume when streaming
Mauro Carvalho Chehab [Sun, 10 Aug 2014 02:14:21 +0000 (23:14 -0300)]
[media] au0828: Fix DVB resume when streaming

When DVB is streaming and suspend is called, it will call
au0828_stop_transport(), with will clean the streaming flag.

Due to that, stop_urb_transfer() will be called twice,
causing an oops.

So, we need another flag to be used at resume, telling it
to restart DVB.

While here, add a logic at stop_urb_transfer() to prevent
it of being called twice, and convert the usb_streaming
flag into boolean.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828: fix checks if dvb is initialized
Mauro Carvalho Chehab [Sun, 10 Aug 2014 02:14:20 +0000 (23:14 -0300)]
[media] au0828: fix checks if dvb is initialized

dev->dvb is always not null, as it is an area at the dev
memory. So, checking if (dev->dvb) is always true.

Instead of this stupid check, what the code wants to do is
to know if the DVB was successully registered.

Fix it by checking, instead, for dvb->frontend. It should
also be sure that this var will be NULL if the device was
not properly initialized.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] xc5000: better name the functions
Mauro Carvalho Chehab [Sun, 10 Aug 2014 00:47:24 +0000 (21:47 -0300)]
[media] xc5000: better name the functions

xc5000_set_params() is a bad name for a function that
handles only digital TV. Rename it to xc5000_set_digital_params(),
and proper name the generic function that works for both
digital and analog.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] xc5000: add a resume function
Mauro Carvalho Chehab [Sun, 10 Aug 2014 00:47:23 +0000 (21:47 -0300)]
[media] xc5000: add a resume function

If a device suspends/hibertates with a station tuned, restore
the tuner station at resume.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] xc5000: Split config and set code for analog/radio
Mauro Carvalho Chehab [Sun, 10 Aug 2014 00:47:22 +0000 (21:47 -0300)]
[media] xc5000: Split config and set code for analog/radio

As we need a function that reapply the last tuned radio,
in order to do resume, split the code that validates and
updates the internal priv struct from the ones that
actually set radio and TV.

A latter patch will add support for resume.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828: move the code that sets DTV on a separate function
Mauro Carvalho Chehab [Sun, 10 Aug 2014 00:47:21 +0000 (21:47 -0300)]
[media] au0828: move the code that sets DTV on a separate function

As we'll be adding a code to resume tuner operation, we
need to move the code that actually sets DTV on a separate
function, to be called by the resume code.

No functional changes, just code got moved.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] xc5000: fix xc5000 suspend
Mauro Carvalho Chehab [Sun, 10 Aug 2014 00:47:20 +0000 (21:47 -0300)]
[media] xc5000: fix xc5000 suspend

After xc5000 stops working, it waits for 5 seconds, waiting
for a new usage. Only after that it goes to low power mode.

If a suspend event happens before that, a work queue will
remain active, with causes suspend to crash.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] dvb-frontend: add core support for tuner suspend/resume
Mauro Carvalho Chehab [Sun, 10 Aug 2014 00:47:19 +0000 (21:47 -0300)]
[media] dvb-frontend: add core support for tuner suspend/resume

While several tuners have some sort of suspend/resume
implementation, this is currently mangled with an optional
.sleep callback that it is also used to put the device on
low power mode.

Not all drivers implement it, as returning the driver from
low power may require to re-load the firmware, with takes
some time. Also, some drivers may delay it.

So, the more coherent is to add two new optional callbacks
that will let the tuners to directy implement suspend and
resume callbacks if they need.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828: add pr_info to track au0828 suspend/resume code
Mauro Carvalho Chehab [Sun, 10 Aug 2014 00:47:18 +0000 (21:47 -0300)]
[media] au0828: add pr_info to track au0828 suspend/resume code

Suspend/resume conditions can be very tricky. Add some info
printk's to help tracking what's happening there.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828: use pr_foo macros
Mauro Carvalho Chehab [Sun, 10 Aug 2014 00:47:17 +0000 (21:47 -0300)]
[media] au0828: use pr_foo macros

Instead of using printk(KERN_foo, use pr_foo() macros.

No functional changes.

Note: we should do the same for dprintk(), but that would
require to remove the dprintk levels. So, for now, let's
not touch on it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828: Remove a bad whitespace
Mauro Carvalho Chehab [Sun, 10 Aug 2014 00:47:16 +0000 (21:47 -0300)]
[media] au0828: Remove a bad whitespace

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828: add suspend/resume code for V4L2
Mauro Carvalho Chehab [Sun, 10 Aug 2014 00:47:15 +0000 (21:47 -0300)]
[media] au0828: add suspend/resume code for V4L2

No timers should be enabled during suspend. So,
stop them. At resume time, we should do the proper
initialization for it to keep working.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828: properly handle stream on/off state
Mauro Carvalho Chehab [Sun, 10 Aug 2014 00:47:14 +0000 (21:47 -0300)]
[media] au0828: properly handle stream on/off state

The STREAM_ON state is used by s_format callback,
but the driver never sets it.

Fix it. This will also be needed in order to handle
suspend/resume ops.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828: Add suspend code for DVB
Mauro Carvalho Chehab [Sun, 10 Aug 2014 00:47:13 +0000 (21:47 -0300)]
[media] au0828: Add suspend code for DVB

The scheduled work should be cancelled during suspend.

At resume time, we need to set the frontend again. So,
add such logic to the driver.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828: be sure to reenable the bridge and GPIOs on resume
Mauro Carvalho Chehab [Sun, 10 Aug 2014 00:47:12 +0000 (21:47 -0300)]
[media] au0828: be sure to reenable the bridge and GPIOs on resume

At resume, we should restore the register contents. So,
reenable the bridge and GPIO settings.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828: don't let the IR polling thread to run at suspend
Mauro Carvalho Chehab [Sun, 10 Aug 2014 00:47:11 +0000 (21:47 -0300)]
[media] au0828: don't let the IR polling thread to run at suspend

Trying to make au0828 to suspend can do very bad things, as
the polling Kthread is not handled. We should disable it
during suspend, only re-enabling it at resume.

Still, analog and digital TV won't work, as we don't reinit
the settings at resume, but at least it won't hang.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828: remove CONFIG_VIDEO_AU0828_RC scope around au0828_rc_*()
Shuah Khan [Sun, 10 Aug 2014 00:47:10 +0000 (21:47 -0300)]
[media] au0828: remove CONFIG_VIDEO_AU0828_RC scope around au0828_rc_*()

Remove CONFIG_VIDEO_AU0828_RC scope around au0828_rc_register()
and au0828_rc_unregister() calls in au0828-core

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828: add au0828_rc_*() stubs for VIDEO_AU0828_RC disabled case
Shuah Khan [Sat, 9 Aug 2014 00:36:18 +0000 (21:36 -0300)]
[media] au0828: add au0828_rc_*() stubs for VIDEO_AU0828_RC disabled case

Define au0828_rc_*() stubs to avoid compile errors when
VIDEO_AU0828_RC is disabled and avoid the need to enclose
au0828_rc_*() in ifdef CONFIG_VIDEO_AU0828_RC in .c files.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828: handle IR int during suspend/resume
Mauro Carvalho Chehab [Sun, 10 Aug 2014 00:47:08 +0000 (21:47 -0300)]
[media] au0828: handle IR int during suspend/resume

It doesn't make sense to handle an IR code given before
suspending after the device resume. So, turn off IR
int while suspending.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828: avoid race conditions at RC stop
Mauro Carvalho Chehab [Sun, 10 Aug 2014 00:47:07 +0000 (21:47 -0300)]
[media] au0828: avoid race conditions at RC stop

As the RC kthread can re-enable IR int, we should first
cancel the kthread and then disable IR int.

While here, remove a temporary debug printk.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828-input: Be sure that IR is enabled at polling
Mauro Carvalho Chehab [Thu, 7 Aug 2014 13:46:30 +0000 (10:46 -0300)]
[media] au0828-input: Be sure that IR is enabled at polling

When the DVB code sets the frontend, it disables the IR
INT, probably due to some hardware bug, as there's no code
there at au8522 frontend that writes on register 0xe0.

Fixing it at au8522 code is hard, as it doesn't know if the
IR is enabled or disabled, and just restoring the value of
register 0xe0 could cause other nasty effects. So, better
to add a hack at au0828-input polling interval to enable int,
if disabled.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828: Enable IR for HVR-850
Mauro Carvalho Chehab [Thu, 7 Aug 2014 16:10:26 +0000 (13:10 -0300)]
[media] au0828: Enable IR for HVR-850

HVR-850 also has a remote. Enable it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828: add an option to disable IR via modprobe parameter
Mauro Carvalho Chehab [Thu, 7 Aug 2014 16:10:25 +0000 (13:10 -0300)]
[media] au0828: add an option to disable IR via modprobe parameter

The IR code increases the power consumption of the device.
Allow to disable it via modprobe parameter.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] au0828: no need to sleep at the IR code
Mauro Carvalho Chehab [Thu, 7 Aug 2014 16:10:24 +0000 (13:10 -0300)]
[media] au0828: no need to sleep at the IR code

This sleep was doing some debouncing on the original driver.
This is not needed on Linux, because the RC core and the input
layer already takes care of it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>