alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Daniel Mack <daniel@caiaq.de>, Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: [PATCH 1/3] ALSA: usb-audio: rename substream format field to altset_idx
Date: Mon, 01 Mar 2010 12:27:39 +0100	[thread overview]
Message-ID: <4B8BA4AB.2070704@ladisch.de> (raw)
In-Reply-To: <1267194883-6854-4-git-send-email-daniel@caiaq.de>

The snd_usb_substream::format field actually contains the index of the
current alternate setting, so rename it to altset_idx to avoid
confusion.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>

--- linux/sound/usb/card.h
+++ linux/sound/usb/card.h
@@ -54,7 +54,7 @@ struct snd_usb_substream {
 	struct audioformat *cur_audiofmt;	/* current audioformat pointer (for hw_params callback) */
 	unsigned int cur_rate;		/* current rate (for hw_params callback) */
 	unsigned int period_bytes;	/* current period bytes (for hw_params callback) */
-	unsigned int format;     /* USB data format */
+	unsigned int altset_idx;     /* USB data format: index of alternate setting */
 	unsigned int datapipe;   /* the data i/o pipe */
 	unsigned int syncpipe;   /* 1 - async out or adaptive in */
 	unsigned int datainterval;	/* log_2 of data packet interval */
--- linux/sound/usb/pcm.c
+++ linux/sound/usb/pcm.c
@@ -202,11 +202,11 @@ static int set_format(struct snd_usb_sub
 			return -EIO;
 		}
 		subs->interface = -1;
-		subs->format = 0;
+		subs->altset_idx = 0;
 	}
 
 	/* set interface */
-	if (subs->interface != fmt->iface || subs->format != fmt->altset_idx) {
+	if (subs->interface != fmt->iface || subs->altset_idx != fmt->altset_idx) {
 		if (usb_set_interface(dev, fmt->iface, fmt->altsetting) < 0) {
 			snd_printk(KERN_ERR "%d:%d:%d: usb_set_interface failed\n",
 				   dev->devnum, fmt->iface, fmt->altsetting);
@@ -214,7 +214,7 @@ static int set_format(struct snd_usb_sub
 		}
 		snd_printdd(KERN_INFO "setting usb interface %d:%d\n", fmt->iface, fmt->altsetting);
 		subs->interface = fmt->iface;
-		subs->format = fmt->altset_idx;
+		subs->altset_idx = fmt->altset_idx;
 	}
 
 	/* create a data pipe */
@@ -771,7 +771,7 @@ static int snd_usb_pcm_open(struct snd_p
 	struct snd_usb_substream *subs = &as->substream[direction];
 
 	subs->interface = -1;
-	subs->format = 0;
+	subs->altset_idx = 0;
 	runtime->hw = snd_usb_hardware;
 	runtime->private_data = subs;
 	subs->pcm_substream = substream;
--- linux/sound/usb/proc.c
+++ linux/sound/usb/proc.c
@@ -116,7 +116,7 @@ static void proc_dump_substream_status(s
 		unsigned int i;
 		snd_iprintf(buffer, "  Status: Running\n");
 		snd_iprintf(buffer, "    Interface = %d\n", subs->interface);
-		snd_iprintf(buffer, "    Altset = %d\n", subs->format);
+		snd_iprintf(buffer, "    Altset = %d\n", subs->altset_idx);
 		snd_iprintf(buffer, "    URBs = %d [ ", subs->nurbs);
 		for (i = 0; i < subs->nurbs; i++)
 			snd_iprintf(buffer, "%d ", subs->dataurb[i].packets);

  parent reply	other threads:[~2010-03-01 11:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-26 14:34 [RFC] Cleanup/refactor the usbaudio driver Daniel Mack
2010-02-26 14:34 ` [PATCH 1/3] ALSA: usb: move ua101 driver Daniel Mack
2010-02-26 14:34   ` [PATCH 2/3] ALSA: usb: header file cleanups Daniel Mack
     [not found]     ` <1267194883-6854-4-git-send-email-daniel@caiaq.de>
2010-03-01 11:27       ` Clemens Ladisch [this message]
2010-03-01 11:27       ` [PATCH 2/3] ALSA: usb-audio: use a format bitmask per alternate setting Clemens Ladisch
2010-03-01 11:27       ` [PATCH 3/3] ALSA: usb-audio: support multiple formats with audio class v2 devices Clemens Ladisch
2010-03-01 14:26         ` Daniel Mack
2010-03-01 15:26           ` Clemens Ladisch
2010-03-01 11:27   ` [PATCH 1/3] ALSA: usb: move ua101 driver Clemens Ladisch
2010-03-01 14:01     ` Daniel Mack
2010-03-01 14:06       ` Takashi Iwai
2010-03-01 14:18         ` Daniel Mack
2010-03-01 14:23           ` Takashi Iwai
2010-03-04 15:16             ` Daniel Mack
2010-03-04 15:31               ` Takashi Iwai
2010-03-04 15:38                 ` Daniel Mack
2010-03-04 15:43                   ` Takashi Iwai

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=4B8BA4AB.2070704@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=daniel@caiaq.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).