All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Daniel Mack <zonque@gmail.com>
Cc: blablack@gmail.com, alsa-devel@alsa-project.org,
	clemens@ladisch.de, gdiffey@gmail.com, linuxaudio@showlabor.de
Subject: [PATCH 3/3] ALSA: usb: Remove obsoleted fields from struct snd_usb_substream
Date: Fri, 13 Apr 2012 21:28:38 +0200	[thread overview]
Message-ID: <s5hpqbbph21.wl%tiwai@suse.de> (raw)
In-Reply-To: <s5hty0nph7j.wl%tiwai@suse.de>

Many fields have been moved to struct snd_usb_endpoint.
Also fix the proc output to correspond to the new structure.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/usb/card.h |   15 ---------------
 sound/usb/proc.c |   32 +++++++++++++++++++++-----------
 2 files changed, 21 insertions(+), 26 deletions(-)

diff --git a/sound/usb/card.h b/sound/usb/card.h
index 8a08687..77d2eec 100644
--- a/sound/usb/card.h
+++ b/sound/usb/card.h
@@ -115,21 +115,6 @@ struct snd_usb_substream {
 	unsigned int cur_rate;		/* current rate (for hw_params callback) */
 	unsigned int period_bytes;	/* current period bytes (for hw_params callback) */
 	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 */
-	unsigned int syncinterval;  /* P for adaptive mode, 0 otherwise */
-	unsigned int freqn;      /* nominal sampling rate in fs/fps in Q16.16 format */
-	unsigned int freqm;      /* momentary sampling rate in fs/fps in Q16.16 format */
-	int          freqshift;  /* how much to shift the feedback value to get Q16.16 */
-	unsigned int freqmax;    /* maximum sampling rate, used for buffer management */
-	unsigned int phase;      /* phase accumulator */
-	unsigned int maxpacksize;	/* max packet size in bytes */
-	unsigned int maxframesize;	/* max packet size in frames */
-	unsigned int curpacksize;	/* current packet size in bytes (for capture) */
-	unsigned int curframesize;	/* current packet size in frames (for capture) */
-	unsigned int syncmaxsize;	/* sync endpoint packet size */
-	unsigned int fill_max: 1;	/* fill max packet size always */
 	unsigned int txfr_quirk:1;	/* allow sub-frame alignment */
 	unsigned int fmt_type;		/* USB audio format type (1-3) */
 
diff --git a/sound/usb/proc.c b/sound/usb/proc.c
index 961c9a2..06e23d8 100644
--- a/sound/usb/proc.c
+++ b/sound/usb/proc.c
@@ -115,6 +115,25 @@ static void proc_dump_substream_formats(struct snd_usb_substream *subs, struct s
 	}
 }
 
+static void proc_dump_ep_status(struct snd_usb_substream *subs,
+				struct snd_usb_endpoint *ep,
+				struct snd_info_buffer *buffer)
+{
+	if (!ep)
+		return;
+	snd_iprintf(buffer, "    Packet Size = %d\n", ep->curpacksize);
+	snd_iprintf(buffer, "    Momentary freq = %u Hz (%#x.%04x)\n",
+		    snd_usb_get_speed(subs->dev) == USB_SPEED_FULL
+		    ? get_full_speed_hz(ep->freqm)
+		    : get_high_speed_hz(ep->freqm),
+		    ep->freqm >> 16, ep->freqm & 0xffff);
+	if (ep->freqshift != INT_MIN) {
+		int res = 16 - ep->freqshift;
+		snd_iprintf(buffer, "    Feedback Format = %d.%d\n",
+			    (ep->syncmaxsize > 3 ? 32 : 24) - res, res);
+	}
+}
+
 static void proc_dump_substream_status(struct snd_usb_substream *subs, struct snd_info_buffer *buffer)
 {
 	if (subs->running) {
@@ -126,17 +145,8 @@ static void proc_dump_substream_status(struct snd_usb_substream *subs, struct sn
 		for (i = 0; i < subs->nurbs; i++)
 			snd_iprintf(buffer, "%d ", subs->dataurb[i].packets);
 		snd_iprintf(buffer, "]\n");
-		snd_iprintf(buffer, "    Packet Size = %d\n", subs->curpacksize);
-		snd_iprintf(buffer, "    Momentary freq = %u Hz (%#x.%04x)\n",
-			    snd_usb_get_speed(subs->dev) == USB_SPEED_FULL
-			    ? get_full_speed_hz(subs->freqm)
-			    : get_high_speed_hz(subs->freqm),
-			    subs->freqm >> 16, subs->freqm & 0xffff);
-		if (subs->freqshift != INT_MIN)
-			snd_iprintf(buffer, "    Feedback Format = %d.%d\n",
-				    (subs->syncmaxsize > 3 ? 32 : 24)
-						- (16 - subs->freqshift),
-				    16 - subs->freqshift);
+		proc_dump_ep_status(subs, subs->data_endpoint, buffer);
+		proc_dump_ep_status(subs, subs->sync_endpoint, buffer);
 	} else {
 		snd_iprintf(buffer, "  Status: Stop\n");
 	}
-- 
1.7.9.2

  parent reply	other threads:[~2012-04-13 19:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-12 11:51 [PATCH 0/6] snd-usb endpoint rework, version 7 Daniel Mack
2012-04-12 11:51 ` [PATCH 1/6] ALSA: snd-usb: add snd_usb_audio-wide mutex Daniel Mack
2012-04-12 11:51 ` [PATCH 2/6] ALSA: snd-usb: implement new endpoint streaming model Daniel Mack
2012-04-12 11:51 ` [PATCH 3/6] ALSA: snd-usb: switch over to new endpoint streaming logic Daniel Mack
2012-04-12 11:51 ` [PATCH 4/6] ALSA: snd-usb: remove old " Daniel Mack
2012-04-12 11:51 ` [PATCH 5/6] ALSA: snd-usb: add support for implicit feedback Daniel Mack
2012-04-12 11:51 ` [PATCH 6/6] ALSA: snd-usb: add some documentation Daniel Mack
2012-04-12 23:59 ` [PATCH 0/6] snd-usb endpoint rework, version 7 Grant Diffey
2012-04-13  1:39   ` Grant Diffey
2012-04-13  6:19     ` Daniel Mack
2012-04-13  6:23       ` Takashi Iwai
2012-04-16 12:00         ` Grant Diffey
2012-04-13  7:32       ` Felix Homann
2012-04-13  7:51         ` Takashi Iwai
2012-04-13 14:10           ` Felix Homann
2012-04-13 14:15             ` Takashi Iwai
2012-04-13 14:25               ` Felix Homann
2012-04-13 14:49               ` Felix Homann
2012-04-13  6:25 ` Takashi Iwai
2012-04-13 19:25   ` Takashi Iwai
2012-04-13 19:27     ` [PATCH 1/3] ALSA: usb: Remove unused variable Takashi Iwai
2012-04-13 19:28     ` [PATCH 2/3] ALSA: usb: Fix fill_max flag set Takashi Iwai
2012-04-13 19:28     ` Takashi Iwai [this message]
2012-04-13 20:19     ` [PATCH 0/6] snd-usb endpoint rework, version 7 Daniel Mack
2012-04-17 13:33 ` Aurélien Leblond

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=s5hpqbbph21.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=blablack@gmail.com \
    --cc=clemens@ladisch.de \
    --cc=gdiffey@gmail.com \
    --cc=linuxaudio@showlabor.de \
    --cc=zonque@gmail.com \
    /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.