diff options
Diffstat (limited to 'sound/drivers')
-rw-r--r-- | sound/drivers/serial-u16550.c | 10 | ||||
-rw-r--r-- | sound/drivers/vx/vx_uer.c | 46 |
2 files changed, 23 insertions, 33 deletions
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c index 964b97e70c84..986df35fb829 100644 --- a/sound/drivers/serial-u16550.c +++ b/sound/drivers/serial-u16550.c | |||
@@ -168,7 +168,7 @@ typedef struct _snd_uart16550 { | |||
168 | 168 | ||
169 | static snd_card_t *snd_serial_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; | 169 | static snd_card_t *snd_serial_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; |
170 | 170 | ||
171 | inline static void snd_uart16550_add_timer(snd_uart16550_t *uart) | 171 | static inline void snd_uart16550_add_timer(snd_uart16550_t *uart) |
172 | { | 172 | { |
173 | if (! uart->timer_running) { | 173 | if (! uart->timer_running) { |
174 | /* timer 38600bps * 10bit * 16byte */ | 174 | /* timer 38600bps * 10bit * 16byte */ |
@@ -178,7 +178,7 @@ inline static void snd_uart16550_add_timer(snd_uart16550_t *uart) | |||
178 | } | 178 | } |
179 | } | 179 | } |
180 | 180 | ||
181 | inline static void snd_uart16550_del_timer(snd_uart16550_t *uart) | 181 | static inline void snd_uart16550_del_timer(snd_uart16550_t *uart) |
182 | { | 182 | { |
183 | if (uart->timer_running) { | 183 | if (uart->timer_running) { |
184 | del_timer(&uart->buffer_timer); | 184 | del_timer(&uart->buffer_timer); |
@@ -187,7 +187,7 @@ inline static void snd_uart16550_del_timer(snd_uart16550_t *uart) | |||
187 | } | 187 | } |
188 | 188 | ||
189 | /* This macro is only used in snd_uart16550_io_loop */ | 189 | /* This macro is only used in snd_uart16550_io_loop */ |
190 | inline static void snd_uart16550_buffer_output(snd_uart16550_t *uart) | 190 | static inline void snd_uart16550_buffer_output(snd_uart16550_t *uart) |
191 | { | 191 | { |
192 | unsigned short buff_out = uart->buff_out; | 192 | unsigned short buff_out = uart->buff_out; |
193 | if( uart->buff_in_count > 0 ) { | 193 | if( uart->buff_in_count > 0 ) { |
@@ -579,7 +579,7 @@ static int snd_uart16550_output_close(snd_rawmidi_substream_t * substream) | |||
579 | return 0; | 579 | return 0; |
580 | }; | 580 | }; |
581 | 581 | ||
582 | inline static int snd_uart16550_buffer_can_write( snd_uart16550_t *uart, int Num ) | 582 | static inline int snd_uart16550_buffer_can_write( snd_uart16550_t *uart, int Num ) |
583 | { | 583 | { |
584 | if( uart->buff_in_count + Num < TX_BUFF_SIZE ) | 584 | if( uart->buff_in_count + Num < TX_BUFF_SIZE ) |
585 | return 1; | 585 | return 1; |
@@ -587,7 +587,7 @@ inline static int snd_uart16550_buffer_can_write( snd_uart16550_t *uart, int Num | |||
587 | return 0; | 587 | return 0; |
588 | } | 588 | } |
589 | 589 | ||
590 | inline static int snd_uart16550_write_buffer(snd_uart16550_t *uart, unsigned char byte) | 590 | static inline int snd_uart16550_write_buffer(snd_uart16550_t *uart, unsigned char byte) |
591 | { | 591 | { |
592 | unsigned short buff_in = uart->buff_in; | 592 | unsigned short buff_in = uart->buff_in; |
593 | if( uart->buff_in_count < TX_BUFF_SIZE ) { | 593 | if( uart->buff_in_count < TX_BUFF_SIZE ) { |
diff --git a/sound/drivers/vx/vx_uer.c b/sound/drivers/vx/vx_uer.c index 18114713c3b3..4fc38bde34f4 100644 --- a/sound/drivers/vx/vx_uer.c +++ b/sound/drivers/vx/vx_uer.c | |||
@@ -162,34 +162,24 @@ static int vx_read_uer_status(vx_core_t *chip, int *mode) | |||
162 | 162 | ||
163 | static int vx_calc_clock_from_freq(vx_core_t *chip, int freq) | 163 | static int vx_calc_clock_from_freq(vx_core_t *chip, int freq) |
164 | { | 164 | { |
165 | #define XX_FECH48000 0x0000004B | 165 | int hexfreq; |
166 | #define XX_FECH32000 0x00000171 | 166 | |
167 | #define XX_FECH24000 0x0000024B | 167 | snd_assert(freq > 0, return 0); |
168 | #define XX_FECH16000 0x00000371 | 168 | |
169 | #define XX_FECH12000 0x0000044B | 169 | hexfreq = (28224000 * 10) / freq; |
170 | #define XX_FECH8000 0x00000571 | 170 | hexfreq = (hexfreq + 5) / 10; |
171 | #define XX_FECH44100 0x0000007F | 171 | |
172 | #define XX_FECH29400 0x0000016F | 172 | /* max freq = 55125 Hz */ |
173 | #define XX_FECH22050 0x0000027F | 173 | snd_assert(hexfreq > 0x00000200, return 0); |
174 | #define XX_FECH14000 0x000003EF | 174 | |
175 | #define XX_FECH11025 0x0000047F | 175 | if (hexfreq <= 0x03ff) |
176 | #define XX_FECH7350 0x000005BF | 176 | return hexfreq - 0x00000201; |
177 | 177 | if (hexfreq <= 0x07ff) | |
178 | switch (freq) { | 178 | return (hexfreq / 2) - 1; |
179 | case 48000: return XX_FECH48000; | 179 | if (hexfreq <= 0x0fff) |
180 | case 44100: return XX_FECH44100; | 180 | return (hexfreq / 4) + 0x000001ff; |
181 | case 32000: return XX_FECH32000; | 181 | |
182 | case 29400: return XX_FECH29400; | 182 | return 0x5fe; /* min freq = 6893 Hz */ |
183 | case 24000: return XX_FECH24000; | ||
184 | case 22050: return XX_FECH22050; | ||
185 | case 16000: return XX_FECH16000; | ||
186 | case 14000: return XX_FECH14000; | ||
187 | case 12000: return XX_FECH12000; | ||
188 | case 11025: return XX_FECH11025; | ||
189 | case 8000: return XX_FECH8000; | ||
190 | case 7350: return XX_FECH7350; | ||
191 | default: return freq; /* The value is already correct */ | ||
192 | } | ||
193 | } | 183 | } |
194 | 184 | ||
195 | 185 | ||