History log of /linux-master/drivers/media/usb/au0828/au0828.h
Revision Date Author Comments
# c942fddf 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157

Based on 3 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version this program is distributed in the
hope that it will be useful but without any warranty without even
the implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version [author] [kishon] [vijay] [abraham]
[i] [kishon]@[ti] [com] this program is distributed in the hope that
it will be useful but without any warranty without even the implied
warranty of merchantability or fitness for a particular purpose see
the gnu general public license for more details

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version [author] [graeme] [gregory]
[gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
[kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
[hk] [hemahk]@[ti] [com] this program is distributed in the hope
that it will be useful but without any warranty without even the
implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 1105 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 383b0e5b 01-Apr-2019 Shuah Khan <shuah@kernel.org>

media: au0828: fix enable and disable source audio and video inconsistencies

Enable and disable source interfaces aren't consistent in enforcing
how video and audio share the tuner resource.

Fix these issues to enforce the following rules and allow
sharing between audio and video applications.

- When DVB is streaming, audio/video/vbi/s-video/composite
should find the resource busy. DVB holds the tuner in
exclusive mode.
- When video/VBI is streaming, audio can share the tuner and vice versa.
- v4l2 allows multiple applications to open video device.
- Video applications call enable source multiple times during their
run-time. Resource should stay locked until the last application
releases it.
- A shared resource should stay in shared state and locked when it is
in use by audio and video. More than one video application is allowed
to use the tuner as long as video streaming protocol allows such usage.
Resource is released when the last video/audio application releases it.
- S-Video and Composite hold the resource in exclusive mode.

Signed-off-by: Shuah Khan <shuah@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 812658d8 01-Apr-2019 Shuah Khan <shuah@kernel.org>

media: change au0828 to use Media Device Allocator API

Media Device Allocator API to allows multiple drivers share a media device.
This API solves a very common use-case for media devices where one physical
device (an USB stick) provides both audio and video. When such media device
exposes a standard USB Audio class, a proprietary Video class, two or more
independent drivers will share a single physical USB bridge. In such cases,
it is necessary to coordinate access to the shared resource.

Using this API, drivers can allocate a media device with the shared struct
device as the key. Once the media device is allocated by a driver, other
drivers can get a reference to it. The media device is released when all
the references are released.

Change au0828 to use Media Device Allocator API to allocate media device
with the parent usb struct device as the key, so it can be shared with the
snd_usb_audio driver.

Signed-off-by: Shuah Khan <shuah@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 3e4d8f48 18-Feb-2019 Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

media: usb: fix several typos

Use codespell to fix lots of typos over frontends.

Manually verified to avoid false-positives.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 6e6a8b5a 04-Jan-2018 Mauro Carvalho Chehab <mchehab@kernel.org>

media: replace all <spaces><tab> occurrences

There are a lot of places where sequences of space/tabs are
found. Get rid of all spaces before tabs.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# fada1935 28-Dec-2017 Mauro Carvalho Chehab <mchehab@kernel.org>

media: move dvb kAPI headers to include/media

Except for DVB, all media kAPI headers are at include/media.

Move the headers to it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# ac71484e 27-Sep-2017 Bhumika Goyal <bhumirks@gmail.com>

media: au0828/em28xx: make vb2_ops const

Make vb2_ops const as they are only stored in the const field of a
vb2_queue structure. Make the declarations const too.

Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 53460c53 19-Apr-2017 Devin Heitmueller <dheitmueller@kernellabs.com>

[media] au0828: Add timer to restart TS stream if no data arrives on bulk endpoint

For reasons unclear, we intermittently see a case where the tune
is successful but the bulk stream fails to deliver any packets.

Add a timer to automatically stop/start the data pump if we
encounter such a case.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# bcb63314 28-Oct-2016 Sakari Ailus <sakari.ailus@linux.intel.com>

[media] media: Drop FSF's postal address from the source code files

Drop the FSF's postal address from the source code files that typically
contain mostly the license text. Of the 628 removed instances, 578 are
outdated.

The patch has been created with the following command without manual edits:

git grep -l "675 Mass Ave\|59 Temple Place\|51 Franklin St" -- \
drivers/media/ include/media|while read i; do i=$i perl -e '
open(F,"< $ENV{i}");
$a=join("", <F>);
$a =~ s/[ \t]*\*\n.*You should.*\n.*along with.*\n.*(\n.*USA.*$)?\n//m
&& $a =~ s/(^.*)Or, (point your browser to) /$1To obtain the license, $2\n$1/m;
close(F);
open(F, "> $ENV{i}");
print F $a;
close(F);'; done

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>


# 20674818 05-Apr-2016 Guennadi Liakhovetski <g.liakhovetski@gmx.de>

[media] au0828: remove unused macro

An V4L2_CID_PRIVATE_SHARPNESS macro is defined in the au0828 driver, but
never used. Remove it.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# e8e3039f 22-Mar-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] au0828: Fix dev_state handling

The au0828 dev_state is actually a bit mask. It should not be
checking with "==" but, instead, with a logic and. There are some
places where it was doing it wrong.

Fix that by replacing the dev_state set/clear/test with the
bitops.

As reviewed by Shuah:
"Looks good. Tested running bind/unbind au0828 loop for 1000 times.
Didn't see any problems and the v4l2_querycap() problem has been
fixed with this patch.

After the above test, ran bind/unbind snd_usb_audio 1000 times.
Didn't see any problems. Generated media graph and the graph
looks good."

Cc: stable@vger.kernel.org
Reviewed-by: Shuah Khan <shuahkh@osg.samsung.com>
Tested-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# c94903f1 11-Feb-2016 Shuah Khan <shuah@kernel.org>

[media] media: au0828 add enable, disable source handlers

Add enable_source and disable_source handlers. The enable source handler
is called from v4l2-core, dvb-core, and ALSA drivers to check if the
shared media source is free.

The disable source handler is called to release the shared media
source.

[mchehab@osg.samsung.com: fix merge conflicts]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# f90c5d79 11-Feb-2016 Shuah Khan <shuah@kernel.org>

[media] media: au0828-core register entity_notify hook

Register entity_notify async hook to create links between existing
bridge driver entities and a newly added non-bridge driver entities. For
example, this handler creates link between V4L decoder entity and ALSA
mixer entity.

[mchehab@osg.samsung.com: fix merge conflicts and make
au0828_media_graph_notify static to shut up a warning]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 34ac2532 12-Feb-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] au0828: get rid of AU0828_VMUX_DEBUG

This is not used on the driver. remove it.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 7b606ffd 09-Feb-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] au0828: move V4L2-specific code to au0828-core.c

