add support for PC-9800 architecture (sound oss #1)
PATCH 21/23 add support for PC-9800 architecture (sound oss #1)
This is a part 21/23 of patchset for add support NEC PC-9800 architecture, against 2.5.44.
Summary:
OSS sound driver related modules.
- add hardware specific initialization.
- IO port address and IRQ number change.
diffstat:
sound/oss/Config.in | 16 ++++ sound/oss/Makefile | 1 sound/oss/ad1848.c | 45 +++++++++++ sound/oss/dev_table.h | 3 sound/oss/dmabuf.c | 3 sound/oss/mpu401.c | 178 +++++++++++++++++++++++++++++++++++++++++++++++ sound/oss/opl3.c | 132 +++++++++++++++++++++++++++++++++- sound/oss/sb.h | 34 ++++++++ sound/oss/sb_common.c | 103 ++++++++++++++++++++++++++- sound/oss/sound_config.h | 12 +++ sound/oss/uart401.c | 17 ++++ 11 files changed, 538 insertions(+), 6 deletions(-)
patch:
sound/oss/Config.in +16 -0
@@ -132,6 +132,9 @@ dep_tristate ' Microsoft Sound System support' CONFIG_SOUND_MSS $CONFIG_SOUND_OSS dep_tristate ' MPU-401 support (NOT for SB16)' CONFIG_SOUND_MPU401 $CONFIG_SOUND_OSS + if [ "$CONFIG_SOUND_MPU401" != "n" -a "$CONFIG_PC9800" = "y" ]; then + dep_bool ' Roland MPU-PC98II support' CONFIG_MPU_PC98II y + fi dep_tristate ' NM256AV/NM256ZX audio support' CONFIG_SOUND_NM256 $CONFIG_SOUND_OSS dep_tristate ' OPTi MAD16 and/or Mozart based cards' CONFIG_SOUND_MAD16 $CONFIG_SOUND_OSS $CONFIG_SOUND_GAMEPORT if [ "$CONFIG_SOUND_MAD16" = "y" -o "$CONFIG_SOUND_MAD16" = "m" ]; then
@@ -151,6 +154,9 @@ dep_tristate ' 100% Sound Blaster compatibles (SB16/32/64, ESS, Jazz16) support' CONFIG_SOUND_SB $CONFIG_SOUND_OSS dep_tristate ' AWE32 synth' CONFIG_SOUND_AWE32_SYNTH $CONFIG_SOUND_OSS + if [ "$CONFIG_PC9800" = "y" -a "$CONFIG_SOUND_SB" != "n" ]; then + define_bool CONFIG_SB16_PC9800 y + fi dep_tristate ' Full support for Turtle Beach WaveFront (Tropez Plus, Tropez, Maui) synth/soundcards' CONFIG_SOUND_WAVEFRONT $CONFIG_SOUND_OSS m dep_tristate ' Limited support for Turtle Beach Wave Front (Maui, Tropez) synthesizers' CONFIG_SOUND_MAUI $CONFIG_SOUND_OSS if [ "$CONFIG_SOUND_MAUI" = "y" ]; then
@@ -161,6 +167,9 @@ fi dep_tristate ' Yamaha FM synthesizer (YM3812/OPL-3) support' CONFIG_SOUND_YM3812 $CONFIG_SOUND_OSS + if [ "$CONFIG_PC9800" = "y" -a "$CONFIG_SOUND_YM3812" != "n" ]; then + define_bool CONFIG_PC9801_118 y + fi dep_tristate ' Yamaha OPL3-SA1 audio controller' CONFIG_SOUND_OPL3SA1 $CONFIG_SOUND_OSS dep_tristate ' Yamaha OPL3-SA2 and SA3 based PnP cards' CONFIG_SOUND_OPL3SA2 $CONFIG_SOUND_OSS dep_tristate ' Yamaha YMF7xx PCI audio (native mode)' CONFIG_SOUND_YMFPCI $CONFIG_SOUND_OSS $CONFIG_PCI
@@ -197,6 +206,13 @@ dep_tristate ' Netwinder WaveArtist' CONFIG_SOUND_WAVEARTIST $CONFIG_SOUND_OSS $CONFIG_ARCH_NETWINDER fi + if [ "$CONFIG_PC9800" = "y" -a "$CONFIG_EXPERIMENTAL" = "y" ]; then + dep_tristate ' NEC PC-9801-86 PCM support' CONFIG_SOUND_PC9801_86 $CONFIG_SOUND_OSS + if [ "$CONFIG_SOUND_PC9801_86" != "n" ]; then + hex ' PC-9801-86 I/O base' CONFIG_PC9801_86_BASE a460 + fi + fi + fi dep_tristate ' TV card (bt848) mixer support' CONFIG_SOUND_TVMIXER $CONFIG_SOUND $CONFIG_I2C
sound/oss/Makefile +1 -0
@@ -42,6 +42,7 @@ obj-$(CONFIG_SOUND_AD1816) += ad1816.o obj-$(CONFIG_SOUND_ACI_MIXER) += aci.o obj-$(CONFIG_SOUND_AWE32_SYNTH) += awe_wave.o +obj-$(CONFIG_SOUND_PC9801_86) += pc9801_86_pcm.o obj-$(CONFIG_SOUND_VIA82CXXX) += via82cxxx_audio.o ac97_codec.o ifeq ($(CONFIG_MIDI_VIA82CXXX),y)
sound/oss/ad1848.c +45 -0
85 lines not on this page · raw message
sound/oss/dev_table.h +3 -0
@@ -34,6 +34,9 @@#define SNDCARD_OPL3SA2_MPU 43#define SNDCARD_WAVEARTIST 44/* Waveartist */ #define SNDCARD_OPL3SA2_MSS 45/* Originally missed */ +#ifdef CONFIG_PC9800 +#define SNDCARD_PC9801_86 86/* PC-9801-86 */ +#endif #define SNDCARD_AD1816 88/*
sound/oss/dmabuf.c +3 -0
@@ -153,6 +157,9 @@/* printk( "Start DMA%d %d, %d\n", chan, (int)(physaddr-dmap->raw_buf_phys), count); */ flags =claim_dma_lock (); +#ifdef CONFIG_PC9800 +outb (chan,0x29 ); +#endif /* CONFIG_PC9800 */ disable_dma (chan);clear_dma_ff (chan);set_dma_mode (chan, dma_mode);
sound/oss/mpu401.c +178 -0
222 lines not on this page · raw message
sound/oss/opl3.c +127 -5
206 lines not on this page · raw message
sound/oss/sb.h +34 -0
@@ -1,3 +1,7 @@ +#include <linux/config.h> + +#ifndef CONFIG_SB16_PC9800 +#define DSP_RESET (devc->base + 0x6)#define DSP_READ (devc->base + 0xA)#define DSP_WRITE (devc->base + 0xC)
@@ -10,6 +14,26 @@#define OPL3_LEFT (devc->base + 0x0)#define OPL3_RIGHT (devc->base + 0x2)#define OPL3_BOTH (devc->base + 0x8) + +#else /* CONFIG_SB16_PC9800 */ + +#define _SB_98_IOINCR (devc->type == MDL_SB16_PC9800 ? 0x100 : 1) + +#define DSP_RESET (devc->base + 0x6 * _SB_98_IOINCR) +#define DSP_READ (devc->base + 0xA * _SB_98_IOINCR) +#define DSP_WRITE (devc->base + 0xC * _SB_98_IOINCR) +#define DSP_COMMAND (devc->base + 0xC * _SB_98_IOINCR) +#define DSP_STATUS (devc->base + 0xC * _SB_98_IOINCR) +#define DSP_DATA_AVAIL (devc->base + 0xE * _SB_98_IOINCR) +#define DSP_DATA_AVL16 (devc->base + 0xF * _SB_98_IOINCR) +#define MIXER_ADDR (devc->base + 0x4 * _SB_98_IOINCR) +#define MIXER_DATA (devc->base + 0x5 * _SB_98_IOINCR) +#define OPL3_LEFT (devc->base + 0x0 * _SB_98_IOINCR) +#define OPL3_RIGHT (devc->base + 0x2 * _SB_98_IOINCR) +#define OPL3_BOTH (devc->base + 0x8 * _SB_98_IOINCR) + +#endif /* CONFIG_SB16_PC9800 */ +/* DSP Commands */ #define DSP_CMD_SPKON 0xD1
@@ -46,6 +70,10 @@#define MDL_ESSPCI 16/* ESS PCI card */ #define MDL_YMPCI 17/* Yamaha PCI sb in emulation */ +#ifdef CONFIG_SB16_PC9800 +#define MDL_SB16_PC9800 9801/* SB16 for PC-9800 */ +#endif +#define SUBMDL_ALS007 42/* ALS-007 differs from SB16 only in mixer */ /* register assignment */ #define SUBMDL_ALS100 43/* ALS-100 allows sampling rates of up */
@@ -175,6 +203,12 @@int sb_audio_open (int dev,int mode);void sb_audio_close (int dev); +#ifdef CONFIG_SB16_PC9800 +int sb16_pc9800_check_region (int ioaddr); +void sb16_pc9800_request_region (int ioaddr,const char *name); +void sb16_pc9800_release_region (int ioaddr); +#endif +extern sb_devc *last_sb;/* From sb_common.c */
sound/oss/sb_common.c +102 -1
173 lines not on this page · raw message
sound/oss/sound_config.h +12 -0
@@ -34,13 +34,25 @@* Use always 64k buffer size. There is no reason to use shorter. */ #undef DSP_BUFFSIZE +#ifdef CONFIG_PC9800 +#define DSP_BUFFSIZE 61440 +#else #define DSP_BUFFSIZE (64*1024) +#endif #ifndef DSP_BUFFCOUNT #define DSP_BUFFCOUNT 1/* 1 is recommended. */ #endif +#ifdef CONFIG_PC9800 +#define FM_MONO 0x28d2/* This is the I/O address used by AdLib */ +#else #define FM_MONO 0x388/* This is the I/O address used by AdLib */ +#endif + +#ifdef CONFIG_PC9801_118 +#define FM_MONO_118 0x1488/* This is the I/O address used by AdLib */ +#endif #ifndef CONFIG_PAS_BASE #define CONFIG_PAS_BASE 0x388
sound/oss/uart401.c +17 -0
@@ -21,6 +21,7 @@* Untested */ +#include <linux/config.h> #include <linux/init.h> #include <linux/module.h> #include <linux/spinlock.h>
@@ -43,8 +44,13 @@ uart401_devc;#define DATAPORT (devc->base) +#ifndef CONFIG_SB16_PC9800 #define COMDPORT (devc->base+1)#define STATPORT (devc->base+1) +#else +#define COMDPORT (devc->base+0x100) +#define STATPORT (devc->base+0x100) +#endif static int uart401_status (uart401_devc * devc) {
@@ -304,6 +310,14 @@return 0 ; } +#ifdef CONFIG_SB16_PC9800 +if (!request_region (hw_config->io_base +0x100 ,4 ,"MPU-401 UART SB16-PC98" )) { +printk (KERN_INFO "uart401: could not request_region(%d, 4)\n" , hw_config->io_base +0x100 ); +release_region (hw_config->io_base,4 ); +return 0 ; + } +#endif + devc =kmalloc (sizeof (uart401_devc),GFP_KERNEL );if (!devc) {printk (KERN_WARNING "uart401: Can't allocate memory\n" );
@@ -408,6 +422,9 @@reset_uart401 (devc);release_region (hw_config->io_base,4 ); +#ifdef CONFIG_SB16_PC9800 +release_region (hw_config->io_base +0x100 ,4 ); +#endif if (!devc->share_irq)free_irq (devc->irq, devc);