Re: [PATCH] ASoC: davinci-pcm: trivial: replace link with actual chan/link

2011-09-13 Thread Liam Girdwood
On Fri, 2011-09-09 at 17:06 -0400, Ben Gardiner wrote:
 The ambiguously named variable 'link' is used as a temporary throughout
 davinci-pcm -- its presence makes grepping (and groking) the code
 difficult.
 
 Replace link with the value of link in almost all sites. The exception
 is a couple places where the last-assigned link/chan needs to be
 returned by a function -- in these cases, rename to last_link.
 
 Signed-off-by: Ben Gardiner bengardi...@nanometrics.ca

Acked-by: Liam Girdwood l...@ti.com

 ---
  sound/soc/davinci/davinci-pcm.c |  123 
 +++
  1 files changed, 59 insertions(+), 64 deletions(-)
 
 diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c
 index a49e667..d5fe08c 100644
 --- a/sound/soc/davinci/davinci-pcm.c
 +++ b/sound/soc/davinci/davinci-pcm.c
 @@ -180,7 +180,6 @@ static void davinci_pcm_enqueue_dma(struct 
 snd_pcm_substream *substream)
  {
   struct davinci_runtime_data *prtd = substream-runtime-private_data;
   struct snd_pcm_runtime *runtime = substream-runtime;
 - int link = prtd-asp_link[0];
   unsigned int period_size;
   unsigned int dma_offset;
   dma_addr_t dma_pos;
 @@ -198,7 +197,8 @@ static void davinci_pcm_enqueue_dma(struct 
 snd_pcm_substream *substream)
   fifo_level = prtd-params-fifo_level;
  
   pr_debug(davinci_pcm: audio_set_dma_params_play channel = %d 
 - dma_ptr = %x period_size=%x\n, link, dma_pos, period_size);
 + dma_ptr = %x period_size=%x\n, prtd-asp_link[0], dma_pos,
 + period_size);
  
   data_type = prtd-params-data_type;
   count = period_size / data_type;
 @@ -222,17 +222,19 @@ static void davinci_pcm_enqueue_dma(struct 
 snd_pcm_substream *substream)
   }
  
   acnt = prtd-params-acnt;
 - edma_set_src(link, src, INCR, W8BIT);
 - edma_set_dest(link, dst, INCR, W8BIT);
 + edma_set_src(prtd-asp_link[0], src, INCR, W8BIT);
 + edma_set_dest(prtd-asp_link[0], dst, INCR, W8BIT);
  
 - edma_set_src_index(link, src_bidx, src_cidx);
 - edma_set_dest_index(link, dst_bidx, dst_cidx);
 + edma_set_src_index(prtd-asp_link[0], src_bidx, src_cidx);
 + edma_set_dest_index(prtd-asp_link[0], dst_bidx, dst_cidx);
  
   if (!fifo_level)
 - edma_set_transfer_params(link, acnt, count, 1, 0, ASYNC);
 + edma_set_transfer_params(prtd-asp_link[0], acnt, count, 1, 0,
 + ASYNC);
   else
 - edma_set_transfer_params(link, acnt, fifo_level, count,
 - fifo_level, ABSYNC);
 + edma_set_transfer_params(prtd-asp_link[0], acnt, fifo_level,
 + count, fifo_level,
 + ABSYNC);
  }
  
  static void davinci_pcm_dma_irq(unsigned link, u16 ch_status, void *data)
 @@ -305,7 +307,6 @@ static int ping_pong_dma_setup(struct snd_pcm_substream 
 *substream)
   unsigned int acnt = params-acnt;
   /* divide by 2 for ping/pong */
   unsigned int ping_size = snd_pcm_lib_period_bytes(substream)  1;
 - int link = prtd-asp_link[1];
   unsigned int fifo_level = prtd-params-fifo_level;
   unsigned int count;
   if ((data_type == 0) || (data_type  4)) {
 @@ -316,28 +317,26 @@ static int ping_pong_dma_setup(struct snd_pcm_substream 
 *substream)
   dma_addr_t asp_src_pong = iram_dma-addr + ping_size;
   ram_src_cidx = ping_size;
   ram_dst_cidx = -ping_size;
 - edma_set_src(link, asp_src_pong, INCR, W8BIT);
 + edma_set_src(prtd-asp_link[1], asp_src_pong, INCR, W8BIT);
  
 - link = prtd-asp_link[0];
 - edma_set_src_index(link, data_type, data_type * fifo_level);
 - link = prtd-asp_link[1];
 - edma_set_src_index(link, data_type, data_type * fifo_level);
 + edma_set_src_index(prtd-asp_link[0], data_type,
 + data_type * fifo_level);
 + edma_set_src_index(prtd-asp_link[1], data_type,
 + data_type * fifo_level);
  
 - link = prtd-ram_link;
 - edma_set_src(link, runtime-dma_addr, INCR, W32BIT);
 + edma_set_src(prtd-ram_link, runtime-dma_addr, INCR, W32BIT);
   } else {
   dma_addr_t asp_dst_pong = iram_dma-addr + ping_size;
   ram_src_cidx = -ping_size;
   ram_dst_cidx = ping_size;
 - edma_set_dest(link, asp_dst_pong, INCR, W8BIT);
 + edma_set_dest(prtd-asp_link[1], asp_dst_pong, INCR, W8BIT);
  
 - link = prtd-asp_link[0];
 - edma_set_dest_index(link, data_type, data_type * fifo_level);
 - link = prtd-asp_link[1];
 - edma_set_dest_index(link, data_type, data_type * fifo_level);
 + edma_set_dest_index(prtd-asp_link

Re: [PATCH] ASoC: davinci-pcm: trivial: replace link with actual chan/link

2011-09-13 Thread Liam Girdwood
On Fri, 2011-09-09 at 17:06 -0400, Ben Gardiner wrote:
 The ambiguously named variable 'link' is used as a temporary throughout
 davinci-pcm -- its presence makes grepping (and groking) the code
 difficult.
 
 Replace link with the value of link in almost all sites. The exception
 is a couple places where the last-assigned link/chan needs to be
 returned by a function -- in these cases, rename to last_link.
 
 Signed-off-by: Ben Gardiner bengardi...@nanometrics.ca

Acked-by: Liam Girdwood l...@ti.com

 ---
  sound/soc/davinci/davinci-pcm.c |  123 
 +++
  1 files changed, 59 insertions(+), 64 deletions(-)
 
 diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c
 index a49e667..d5fe08c 100644
 --- a/sound/soc/davinci/davinci-pcm.c
 +++ b/sound/soc/davinci/davinci-pcm.c
 @@ -180,7 +180,6 @@ static void davinci_pcm_enqueue_dma(struct 
 snd_pcm_substream *substream)
  {
   struct davinci_runtime_data *prtd = substream-runtime-private_data;
   struct snd_pcm_runtime *runtime = substream-runtime;
 - int link = prtd-asp_link[0];
   unsigned int period_size;
   unsigned int dma_offset;
   dma_addr_t dma_pos;
 @@ -198,7 +197,8 @@ static void davinci_pcm_enqueue_dma(struct 
 snd_pcm_substream *substream)
   fifo_level = prtd-params-fifo_level;
  
   pr_debug(davinci_pcm: audio_set_dma_params_play channel = %d 
 - dma_ptr = %x period_size=%x\n, link, dma_pos, period_size);
 + dma_ptr = %x period_size=%x\n, prtd-asp_link[0], dma_pos,
 + period_size);
  
   data_type = prtd-params-data_type;
   count = period_size / data_type;
 @@ -222,17 +222,19 @@ static void davinci_pcm_enqueue_dma(struct 
 snd_pcm_substream *substream)
   }
  
   acnt = prtd-params-acnt;
 - edma_set_src(link, src, INCR, W8BIT);
 - edma_set_dest(link, dst, INCR, W8BIT);
 + edma_set_src(prtd-asp_link[0], src, INCR, W8BIT);
 + edma_set_dest(prtd-asp_link[0], dst, INCR, W8BIT);
  
 - edma_set_src_index(link, src_bidx, src_cidx);
 - edma_set_dest_index(link, dst_bidx, dst_cidx);
 + edma_set_src_index(prtd-asp_link[0], src_bidx, src_cidx);
 + edma_set_dest_index(prtd-asp_link[0], dst_bidx, dst_cidx);
  
   if (!fifo_level)
 - edma_set_transfer_params(link, acnt, count, 1, 0, ASYNC);
 + edma_set_transfer_params(prtd-asp_link[0], acnt, count, 1, 0,
 + ASYNC);
   else
 - edma_set_transfer_params(link, acnt, fifo_level, count,
 - fifo_level, ABSYNC);
 + edma_set_transfer_params(prtd-asp_link[0], acnt, fifo_level,
 + count, fifo_level,
 + ABSYNC);
  }
  
  static void davinci_pcm_dma_irq(unsigned link, u16 ch_status, void *data)
 @@ -305,7 +307,6 @@ static int ping_pong_dma_setup(struct snd_pcm_substream 
 *substream)
   unsigned int acnt = params-acnt;
   /* divide by 2 for ping/pong */
   unsigned int ping_size = snd_pcm_lib_period_bytes(substream)  1;
 - int link = prtd-asp_link[1];
   unsigned int fifo_level = prtd-params-fifo_level;
   unsigned int count;
   if ((data_type == 0) || (data_type  4)) {
 @@ -316,28 +317,26 @@ static int ping_pong_dma_setup(struct snd_pcm_substream 
 *substream)
   dma_addr_t asp_src_pong = iram_dma-addr + ping_size;
   ram_src_cidx = ping_size;
   ram_dst_cidx = -ping_size;
 - edma_set_src(link, asp_src_pong, INCR, W8BIT);
 + edma_set_src(prtd-asp_link[1], asp_src_pong, INCR, W8BIT);
  
 - link = prtd-asp_link[0];
 - edma_set_src_index(link, data_type, data_type * fifo_level);
 - link = prtd-asp_link[1];
 - edma_set_src_index(link, data_type, data_type * fifo_level);
 + edma_set_src_index(prtd-asp_link[0], data_type,
 + data_type * fifo_level);
 + edma_set_src_index(prtd-asp_link[1], data_type,
 + data_type * fifo_level);
  
 - link = prtd-ram_link;
 - edma_set_src(link, runtime-dma_addr, INCR, W32BIT);
 + edma_set_src(prtd-ram_link, runtime-dma_addr, INCR, W32BIT);
   } else {
   dma_addr_t asp_dst_pong = iram_dma-addr + ping_size;
   ram_src_cidx = -ping_size;
   ram_dst_cidx = ping_size;
 - edma_set_dest(link, asp_dst_pong, INCR, W8BIT);
 + edma_set_dest(prtd-asp_link[1], asp_dst_pong, INCR, W8BIT);
  
 - link = prtd-asp_link[0];
 - edma_set_dest_index(link, data_type, data_type * fifo_level);
 - link = prtd-asp_link[1];
 - edma_set_dest_index(link, data_type, data_type * fifo_level);
 + edma_set_dest_index(prtd-asp_link

Re: [PATCH] ASoC: davinci-mcasp: add support for unsigned PCM formats

2011-08-28 Thread Liam Girdwood
On 26/08/11 17:02, Ben Gardiner wrote:
 Although the McASP supports sign-extending samples in RX or TX [1]; the
 davinci-mcasp driver does not touch the {R,X}PBIT or {R,X}PAD field of the
 {R,X}FMT registers meaning that the McASP will serialize the bytes it is given
 regardless of their signedness. So supporting unsigned formats is as simple
 as adding them to the metadata of the davinci-mcasp driver.
 
 Update the FMTBITs reported in the snd_soc_dai_driver and also update the case
 statements in davinci-mcasp's hw_params() function so that the McASP can be
 connected to CODECs that use unsigned values.
 
 [1] http://www.ti.com/lit/ug/sprufm1/sprufm1.pdf
 
 Signed-off-by: Ben Gardiner bengardi...@nanometrics.ca

Acked-by: Liam Girdwood l...@ti.com
 
 ---
 
 Tested with a logic analyzer on da850evm where an unsigned 16bit codec was
 registered with the mcasp and a 16bit signed file was played to it. ALSA's
 plug pcm mapped to unsigned and the samples serialized as unsigned 16bit --
 as expected.
 ---
  sound/soc/davinci/davinci-mcasp.c |   20 +---
  1 files changed, 13 insertions(+), 7 deletions(-)
 
 diff --git a/sound/soc/davinci/davinci-mcasp.c 
 b/sound/soc/davinci/davinci-mcasp.c
 index 8566238..7173df2 100644
 --- a/sound/soc/davinci/davinci-mcasp.c
 +++ b/sound/soc/davinci/davinci-mcasp.c
 @@ -732,16 +732,19 @@ static int davinci_mcasp_hw_params(struct 
 snd_pcm_substream *substream,
   davinci_hw_param(dev, substream-stream);
  
   switch (params_format(params)) {
 + case SNDRV_PCM_FORMAT_U8:
   case SNDRV_PCM_FORMAT_S8:
   dma_params-data_type = 1;
   word_length = DAVINCI_AUDIO_WORD_8;
   break;
  
 + case SNDRV_PCM_FORMAT_U16_LE:
   case SNDRV_PCM_FORMAT_S16_LE:
   dma_params-data_type = 2;
   word_length = DAVINCI_AUDIO_WORD_16;
   break;
  
 + case SNDRV_PCM_FORMAT_U32_LE:
   case SNDRV_PCM_FORMAT_S32_LE:
   dma_params-data_type = 4;
   word_length = DAVINCI_AUDIO_WORD_32;
 @@ -818,6 +821,13 @@ static struct snd_soc_dai_ops davinci_mcasp_dai_ops = {
  
  };
  
 +#define DAVINCI_MCASP_PCM_FMTS (SNDRV_PCM_FMTBIT_S8 | \
 + SNDRV_PCM_FMTBIT_U8 | \
 + SNDRV_PCM_FMTBIT_S16_LE | \
 + SNDRV_PCM_FMTBIT_U16_LE | \
 + SNDRV_PCM_FMTBIT_S32_LE | \
 + SNDRV_PCM_FMTBIT_U32_LE)
 +
  static struct snd_soc_dai_driver davinci_mcasp_dai[] = {
   {
   .name   = davinci-mcasp.0,
 @@ -825,17 +835,13 @@ static struct snd_soc_dai_driver davinci_mcasp_dai[] = {
   .channels_min   = 2,
   .channels_max   = 2,
   .rates  = DAVINCI_MCASP_RATES,
 - .formats= SNDRV_PCM_FMTBIT_S8 |
 - SNDRV_PCM_FMTBIT_S16_LE |
 - SNDRV_PCM_FMTBIT_S32_LE,
 + .formats= DAVINCI_MCASP_PCM_FMTS,
   },
   .capture= {
   .channels_min   = 2,
   .channels_max   = 2,
   .rates  = DAVINCI_MCASP_RATES,
 - .formats= SNDRV_PCM_FMTBIT_S8 |
 - SNDRV_PCM_FMTBIT_S16_LE |
 - SNDRV_PCM_FMTBIT_S32_LE,
 + .formats= DAVINCI_MCASP_PCM_FMTS,
   },
   .ops= davinci_mcasp_dai_ops,
  
 @@ -846,7 +852,7 @@ static struct snd_soc_dai_driver davinci_mcasp_dai[] = {
   .channels_min   = 1,
   .channels_max   = 384,
   .rates  = DAVINCI_MCASP_RATES,
 - .formats= SNDRV_PCM_FMTBIT_S16_LE,
 + .formats= DAVINCI_MCASP_PCM_FMTS,
   },
   .ops= davinci_mcasp_dai_ops,
   },

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH v2 1/2] ASoC: davinci: fix codec start and stop functions

2011-07-20 Thread Liam Girdwood
On 20/07/11 13:06, Rajashekhara, Sudhakar wrote:
 According to DM365 voice codec data sheet at [1], before starting
 recording or playback, ADC/DAC modules should follow a reset and
 enable cycle. Writing a 1 to the ADC/DAC bit in the register resets
 the module and clearing the bit to 0 will enable the module. But the
 driver seems to be doing the reverse of it.
 
 [1] http://focus.ti.com/lit/ug/sprufi9b/sprufi9b.pdf
 
 Signed-off-by: Rajashekhara, Sudhakar sudhakar@ti.com
 ---

Both

Acked-by: Liam Girdwood l...@ti.com
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH 0/4] davinci-mcasp: fix tdm_slots and CBM/CFS

2011-04-26 Thread Liam Girdwood
On Thu, 2011-04-21 at 14:19 -0400, Ben Gardiner wrote:
 This patch series is comprised of three bugfixes and one cleanup that 
 were performed during prototyping of McASP operation in codec clock-
 master frame-slave mode.
 
 First we noticed that the check of the number of tdm slots requested
 by platform data was always returning true -- unrelated to CMB/CFS
 mode.
 
 Then a cleanup: the PDIR values set are currently based on magic 
 numbers and there are  available bitfield definitions. Not strictly
 needed but it makes the changes introduced in the last patch simpler
 to read.
 
 It was found that the hardware parameters assigned when 
 codec clock-master frame-slave is requested were incorrect. This
 change is required for correct CBM/CFS operation.
 
 Finally, the direction of the pins is corrected to reflect the
 implications of codec clock-master frame-slave -- i.e. mcasp clock-
 input frame-output. This change is also required for correct operation.
 
 The combination was tested with a logic analyzer and the hrtimer pwm
 device from Bill Gatliff's PWM framework [1] on a da850evm with
 hardware modifications to access the McASP lines.
 
 [1] http://article.gmane.org/gmane.linux.kernel.embedded/3486/
 
 Ben Gardiner (4):
   davinci-mcasp: correct tdm_slots limit
   davinci-mcasp: use bitfield definitions for PDIR
   davinci-mcasp: fix _CBM_CFS hw_params
   davinci-mcasp: fix _CBM_CFS pin directions
 
  sound/soc/davinci/davinci-mcasp.c |   19 ---
  1 files changed, 12 insertions(+), 7 deletions(-)
 

All

Acked-by: Liam Girdwood l...@ti.com

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH 1/3] ASoC: Davinci: Use resource_size() helper function

2011-02-09 Thread Liam Girdwood
On Wed, 2011-02-09 at 18:39 +0530, Vaibhav Bedia wrote:
 This patch modifies the Davinci i2s and mcasp drivers
 to make use of the resource_size() helper function for readability.
 
 Signed-off-by: Vaibhav Bedia vaibhav.be...@ti.com

All

Acked-by: Liam Girdwood l...@slimlogic.co.uk
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [alsa-devel] [PATCH v2] asoc: davinci: da830/omap-l137: correct cpu_dai_name

2011-02-03 Thread Liam Girdwood
On Thu, 2011-02-03 at 16:42 +0530, Vaibhav Bedia wrote:
 McASP1 is used on the DA830/OMAP-L137 platform for the codec.
 This is different from the DA850/OMAP-L138 platform which uses McASP0.
 
 This is fixed by adding a new snd_soc_dai_link struct.
 
 Signed-off-by: Vaibhav Bedia vaibhav.be...@ti.com
 ---
 
 v2: 
 Fixed the subject as pointed out by Sergei.
 

Acked-by: Liam Girdwood l...@slimlogic.co.uk
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [alsa-devel] [PATCH] ASoC: DaVinci: fix kernel panic due to uninitialized platform_data

2011-01-27 Thread Liam Girdwood
On Thu, 2011-01-27 at 19:17 +0530, Manjunathappa, Prakash wrote:
 This patch fixes the Kernel panic issue on accessing davinci_vc in
 cq93vc_probe function. struct davinci_vc is part of platform device's
 private driver data(codec-dev-p-driver_data) and this is populated
 by DaVinci Voice Codec MFD driver.
 
 Signed-off-by: Manjunathappa, Prakash prakash...@ti.com
 ---
 This patch applies to Linus's tree at [1].
 
 [1] http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
 ---
  sound/soc/codecs/cq93vc.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/sound/soc/codecs/cq93vc.c b/sound/soc/codecs/cq93vc.c
 index 46dbfd0..347a567 100644
 --- a/sound/soc/codecs/cq93vc.c
 +++ b/sound/soc/codecs/cq93vc.c
 @@ -153,7 +153,7 @@ static int cq93vc_resume(struct snd_soc_codec *codec)
  
  static int cq93vc_probe(struct snd_soc_codec *codec)
  {
 - struct davinci_vc *davinci_vc = codec-dev-platform_data;
 + struct davinci_vc *davinci_vc = snd_soc_codec_get_drvdata(codec);
  
   davinci_vc-cq93vc.codec = codec;
   codec-control_data = davinci_vc;

Acked-by: Liam Girdwood l...@slimlogic.co.uk
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH] MFD: DaVinci: Fix voice codec device name

2011-01-27 Thread Liam Girdwood
On Thu, 2011-01-27 at 18:58 +0530, Manjunathappa, Prakash wrote:
 Fix the device name in DaVinci Voice Codec MFD driver to load
 davinci-vcif and cq93vc codec client drivers.
 
 Signed-off-by: Manjunathappa, Prakash prakash...@ti.com
 ---
 This patch applies to Linus's tree at [1].
 
 [1] http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
 ---
  drivers/mfd/davinci_voicecodec.c |4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/mfd/davinci_voicecodec.c 
 b/drivers/mfd/davinci_voicecodec.c
 index 33c923d..fdd8a1b 100644
 --- a/drivers/mfd/davinci_voicecodec.c
 +++ b/drivers/mfd/davinci_voicecodec.c
 @@ -118,12 +118,12 @@ static int __init davinci_vc_probe(struct 
 platform_device *pdev)
  
   /* Voice codec interface client */
   cell = davinci_vc-cells[DAVINCI_VC_VCIF_CELL];
 - cell-name = davinci_vcif;
 + cell-name = davinci-vcif;
   cell-driver_data = davinci_vc;
  
   /* Voice codec CQ93VC client */
   cell = davinci_vc-cells[DAVINCI_VC_CQ93VC_CELL];
 - cell-name = cq93vc;
 + cell-name = cq93vc-codec;
   cell-driver_data = davinci_vc;
  
   ret = mfd_add_devices(pdev-dev, pdev-id, davinci_vc-cells,

Acked-by: Liam Girdwood l...@slimlogic.co.uk
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [alsa-devel] [PATCH] davinci: da8xx/omap-l1xx: match codec_name with i2c ids

2011-01-25 Thread Liam Girdwood
On Mon, 2011-01-24 at 15:09 -0800, Kevin Hilman wrote:
 Kevin Hilman khil...@ti.com writes:
 
  Liam Girdwood l...@slimlogic.co.uk writes:
 
  On Fri, 2011-01-21 at 19:54 +0530, Rajashekhara, Sudhakar wrote:
  The codec_name entry for da8xx evm in sound/soc/davinci/davinci-evm.c
  is not matching with the i2c ids in the board file. Without this fix the
  soundcard does not get detected on da850/omap-l138/am18x evm.
  
  Signed-off-by: Rajashekhara, Sudhakar sudhakar@ti.com
  Tested-by: Dan Sharon dansha...@nanometrics.ca
  ---
  This patch applies to Linus's kernel tree.
  
   sound/soc/davinci/davinci-evm.c |2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)
  
  diff --git a/sound/soc/davinci/davinci-evm.c 
  b/sound/soc/davinci/davinci-evm.c
  index 0c2d6ba..b36f0b3 100644
  --- a/sound/soc/davinci/davinci-evm.c
  +++ b/sound/soc/davinci/davinci-evm.c
  @@ -223,7 +223,7 @@ static struct snd_soc_dai_link da8xx_evm_dai = {
.stream_name = AIC3X,
.cpu_dai_name= davinci-mcasp.0,
.codec_dai_name = tlv320aic3x-hifi,
  - .codec_name = tlv320aic3x-codec.0-001a,
  + .codec_name = tlv320aic3x-codec.1-0018,
.platform_name = davinci-pcm-audio,
.init = evm_aic3x_init,
.ops = evm_ops,
 
  Acked-by: Liam Girdwood l...@slimlogic.co.uk
 
  Liam,
 
  I'm assuming you'll merge this one via the ASoC tree?
 
 
 On second thought, these should probably merge for .38-rc3.
 
 If you're OK with it, I can merge this and the platform fix together for
 .38-rc3.

Yes please :)

Thanks !

Liam
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH] davinci: da8xx/omap-l1xx: match codec_name with i2c ids

