From: Takashi Iwai Date: Tue, 21 Apr 2009 05:42:49 +0000 (+0200) Subject: Merge branch 'fix/asoc' into for-linus X-Git-Tag: v2.6.30-rc4~61^2~4 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=f22d806b6cc0c74dd0a1a21b3f311dba51d9df84;hp=-c Merge branch 'fix/asoc' into for-linus * fix/asoc: ASoC: Fix warning in wm9705 ASoC: OMAP: Update contact addresses ASoC: pxa-ssp: Don't use SSCR0_SerClkDiv and SSCR0_SCR --- f22d806b6cc0c74dd0a1a21b3f311dba51d9df84 diff --combined sound/soc/omap/omap-pcm.c index 1bdbb0427183,b078ed537bc3..07cf7f46b584 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c @@@ -3,7 -3,8 +3,8 @@@ * * Copyright (C) 2008 Nokia Corporation * - * Contact: Jarkko Nikula + * Contact: Jarkko Nikula + * Peter Ujfalusi * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@@ -327,7 -328,7 +328,7 @@@ int omap_pcm_new(struct snd_card *card if (!card->dev->dma_mask) card->dev->dma_mask = &omap_pcm_dmamask; if (!card->dev->coherent_dma_mask) - card->dev->coherent_dma_mask = DMA_32BIT_MASK; + card->dev->coherent_dma_mask = DMA_BIT_MASK(32); if (dai->playback.channels_min) { ret = omap_pcm_preallocate_dma_buffer(pcm, @@@ -367,6 -368,6 +368,6 @@@ static void __exit omap_soc_platform_ex } module_exit(omap_soc_platform_exit); - MODULE_AUTHOR("Jarkko Nikula "); + MODULE_AUTHOR("Jarkko Nikula "); MODULE_DESCRIPTION("OMAP PCM DMA module"); MODULE_LICENSE("GPL"); diff --combined sound/soc/pxa/pxa-ssp.c index de2254475d52,74ff69e3ce34..286be31545df --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c @@@ -30,7 -30,7 +30,7 @@@ #include #include -#include +#include #include #include #include @@@ -280,12 -280,33 +280,33 @@@ static int pxa_ssp_resume(struct snd_so * ssp_set_clkdiv - set SSP clock divider * @div: serial clock rate divider */ - static void ssp_set_scr(struct ssp_dev *dev, u32 div) + static void ssp_set_scr(struct ssp_device *ssp, u32 div) { - struct ssp_device *ssp = dev->ssp; - u32 sscr0 = ssp_read_reg(dev->ssp, SSCR0) & ~SSCR0_SCR; + u32 sscr0 = ssp_read_reg(ssp, SSCR0); + + if (cpu_is_pxa25x() && ssp->type == PXA25x_SSP) { + sscr0 &= ~0x0000ff00; + sscr0 |= ((div - 2)/2) << 8; /* 2..512 */ + } else { + sscr0 &= ~0x000fff00; + sscr0 |= (div - 1) << 8; /* 1..4096 */ + } + ssp_write_reg(ssp, SSCR0, sscr0); + } + + /** + * ssp_get_clkdiv - get SSP clock divider + */ + static u32 ssp_get_scr(struct ssp_device *ssp) + { + u32 sscr0 = ssp_read_reg(ssp, SSCR0); + u32 div; - ssp_write_reg(ssp, SSCR0, (sscr0 | SSCR0_SerClkDiv(div))); + if (cpu_is_pxa25x() && ssp->type == PXA25x_SSP) + div = ((sscr0 >> 8) & 0xff) * 2 + 2; + else + div = ((sscr0 >> 8) & 0xfff) + 1; + return div; } /* @@@ -326,7 -347,7 +347,7 @@@ static int pxa_ssp_set_dai_sysclk(struc break; case PXA_SSP_CLK_AUDIO: priv->sysclk = 0; - ssp_set_scr(&priv->dev, 1); + ssp_set_scr(ssp, 1); sscr0 |= SSCR0_ACS; break; default: @@@ -387,7 -408,7 +408,7 @@@ static int pxa_ssp_set_dai_clkdiv(struc ssp_write_reg(ssp, SSACD, val); break; case PXA_SSP_DIV_SCR: - ssp_set_scr(&priv->dev, div); + ssp_set_scr(ssp, div); break; default: return -ENODEV; @@@ -674,8 -695,7 +695,7 @@@ static int pxa_ssp_hw_params(struct snd case SND_SOC_DAIFMT_I2S: sspsp = ssp_read_reg(ssp, SSPSP); - if (((sscr0 & SSCR0_SCR) == SSCR0_SerClkDiv(4)) && - (width == 16)) { + if ((ssp_get_scr(ssp) == 4) && (width == 16)) { /* This is a special case where the bitclk is 64fs * and we're not dealing with 2*32 bits of audio * samples.