Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 81581
b: refs/heads/master
c: 740eb83
h: refs/heads/master
i:
  81579: 620357b
v: v3
  • Loading branch information
Clemens Ladisch authored and Jaroslav Kysela committed Jan 31, 2008
1 parent ad47920 commit 21c8088
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 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: 93521d274b7fb4e6da5772768683e4984783d9e7
refs/heads/master: 740eb8358f2bf337fd4ec62abb5b8cca7c652e5a
20 changes: 13 additions & 7 deletions trunk/sound/pci/oxygen/oxygen_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,20 @@ static struct snd_pcm_hardware oxygen_hardware[PCM_COUNT] = {
},
};

static inline unsigned int
oxygen_substream_channel(struct snd_pcm_substream *substream)
{
return (unsigned int)(uintptr_t)substream->runtime->private_data;
}

static int oxygen_open(struct snd_pcm_substream *substream,
unsigned int channel)
{
struct oxygen *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
int err;

runtime->private_data = (void *)channel;
runtime->private_data = (void *)(uintptr_t)channel;
runtime->hw = oxygen_hardware[channel];
err = snd_pcm_hw_constraint_step(runtime, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 32);
Expand Down Expand Up @@ -248,7 +254,7 @@ static int oxygen_ac97_open(struct snd_pcm_substream *substream)
static int oxygen_close(struct snd_pcm_substream *substream)
{
struct oxygen *chip = snd_pcm_substream_chip(substream);
unsigned int channel = (unsigned int)substream->runtime->private_data;
unsigned int channel = oxygen_substream_channel(substream);

mutex_lock(&chip->mutex);
chip->pcm_active &= ~(1 << channel);
Expand Down Expand Up @@ -337,7 +343,7 @@ static int oxygen_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{
struct oxygen *chip = snd_pcm_substream_chip(substream);
unsigned int channel = (unsigned int)substream->runtime->private_data;
unsigned int channel = oxygen_substream_channel(substream);
int err;

err = snd_pcm_lib_malloc_pages(substream,
Expand Down Expand Up @@ -516,7 +522,7 @@ static int oxygen_ac97_hw_params(struct snd_pcm_substream *substream,
static int oxygen_hw_free(struct snd_pcm_substream *substream)
{
struct oxygen *chip = snd_pcm_substream_chip(substream);
unsigned int channel = (unsigned int)substream->runtime->private_data;
unsigned int channel = oxygen_substream_channel(substream);

spin_lock_irq(&chip->reg_lock);
chip->interrupt_mask &= ~(1 << channel);
Expand All @@ -540,7 +546,7 @@ static int oxygen_spdif_hw_free(struct snd_pcm_substream *substream)
static int oxygen_prepare(struct snd_pcm_substream *substream)
{
struct oxygen *chip = snd_pcm_substream_chip(substream);
unsigned int channel = (unsigned int)substream->runtime->private_data;
unsigned int channel = oxygen_substream_channel(substream);
unsigned int channel_mask = 1 << channel;

spin_lock_irq(&chip->reg_lock);
Expand Down Expand Up @@ -575,7 +581,7 @@ static int oxygen_trigger(struct snd_pcm_substream *substream, int cmd)

snd_pcm_group_for_each_entry(s, substream) {
if (snd_pcm_substream_chip(s) == chip) {
mask |= 1 << (unsigned int)s->runtime->private_data;
mask |= 1 << oxygen_substream_channel(s);
snd_pcm_trigger_done(s, substream);
}
}
Expand All @@ -594,7 +600,7 @@ static snd_pcm_uframes_t oxygen_pointer(struct snd_pcm_substream *substream)
{
struct oxygen *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
unsigned int channel = (unsigned int)runtime->private_data;
unsigned int channel = oxygen_substream_channel(substream);
u32 curr_addr;

/* no spinlock, this read should be atomic */
Expand Down

0 comments on commit 21c8088

Please sign in to comment.