Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170089
b: refs/heads/master
c: b00615d
h: refs/heads/master
i:
  170087: b86f8d9
v: v3
  • Loading branch information
Takashi Iwai committed Dec 1, 2009
1 parent afba0d2 commit 30eabb2
Show file tree
Hide file tree
Showing 54 changed files with 1,194 additions and 2,170 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d6797322231af98b9bb4afb175dd614cf511e5f7
refs/heads/master: b00615d163cd24fa98d155acfc1f9d81d6fe1103
10 changes: 6 additions & 4 deletions trunk/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 trunk/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 trunk/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 trunk/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 trunk/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
5 changes: 3 additions & 2 deletions trunk/include/sound/control.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ struct snd_kcontrol_new {

struct snd_kcontrol_volatile {
struct snd_ctl_file *owner; /* locked */
pid_t owner_pid;
unsigned int access; /* access rights */
};

Expand Down Expand Up @@ -87,10 +86,12 @@ struct snd_kctl_event {

#define snd_kctl_event(n) list_entry(n, struct snd_kctl_event, list)

struct pid;

struct snd_ctl_file {
struct list_head list; /* list of all control files */
struct snd_card *card;
pid_t pid;
struct pid *pid;
int prefer_pcm_subdevice;
int prefer_rawmidi_subdevice;
wait_queue_head_t change_sleep;
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/sound/pcm.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ struct snd_pcm_group { /* keep linked substreams */
int count;
};

struct pid;

struct snd_pcm_substream {
struct snd_pcm *pcm;
struct snd_pcm_str *pstr;
Expand Down Expand Up @@ -379,6 +381,7 @@ struct snd_pcm_substream {
atomic_t mmap_count;
unsigned int f_flags;
void (*pcm_release)(struct snd_pcm_substream *);
struct pid *pid;
#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
/* -- OSS things -- */
struct snd_pcm_oss_substream oss;
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/sound/rawmidi.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
struct snd_rawmidi;
struct snd_rawmidi_substream;
struct snd_seq_port_info;
struct pid;

struct snd_rawmidi_ops {
int (*open) (struct snd_rawmidi_substream * substream);
Expand Down Expand Up @@ -97,6 +98,7 @@ struct snd_rawmidi_substream {
struct snd_rawmidi_str *pstr;
char name[32];
struct snd_rawmidi_runtime *runtime;
struct pid *pid;
/* hardware layer */
struct snd_rawmidi_ops *ops;
};
Expand Down
21 changes: 21 additions & 0 deletions trunk/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 trunk/include/sound/sscape_ioctl.h

This file was deleted.

7 changes: 3 additions & 4 deletions trunk/sound/core/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static int snd_ctl_open(struct inode *inode, struct file *file)
ctl->card = card;
ctl->prefer_pcm_subdevice = -1;
ctl->prefer_rawmidi_subdevice = -1;
ctl->pid = current->pid;
ctl->pid = get_pid(task_pid(current));
file->private_data = ctl;
write_lock_irqsave(&card->ctl_files_rwlock, flags);
list_add_tail(&ctl->list, &card->ctl_files);
Expand Down Expand Up @@ -125,6 +125,7 @@ static int snd_ctl_release(struct inode *inode, struct file *file)
control->vd[idx].owner = NULL;
up_write(&card->controls_rwsem);
snd_ctl_empty_read_queue(ctl);
put_pid(ctl->pid);
kfree(ctl);
module_put(card->module);
snd_card_file_remove(card, file);
Expand Down Expand Up @@ -672,7 +673,7 @@ static int snd_ctl_elem_info(struct snd_ctl_file *ctl,
info->access |= SNDRV_CTL_ELEM_ACCESS_LOCK;
if (vd->owner == ctl)
info->access |= SNDRV_CTL_ELEM_ACCESS_OWNER;
info->owner = vd->owner_pid;
info->owner = pid_vnr(vd->owner->pid);
} else {
info->owner = -1;
}
Expand Down Expand Up @@ -827,7 +828,6 @@ static int snd_ctl_elem_lock(struct snd_ctl_file *file,
result = -EBUSY;
else {
vd->owner = file;
vd->owner_pid = current->pid;
result = 0;
}
}
Expand Down Expand Up @@ -858,7 +858,6 @@ static int snd_ctl_elem_unlock(struct snd_ctl_file *file,
result = -EPERM;
else {
vd->owner = NULL;
vd->owner_pid = 0;
result = 0;
}
}
Expand Down
10 changes: 9 additions & 1 deletion trunk/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 trunk/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
6 changes: 5 additions & 1 deletion trunk/sound/core/pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ static void snd_pcm_substream_proc_status_read(struct snd_info_entry *entry,
return;
}
snd_iprintf(buffer, "state: %s\n", snd_pcm_state_name(status.state));
snd_iprintf(buffer, "owner_pid : %d\n", pid_vnr(substream->pid));
snd_iprintf(buffer, "trigger_time: %ld.%09ld\n",
status.trigger_tstamp.tv_sec, status.trigger_tstamp.tv_nsec);
snd_iprintf(buffer, "tstamp : %ld.%09ld\n",
Expand Down Expand Up @@ -809,7 +810,7 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream,
card = pcm->card;
read_lock(&card->ctl_files_rwlock);
list_for_each_entry(kctl, &card->ctl_files, list) {
if (kctl->pid == current->pid) {
if (kctl->pid == task_pid(current)) {
prefer_subdevice = kctl->prefer_pcm_subdevice;
if (prefer_subdevice != -1)
break;
Expand Down Expand Up @@ -900,6 +901,7 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream,
substream->private_data = pcm->private_data;
substream->ref_count = 1;
substream->f_flags = file->f_flags;
substream->pid = get_pid(task_pid(current));
pstr->substream_opened++;
*rsubstream = substream;
return 0;
Expand All @@ -921,6 +923,8 @@ void snd_pcm_detach_substream(struct snd_pcm_substream *substream)
kfree(runtime->hw_constraints.rules);
kfree(runtime);
substream->runtime = NULL;
put_pid(substream->pid);
substream->pid = NULL;
substream->pstr->substream_opened--;
}

Expand Down
Loading

0 comments on commit 30eabb2

Please sign in to comment.