Instead of having lots of #ifdefs inside au0828-core due to
V4L2, move the dependencies to au0828-video.c. That allows
removing all those ifdefs, as au0828-video is only compiled if
CONFIG_VIDEO_AU0828_V4L2.

This fixes the following warnings reported by Kbuild test
with a random config with au0828 enabled, but V4L2 is disabled.

All warnings (new ones prefixed by >>):

drivers/media/usb/au0828/au0828-core.c: In function 'au0828_usb_probe':
>> drivers/media/usb/au0828/au0828-core.c:463:1: warning: label 'done' defined but not used [-Wunused-label]
done:
^
drivers/media/usb/au0828/au0828-core.c: At top level:
drivers/media/usb/au0828/au0828-core.c:250:12: warning: 'au0828_create_media_graph' defined but not used [-Wunused-function]
static int au0828_create_media_graph(struct au0828_dev *dev)
^

Tested with a WinTV HVR 950Q (USB ID: 2040:7200)

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# d1f33737 31-Aug-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] au0828: add support for the connectors

Depending on the input, an au0828 may have a different
number of connectors. add entities to represent them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 0158e7b6 18-Jun-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] au0828: Cache the decoder info at au0828 dev structure

Instead of seeking for the decoder every time analog stream is
started, cache it. This simplifies the code a little bit.

Requested-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# bed69196 08-Jun-2015 Rafael Lourenço de Lima Chehab <chehabrafael@gmail.com>

[media] au0828: Add support for media controller

Add support for analog and dvb tv using media controller.

Signed-off-by: Rafael Lourenço de Lima Chehab <chehabrafael@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 2d700715 22-Sep-2015 Junghak Sung <jh1009.sung@samsung.com>

[media] media: videobuf2: Restructure vb2_buffer

Remove v4l2 stuff - v4l2_buf, v4l2_plane - from struct vb2_buffer.

Add new member variables - bytesused, length, offset, userptr, fd,
data_offset - to struct vb2_plane in order to cover all information
of v4l2_plane.
struct vb2_plane {
<snip>
unsigned int bytesused;
unsigned int length;
union {
unsigned int offset;
unsigned long userptr;
int fd;
} m;
unsigned int data_offset;
}

Replace v4l2_buf with new member variables - index, type, memory - which
are common fields for buffer management.
struct vb2_buffer {
<snip>
unsigned int index;
unsigned int type;
unsigned int memory;
unsigned int num_planes;
struct vb2_plane planes[VIDEO_MAX_PLANES];
<snip>
};

v4l2 specific fields - flags, field, timestamp, timecode,
sequence - are moved to vb2_v4l2_buffer in videobuf2-v4l2.c
struct vb2_v4l2_buffer {
struct vb2_buffer vb2_buf;

__u32 flags;
__u32 field;
struct timeval timestamp;
struct v4l2_timecode timecode;
__u32 sequence;
};

Signed-off-by: Junghak Sung <jh1009.sung@samsung.com>
Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com>
Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 41071bb8 26-Feb-2015 Shuah Khan <shuah@kernel.org>

