diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2014-04-25 17:45:11 +0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-05-26 16:28:27 +0400 |
commit | aa02bb6e60783938d61eefe38346781a646800a6 (patch) | |
tree | 9eda5e0ae49c61c799b39682e943768ba4e51e94 /sound/firewire/fireworks/fireworks_stream.c | |
parent | 53111cdc53205fd35aac392c1d33893766be514e (diff) | |
download | linux-aa02bb6e60783938d61eefe38346781a646800a6.tar.xz |
ALSA: fireworks: Add PCM interface
This commit adds a functionality to capture/playback PCM samples.
When AMDTP stream is already running for PCM or the source of clock is not
internal, available sampling rate is limited at current one.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/fireworks/fireworks_stream.c')
-rw-r--r-- | sound/firewire/fireworks/fireworks_stream.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/sound/firewire/fireworks/fireworks_stream.c b/sound/firewire/fireworks/fireworks_stream.c index f9d836fc5039..1860914a3e0f 100644 --- a/sound/firewire/fireworks/fireworks_stream.c +++ b/sound/firewire/fireworks/fireworks_stream.c @@ -9,39 +9,6 @@ #define CALLBACK_TIMEOUT 100 -static unsigned int freq_table[] = { - /* multiplier mode 0 */ - [0] = 32000, - [1] = 44100, - [2] = 48000, - /* multiplier mode 1 */ - [3] = 88200, - [4] = 96000, - /* multiplier mode 2 */ - [5] = 176400, - [6] = 192000, -}; - -static inline unsigned int -get_multiplier_mode_with_index(unsigned int index) -{ - return ((int)index - 1) / 2; -} - -int snd_efw_get_multiplier_mode(unsigned int sampling_rate, unsigned int *mode) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(freq_table); i++) { - if (freq_table[i] == sampling_rate) { - *mode = get_multiplier_mode_with_index(i); - return 0; - } - } - - return -EINVAL; -} - static int init_stream(struct snd_efw *efw, struct amdtp_stream *stream) { |