Commit 79918bec authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] dmasound update.

The largest part of the OSS update from 2.4
Various changelog entries scattered throughout the patch.
parent 8412c915
/* /*
* linux/drivers/sound/dmasound/dmasound_atari.c * linux/drivers/sound/dmasound/dmasound_atari.c
* *
* Atari TT and Falcon DMA Sound Driver * Atari TT and Falcon DMA Sound Driver
* *
* See linux/drivers/sound/dmasound/dmasound_core.c for copyright and credits * See linux/drivers/sound/dmasound/dmasound_core.c for copyright and credits
* prior to 28/01/2001
*
* 28/01/2001 [0.1] Iain Sandoe
* - added versioning
* - put in and populated the hardware_afmts field.
* [0.2] - put in SNDCTL_DSP_GETCAPS value.
* 01/02/2001 [0.3] - put in default hard/soft settings.
*/ */
...@@ -21,10 +27,11 @@ ...@@ -21,10 +27,11 @@
#include "dmasound.h" #include "dmasound.h"
#define DMASOUND_ATARI_REVISION 0
#define DMASOUND_ATARI_EDITION 3
extern void atari_microwire_cmd(int cmd); extern void atari_microwire_cmd(int cmd);
static int is_falcon; static int is_falcon;
static int write_sq_ignore_int = 0; /* ++TeSche: used for Falcon */ static int write_sq_ignore_int = 0; /* ++TeSche: used for Falcon */
...@@ -136,10 +143,10 @@ static void FalconMixerInit(void); ...@@ -136,10 +143,10 @@ static void FalconMixerInit(void);
static int AtaMixerIoctl(u_int cmd, u_long arg); static int AtaMixerIoctl(u_int cmd, u_long arg);
static int TTMixerIoctl(u_int cmd, u_long arg); static int TTMixerIoctl(u_int cmd, u_long arg);
static int FalconMixerIoctl(u_int cmd, u_long arg); static int FalconMixerIoctl(u_int cmd, u_long arg);
static void AtaWriteSqSetup(void); static int AtaWriteSqSetup(void);
static void AtaSqOpen(void); static int AtaSqOpen(mode_t mode);
static int TTStateInfo(char *buffer); static int TTStateInfo(char *buffer, size_t space);
static int FalconStateInfo(char *buffer); static int FalconStateInfo(char *buffer, size_t space);
/*** Translations ************************************************************/ /*** Translations ************************************************************/
...@@ -1438,43 +1445,73 @@ static int FalconMixerIoctl(u_int cmd, u_long arg) ...@@ -1438,43 +1445,73 @@ static int FalconMixerIoctl(u_int cmd, u_long arg)
return AtaMixerIoctl(cmd, arg); return AtaMixerIoctl(cmd, arg);
} }
static void AtaWriteSqSetup(void) static int AtaWriteSqSetup(void)
{ {
write_sq_ignore_int = 0; write_sq_ignore_int = 0;
return 0 ;
} }
static void AtaSqOpen(void) static int AtaSqOpen(mode_t mode)
{ {
write_sq_ignore_int = 1; write_sq_ignore_int = 1;
return 0 ;
} }
static int TTStateInfo(char *buffer) static int TTStateInfo(char *buffer, size_t space)
{ {
int len = 0; int len = 0;
len += sprintf(buffer+len, "\tsound.volume_left = %ddB [-40...0]\n", len += sprintf(buffer+len, "\tvol left %ddB [-40... 0]\n",
dmasound.volume_left); dmasound.volume_left);
len += sprintf(buffer+len, "\tsound.volume_right = %ddB [-40...0]\n", len += sprintf(buffer+len, "\tvol right %ddB [-40... 0]\n",
dmasound.volume_right); dmasound.volume_right);
len += sprintf(buffer+len, "\tsound.bass = %ddB [-12...+12]\n", len += sprintf(buffer+len, "\tbass %ddB [-12...+12]\n",
dmasound.bass); dmasound.bass);
len += sprintf(buffer+len, "\tsound.treble = %ddB [-12...+12]\n", len += sprintf(buffer+len, "\ttreble %ddB [-12...+12]\n",
dmasound.treble); dmasound.treble);
if (len >= space) {
printk(KERN_ERR "dmasound_atari: overflowed state buffer alloc.\n") ;
len = space ;
}
return len; return len;
} }
static int FalconStateInfo(char *buffer) static int FalconStateInfo(char *buffer, size_t space)
{ {
int len = 0; int len = 0;
len += sprintf(buffer+len, "\tsound.volume_left = %ddB [-22.5...0]\n", len += sprintf(buffer+len, "\tvol left %ddB [-22.5 ... 0]\n",
dmasound.volume_left); dmasound.volume_left);
len += sprintf(buffer+len, "\tsound.volume_right = %ddB [-22.5...0]\n", len += sprintf(buffer+len, "\tvol right %ddB [-22.5 ... 0]\n",
dmasound.volume_right); dmasound.volume_right);
if (len >= space) {
printk(KERN_ERR "dmasound_atari: overflowed state buffer alloc.\n") ;
len = space ;
}
return len; return len;
} }
/*** Machine definitions *****************************************************/ /*** Machine definitions *****************************************************/
static SETTINGS def_hard_falcon = {
format: AFMT_S8,
stereo: 0,
size: 8,
speed: 8195
} ;
static SETTINGS def_hard_tt = {
format: AFMT_S8,
stereo: 0,
size: 8,
speed: 12517
} ;
static SETTINGS def_soft = {
format: AFMT_U8,
stereo: 0,
size: 8,
speed: 8000
} ;
static MACHINE machTT = { static MACHINE machTT = {
name: "Atari", name: "Atari",
...@@ -1501,6 +1538,9 @@ static MACHINE machTT = { ...@@ -1501,6 +1538,9 @@ static MACHINE machTT = {
sq_open: AtaSqOpen, sq_open: AtaSqOpen,
state_info: TTStateInfo, state_info: TTStateInfo,
min_dsp_speed: 6258, min_dsp_speed: 6258,
version: ((DMASOUND_ATARI_REVISION<<8) | DMASOUND_ATARI_EDITION),
hardware_afmts: AFMT_S8, /* h'ware-supported formats *only* here */
capabilities: DSP_CAP_BATCH /* As per SNDCTL_DSP_GETCAPS */
}; };
static MACHINE machFalcon = { static MACHINE machFalcon = {
...@@ -1525,6 +1565,9 @@ static MACHINE machFalcon = { ...@@ -1525,6 +1565,9 @@ static MACHINE machFalcon = {
sq_open: AtaSqOpen, sq_open: AtaSqOpen,
state_info: FalconStateInfo, state_info: FalconStateInfo,
min_dsp_speed: 8195, min_dsp_speed: 8195,
version: ((DMASOUND_ATARI_REVISION<<8) | DMASOUND_ATARI_EDITION),
hardware_afmts: (AFMT_S8 | AFMT_S16_BE), /* h'ware-supported formats *only* here */
capabilities: DSP_CAP_BATCH /* As per SNDCTL_DSP_GETCAPS */
}; };
...@@ -1536,9 +1579,13 @@ static int __init dmasound_atari_init(void) ...@@ -1536,9 +1579,13 @@ static int __init dmasound_atari_init(void)
if (MACH_IS_ATARI && ATARIHW_PRESENT(PCM_8BIT)) { if (MACH_IS_ATARI && ATARIHW_PRESENT(PCM_8BIT)) {
if (ATARIHW_PRESENT(CODEC)) { if (ATARIHW_PRESENT(CODEC)) {
dmasound.mach = machFalcon; dmasound.mach = machFalcon;
dmasound.mach.default_soft = def_soft ;
dmasound.mach.default_hard = def_hard_falcon ;
is_falcon = 1; is_falcon = 1;
} else if (ATARIHW_PRESENT(MICROWIRE)) { } else if (ATARIHW_PRESENT(MICROWIRE)) {
dmasound.mach = machTT; dmasound.mach = machTT;
dmasound.mach.default_soft = def_soft ;
dmasound.mach.default_hard = def_hard_tt ;
is_falcon = 0; is_falcon = 0;
} else } else
return -ENODEV; return -ENODEV;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
/* /*
* linux/drivers/sound/dmasound/dmasound_paula.c * linux/drivers/sound/dmasound/dmasound_paula.c
* *
* Amiga `Paula' DMA Sound Driver * Amiga `Paula' DMA Sound Driver
* *
* See linux/drivers/sound/dmasound/dmasound_core.c for copyright and credits * See linux/drivers/sound/dmasound/dmasound_core.c for copyright and credits
*/ * prior to 28/01/2001
*
* 28/01/2001 [0.1] Iain Sandoe
* - added versioning
* - put in and populated the hardware_afmts field.
* [0.2] - put in SNDCTL_DSP_GETCAPS value.
* [0.3] - put in constraint on state buffer usage.
* [0.4] - put in default hard/soft settings
*/
#include <linux/module.h> #include <linux/module.h>
...@@ -23,6 +30,8 @@ ...@@ -23,6 +30,8 @@
#include "dmasound.h" #include "dmasound.h"
#define DMASOUND_PAULA_REVISION 0
#define DMASOUND_PAULA_EDITION 4
/* /*
* The minimum period for audio depends on htotal (for OCS/ECS/AGA) * The minimum period for audio depends on htotal (for OCS/ECS/AGA)
...@@ -113,8 +122,8 @@ static inline void enable_heartbeat(void) ...@@ -113,8 +122,8 @@ static inline void enable_heartbeat(void)
static void AmiMixerInit(void); static void AmiMixerInit(void);
static int AmiMixerIoctl(u_int cmd, u_long arg); static int AmiMixerIoctl(u_int cmd, u_long arg);
static void AmiWriteSqSetup(void); static int AmiWriteSqSetup(void);
static int AmiStateInfo(char *buffer); static int AmiStateInfo(char *buffer, size_t space);
/*** Translations ************************************************************/ /*** Translations ************************************************************/
...@@ -646,26 +655,44 @@ static int AmiMixerIoctl(u_int cmd, u_long arg) ...@@ -646,26 +655,44 @@ static int AmiMixerIoctl(u_int cmd, u_long arg)
} }
static void AmiWriteSqSetup(void) static int AmiWriteSqSetup(void)
{ {
write_sq_block_size_half = write_sq.block_size>>1; write_sq_block_size_half = write_sq.block_size>>1;
write_sq_block_size_quarter = write_sq_block_size_half>>1; write_sq_block_size_quarter = write_sq_block_size_half>>1;
return 0;
} }
static int AmiStateInfo(char *buffer) static int AmiStateInfo(char *buffer, size_t space)
{ {
int len = 0; int len = 0;
len += sprintf(buffer+len, "\tsound.volume_left = %d [0...64]\n", len += sprintf(buffer+len, "\tsound.volume_left = %d [0...64]\n",
dmasound.volume_left); dmasound.volume_left);
len += sprintf(buffer+len, "\tsound.volume_right = %d [0...64]\n", len += sprintf(buffer+len, "\tsound.volume_right = %d [0...64]\n",
dmasound.volume_right); dmasound.volume_right);
if (len >= space) {
printk(KERN_ERR "dmasound_paula: overlowed state buffer alloc.\n") ;
len = space ;
}
return len; return len;
} }
/*** Machine definitions *****************************************************/ /*** Machine definitions *****************************************************/
static SETTINGS def_hard = {
format: AFMT_S8,
stereo: 0,
size: 8,
speed: 8000
} ;
static SETTINGS def_soft = {
format: AFMT_U8,
stereo: 0,
size: 8,
speed: 8000
} ;
static MACHINE machAmiga = { static MACHINE machAmiga = {
name: "Amiga", name: "Amiga",
...@@ -688,7 +715,10 @@ static MACHINE machAmiga = { ...@@ -688,7 +715,10 @@ static MACHINE machAmiga = {
mixer_ioctl: AmiMixerIoctl, mixer_ioctl: AmiMixerIoctl,
write_sq_setup: AmiWriteSqSetup, write_sq_setup: AmiWriteSqSetup,
state_info: AmiStateInfo, state_info: AmiStateInfo,
min_dsp_speed: 8000 min_dsp_speed: 8000,
version: ((DMASOUND_PAULA_REVISION<<8) | DMASOUND_PAULA_EDITION),
hardware_afmts: (AFMT_S8 | AFMT_S16_BE), /* h'ware-supported formats *only* here */
capabilities: DSP_CAP_BATCH /* As per SNDCTL_DSP_GETCAPS */
}; };
...@@ -704,6 +734,8 @@ int __init dmasound_paula_init(void) ...@@ -704,6 +734,8 @@ int __init dmasound_paula_init(void)
"dmasound [Paula]")) "dmasound [Paula]"))
return -EBUSY; return -EBUSY;
dmasound.mach = machAmiga; dmasound.mach = machAmiga;
dmasound.mach.default_hard = def_hard ;
dmasound.mach.default_soft = def_soft ;
err = dmasound_init(); err = dmasound_init();
if (err) if (err)
release_mem_region(CUSTOM_PHYSADDR+0xa0, 0x40); release_mem_region(CUSTOM_PHYSADDR+0xa0, 0x40);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment