[alsa-devel] [PATCH 07/10] ALSA: usb-audio: UAC2: try to find and switch to valid clock

Eldad Zack eldad at fogrefinery.com
Tue Apr 2 22:20:36 CEST 2013


On Tue, 2 Apr 2013, Takashi Iwai wrote:

> At Sun, 31 Mar 2013 17:52:29 +0200,
> Eldad Zack wrote:
> > 
> > If a selector is available on a device, it may be pointing to a
> > clock source which is currently invalid.
> > If there is a valid clock source which can be selected, switch
> > to it.
> > 
> > Signed-off-by: Eldad Zack <eldad at fogrefinery.com>
> > ---
> >  sound/usb/clock.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
> >  1 file changed, 63 insertions(+), 2 deletions(-)
> > 
> > diff --git a/sound/usb/clock.c b/sound/usb/clock.c
> > index 08fa345..6b79e25 100644
> > --- a/sound/usb/clock.c
> > +++ b/sound/usb/clock.c
> > @@ -99,6 +99,40 @@ static int uac_clock_selector_get_val(struct snd_usb_audio *chip, int selector_i

> > +	buf = uac_clock_selector_get_val(chip, selector_id);
> > +	if (buf != pin) {
> 
> uac_clock_selector_get_val() returns an int with a negative value,
> so it's safer to compare it as an int.

Right, and I need to return the error code, too. Thanks!

Cheers,
Eldad


More information about the Alsa-devel mailing list