2011-01-21 Thread Liam Girdwood
On Fri, 2011-01-21 at 19:54 +0530, Rajashekhara, Sudhakar wrote:
 The codec_name entry for da8xx evm in sound/soc/davinci/davinci-evm.c
 is not matching with the i2c ids in the board file. Without this fix the
 soundcard does not get detected on da850/omap-l138/am18x evm.
 
 Signed-off-by: Rajashekhara, Sudhakar sudhakar@ti.com
 Tested-by: Dan Sharon dansha...@nanometrics.ca
 ---
 This patch applies to Linus's kernel tree.
 
  sound/soc/davinci/davinci-evm.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c
 index 0c2d6ba..b36f0b3 100644
 --- a/sound/soc/davinci/davinci-evm.c
 +++ b/sound/soc/davinci/davinci-evm.c
 @@ -223,7 +223,7 @@ static struct snd_soc_dai_link da8xx_evm_dai = {
   .stream_name = AIC3X,
   .cpu_dai_name= davinci-mcasp.0,
   .codec_dai_name = tlv320aic3x-hifi,
 - .codec_name = tlv320aic3x-codec.0-001a,
 + .codec_name = tlv320aic3x-codec.1-0018,
   .platform_name = davinci-pcm-audio,
   .init = evm_aic3x_init,
   .ops = evm_ops,

Acked-by: Liam Girdwood l...@slimlogic.co.uk
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH] regulator: add driver for tps6524x regulator

