2 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include <linux/time.h>
22 #include <sound/core.h>
23 #include <sound/gus.h>
24 #define __GUS_TABLES_ALLOC__
25 #include "gus_tables.h"
27 EXPORT_SYMBOL(snd_gf1_atten_table
); /* for snd-gus-synth module */
29 unsigned short snd_gf1_lvol_to_gvol_raw(unsigned int vol
)
31 unsigned short e
, m
, tmp
;
38 while (e
> 0 && tmp
< (1 << e
))
58 unsigned short snd_gf1_translate_freq(struct snd_gus_card
* gus
, unsigned int freq16
)
63 if (freq16
& 0xf8000000) {
65 snd_printk(KERN_ERR
"snd_gf1_translate_freq: overflow - freq = 0x%x\n", freq16
);
67 return ((freq16
<< 9) + (gus
->gf1
.playback_freq
>> 1)) / gus
->gf1
.playback_freq
;