Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142710
b: refs/heads/master
c: 128ed6a
h: refs/heads/master
v: v3
  • Loading branch information
Hans-Christian Egtvedt authored and Takashi Iwai committed Apr 6, 2009
1 parent 6f93232 commit 435c9d7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 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: d54bb9f0c57e39a9a7c8ba523f2c0c1a955d8efb
refs/heads/master: 128ed6a9266daac5d7b0e082339742e16caf7caa
23 changes: 18 additions & 5 deletions trunk/sound/atmel/ac97c.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Driver for the Atmel AC97C controller
* Driver for Atmel AC97C
*
* Copyright (C) 2005-2009 Atmel Corporation
*
Expand All @@ -10,6 +10,7 @@
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/bitmap.h>
#include <linux/device.h>
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
#include <linux/init.h>
Expand Down Expand Up @@ -297,9 +298,11 @@ static int atmel_ac97c_playback_prepare(struct snd_pcm_substream *substream)
{
struct atmel_ac97c *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
unsigned long word = 0;
unsigned long word = ac97c_readl(chip, OCA);
int retval;

word &= ~(AC97C_CH_MASK(PCM_LEFT) | AC97C_CH_MASK(PCM_RIGHT));

/* assign channels to AC97C channel A */
switch (runtime->channels) {
case 1:
Expand All @@ -323,9 +326,13 @@ static int atmel_ac97c_playback_prepare(struct snd_pcm_substream *substream)
word |= AC97C_CMR_CEM_LITTLE;
break;
case SNDRV_PCM_FORMAT_S16_BE: /* fall through */
default:
word &= ~(AC97C_CMR_CEM_LITTLE);
break;
default:
word = ac97c_readl(chip, OCA);
word &= ~(AC97C_CH_MASK(PCM_LEFT) | AC97C_CH_MASK(PCM_RIGHT));
ac97c_writel(chip, OCA, word);
return -EINVAL;
}

ac97c_writel(chip, CAMR, word);
Expand Down Expand Up @@ -358,9 +365,11 @@ static int atmel_ac97c_capture_prepare(struct snd_pcm_substream *substream)
{
struct atmel_ac97c *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
unsigned long word = 0;
unsigned long word = ac97c_readl(chip, ICA);
int retval;

word &= ~(AC97C_CH_MASK(PCM_LEFT) | AC97C_CH_MASK(PCM_RIGHT));

/* assign channels to AC97C channel A */
switch (runtime->channels) {
case 1:
Expand All @@ -384,9 +393,13 @@ static int atmel_ac97c_capture_prepare(struct snd_pcm_substream *substream)
word |= AC97C_CMR_CEM_LITTLE;
break;
case SNDRV_PCM_FORMAT_S16_BE: /* fall through */
default:
word &= ~(AC97C_CMR_CEM_LITTLE);
break;
default:
word = ac97c_readl(chip, ICA);
word &= ~(AC97C_CH_MASK(PCM_LEFT) | AC97C_CH_MASK(PCM_RIGHT));
ac97c_writel(chip, ICA, word);
return -EINVAL;
}

ac97c_writel(chip, CAMR, word);
Expand Down

0 comments on commit 435c9d7

Please sign in to comment.