Skip to content

Commit

Permalink
ALSA: ALSA driver for SGI O2 audio board
Browse files Browse the repository at this point in the history
This patch adds a new ALSA driver for the audio device found inside
most of the SGI O2 workstation. The hardware uses a SGI custom chip,
which feeds a AD codec chip.

Signed-off-by: Thomas Bogendoerfer <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Jaroslav Kysela <[email protected]>
  • Loading branch information
tsbogend authored and perexg committed Jul 14, 2008
1 parent 1e06632 commit 862c2c0
Show file tree
Hide file tree
Showing 5 changed files with 1,621 additions and 0 deletions.
46 changes: 46 additions & 0 deletions include/sound/ad1843.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright 2003 Vivien Chappelier <[email protected]>
* Copyright 2008 Thomas Bogendoerfer <[email protected]>
*/

#ifndef __SOUND_AD1843_H
#define __SOUND_AD1843_H

struct snd_ad1843 {
void *chip;
int (*read)(void *chip, int reg);
int (*write)(void *chip, int reg, int val);
};

#define AD1843_GAIN_RECLEV 0
#define AD1843_GAIN_LINE 1
#define AD1843_GAIN_LINE_2 2
#define AD1843_GAIN_MIC 3
#define AD1843_GAIN_PCM_0 4
#define AD1843_GAIN_PCM_1 5
#define AD1843_GAIN_SIZE (AD1843_GAIN_PCM_1+1)

int ad1843_get_gain_max(struct snd_ad1843 *ad1843, int id);
int ad1843_get_gain(struct snd_ad1843 *ad1843, int id);
int ad1843_set_gain(struct snd_ad1843 *ad1843, int id, int newval);
int ad1843_get_recsrc(struct snd_ad1843 *ad1843);
int ad1843_set_recsrc(struct snd_ad1843 *ad1843, int newsrc);
void ad1843_setup_dac(struct snd_ad1843 *ad1843,
unsigned int id,
unsigned int framerate,
snd_pcm_format_t fmt,
unsigned int channels);
void ad1843_shutdown_dac(struct snd_ad1843 *ad1843,
unsigned int id);
void ad1843_setup_adc(struct snd_ad1843 *ad1843,
unsigned int framerate,
snd_pcm_format_t fmt,
unsigned int channels);
void ad1843_shutdown_adc(struct snd_ad1843 *ad1843);
int ad1843_init(struct snd_ad1843 *ad1843);

#endif /* __SOUND_AD1843_H */
6 changes: 6 additions & 0 deletions sound/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ menuconfig SND_MIPS

if SND_MIPS

config SND_SGI_O2
tristate "SGI O2 Audio"
depends on SGI_IP32
help
Sound support for the SGI O2 Workstation.

config SND_SGI_HAL2
tristate "SGI HAL2 Audio"
depends on SGI_HAS_HAL2
Expand Down
2 changes: 2 additions & 0 deletions sound/mips/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
#

snd-au1x00-objs := au1x00.o
snd-sgi-o2-objs := sgio2audio.o ad1843.o
snd-sgi-hal2-objs := hal2.o

# Toplevel Module Dependency
obj-$(CONFIG_SND_AU1X00) += snd-au1x00.o
obj-$(CONFIG_SND_SGI_O2) += snd-sgi-o2.o
obj-$(CONFIG_SND_SGI_HAL2) += snd-sgi-hal2.o
Loading

0 comments on commit 862c2c0

Please sign in to comment.