Skip to content

Commit

Permalink
Merge branch 'topic/beep-rename' into topic/core-change
Browse files Browse the repository at this point in the history
  • Loading branch information
tiwai committed Dec 1, 2009
2 parents 7584af1 + ad1cd74 commit 75639e7
Show file tree
Hide file tree
Showing 47 changed files with 1,165 additions and 2,157 deletions.
10 changes: 6 additions & 4 deletions Documentation/sound/alsa/ALSA-Configuration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1454,6 +1454,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.

Module for internal PC-Speaker.

nopcm - Disable PC-Speaker PCM sound. Only beeps remain.
nforce_wa - enable NForce chipset workaround. Expect bad sound.

This module supports system beeps, some kind of PCM playback and
Expand Down Expand Up @@ -1631,18 +1632,19 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
Module snd-sscape
-----------------

Module for ENSONIQ SoundScape PnP cards.
Module for ENSONIQ SoundScape cards.

port - Port # (PnP setup)
wss_port - WSS Port # (PnP setup)
irq - IRQ # (PnP setup)
mpu_irq - MPU-401 IRQ # (PnP setup)
dma - DMA # (PnP setup)
dma2 - 2nd DMA # (PnP setup, -1 to disable)
joystick - Enable gameport - 0 = disable (default), 1 = enable

This module supports multiple cards.

This module supports multiple cards. ISA PnP must be enabled.
You need sscape_ctl tool in alsa-tools package for loading
the microcode.
The driver requires the firmware loader support on kernel.

Module snd-sun-amd7930 (on sparc only)
--------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion Documentation/sound/alsa/ControlNames.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ SOURCE:
Master
Master Mono
Hardware Master
Speaker (internal speaker)
Headphone
PC Speaker
Beep (beep generator)
Phone
Phone Input
Phone Output
Expand Down
55 changes: 55 additions & 0 deletions arch/sh/boards/mach-hp6xx/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/irq.h>
#include <sound/sh_dac_audio.h>
#include <asm/hd64461.h>
#include <asm/io.h>
#include <mach/hp6xx.h>
Expand Down Expand Up @@ -51,9 +52,63 @@ static struct platform_device jornadakbd_device = {
.id = -1,
};

static void dac_audio_start(struct dac_audio_pdata *pdata)
{
u16 v;
u8 v8;

/* HP Jornada 680/690 speaker on */
v = inw(HD64461_GPADR);
v &= ~HD64461_GPADR_SPEAKER;
outw(v, HD64461_GPADR);

/* HP Palmtop 620lx/660lx speaker on */
v8 = inb(PKDR);
v8 &= ~PKDR_SPEAKER;
outb(v8, PKDR);

sh_dac_enable(pdata->channel);
}

static void dac_audio_stop(struct dac_audio_pdata *pdata)
{
u16 v;
u8 v8;

/* HP Jornada 680/690 speaker off */
v = inw(HD64461_GPADR);
v |= HD64461_GPADR_SPEAKER;
outw(v, HD64461_GPADR);

/* HP Palmtop 620lx/660lx speaker off */
v8 = inb(PKDR);
v8 |= PKDR_SPEAKER;
outb(v8, PKDR);

sh_dac_output(0, pdata->channel);
sh_dac_disable(pdata->channel);
}

static struct dac_audio_pdata dac_audio_platform_data = {
.buffer_size = 64000,
.channel = 1,
.start = dac_audio_start,
.stop = dac_audio_stop,
};

static struct platform_device dac_audio_device = {
.name = "dac_audio",
.id = -1,
.dev = {
.platform_data = &dac_audio_platform_data,
}

};

static struct platform_device *hp6xx_devices[] __initdata = {
&cf_ide_device,
&jornadakbd_device,
&dac_audio_device,
};

static void __init hp6xx_init_irq(void)
Expand Down
4 changes: 4 additions & 0 deletions arch/sh/include/mach-common/mach/hp6xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

#define PKDR_LED_GREEN 0x10

/* HP Palmtop 620lx/660lx speaker on/off */
#define PKDR_SPEAKER 0x20

#define SCPDR_TS_SCAN_ENABLE 0x20
#define SCPDR_TS_SCAN_Y 0x02
#define SCPDR_TS_SCAN_X 0x01
Expand All @@ -42,6 +45,7 @@
#define ADC_CHANNEL_BACKUP 4
#define ADC_CHANNEL_CHARGE 5

