Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 270457
b: refs/heads/master
c: 25942fd
h: refs/heads/master
i:
  270455: 31a6184
v: v3
  • Loading branch information
Manuel Lauss authored and Mark Brown committed Jul 27, 2011
1 parent 5df5d9b commit b7a6342
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 28 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: adbc7a5a61ee9225e0b80d3f5719e05a88db2b4c
refs/heads/master: 25942fdc824a709c48190356ed058ef7be19fb6a
10 changes: 5 additions & 5 deletions trunk/sound/soc/au1x/dbdma2.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static int au1x_pcm_dbdma_realloc(struct au1xpsc_audio_dmadata *pcd,

au1x_pcm_dbdma_free(pcd);

if (stype == PCM_RX)
if (stype == SNDRV_PCM_STREAM_CAPTURE)
pcd->ddma_chan = au1xxx_dbdma_chan_alloc(pcd->ddma_id,
DSCR_CMD0_ALWAYS,
au1x_pcm_dmarx_cb, (void *)pcd);
Expand Down Expand Up @@ -198,7 +198,7 @@ static inline struct au1xpsc_audio_dmadata *to_dmadata(struct snd_pcm_substream
struct snd_soc_pcm_runtime *rtd = ss->private_data;
struct au1xpsc_audio_dmadata *pcd =
snd_soc_platform_get_drvdata(rtd->platform);
return &pcd[SUBSTREAM_TYPE(ss)];
return &pcd[ss->stream];
}

static int au1xpsc_pcm_hw_params(struct snd_pcm_substream *substream,
Expand All @@ -212,7 +212,7 @@ static int au1xpsc_pcm_hw_params(struct snd_pcm_substream *substream,
if (ret < 0)
goto out;

stype = SUBSTREAM_TYPE(substream);
stype = substream->stream;
pcd = to_dmadata(substream);

DBG("runtime->dma_area = 0x%08lx dma_addr_t = 0x%08lx dma_size = %d "
Expand Down Expand Up @@ -255,7 +255,7 @@ static int au1xpsc_pcm_prepare(struct snd_pcm_substream *substream)

au1xxx_dbdma_reset(pcd->ddma_chan);

if (SUBSTREAM_TYPE(substream) == PCM_RX) {
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
au1x_pcm_queue_rx(pcd);
au1x_pcm_queue_rx(pcd);
} else {
Expand Down Expand Up @@ -295,7 +295,7 @@ static int au1xpsc_pcm_open(struct snd_pcm_substream *substream)
{
struct au1xpsc_audio_dmadata *pcd = to_dmadata(substream);
struct snd_soc_pcm_runtime *rtd = substream->private_data;
int stype = SUBSTREAM_TYPE(substream), *dmaids;
int stype = substream->stream, *dmaids;

dmaids = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
if (!dmaids)
Expand Down
18 changes: 9 additions & 9 deletions trunk/sound/soc/au1x/psc-ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
(SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3BE)

#define AC97PCR_START(stype) \
((stype) == PCM_TX ? PSC_AC97PCR_TS : PSC_AC97PCR_RS)
((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_AC97PCR_TS : PSC_AC97PCR_RS)
#define AC97PCR_STOP(stype) \
((stype) == PCM_TX ? PSC_AC97PCR_TP : PSC_AC97PCR_RP)
((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_AC97PCR_TP : PSC_AC97PCR_RP)
#define AC97PCR_CLRFIFO(stype) \
((stype) == PCM_TX ? PSC_AC97PCR_TC : PSC_AC97PCR_RC)
((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_AC97PCR_TC : PSC_AC97PCR_RC)

#define AC97STAT_BUSY(stype) \
((stype) == PCM_TX ? PSC_AC97STAT_TB : PSC_AC97STAT_RB)
((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_AC97STAT_TB : PSC_AC97STAT_RB)

/* instance data. There can be only one, MacLeod!!!! */
static struct au1xpsc_audio_data *au1xpsc_ac97_workdata;
Expand Down Expand Up @@ -215,7 +215,7 @@ static int au1xpsc_ac97_hw_params(struct snd_pcm_substream *substream,
{
struct au1xpsc_audio_data *pscdata = snd_soc_dai_get_drvdata(dai);
unsigned long r, ro, stat;
int chans, t, stype = SUBSTREAM_TYPE(substream);
int chans, t, stype = substream->stream;

chans = params_channels(params);

Expand All @@ -235,7 +235,7 @@ static int au1xpsc_ac97_hw_params(struct snd_pcm_substream *substream,
r |= PSC_AC97CFG_SET_LEN(params->msbits);

/* channels: enable slots for front L/R channel */
if (stype == PCM_TX) {
if (stype == SNDRV_PCM_STREAM_PLAYBACK) {
r &= ~PSC_AC97CFG_TXSLOT_MASK;
r |= PSC_AC97CFG_TXSLOT_ENA(3);
r |= PSC_AC97CFG_TXSLOT_ENA(4);
Expand Down Expand Up @@ -294,7 +294,7 @@ static int au1xpsc_ac97_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai)
{
struct au1xpsc_audio_data *pscdata = snd_soc_dai_get_drvdata(dai);
int ret, stype = SUBSTREAM_TYPE(substream);
int ret, stype = substream->stream;

ret = 0;

Expand Down Expand Up @@ -391,12 +391,12 @@ static int __devinit au1xpsc_ac97_drvprobe(struct platform_device *pdev)
r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
if (!r)
goto out2;
wd->dmaids[PCM_TX] = r->start;
wd->dmaids[SNDRV_PCM_STREAM_PLAYBACK] = r->start;

r = platform_get_resource(pdev, IORESOURCE_DMA, 1);
if (!r)
goto out2;
wd->dmaids[PCM_RX] = r->start;
wd->dmaids[SNDRV_PCM_STREAM_CAPTURE] = r->start;

/* configuration: max dma trigger threshold, enable ac97 */
wd->cfg = PSC_AC97CFG_RT_FIFO8 | PSC_AC97CFG_TT_FIFO8 |
Expand Down
14 changes: 7 additions & 7 deletions trunk/sound/soc/au1x/psc-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
(SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE)

#define I2SSTAT_BUSY(stype) \
((stype) == PCM_TX ? PSC_I2SSTAT_TB : PSC_I2SSTAT_RB)
((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_I2SSTAT_TB : PSC_I2SSTAT_RB)
#define I2SPCR_START(stype) \
((stype) == PCM_TX ? PSC_I2SPCR_TS : PSC_I2SPCR_RS)
((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_I2SPCR_TS : PSC_I2SPCR_RS)
#define I2SPCR_STOP(stype) \
((stype) == PCM_TX ? PSC_I2SPCR_TP : PSC_I2SPCR_RP)
((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_I2SPCR_TP : PSC_I2SPCR_RP)
#define I2SPCR_CLRFIFO(stype) \
((stype) == PCM_TX ? PSC_I2SPCR_TC : PSC_I2SPCR_RC)
((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_I2SPCR_TC : PSC_I2SPCR_RC)


static int au1xpsc_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
Expand Down Expand Up @@ -240,7 +240,7 @@ static int au1xpsc_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *dai)
{
struct au1xpsc_audio_data *pscdata = snd_soc_dai_get_drvdata(dai);
int ret, stype = SUBSTREAM_TYPE(substream);
int ret, stype = substream->stream;

switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
Expand Down Expand Up @@ -316,12 +316,12 @@ static int __devinit au1xpsc_i2s_drvprobe(struct platform_device *pdev)
r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
if (!r)
goto out2;
wd->dmaids[PCM_TX] = r->start;
wd->dmaids[SNDRV_PCM_STREAM_PLAYBACK] = r->start;

r = platform_get_resource(pdev, IORESOURCE_DMA, 1);
if (!r)
goto out2;
wd->dmaids[PCM_RX] = r->start;
wd->dmaids[SNDRV_PCM_STREAM_CAPTURE] = r->start;

/* preserve PSC clock source set up by platform (dev.platform_data
* is already occupied by soc layer)
Expand Down
6 changes: 0 additions & 6 deletions trunk/sound/soc/au1x/psc.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
#ifndef _AU1X_PCM_H
#define _AU1X_PCM_H

#define PCM_TX 0
#define PCM_RX 1

#define SUBSTREAM_TYPE(substream) \
((substream)->stream == SNDRV_PCM_STREAM_PLAYBACK ? PCM_TX : PCM_RX)

struct au1xpsc_audio_data {
void __iomem *mmio;

Expand Down

0 comments on commit b7a6342

Please sign in to comment.