Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47030
b: refs/heads/master
c: 1700f30
h: refs/heads/master
v: v3
  • Loading branch information
Clemens Ladisch authored and Jaroslav Kysela committed Feb 9, 2007
1 parent 037f899 commit 53b3927
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9f4bd5dde81b5cb94e4f52f2f05825aa0422f1ff
refs/heads/master: 1700f3080d98323e91864d67cb9f6d46f818ccf0
25 changes: 5 additions & 20 deletions trunk/sound/usb/usbaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1511,21 +1511,7 @@ static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream)
return 0;
}

static struct snd_pcm_hardware snd_usb_playback =
{
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_BATCH |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER,
.buffer_bytes_max = 1024 * 1024,
.period_bytes_min = 64,
.period_bytes_max = 512 * 1024,
.periods_min = 2,
.periods_max = 1024,
};

static struct snd_pcm_hardware snd_usb_capture =
static struct snd_pcm_hardware snd_usb_hardware =
{
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
Expand Down Expand Up @@ -1904,16 +1890,15 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre
return 0;
}

static int snd_usb_pcm_open(struct snd_pcm_substream *substream, int direction,
struct snd_pcm_hardware *hw)
static int snd_usb_pcm_open(struct snd_pcm_substream *substream, int direction)
{
struct snd_usb_stream *as = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_usb_substream *subs = &as->substream[direction];

subs->interface = -1;
subs->format = 0;
runtime->hw = *hw;
runtime->hw = snd_usb_hardware;
runtime->private_data = subs;
subs->pcm_substream = substream;
return setup_hw_info(runtime, subs);
Expand All @@ -1934,7 +1919,7 @@ static int snd_usb_pcm_close(struct snd_pcm_substream *substream, int direction)

static int snd_usb_playback_open(struct snd_pcm_substream *substream)
{
return snd_usb_pcm_open(substream, SNDRV_PCM_STREAM_PLAYBACK, &snd_usb_playback);
return snd_usb_pcm_open(substream, SNDRV_PCM_STREAM_PLAYBACK);
}

static int snd_usb_playback_close(struct snd_pcm_substream *substream)
Expand All @@ -1944,7 +1929,7 @@ static int snd_usb_playback_close(struct snd_pcm_substream *substream)

static int snd_usb_capture_open(struct snd_pcm_substream *substream)
{
return snd_usb_pcm_open(substream, SNDRV_PCM_STREAM_CAPTURE, &snd_usb_capture);
return snd_usb_pcm_open(substream, SNDRV_PCM_STREAM_CAPTURE);
}

static int snd_usb_capture_close(struct snd_pcm_substream *substream)
Expand Down

0 comments on commit 53b3927

Please sign in to comment.