2010-12-10 Thread Liam Girdwood
On Fri, 2010-12-10 at 08:42 -0800, Kevin Hilman wrote:
 Mark Brown broo...@opensource.wolfsonmicro.com writes:
 
  On Tue, Dec 07, 2010 at 12:20:14PM -0500, Cyril Chemparathy wrote:
  On 12/07/2010 12:15 PM, Mark Brown wrote:
 
   Acked-by: Mark Brown broo...@opensource.wolfsonmicro.com
 
  Is this to be merged via the davinci tree?
 
  Liam would need to merge it, or it'd need to wait until the regulator
  tree change to the signature of set_voltage() gets merged into the
  DaVinci tree.
 
 I suggest Liam merge this, as there shouldn't be any dependencies in the
 davinci tree.

Will do. I'll get around to this at the weekend.

Thanks

Liam

-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH] regulator: add driver for tps6524x regulator

2010-12-10 Thread Liam Girdwood
On Fri, 2010-12-10 at 08:42 -0800, Kevin Hilman wrote:
 Mark Brown broo...@opensource.wolfsonmicro.com writes:
 
  On Tue, Dec 07, 2010 at 12:20:14PM -0500, Cyril Chemparathy wrote:
  On 12/07/2010 12:15 PM, Mark Brown wrote:
 
   Acked-by: Mark Brown broo...@opensource.wolfsonmicro.com
 
  Is this to be merged via the davinci tree?
 
  Liam would need to merge it, or it'd need to wait until the regulator
  tree change to the signature of set_voltage() gets merged into the
  DaVinci tree.
 
 I suggest Liam merge this, as there shouldn't be any dependencies in the
 davinci tree.

