]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'for-2.6.30' into for-2.6.31
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 20 Apr 2009 11:45:40 +0000 (12:45 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 20 Apr 2009 11:45:40 +0000 (12:45 +0100)
1  2 
sound/soc/omap/n810.c
sound/soc/omap/omap-mcbsp.c
sound/soc/omap/omap-pcm.c
sound/soc/pxa/pxa-ssp.c

diff --combined sound/soc/omap/n810.c
index e54e1c2f5e63bf2e8aae4d7d7412497c67367cc3,91ef17992de52c68711da692679be075b7069aec..b60b1dfbc435f0036f9d18447b6e45c617e39439
@@@ -3,7 -3,7 +3,7 @@@
   *
   * Copyright (C) 2008 Nokia Corporation
   *
-  * Contact: Jarkko Nikula <jarkko.nikula@nokia.com>
+  * Contact: Jarkko Nikula <jhnikula@gmail.com>
   *
   * This program is free software; you can redistribute it and/or
   * modify it under the terms of the GNU General Public License
@@@ -383,9 -383,10 +383,9 @@@ static int __init n810_soc_init(void
        clk_set_parent(sys_clkout2_src, func96m_clk);
        clk_set_rate(sys_clkout2, 12000000);
  
 -      if (gpio_request(N810_HEADSET_AMP_GPIO, "hs_amp") < 0)
 -              BUG();
 -      if (gpio_request(N810_SPEAKER_AMP_GPIO, "spk_amp") < 0)
 -              BUG();
 +      BUG_ON((gpio_request(N810_HEADSET_AMP_GPIO, "hs_amp") < 0) ||
 +             (gpio_request(N810_SPEAKER_AMP_GPIO, "spk_amp") < 0));
 +
        gpio_direction_output(N810_HEADSET_AMP_GPIO, 0);
        gpio_direction_output(N810_SPEAKER_AMP_GPIO, 0);
  
@@@ -416,6 -417,6 +416,6 @@@ static void __exit n810_soc_exit(void
  module_init(n810_soc_init);
  module_exit(n810_soc_exit);
  
- MODULE_AUTHOR("Jarkko Nikula <jarkko.nikula@nokia.com>");
+ MODULE_AUTHOR("Jarkko Nikula <jhnikula@gmail.com>");
  MODULE_DESCRIPTION("ALSA SoC Nokia N810");
  MODULE_LICENSE("GPL");
index 4d6ef0bf71dd945e081bbb4b5efc0dcbffff46b5,9126142838486926c00fbb3b6586c06f9b1c696b..495192af8c2ea51d12f2b1a4f5f33679148ed7fa
@@@ -3,7 -3,8 +3,8 @@@
   *
   * Copyright (C) 2008 Nokia Corporation
   *
-  * Contact: Jarkko Nikula <jarkko.nikula@nokia.com>
+  * Contact: Jarkko Nikula <jhnikula@gmail.com>
+  *          Peter Ujfalusi <peter.ujfalusi@nokia.com>
   *
   * This program is free software; you can redistribute it and/or
   * modify it under the terms of the GNU General Public License
@@@ -214,9 -215,8 +215,9 @@@ static int omap_mcbsp_dai_hw_params(str
        struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data);
        struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs;
        int dma, bus_id = mcbsp_data->bus_id, id = cpu_dai->id;
 -      int wlen, channels;
 +      int wlen, channels, wpf;
        unsigned long port;
 +      unsigned int format;
  
        if (cpu_class_is_omap1()) {
                dma = omap1_dma_reqs[bus_id][substream->stream];
                return 0;
        }
  
 -      channels = params_channels(params);
 +      format = mcbsp_data->fmt & SND_SOC_DAIFMT_FORMAT_MASK;
 +      wpf = channels = params_channels(params);
        switch (channels) {
        case 2:
 -              /* Use dual-phase frames */
 -              regs->rcr2      |= RPHASE;
 -              regs->xcr2      |= XPHASE;
 +              if (format == SND_SOC_DAIFMT_I2S) {
 +                      /* Use dual-phase frames */
 +                      regs->rcr2      |= RPHASE;
 +                      regs->xcr2      |= XPHASE;
 +                      /* Set 1 word per (McBSP) frame for phase1 and phase2 */
 +                      wpf--;
 +                      regs->rcr2      |= RFRLEN2(wpf - 1);
 +                      regs->xcr2      |= XFRLEN2(wpf - 1);
 +              }
        case 1:
 -              /* Set 1 word per (McBSP) frame */
 -              regs->rcr2      |= RFRLEN2(1 - 1);
 -              regs->rcr1      |= RFRLEN1(1 - 1);
 -              regs->xcr2      |= XFRLEN2(1 - 1);
 -              regs->xcr1      |= XFRLEN1(1 - 1);
 +              /* Set word per (McBSP) frame for phase1 */
 +              regs->rcr1      |= RFRLEN1(wpf - 1);
 +              regs->xcr1      |= XFRLEN1(wpf - 1);
                break;
        default:
                /* Unsupported number of channels */
        }
  
        /* Set FS period and length in terms of bit clock periods */
 -      switch (mcbsp_data->fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 +      switch (format) {
        case SND_SOC_DAIFMT_I2S:
 -              regs->srgr2     |= FPER(wlen * 2 - 1);
 +              regs->srgr2     |= FPER(wlen * channels - 1);
                regs->srgr1     |= FWID(wlen - 1);
                break;
 +      case SND_SOC_DAIFMT_DSP_A:
        case SND_SOC_DAIFMT_DSP_B:
                regs->srgr2     |= FPER(wlen * channels - 1);
                regs->srgr1     |= FWID(0);
@@@ -332,13 -326,6 +333,13 @@@ static int omap_mcbsp_dai_set_dai_fmt(s
                regs->rcr2      |= RDATDLY(1);
                regs->xcr2      |= XDATDLY(1);
                break;
 +      case SND_SOC_DAIFMT_DSP_A:
 +              /* 1-bit data delay */
 +              regs->rcr2      |= RDATDLY(1);
 +              regs->xcr2      |= XDATDLY(1);
 +              /* Invert FS polarity configuration */
 +              temp_fmt ^= SND_SOC_DAIFMT_NB_IF;
 +              break;
        case SND_SOC_DAIFMT_DSP_B:
                /* 0-bit data delay */
                regs->rcr2      |= RDATDLY(0);
@@@ -546,6 -533,6 +547,6 @@@ static void __exit snd_omap_mcbsp_exit(
  }
  module_exit(snd_omap_mcbsp_exit);
  
- MODULE_AUTHOR("Jarkko Nikula <jarkko.nikula@nokia.com>");
+ MODULE_AUTHOR("Jarkko Nikula <jhnikula@gmail.com>");
  MODULE_DESCRIPTION("OMAP I2S SoC Interface");
  MODULE_LICENSE("GPL");
index 1bdbb04271830a33fe948a847b6983525ad9f1dd,b078ed537bc3f51b708b6830518f7215562f0c31..07cf7f46b584f37f83404d59133731eaa965df9b
@@@ -3,7 -3,8 +3,8 @@@
   *
   * Copyright (C) 2008 Nokia Corporation
   *
-  * Contact: Jarkko Nikula <jarkko.nikula@nokia.com>
+  * Contact: Jarkko Nikula <jhnikula@gmail.com>
+  *          Peter Ujfalusi <peter.ujfalusi@nokia.com>
   *
   * 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 <jarkko.nikula@nokia.com>");
+ MODULE_AUTHOR("Jarkko Nikula <jhnikula@gmail.com>");
  MODULE_DESCRIPTION("OMAP PCM DMA module");
  MODULE_LICENSE("GPL");
diff --combined sound/soc/pxa/pxa-ssp.c
index 487079550e710a5cd7e69d854e7f749f879d1e46,74ff69e3ce34d4a8cf8604e7edb24a74816527b6..b9b61ddca6ba07868e158ad3604cd5c6355e1f70
@@@ -30,7 -30,7 +30,7 @@@
  #include <sound/pxa2xx-lib.h>
  
  #include <mach/hardware.h>
 -#include <mach/pxa-regs.h>
 +#include <mach/dma.h>
  #include <mach/regs-ssp.h>
  #include <mach/audio.h>
  #include <mach/ssp.h>
@@@ -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;
@@@ -568,10 -589,7 +589,10 @@@ static int pxa_ssp_set_dai_fmt(struct s
                case SND_SOC_DAIFMT_NB_IF:
                        break;
                case SND_SOC_DAIFMT_IB_IF:
 -                      sspsp |= SSPSP_SCMODE(3);
 +                      sspsp |= SSPSP_SCMODE(2);
 +                      break;
 +              case SND_SOC_DAIFMT_IB_NF:
 +                      sspsp |= SSPSP_SCMODE(2) | SSPSP_SFRMP;
                        break;
                default:
                        return -EINVAL;
                case SND_SOC_DAIFMT_NB_NF:
                        sspsp |= SSPSP_SFRMP;
                        break;
 +              case SND_SOC_DAIFMT_NB_IF:
 +                      break;
                case SND_SOC_DAIFMT_IB_IF:
 +                      sspsp |= SSPSP_SCMODE(2);
 +                      break;
 +              case SND_SOC_DAIFMT_IB_NF:
 +                      sspsp |= SSPSP_SCMODE(2) | SSPSP_SFRMP;
                        break;
                default:
                        return -EINVAL;
@@@ -683,8 -695,7 +704,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.