/* HP Jornada 680/690 speaker on/off */
#define HD64461_GPADR_SPEAKER 0x01
#define HD64461_GPADR_PCMCIA0 (0x02|0x08)

Expand Down
1 change: 0 additions & 1 deletion include/sound/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ header-y += asound_fm.h
header-y += hdsp.h
header-y += hdspm.h
header-y += sfnt_info.h
header-y += sscape_ioctl.h

unifdef-y += asequencer.h
unifdef-y += asound.h
Expand Down
21 changes: 21 additions & 0 deletions include/sound/sh_dac_audio.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* SH_DAC specific configuration, for the dac_audio platform_device
*
* Copyright (C) 2009 Rafael Ignacio Zurita <rizurita@yahoo.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*/

#ifndef __INCLUDE_SH_DAC_AUDIO_H
#define __INCLUDE_SH_DAC_AUDIO_H

struct dac_audio_pdata {
int buffer_size;
int channel;
void (*start)(struct dac_audio_pdata *pd);
void (*stop)(struct dac_audio_pdata *pd);
};

#endif /* __INCLUDE_SH_DAC_AUDIO_H */
21 changes: 0 additions & 21 deletions include/sound/sscape_ioctl.h

This file was deleted.

10 changes: 9 additions & 1 deletion sound/core/isadma.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,24 @@ EXPORT_SYMBOL(snd_dma_disable);
unsigned int snd_dma_pointer(unsigned long dma, unsigned int size)
{
unsigned long flags;
unsigned int result;
unsigned int result, result1;

flags = claim_dma_lock();
clear_dma_ff(dma);
if (!isa_dma_bridge_buggy)
disable_dma(dma);
result = get_dma_residue(dma);
/*
* HACK - read the counter again and choose higher value in order to
* avoid reading during counter lower byte roll over if the
* isa_dma_bridge_buggy is set.
*/
result1 = get_dma_residue(dma);
if (!isa_dma_bridge_buggy)
enable_dma(dma);
release_dma_lock(flags);
if (unlikely(result < result1))
result = result1;
#ifdef CONFIG_SND_DEBUG
if (result > size)
snd_printk(KERN_ERR "pointer (0x%x) for DMA #%ld is greater than transfer size (0x%x)\n", result, dma, size);
Expand Down
4 changes: 3 additions & 1 deletion sound/core/oss/mixer_oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,9 @@ static void snd_mixer_oss_build(struct snd_mixer_oss *mixer)
{ SOUND_MIXER_SYNTH, "FM", 0 }, /* fallback */
{ SOUND_MIXER_SYNTH, "Music", 0 }, /* fallback */
{ SOUND_MIXER_PCM, "PCM", 0 },
{ SOUND_MIXER_SPEAKER, "PC Speaker", 0 },
{ SOUND_MIXER_SPEAKER, "Beep", 0 },
{ SOUND_MIXER_SPEAKER, "PC Speaker", 0 }, /* fallback */
{ SOUND_MIXER_SPEAKER, "Speaker", 0 }, /* fallback */
{ SOUND_MIXER_LINE, "Line", 0 },
{ SOUND_MIXER_MIC, "Mic", 0 },
{ SOUND_MIXER_CD, "CD", 0 },
Expand Down
32 changes: 20 additions & 12 deletions sound/drivers/pcsp/pcsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@ MODULE_ALIAS("platform:pcspkr");
static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
static int enable = SNDRV_DEFAULT_ENABLE1; /* Enable this card */
static int nopcm; /* Disable PCM capability of the driver */

module_param(index, int, 0444);
MODULE_PARM_DESC(index, "Index value for pcsp soundcard.");
module_param(id, charp, 0444);
MODULE_PARM_DESC(id, "ID string for pcsp soundcard.");
module_param(enable, bool, 0444);
MODULE_PARM_DESC(enable, "Enable PC-Speaker sound.");
module_param(nopcm, bool, 0444);
MODULE_PARM_DESC(nopcm, "Disable PC-Speaker PCM sound. Only beeps remain.");

struct snd_pcsp pcsp_chip;

Expand All @@ -43,13 +46,16 @@ static int __devinit snd_pcsp_create(struct snd_card *card)
int err;
int div, min_div, order;

hrtimer_get_res(CLOCK_MONOTONIC, &tp);
if (tp.tv_sec || tp.tv_nsec > PCSP_MAX_PERIOD_NS) {
printk(KERN_ERR "PCSP: Timer resolution is not sufficient "
"(%linS)\n", tp.tv_nsec);
printk(KERN_ERR "PCSP: Make sure you have HPET and ACPI "
"enabled.\n");
return -EIO;
if (!nopcm) {
hrtimer_get_res(CLOCK_MONOTONIC, &tp);
if (tp.tv_sec || tp.tv_nsec > PCSP_MAX_PERIOD_NS) {
printk(KERN_ERR "PCSP: Timer resolution is not sufficient "
"(%linS)\n", tp.tv_nsec);
printk(KERN_ERR "PCSP: Make sure you have HPET and ACPI "
"enabled.\n");
printk(KERN_ERR "PCSP: Turned into nopcm mode.\n");
nopcm = 1;
}
}

if (loops_per_jiffy >= PCSP_MIN_LPJ && tp.tv_nsec <= PCSP_MIN_PERIOD_NS)
Expand Down Expand Up @@ -107,12 +113,14 @@ static int __devinit snd_card_pcsp_probe(int devnum, struct device *dev)
snd_card_free(card);
return err;
}
err = snd_pcsp_new_pcm(&pcsp_chip);
if (err < 0) {
snd_card_free(card);
return err;
if (!nopcm) {
err = snd_pcsp_new_pcm(&pcsp_chip);
if (err < 0) {
snd_card_free(card);
return err;
}
}
err = snd_pcsp_new_mixer(&pcsp_chip);
err = snd_pcsp_new_mixer(&pcsp_chip, nopcm);
if (err < 0) {
snd_card_free(card);
return err;
Expand Down
2 changes: 1 addition & 1 deletion sound/drivers/pcsp/pcsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@ extern enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle);
extern void pcsp_sync_stop(struct snd_pcsp *chip);

extern int snd_pcsp_new_pcm(struct snd_pcsp *chip);
extern int snd_pcsp_new_mixer(struct snd_pcsp *chip);
extern int snd_pcsp_new_mixer(struct snd_pcsp *chip, int nopcm);

#endif
35 changes: 27 additions & 8 deletions sound/drivers/pcsp/pcsp_mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,24 +119,43 @@ static int pcsp_pcspkr_put(struct snd_kcontrol *kcontrol,
.put = pcsp_##ctl_type##_put, \
}

static struct snd_kcontrol_new __devinitdata snd_pcsp_controls[] = {
static struct snd_kcontrol_new __devinitdata snd_pcsp_controls_pcm[] = {
PCSP_MIXER_CONTROL(enable, "Master Playback Switch"),
PCSP_MIXER_CONTROL(treble, "BaseFRQ Playback Volume"),
PCSP_MIXER_CONTROL(pcspkr, "PC Speaker Playback Switch"),
};

int __devinit snd_pcsp_new_mixer(struct snd_pcsp *chip)
static struct snd_kcontrol_new __devinitdata snd_pcsp_controls_spkr[] = {
PCSP_MIXER_CONTROL(pcspkr, "Beep Playback Switch"),
};

static int __devinit snd_pcsp_ctls_add(struct snd_pcsp *chip,
struct snd_kcontrol_new *ctls, int num)
{
struct snd_card *card = chip->card;
int i, err;
struct snd_card *card = chip->card;
for (i = 0; i < num; i++) {
err = snd_ctl_add(card, snd_ctl_new1(ctls + i, chip));
if (err < 0)
return err;
}
return 0;
}

int __devinit snd_pcsp_new_mixer(struct snd_pcsp *chip, int nopcm)
{
int err;
struct snd_card *card = chip->card;

for (i = 0; i < ARRAY_SIZE(snd_pcsp_controls); i++) {
err = snd_ctl_add(card,
snd_ctl_new1(snd_pcsp_controls + i,
chip));
if (!nopcm) {
err = snd_pcsp_ctls_add(chip, snd_pcsp_controls_pcm,
ARRAY_SIZE(snd_pcsp_controls_pcm));
if (err < 0)
return err;
}
err = snd_pcsp_ctls_add(chip, snd_pcsp_controls_spkr,
ARRAY_SIZE(snd_pcsp_controls_spkr));
if (err < 0)
return err;

strcpy(card->mixername, "PC-Speaker");

Expand Down
12 changes: 9 additions & 3 deletions sound/isa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -372,15 +372,21 @@ config SND_SGALAXY

config SND_SSCAPE
tristate "Ensoniq SoundScape driver"
select SND_HWDEP
select SND_MPU401_UART
select SND_WSS_LIB
select FW_LOADER
help
Say Y here to include support for Ensoniq SoundScape
soundcards.
and Ensoniq OEM soundcards.

The PCM audio is supported on SoundScape Classic, Elite, PnP
and VIVO cards. The MIDI support is very experimental.
and VIVO cards. The supported OEM cards are SPEA Media FX and
Reveal SC-600.
The MIDI support is very experimental and requires binary
firmware files called "scope.cod" and "sndscape.co?" where the
? is digit 0, 1, 2, 3 or 4. The firmware files can be found
in DOS or Windows driver packages. One has to put the firmware
files into the /lib/firmware directory.

To compile this driver as a module, choose M here: the module
will be called snd-sscape.
Expand Down
4 changes: 2 additions & 2 deletions sound/isa/cmi8330.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ WSS_DOUBLE("Wavetable Capture Volume", 0,
CMI8330_WAVGAIN, CMI8330_WAVGAIN, 4, 0, 15, 0),
WSS_SINGLE("3D Control - Switch", 0,
CMI8330_RMUX3D, 5, 1, 1),
WSS_SINGLE("PC Speaker Playback Volume", 0,
WSS_SINGLE("Beep Playback Volume", 0,
CMI8330_OUTPUTVOL, 3, 3, 0),
WSS_DOUBLE("FM Playback Switch", 0,
CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 7, 7, 1, 1),
Expand All @@ -262,7 +262,7 @@ SB_DOUBLE("SB Line Playback Switch", SB_DSP4_OUTPUT_SW, SB_DSP4_OUTPUT_SW, 4, 3,
SB_DOUBLE("SB Line Playback Volume", SB_DSP4_LINE_DEV, (SB_DSP4_LINE_DEV + 1), 3, 3, 31),
SB_SINGLE("SB Mic Playback Switch", SB_DSP4_OUTPUT_SW, 0, 1),
SB_SINGLE("SB Mic Playback Volume", SB_DSP4_MIC_DEV, 3, 31),
SB_SINGLE("SB PC Speaker Volume", SB_DSP4_SPEAKER_DEV, 6, 3),
SB_SINGLE("SB Beep Volume", SB_DSP4_SPEAKER_DEV, 6, 3),
SB_DOUBLE("SB Capture Volume", SB_DSP4_IGAIN_DEV, (SB_DSP4_IGAIN_DEV + 1), 6, 6, 3),
SB_DOUBLE("SB Playback Volume", SB_DSP4_OGAIN_DEV, (SB_DSP4_OGAIN_DEV + 1), 6, 6, 3),
SB_SINGLE("SB Mic Auto Gain", SB_DSP4_MIC_AGC, 0, 1),
Expand Down
2 changes: 1 addition & 1 deletion sound/isa/es1688/es1688_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ ES1688_DOUBLE("CD Playback Volume", 0, ES1688_CD_DEV, ES1688_CD_DEV, 4, 0, 15, 0
ES1688_DOUBLE("FM Playback Volume", 0, ES1688_FM_DEV, ES1688_FM_DEV, 4, 0, 15, 0),
ES1688_DOUBLE("Mic Playback Volume", 0, ES1688_MIC_DEV, ES1688_MIC_DEV, 4, 0, 15, 0),
ES1688_DOUBLE("Aux Playback Volume", 0, ES1688_AUX_DEV, ES1688_AUX_DEV, 4, 0, 15, 0),
ES1688_SINGLE("PC Speaker Playback Volume", 0, ES1688_SPEAKER_DEV, 0, 7, 0),
ES1688_SINGLE("Beep Playback Volume", 0, ES1688_SPEAKER_DEV, 0, 7, 0),
ES1688_DOUBLE("Capture Volume", 0, ES1688_RECLEV_DEV, ES1688_RECLEV_DEV, 4, 0, 15, 0),
ES1688_SINGLE("Capture Switch", 0, ES1688_REC_DEV, 4, 1, 1),
{
Expand Down
Loading

0 comments on commit 75639e7

Please sign in to comment.