And now applied.

Thanks

Liam
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [alsa-devel] [PATCH] ASoC: davinci: fixes for multi-component

2010-11-17 Thread Liam Girdwood
On Tue, 2010-11-16 at 12:27 +, Chris Paulson-Ellis wrote:
 Multi-component commit f0fba2ad broke a few things which this patch should
 fix. Tested on the DM355 EVM. I've been as careful as I can, but it would be
 good if those with access to other Davinci boards could test.
 
 --

Acked-by: Liam Girdwood l...@slimlogic.co.uk
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [alsa-devel] [PATCH v5 0/9] Add Omapl138-Hawkboard support

2010-10-21 Thread Liam Girdwood
On Tue, 2010-10-19 at 13:06 -0500, vm.ro...@gmail.com wrote:
 From: Victor Rodriguez victor.rodrig...@sasken.com
 
 This patch adds
 EMAC, EDMA, ASoC, SOUND, MMC/SD and USB OHCI
 support for the Hawkboard-L138 system
 It is under the machine name omapl138_hawkboard.
 This system is based on the da850 davinci CPU architecture.
 
 Victor Rodriguez (9):
   davinci: EMAC support for Omapl138-Hawkboard
   davinci: EDMA support for Omapl138-Hawkboard
   davinci: ASoC support for Omapl138-Hawkboard
   davinci: McASP configuration for Omapl138-Hawkboard
   davinci: Audio support for Omapl138-Hawkboard
   davinci: MMC/SD and USB-OHCI configuration for Omapl138-Hawkboard
   davinci: MMC/SD support for Omapl138-Hawkboar
   davinci: USB clocks for Omapl138-Hawkboard
   davinci: USB1.1 support for Omapl138-Hawkboard
 
  arch/arm/mach-davinci/board-omapl138-hawk.c |  317 
 +++
  arch/arm/mach-davinci/da850.c   |   22 ++-
  arch/arm/mach-davinci/include/mach/mux.h|4 +
  sound/soc/davinci/Kconfig   |5 +-
  sound/soc/davinci/davinci-evm.c |6 +-
  5 files changed, 349 insertions(+), 5 deletions(-)
 

