All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <m.chehab@samsung.com>
To: "Frank Schäfer" <fschaefer.oss@googlemail.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 2/2] em28xx: fix check for audio only usb interfaces when changing the usb alternate setting
Date: Sun, 12 Jan 2014 15:37:29 -0200	[thread overview]
Message-ID: <20140112153729.6f87cd2e@samsung.com> (raw)
In-Reply-To: <1389447750-2642-2-git-send-email-fschaefer.oss@googlemail.com>

Em Sat, 11 Jan 2014 14:42:30 +0100
Frank Schäfer <fschaefer.oss@googlemail.com> escreveu:

> Previously, we've been assuming that the video endpoints are always at usb
> interface 0. Hence, if vendor audio endpoints are provided at a separate
> interface, they were supposed to be at interface number > 0.
> Instead of checking for (interface number > 0) to determine if an interface is a
> pure audio interface, dev->is_audio_only should be checked.
> 
> Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
> ---
>  drivers/media/usb/em28xx/em28xx-audio.c |   15 +++++++++++++--
>  1 Datei geändert, 13 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)
> 
> diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c
> index b2ae954..18b745f 100644
> --- a/drivers/media/usb/em28xx/em28xx-audio.c
> +++ b/drivers/media/usb/em28xx/em28xx-audio.c
> @@ -243,11 +243,22 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream)
>  	}
>  
>  	runtime->hw = snd_em28xx_hw_capture;
> -	if ((dev->alt == 0 || dev->ifnum) && dev->adev.users == 0) {
> -		if (dev->ifnum)
> +	if (dev->adev.users == 0 && (dev->alt == 0 || dev->is_audio_only)) {
> +		if (dev->is_audio_only)
> +			/* vendor audio is on a separate interface */
>  			dev->alt = 1;
>  		else
> +			/* vendor audio is on the same interface as video */
>  			dev->alt = 7;
> +			/*
> +			 * FIXME: The intention seems to be to select the alt
> +			 * setting with the largest wMaxPacketSize for the video
> +			 * endpoint.
> +			 * At least dev->alt and dev->dvb_alt_isoc should be
> +			 * used instead, but we should probably not touch it at
> +			 * all if it is already >0, because wMaxPacketSize of
> +			 * the audio endpoints seems to be the same for all.
> +			 */

Actually, it should take into account only the analog case, since, in
digital mode, the audio comes via the MPEG stream instead.

Ok, it makes sense to return -EBUSY if one tries to use it while using
DVB.

>  
>  		dprintk("changing alternate number on interface %d to %d\n",
>  			dev->ifnum, dev->alt);


-- 

Cheers,
Mauro

  reply	other threads:[~2014-01-12 17:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-11 13:42 [PATCH 1/2] em28xx: fix usb alternate setting for analog and digital video endpoints > 0 Frank Schäfer
2014-01-11 13:42 ` [PATCH 2/2] em28xx: fix check for audio only usb interfaces when changing the usb alternate setting Frank Schäfer
2014-01-12 17:37   ` Mauro Carvalho Chehab [this message]
2014-01-13 18:32     ` Frank Schäfer
2014-01-12 17:35 ` [PATCH 1/2] em28xx: fix usb alternate setting for analog and digital video endpoints > 0 Mauro Carvalho Chehab
2014-01-13 18:29   ` Frank Schäfer
2014-01-13 19:13     ` Mauro Carvalho Chehab
2014-01-13 21:52       ` Frank Schäfer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140112153729.6f87cd2e@samsung.com \
    --to=m.chehab@samsung.com \
    --cc=fschaefer.oss@googlemail.com \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.