All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Damien Zammit <damien.zammit@gmail.com>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org,
	Damien Zammit <damien@zamaudio.com>
Subject: Re: [PATCH 1/2 v3] ALSA: usb-audio: Add mixer control	for Digidesign mbox 1 clock source
Date: Mon, 10 Nov 2014 09:23:47 +0100	[thread overview]
Message-ID: <54607613.30802@ladisch.de> (raw)
In-Reply-To: <1415605612-2977-2-git-send-email-damien@zamaudio.com>

Damien Zammit wrote:
> This patch provides the infrastructure for the Digidesign Mbox 1
> to have a mixer control for selecting the clock source.
> Valid options are Internal and S/PDIF external sync.
> A non-documented command is sent to the device to enable this feature
> found by reverse engineering and bus snooping.
>
> Signed-off-by: Damien Zammit <damien@zamaudio.com>
> ---
>  sound/usb/mixer_maps.c   |   9 +++
>  sound/usb/mixer_quirks.c | 142 +++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 151 insertions(+)
>
> +++ b/sound/usb/mixer_maps.c
> +static int snd_mbox1_switch_put(struct snd_kcontrol *kctl,
> +				struct snd_ctl_elem_value *ucontrol)
> +{
> ...
> +		down_read(&chip->shutdown_rwsem);
> +		if (chip->shutdown) {
> +			err = -ENODEV;
> +		} else {
> +			/* Prepare for magic command to toggle clock source */
> +			err = snd_usb_ctl_msg(chip->dev,
> +				usb_rcvctrlpipe(chip->dev, 0), 0x81,
> +				USB_DIR_IN |
> +				USB_TYPE_CLASS |
> +				USB_RECIP_INTERFACE, 0x00, 0x500, buff, 1);
> +			if (err < 0)
> +				return err;

The semaphore is still locked.

> @@ -1605,6 +1740,13 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
>  					      snd_audigy2nx_proc_read);
>  		break;
>
> +	/* Digidesign Mbox 1 */
> +	case USB_ID(0x0dba, 0x1000):

The IDs are supposed to be sorted by their value.

> +		err = snd_mbox1_create_sync_switch(mixer);
> +		if (err < 0)
> +			break;
> +		break;

This if() is meaningless.


Regards,
Clemens

  reply	other threads:[~2014-11-10  8:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-10  7:46 [PATCH 0/2 v3] Digidesign Mbox 1 enhancements Damien Zammit
2014-11-10  7:46 ` [PATCH 1/2 v3] ALSA: usb-audio: Add mixer control for Digidesign mbox 1 clock source Damien Zammit
2014-11-10  8:23   ` Clemens Ladisch [this message]
2014-11-10  7:46 ` [PATCH 2/2 v3] ALSA: usb-audio: Add duplex mode for Digidesign Mbox 1 and enable mixer Damien Zammit

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=54607613.30802@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=damien.zammit@gmail.com \
    --cc=damien@zamaudio.com \
    --cc=tiwai@suse.de \
    /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.