ASoC parts :-

Acked-by: Liam Girdwood l...@slimlogic.co.uk
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [alsa-devel] [PATCH 1/1] ALSA: ASoc: DaVinci Delay start of ASP to trigger

2010-10-04 Thread Liam Girdwood
On Sun, 2010-10-03 at 16:44 -0500, mar...@ti.com wrote:
 From: Troy Kisky troy.ki...@boundarydevices.com
 
 Since only 4 mainline ASoC codecs support the trigger
 callback, we cannot rely upon them stopping the frame clock
 if they are master and must assume it is running even if the
 sound is paused. Thus we cannot start the ASP until the trigger
 method.
 
 Signed-off-by: Troy Kisky troy.ki...@boundarydevices.com
 Signed-off-by: Martin Ambrose mar...@ti.com

Acked-by: Liam Girdwood l...@slimlogic.co.uk

-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH] asoc: davinci: let platform data define edma queue numbers

2010-07-17 Thread Liam Girdwood
On Thu, 2010-07-15 at 17:44 +0530, Sekhar Nori wrote:
 Currently the EDMA queue to be used by for servicing ASP through
 internal RAM is fixed to EDMAQ_0 and that to service internal RAM
 from external RAM is fixed to EDMAQ_1.
 
 This may not be the desirable configuration on all platforms. For
 example, on DM365, queue 0 has large fifo size and is more suitable
 for video transfers. Having audio and video transfers on the same
 queue may lead to starvation on audio side.
 
 platform data as defined currently passes a queue number to the driver
 but that remains unused inside the driver.
 
 Fix this by defining one queue each for ASP and RAM transfers in the
 platform data and using it inside the driver.
 
 Since EDMAQ_0 maps to 0, thats the queue that will be used if
 the asp queue number is not initialized. None of the platforms
 currently utilize ping-pong transfers through internal RAM so that
 functionality remains unchanged too.
 
 This patch has been tested on DM644x and OMAP-L138 EVMs.
 
 Signed-off-by: Sekhar Nori nsek...@ti.com

Acked-by: Liam Girdwood l...@slimlogic.co.uk
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH v2 2/2] davinci: da850/omap-l138 evm: account for DEFDCDC{2,3} being tied high

2010-07-12 Thread Liam Girdwood
On Mon, 2010-07-12 at 13:27 +0100, Mark Brown wrote:
 On Mon, Jul 12, 2010 at 05:56:21PM +0530, Sekhar Nori wrote:
  Per the da850/omap-l138 Beta EVM SOM schematic, the DEFDCDC2 and
  DEFDCDC3 lines are tied high. This leads to a 3.3V IO and 1.2V CVDD
  voltage.
  
  Pass the right platform data to the TPS6507x driver so it can operate
  on the DEFDCDC{2,3}_HIGH register to read and change voltage levels.
  
  Signed-off-by: Sekhar Nori nsek...@ti.com
 
 Acked-by: Mark Brown broo...@opensource.wolfsonmicro.com

Kevin, I can take this through regulator (to reduce dependencies) if you
want ?

