aboutsummaryrefslogtreecommitdiffstats
path: root/sound/oss/sh_dac_audio.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/oss/sh_dac_audio.c')
-rw-r--r--sound/oss/sh_dac_audio.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/sound/oss/sh_dac_audio.c b/sound/oss/sh_dac_audio.c
index ae7fccc510a1..83ff8a71f716 100644
--- a/sound/oss/sh_dac_audio.c
+++ b/sound/oss/sh_dac_audio.c
@@ -1,3 +1,14 @@
1/*
2 * sound/oss/sh_dac_audio.c
3 *
4 * SH DAC based sound :(
5 *
6 * Copyright (C) 2004,2005 Andriy Skulysh
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
1#include <linux/module.h> 12#include <linux/module.h>
2#include <linux/init.h> 13#include <linux/init.h>
3#include <linux/sched.h> 14#include <linux/sched.h>
@@ -11,10 +22,12 @@
11#include <asm/uaccess.h> 22#include <asm/uaccess.h>
12#include <asm/irq.h> 23#include <asm/irq.h>
13#include <asm/delay.h> 24#include <asm/delay.h>
25#include <asm/clock.h>
14#include <asm/cpu/dac.h> 26#include <asm/cpu/dac.h>
27#include <asm/cpu/timer.h>
15#include <asm/machvec.h> 28#include <asm/machvec.h>
16#include <asm/hp6xx/hp6xx.h> 29#include <asm/hp6xx/hp6xx.h>
17#include <asm/hd64461/hd64461.h> 30#include <asm/hd64461.h>
18 31
19#define MODNAME "sh_dac_audio" 32#define MODNAME "sh_dac_audio"
20 33
@@ -23,11 +36,6 @@
23#define TMU1_TCR_INIT 0x0020 /* Clock/4, rising edge; interrupt on */ 36#define TMU1_TCR_INIT 0x0020 /* Clock/4, rising edge; interrupt on */
24#define TMU1_TSTR_INIT 0x02 /* Bit to turn on TMU1 */ 37#define TMU1_TSTR_INIT 0x02 /* Bit to turn on TMU1 */
25 38
26#define TMU_TSTR 0xfffffe92
27#define TMU1_TCOR 0xfffffea0
28#define TMU1_TCNT 0xfffffea4
29#define TMU1_TCR 0xfffffea8
30
31#define BUFFER_SIZE 48000 39#define BUFFER_SIZE 48000
32 40
33static int rate; 41static int rate;
@@ -87,14 +95,18 @@ static void dac_audio_stop(void)
87 outw(v, HD64461_GPADR); 95 outw(v, HD64461_GPADR);
88 } 96 }
89 97
98 sh_dac_output(0, CONFIG_SOUND_SH_DAC_AUDIO_CHANNEL);
90 sh_dac_disable(CONFIG_SOUND_SH_DAC_AUDIO_CHANNEL); 99 sh_dac_disable(CONFIG_SOUND_SH_DAC_AUDIO_CHANNEL);
91} 100}
92 101
93static void dac_audio_set_rate(void) 102static void dac_audio_set_rate(void)
94{ 103{
95 unsigned long interval; 104 unsigned long interval;
105 struct clk *clk;
96 106
97 interval = (current_cpu_data.module_clock / 4) / rate; 107 clk = clk_get("module_clk");
108 interval = (clk_get_rate(clk) / 4) / rate;
109 clk_put(clk);
98 ctrl_outl(interval, TMU1_TCOR); 110 ctrl_outl(interval, TMU1_TCOR);
99 ctrl_outl(interval, TMU1_TCNT); 111 ctrl_outl(interval, TMU1_TCNT);
100} 112}