/* * Copyright (c) 2013 Federico Simoncelli * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * Alternatively, this software may be distributed under the terms of the * GNU General Public License ("GPL"). * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * Fushicai USBTV007 Audio-Video Grabber Driver * * Product web site: * http://www.fushicai.com/products_detail/&productId=d05449ee-b690-42f9-a661-aa7353894bed.html * * No physical hardware was harmed running Windows during the * reverse-engineering activity */ #include <sound/core.h> #include <sound/initval.h> #include <sound/ac97_codec.h> #include <sound/pcm_params.h> #include "usbtv.h" static const struct snd_pcm_hardware snd_usbtv_digital_hw = …; static int snd_usbtv_pcm_open(struct snd_pcm_substream *substream) { … } static int snd_usbtv_pcm_close(struct snd_pcm_substream *substream) { … } static int snd_usbtv_prepare(struct snd_pcm_substream *substream) { … } static void usbtv_audio_urb_received(struct urb *urb) { … } static int usbtv_audio_start(struct usbtv *chip) { … } static int usbtv_audio_stop(struct usbtv *chip) { … } void usbtv_audio_suspend(struct usbtv *usbtv) { … } void usbtv_audio_resume(struct usbtv *usbtv) { … } static void snd_usbtv_trigger(struct work_struct *work) { … } static int snd_usbtv_card_trigger(struct snd_pcm_substream *substream, int cmd) { … } static snd_pcm_uframes_t snd_usbtv_pointer(struct snd_pcm_substream *substream) { … } static const struct snd_pcm_ops snd_usbtv_pcm_ops = …; int usbtv_audio_init(struct usbtv *usbtv) { … } void usbtv_audio_free(struct usbtv *usbtv) { … }