[media] media: au0828 - embed vdev and vbi_dev structs in au0828_dev

Embed video_device structs vdev and vbi_dev in au0828_dev.
With this change, dynamic allocation and error path logic
in au0828_analog_register() is removed as it doesn't need
to allocate and handle allocation errors. Unregister path
doesn't need to free the now static video_device structures,
hence, changed video_device.release in au0828_video_template
to point to video_device_release_empty.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 05439b1a 29-Jan-2015 Shuah Khan <shuah@kernel.org>

[media] media: au0828 - convert to use videobuf2

Convert au0828 to use videobuf2. Tested with NTSC.
Tested video and vbi devices with xawtv, tvtime,
and vlc. Ran v4l2-compliance to ensure there are
no failures.

Video compliance test results summary:
Total: 75, Succeeded: 75, Failed: 0, Warnings: 18

Vbi compliance test results summary:
Total: 75, Succeeded: 75, Failed: 0, Warnings: 0

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Reviewed-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# b13b47e0 18-Aug-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] au0828: explicitly identify boards with analog TV

Right now, the au0828 driver uses .tuner to detect if analog
tv is being used or not. By not filling .tuner fields at the
board struct, the I2C core can't do decisions based on it.

So, add a field to explicitly tell when analog TV is supported.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 2930977a 09-Aug-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[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>


# 83afb32a 09-Aug-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[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>


# 1a1ba95e 09-Aug-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[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>


# b799de75 09-Aug-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[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>


# 917cbcde 08-Aug-2014 Shuah Khan <shuah@kernel.org>

[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>


# 2fcfd317 24-Jul-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] au0828: add support for IR on HVR-950Q

HVR-950Q uses an I2C remote controller at address 0x47 (7-bits
notation). Add support for it.

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


# f6fef863 09-May-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] au0828: reset streaming when a new frequency is set

As reported by Trevor, doing several opening/streaming/closing
operations to the demux causes it to fail.

I was able to simulate this bug too. I also noticed that,
sometimes, changing channels with au0828, the same thing
happens.

Most of the issues seem to be due to some hardware bug, that
causes the device to not fill all the URBs allocated. When
the bug happens, the only known fix is to either replug the
device, or to send an USB reset to it.

There's also a hack a the au0828 driver that starts a thread
that tries to reset the device when a package doesn't start
with a sync.

One of the culpits for this bad hardware behavior seem to be
caused by the lack of stopping and restarting the stream every
time a new channel is set.

This patch warrants that the stream will be properly reset
every time the set_frontend callback is called, partially
solving the problem.

A complete fix, however, would also need to check the PM
conditions for the tuner and demux.

Reported-by: Trevor Graffa <tlgraffa@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# f251b3e7 06-Jan-2014 Tim Mester <ttmesterr@gmail.com>

[media] au0828: Add option to preallocate digital transfer buffers

Added command line parameter preallocate_big_buffers so that the digital
transfer buffers can be allocated when the driver is registered. They
do not have to be allocated every time a feed is started.

Signed-off-by: Tim Mester <tmester@ieee.org>
Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 4609981f 06-Jan-2014 Tim Mester <ttmesterr@gmail.com>

[media] au8028: Fix cleanup on kzalloc fail

Free what was allocated if there is a failure allocating
transfer buffers.

Stop the feed on a start feed error. The stop feed is not always called
if start feed fails. If the feed is not stopped on error, then the driver
will be stuck so that it can never start feeding again.

[m.chehab@samsung.com: CodingStyle cleanup]
Signed-off-by: Tim Mester <tmester@ieee.org>
Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com>

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


# 33b6b89b 15-Feb-2013 Hans Verkuil <hans.verkuil@cisco.com>

[media] au0828: replace deprecated current_norm by g_std

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 83b09422 15-Feb-2013 Hans Verkuil <hans.verkuil@cisco.com>

[media] au0828: add prio, control event and log_status support

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# e8c26f45 15-Feb-2013 Hans Verkuil <hans.verkuil@cisco.com>

[media] au0828: convert to the control framework

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 8a4e7866 04-Dec-2012 Michael Krufky <mkrufky@linuxtv.org>

[media] au0828: remove forced dependency of VIDEO_AU0828 on VIDEO_V4L2

This patch removes the dependendency of VIDEO_AU0828 on VIDEO_V4L2 by
creating a new Kconfig option, VIDEO_AU0828_V4L2, which enables analog
video capture support and depends on VIDEO_V4L2 itself.
With VIDEO_AU0828_V4L2 disabled, the driver will only support digital
television and will not depend on the v4l2-core. With VIDEO_AU0828_V4L2
enabled, the driver will be built with the analog v4l2 support included.
By default, the VIDEO_AU0828_V4L2 option will be set to Y, so as to
preserve the original behavior.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 0c0d06ca 13-Aug-2012 Mauro Carvalho Chehab <mchehab@kernel.org>

[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>