diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2014-09-21 16:52:46 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-09-22 02:57:01 -0400 |
commit | 4e9c58cb1219bcbcf6e698ed6541b275048bfa88 (patch) | |
tree | 6cb446fbb76f202714fb52bddfdc6acd380ac445 | |
parent | 5ae0095d00d48be60b2e3cbdb79a35a7d796d96b (diff) |
ALSA: oxygen: set fifo_size
Allow the driver to report the hardware FIFO size.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/oxygen/oxygen_pcm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/pci/oxygen/oxygen_pcm.c b/sound/pci/oxygen/oxygen_pcm.c index cc0bcd9f3350..02828240ba15 100644 --- a/sound/pci/oxygen/oxygen_pcm.c +++ b/sound/pci/oxygen/oxygen_pcm.c | |||
@@ -29,6 +29,9 @@ | |||
29 | /* the multichannel DMA channel has a 24-bit counter */ | 29 | /* the multichannel DMA channel has a 24-bit counter */ |
30 | #define BUFFER_BYTES_MAX_MULTICH ((1 << 24) * 4) | 30 | #define BUFFER_BYTES_MAX_MULTICH ((1 << 24) * 4) |
31 | 31 | ||
32 | #define FIFO_BYTES 256 | ||
33 | #define FIFO_BYTES_MULTICH 1024 | ||
34 | |||
32 | #define PERIOD_BYTES_MIN 64 | 35 | #define PERIOD_BYTES_MIN 64 |
33 | 36 | ||
34 | #define DEFAULT_BUFFER_BYTES (BUFFER_BYTES_MAX / 2) | 37 | #define DEFAULT_BUFFER_BYTES (BUFFER_BYTES_MAX / 2) |
@@ -60,6 +63,7 @@ static const struct snd_pcm_hardware oxygen_stereo_hardware = { | |||
60 | .period_bytes_max = BUFFER_BYTES_MAX, | 63 | .period_bytes_max = BUFFER_BYTES_MAX, |
61 | .periods_min = 1, | 64 | .periods_min = 1, |
62 | .periods_max = BUFFER_BYTES_MAX / PERIOD_BYTES_MIN, | 65 | .periods_max = BUFFER_BYTES_MAX / PERIOD_BYTES_MIN, |
66 | .fifo_size = FIFO_BYTES, | ||
63 | }; | 67 | }; |
64 | static const struct snd_pcm_hardware oxygen_multichannel_hardware = { | 68 | static const struct snd_pcm_hardware oxygen_multichannel_hardware = { |
65 | .info = SNDRV_PCM_INFO_MMAP | | 69 | .info = SNDRV_PCM_INFO_MMAP | |
@@ -87,6 +91,7 @@ static const struct snd_pcm_hardware oxygen_multichannel_hardware = { | |||
87 | .period_bytes_max = BUFFER_BYTES_MAX_MULTICH, | 91 | .period_bytes_max = BUFFER_BYTES_MAX_MULTICH, |
88 | .periods_min = 1, | 92 | .periods_min = 1, |
89 | .periods_max = BUFFER_BYTES_MAX_MULTICH / PERIOD_BYTES_MIN, | 93 | .periods_max = BUFFER_BYTES_MAX_MULTICH / PERIOD_BYTES_MIN, |
94 | .fifo_size = FIFO_BYTES_MULTICH, | ||
90 | }; | 95 | }; |
91 | static const struct snd_pcm_hardware oxygen_ac97_hardware = { | 96 | static const struct snd_pcm_hardware oxygen_ac97_hardware = { |
92 | .info = SNDRV_PCM_INFO_MMAP | | 97 | .info = SNDRV_PCM_INFO_MMAP | |
@@ -106,6 +111,7 @@ static const struct snd_pcm_hardware oxygen_ac97_hardware = { | |||
106 | .period_bytes_max = BUFFER_BYTES_MAX, | 111 | .period_bytes_max = BUFFER_BYTES_MAX, |
107 | .periods_min = 1, | 112 | .periods_min = 1, |
108 | .periods_max = BUFFER_BYTES_MAX / PERIOD_BYTES_MIN, | 113 | .periods_max = BUFFER_BYTES_MAX / PERIOD_BYTES_MIN, |
114 | .fifo_size = FIFO_BYTES, | ||
109 | }; | 115 | }; |
110 | 116 | ||
111 | static const struct snd_pcm_hardware *const oxygen_hardware[PCM_COUNT] = { | 117 | static const struct snd_pcm_hardware *const oxygen_hardware[PCM_COUNT] = { |
@@ -141,6 +147,10 @@ static int oxygen_open(struct snd_pcm_substream *substream, | |||
141 | runtime->hw.rates &= ~(SNDRV_PCM_RATE_32000 | | 147 | runtime->hw.rates &= ~(SNDRV_PCM_RATE_32000 | |
142 | SNDRV_PCM_RATE_64000); | 148 | SNDRV_PCM_RATE_64000); |
143 | runtime->hw.rate_min = 44100; | 149 | runtime->hw.rate_min = 44100; |
150 | /* fall through */ | ||
151 | case PCM_A: | ||
152 | case PCM_B: | ||
153 | runtime->hw.fifo_size = 0; | ||
144 | break; | 154 | break; |
145 | case PCM_MULTICH: | 155 | case PCM_MULTICH: |
146 | runtime->hw.channels_max = chip->model.dac_channels_pcm; | 156 | runtime->hw.channels_max = chip->model.dac_channels_pcm; |