Liam 

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH 1/3] ASoC: DaVinci: Added two clocking possibilities to McBSP (I2S)

2010-07-06 Thread Liam Girdwood
On Tue, 2010-07-06 at 10:39 +0200, Raffaele Recalcati wrote:
 From: Raffaele Recalcati raffaele.recalc...@bticino.it
 
 Added two clocking options for dm365 McBSP peripheral when used
 with I2S timings, that are SND_SOC_DAIFMT_CBS_CFS (the cpu generates
 clock and frame sync) and SND_SOC_DAIFMT_CBS_CFM (the cpu gets clock
 from external pin and generates frame sync).
 A slave clock management can be important when the external codec needs
 the system clock and the bit clock synchronized (tested with uda1345).
 This patch has been developed against the:
 
 http://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci.git
 git tree and has been tested on bmx board (similar to dm365 evm, but using
 uda1345 as external audio codec).
 
 Signed-off-by: Raffaele Recalcati raffaele.recalc...@bticino.it
 Signed-off-by: Davide Bonfanti davide.bonfa...@bticino.it

All

Acked-by: Liam Girdwood l...@slimlogic.co.uk

But lets get some feedback from the DaVinci folks on this too.

 ---
  sound/soc/davinci/davinci-i2s.c |  110 +++---
  sound/soc/davinci/davinci-i2s.h |5 ++
  2 files changed, 106 insertions(+), 9 deletions(-)
 
 diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c
 index adadcd3..c8f038c 100644
 --- a/sound/soc/davinci/davinci-i2s.c
 +++ b/sound/soc/davinci/davinci-i2s.c
 @@ -26,6 +26,7 @@
  #include mach/asp.h
  
  #include davinci-pcm.h
 +#include davinci-i2s.h
  
 
  /*
 @@ -68,16 +69,21 @@
  #define DAVINCI_MCBSP_RCR_RDATDLY(v) ((v)  16)
  #define DAVINCI_MCBSP_RCR_RFIG   (1  18)
  #define DAVINCI_MCBSP_RCR_RWDLEN2(v) ((v)  21)
 +#define DAVINCI_MCBSP_RCR_RFRLEN2(v) ((v)  24)
 +#define DAVINCI_MCBSP_RCR_RPHASE BIT(31)
  
  #define DAVINCI_MCBSP_XCR_XWDLEN1(v) ((v)  5)
  #define DAVINCI_MCBSP_XCR_XFRLEN1(v) ((v)  8)
  #define DAVINCI_MCBSP_XCR_XDATDLY(v) ((v)  16)
  #define DAVINCI_MCBSP_XCR_XFIG   (1  18)
  #define DAVINCI_MCBSP_XCR_XWDLEN2(v) ((v)  21)
 +#define DAVINCI_MCBSP_XCR_XFRLEN2(v) ((v)  24)
 +#define DAVINCI_MCBSP_XCR_XPHASE BIT(31)
  
  #define DAVINCI_MCBSP_SRGR_FWID(v)   ((v)  8)
  #define DAVINCI_MCBSP_SRGR_FPER(v)   ((v)  16)
  #define DAVINCI_MCBSP_SRGR_FSGM  (1  28)
 +#define DAVINCI_MCBSP_SRGR_CLKSM BIT(29)
  
  #define DAVINCI_MCBSP_PCR_CLKRP  (1  0)
  #define DAVINCI_MCBSP_PCR_CLKXP  (1  1)
 @@ -144,6 +150,9 @@ struct davinci_mcbsp_dev {
* won't end up being swapped because of the underrun.
*/
   unsigned enable_channel_combine:1;
 +
 + unsigned int fmt;
 + int clk_div;
  };
  
  static inline void davinci_mcbsp_write_reg(struct davinci_mcbsp_dev *dev,
 @@ -254,10 +263,12 @@ static int davinci_i2s_set_dai_fmt(struct snd_soc_dai 
 *cpu_dai,
   struct davinci_mcbsp_dev *dev = cpu_dai-private_data;
   unsigned int pcr;
   unsigned int srgr;
 + /* Attention srgr is updated by hw_params! */
   srgr = DAVINCI_MCBSP_SRGR_FSGM |
   DAVINCI_MCBSP_SRGR_FPER(DEFAULT_BITPERSAMPLE * 2 - 1) |
   DAVINCI_MCBSP_SRGR_FWID(DEFAULT_BITPERSAMPLE - 1);
  
 + dev-fmt = fmt;
   /* set master/slave audio interface */
   switch (fmt  SND_SOC_DAIFMT_MASTER_MASK) {
   case SND_SOC_DAIFMT_CBS_CFS:
 @@ -372,6 +383,18 @@ static int davinci_i2s_set_dai_fmt(struct snd_soc_dai 
 *cpu_dai,
   return 0;
  }
  
 +static int davinci_i2s_dai_set_clkdiv(struct snd_soc_dai *cpu_dai,
 + int div_id, int div)
 +{
 + struct davinci_mcbsp_dev *dev = cpu_dai-private_data;
 +
 + if (div_id != DAVINCI_MCBSP_CLKGDV)
 + return -ENODEV;
 +
 + dev-clk_div = div;
 + return 0;
 +}
 +
  static int davinci_i2s_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
 @@ -380,8 +403,8 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream 
 *substream,
   struct davinci_pcm_dma_params *dma_params =
   dev-dma_params[substream-stream];
   struct snd_interval *i = NULL;
 - int mcbsp_word_length;
 - unsigned int rcr, xcr, srgr;
 + int mcbsp_word_length, master;
 + unsigned int rcr, xcr, srgr, clk_div, freq, framesize;
   u32 spcr;
   snd_pcm_format_t fmt;
   unsigned element_cnt = 1;
 @@ -396,12 +419,47 @@ static int davinci_i2s_hw_params(struct 
 snd_pcm_substream *substream,
   davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, spcr);
   }
  
 - i = hw_param_interval(params, SNDRV_PCM_HW_PARAM_SAMPLE_BITS);
 - srgr = DAVINCI_MCBSP_SRGR_FSGM;
 - srgr |= DAVINCI_MCBSP_SRGR_FWID(snd_interval_value(i) - 1);
 + master = dev-fmt  SND_SOC_DAIFMT_MASTER_MASK;
 + fmt = params_format(params);
 + mcbsp_word_length = asp_word_length[fmt];
  
 - i = hw_param_interval(params

Re: [PATCH] ASoC: DaVinci: Added support for stereo I2S

2010-06-23 Thread Liam Girdwood
On Wed, 2010-06-23 at 16:33 +0200, Raffaele Recalcati wrote:
 From: Raffaele Recalcati raffaele.recalc...@bticino.it
 
   Added audio playback support with [frame sync master - clock master] 
 mode
   and with [frame sync master - clock slave].
   Clock slave can be important when the external codec need system clock
   and bit clock synchronized.
   In the clock master case there is a FIXME message in the source code, 
 because we
   (Davide and myself) have guessed a frequency of 12200 that seems 
 the base
   to be divided.
   This patch has been developed against the
   
 http://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci.git
   git tree and has been tested on bmx board (similar to dm365 evm, but 
 using
   uda1345 as external audio codec).
 
 Signed-off-by: Raffaele Recalcati raffaele.recalc...@bticino.it
 Signed-off-by: Davide Bonfanti davide.bonfa...@bticino.it

Had a quick check, it looks like you have made some unintended
formatting changes that make the patch look more complex than necessary.

 ---
  arch/arm/mach-davinci/include/mach/asp.h |7 ++
  sound/soc/davinci/davinci-i2s.c  |  141 
 ++
  2 files changed, 129 insertions(+), 19 deletions(-)
 
 diff --git a/arch/arm/mach-davinci/include/mach/asp.h 
 b/arch/arm/mach-davinci/include/mach/asp.h
 index 834725f..b1faeb9 100644
 --- a/arch/arm/mach-davinci/include/mach/asp.h
 +++ b/arch/arm/mach-davinci/include/mach/asp.h
 @@ -63,6 +63,13 @@ struct snd_platform_data {
   unsigned sram_size_playback;
   unsigned sram_size_capture;
  
 + /*
 +  * This define works when both clock and FS are output for the cpu
 +  * and makes clock very fast (FS is not simmetrical, but sampling
 +  * frequency is better approximated
 +  */
 + int i2s_fast_clock;
 +
   /* McASP specific fields */
   int tdm_slots;
   u8 op_mode;
 diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c
 index adadcd3..8811d25 100644
 --- a/sound/soc/davinci/davinci-i2s.c
 +++ b/sound/soc/davinci/davinci-i2s.c
 @@ -68,16 +68,23 @@
  #define DAVINCI_MCBSP_RCR_RDATDLY(v) ((v)  16)
  #define DAVINCI_MCBSP_RCR_RFIG   (1  18)
  #define DAVINCI_MCBSP_RCR_RWDLEN2(v) ((v)  21)
 +#define DAVINCI_MCBSP_RCR_RFRLEN2(v) ((v)  24)
 +#define DAVINCI_MCBSP_RCR_RPHASE (1  31)
  
  #define DAVINCI_MCBSP_XCR_XWDLEN1(v) ((v)  5)
  #define DAVINCI_MCBSP_XCR_XFRLEN1(v) ((v)  8)
  #define DAVINCI_MCBSP_XCR_XDATDLY(v) ((v)  16)
  #define DAVINCI_MCBSP_XCR_XFIG   (1  18)
  #define DAVINCI_MCBSP_XCR_XWDLEN2(v) ((v)  21)
 +#define DAVINCI_MCBSP_XCR_XFRLEN2(v) ((v)  24)
 +#define DAVINCI_MCBSP_XCR_XPHASE (1  31)
  
 +
 +#define CLKGDV(v)(v) /* Bits 0:7 */

Should you not have a DAVINCI prefix here too ?

  #define DAVINCI_MCBSP_SRGR_FWID(v)   ((v)  8)
  #define DAVINCI_MCBSP_SRGR_FPER(v)   ((v)  16)
  #define DAVINCI_MCBSP_SRGR_FSGM  (1  28)
 +#define DAVINCI_MCBSP_SRGR_CLKSM (1  29)
  
  #define DAVINCI_MCBSP_PCR_CLKRP  (1  0)
  #define DAVINCI_MCBSP_PCR_CLKXP  (1  1)
 @@ -144,8 +151,17 @@ struct davinci_mcbsp_dev {
* won't end up being swapped because of the underrun.
*/
   unsigned enable_channel_combine:1;
 +
 + int i2s_fast_clock;
 +};
 +
 +struct davinci_mcbsp_data {
 + unsigned intfmt;
 + int clk_div;
  };
  
 +static struct davinci_mcbsp_data mcbsp_data;
 +

This struct should be part of the dai private data.

  static inline void davinci_mcbsp_write_reg(struct davinci_mcbsp_dev *dev,
  int reg, u32 val)
  {
 @@ -255,24 +271,27 @@ static int davinci_i2s_set_dai_fmt(struct snd_soc_dai 
 *cpu_dai,
   unsigned int pcr;
   unsigned int srgr;
   srgr = DAVINCI_MCBSP_SRGR_FSGM |
 - DAVINCI_MCBSP_SRGR_FPER(DEFAULT_BITPERSAMPLE * 2 - 1) |
 - DAVINCI_MCBSP_SRGR_FWID(DEFAULT_BITPERSAMPLE - 1);
 +DAVINCI_MCBSP_SRGR_FPER(DEFAULT_BITPERSAMPLE * 2 - 1) |
 +DAVINCI_MCBSP_SRGR_FWID(DEFAULT_BITPERSAMPLE - 1);
 + /* Attention srgr is updated by hw_params! */
  
 + mcbsp_data.fmt = fmt;
   /* set master/slave audio interface */
   switch (fmt  SND_SOC_DAIFMT_MASTER_MASK) {
 + case SND_SOC_DAIFMT_CBS_CFM:
   case SND_SOC_DAIFMT_CBS_CFS:
   /* cpu is master */
   pcr = DAVINCI_MCBSP_PCR_FSXM |
 - DAVINCI_MCBSP_PCR_FSRM |
 - DAVINCI_MCBSP_PCR_CLKXM |
 - DAVINCI_MCBSP_PCR_CLKRM;
 +   DAVINCI_MCBSP_PCR_FSRM |
 +   DAVINCI_MCBSP_PCR_CLKXM |
 +   DAVINCI_MCBSP_PCR_CLKRM;
   break;
   case SND_SOC_DAIFMT_CBM_CFS:
   /* McBSP CLKR pin is the input for the Sample Rate Generator.
* McBSP FSR and FSX are 

Re: [PATCH 0/4]-V3 TPS6507x MFD driver

2010-04-06 Thread Liam Girdwood
Hi Samuel,

Please feel free to upstream via MFD.

On Tue, 2010-04-06 at 11:51 +0100, Mark Brown wrote:
 On Mon, Apr 05, 2010 at 08:23:55PM -0600, Todd Fischer wrote:
 
  This is the third posting of the TPS6507x driver set.  I have
  resolved the concurrent access issue identified by Mark Brown.
  Instead of using a mutex, I used the i2c_transfer() as done in
  the similar routine in the wm8400-core.c file.
 
 All
 
 Acked-by: Mark Brown broo...@opensource.wolfsonmicro.com

Signed-off-by: Liam Girdwood l...@slimlogic.co.uk

-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [alsa-devel] [PATCH v2 1/5] MFD: DaVinci Voice Codec

2010-03-12 Thread Liam Girdwood
On Thu, 2010-03-11 at 09:32 -0600, miguel.agui...@ridgerun.com wrote:
 From: Miguel Aguilar miguel.agui...@ridgerun.com
 
 This is the MFD driver for the DaVinci Voice codec, it has two clients:
 
 * Voice codec interface
 * Voice codec CQ93VC
 
 Signed-off-by: Miguel Aguilar miguel.agui...@ridgerun.com

Please CC the MFD maintainer too for this one.

Thanks

Liam

-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [alsa-devel] [PATCH v2 2/5] ASoC: DaVinci: Voice Codec Interface

2010-03-12 Thread Liam Girdwood
On Thu, 2010-03-11 at 09:32 -0600, miguel.agui...@ridgerun.com wrote:
 From: Miguel Aguilar miguel.agui...@ridgerun.com
 
 This patch adds the support for the interface needed by the DaVinci
 Voice Codec CQ93VC.
 
 Signed-off-by: Miguel Aguilar miguel.agui...@ridgerun.com
 ---

snip

 +
 +static int davinci_vcif_hw_params(struct snd_pcm_substream *substream,
 +   struct snd_pcm_hw_params *params,
 +   struct snd_soc_dai *dai)
 +{
 + struct davinci_vcif_dev *davinci_vcif_dev = dai-private_data;
 + struct davinci_vc *davinci_vc = davinci_vcif_dev-davinci_vc;
 + struct davinci_pcm_dma_params *dma_params =
 + davinci_vcif_dev-dma_params[substream-stream];
 + u32 w;
 +
 + /* Restart the codec before setup */
 + davinci_vcif_stop(substream);
 + davinci_vcif_start(substream);
 +
 + /* General line settings */
 + writel(DAVINCI_VC_CTRL_MASK, davinci_vc-base + DAVINCI_VC_CTRL);
 +
 + writel(DAVINCI_VC_INT_MASK, davinci_vc-base + DAVINCI_VC_INTCLR);
 +
 + writel(DAVINCI_VC_INT_MASK, davinci_vc-base + DAVINCI_VC_INTEN);
 +
 + w = readl(davinci_vc-base + DAVINCI_VC_CTRL);
 +
 + /* Determine xfer data type */
 + switch (params_format(params)) {
 + case SNDRV_PCM_FORMAT_U8:
 + dma_params-data_type = 0;
 +
 + MOD_REG_BIT(w, DAVINCI_VC_CTRL_RD_BITS_8 |
 + DAVINCI_VC_CTRL_RD_UNSIGNED |
 + DAVINCI_VC_CTRL_WD_BITS_8 |
 + DAVINCI_VC_CTRL_WD_UNSIGNED, 1);
 + break;
 + case SNDRV_PCM_FORMAT_S8:
 + dma_params-data_type = 1;
 +
 + MOD_REG_BIT(w, DAVINCI_VC_CTRL_RD_BITS_8 |
 + DAVINCI_VC_CTRL_WD_BITS_8, 1);
 +
 + MOD_REG_BIT(w, DAVINCI_VC_CTRL_RD_UNSIGNED |
 + DAVINCI_VC_CTRL_WD_UNSIGNED, 0);
 + break;
 + case SNDRV_PCM_FORMAT_S16_LE:
 + dma_params-data_type = 2;
 +
 + MOD_REG_BIT(w, DAVINCI_VC_CTRL_RD_BITS_8 |
 + DAVINCI_VC_CTRL_RD_UNSIGNED |
 + DAVINCI_VC_CTRL_WD_BITS_8 |
 + DAVINCI_VC_CTRL_WD_UNSIGNED, 0);
 + break;
 + default:
 + printk(KERN_WARNING davinci-vcif: unsupported PCM format);
 + return -EINVAL;
 + }
 +
 + dma_params-acnt  = dma_params-data_type;
 +
 + writel(w, davinci_vc-base + DAVINCI_VC_CTRL);
 +
 + return 0;
 +}
 +
 +static int davinci_vcif_trigger(struct snd_pcm_substream *substream, int cmd,
 + struct snd_soc_dai *dai)
 +{
 + int ret = 0;
 +
 + switch (cmd) {
 + case SNDRV_PCM_TRIGGER_START:
 + case SNDRV_PCM_TRIGGER_RESUME:
 + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
 + davinci_vcif_start(substream);
 + case SNDRV_PCM_TRIGGER_STOP:
 + case SNDRV_PCM_TRIGGER_SUSPEND:
 + case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
 + davinci_vcif_stop(substream);
 + break;
 + default:
 + ret = -EINVAL;
 + }
 +
 + return ret;
 +}
 +
 +#define DAVINCI_VCIF_RATES   SNDRV_PCM_RATE_8000_48000
 +
 +static struct snd_soc_dai_ops davinci_vcif_dai_ops = {
 + .trigger= davinci_vcif_trigger,
 + .hw_params  = davinci_vcif_hw_params,
 +};
 +
 +struct snd_soc_dai davinci_vcif_dai = {
 + .name = davinci-vcif,
 + .playback = {
 + .channels_min = 1,
 + .channels_max = 2,
 + .rates = DAVINCI_VCIF_RATES,
 + .formats = SNDRV_PCM_FMTBIT_S16_LE,},
 + .capture = {
 + .channels_min = 1,
 + .channels_max = 2,
 + .rates = DAVINCI_VCIF_RATES,
 + .formats = SNDRV_PCM_FMTBIT_S16_LE,},

Your hw_params() supports more formats than just this one.

Liam

-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [alsa-devel] [PATCH] ASoC: DaVinci: Add hw_param callback for S/PDIF DIT link

2010-03-10 Thread Liam Girdwood
On Wed, 2010-03-10 at 14:48 +0530, Chaithrika U S wrote:
 On TI DM6467 EVM, S/PDIF DIT codec fails to open as it is unable to install
 hardware params. This dummy codec has no set_fmt and set_sysclk 
 implementations
 and calls from the application to these functions cause errors. This patch 
 adds
 a new hardware params callback function for S/PDIF transciever codec.
 
 Signed-off-by: Chaithrika U S chaithr...@ti.com
 Tested-by: Anuj Aggarwal anuj.aggar...@ti.com

Acked-by: Liam Girdwood l...@slimlogic.co.uk

-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source