ia64/linux-2.6.18-xen.hg

view arch/m68k/amiga/amisound.c @ 452:c7ed6fe5dca0

kexec: dont initialise regions in reserve_memory()

There is no need to initialise efi_memmap_res and boot_param_res in
reserve_memory() for the initial xen domain as it is done in
machine_kexec_setup_resources() using values from the kexec hypercall.

Signed-off-by: Simon Horman <horms@verge.net.au>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Feb 28 10:55:18 2008 +0000 (2008-02-28)
parents 831230e53067
children
line source
1 /*
2 * linux/arch/m68k/amiga/amisound.c
3 *
4 * amiga sound driver for Linux/m68k
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive
8 * for more details.
9 */
11 #include <linux/jiffies.h>
12 #include <linux/timer.h>
13 #include <linux/init.h>
14 #include <linux/string.h>
16 #include <asm/system.h>
17 #include <asm/amigahw.h>
19 static unsigned short *snd_data;
20 static const signed char sine_data[] = {
21 0, 39, 75, 103, 121, 127, 121, 103, 75, 39,
22 0, -39, -75, -103, -121, -127, -121, -103, -75, -39
23 };
24 #define DATA_SIZE (sizeof(sine_data)/sizeof(sine_data[0]))
26 #define custom amiga_custom
28 /*
29 * The minimum period for audio may be modified by the frame buffer
30 * device since it depends on htotal (for OCS/ECS/AGA)
31 */
33 volatile unsigned short amiga_audio_min_period = 124; /* Default for pre-OCS */
35 #define MAX_PERIOD (65535)
38 /*
39 * Current period (set by dmasound.c)
40 */
42 unsigned short amiga_audio_period = MAX_PERIOD;
44 static unsigned long clock_constant;
46 void __init amiga_init_sound(void)
47 {
48 static struct resource beep_res = { .name = "Beep" };
50 snd_data = amiga_chip_alloc_res(sizeof(sine_data), &beep_res);
51 if (!snd_data) {
52 printk (KERN_CRIT "amiga init_sound: failed to allocate chipmem\n");
53 return;
54 }
55 memcpy (snd_data, sine_data, sizeof(sine_data));
57 /* setup divisor */
58 clock_constant = (amiga_colorclock+DATA_SIZE/2)/DATA_SIZE;
60 /* without amifb, turn video off and enable high quality sound */
61 #ifndef CONFIG_FB_AMIGA
62 amifb_video_off();
63 #endif
64 }
66 static void nosound( unsigned long ignored );
67 static DEFINE_TIMER(sound_timer, nosound, 0, 0);
69 void amiga_mksound( unsigned int hz, unsigned int ticks )
70 {
71 unsigned long flags;
73 if (!snd_data)
74 return;
76 local_irq_save(flags);
77 del_timer( &sound_timer );
79 if (hz > 20 && hz < 32767) {
80 unsigned long period = (clock_constant / hz);
82 if (period < amiga_audio_min_period)
83 period = amiga_audio_min_period;
84 if (period > MAX_PERIOD)
85 period = MAX_PERIOD;
87 /* setup pointer to data, period, length and volume */
88 custom.aud[2].audlc = snd_data;
89 custom.aud[2].audlen = sizeof(sine_data)/2;
90 custom.aud[2].audper = (unsigned short)period;
91 custom.aud[2].audvol = 32; /* 50% of maxvol */
93 if (ticks) {
94 sound_timer.expires = jiffies + ticks;
95 add_timer( &sound_timer );
96 }
98 /* turn on DMA for audio channel 2 */
99 custom.dmacon = DMAF_SETCLR | DMAF_AUD2;
101 } else
102 nosound( 0 );
104 local_irq_restore(flags);
105 }
108 static void nosound( unsigned long ignored )
109 {
110 /* turn off DMA for audio channel 2 */
111 custom.dmacon = DMAF_AUD2;
112 /* restore period to previous value after beeping */
113 custom.aud[2].audper = amiga_audio_period;
114 }