21 Jul, 2011

2 commits

  • In davinci_vcif_trigger() function, a break() statement was missing
    causing the davinci_vcif_stop() function to be called as a fallback
    after calling davinci_vcif_start().

    Signed-off-by: Rajashekhara, Sudhakar
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown
    Cc: stable@kernel.org

    Rajashekhara, Sudhakar
     
  • 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
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown
    Cc: stable@kernel.org

    Rajashekhara, Sudhakar
     

08 Jun, 2011

1 commit


06 Jun, 2011

1 commit


30 May, 2011

1 commit


27 May, 2011

1 commit

  • With the addition of a platform device mfd_cell pointer, MFD drivers
    can go back to passing platform back to their sub drivers.
    This allows for an mfd_cell->mfd_data removal and thus keep the
    sub drivers MFD agnostic. This is mostly needed for non MFD aware
    sub drivers.

    Cc: Miguel Aguilar
    Cc: Mark Brown
    Cc: Liam Girdwood
    Signed-off-by: Samuel Ortiz

    Samuel Ortiz
     

25 May, 2011

7 commits

  • In the previous commit 'ASoC: davinci-pcm: convert to BATCH mode', the phase
    offset of 2 was mentioned in the commit message but not well commented in the
    source.

    Add descriptive comments of the phase offset with and without ping-pong
    buffers enabled.

    Signed-off-by: Ben Gardiner
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Ben Gardiner
     
  • The davinci-pcm driver's snd_pcm_ops pointer function currently calls into
    the edma controller driver to read the current positions of the edma channels
    to determine pos to return to the ALSA framework. In particular,
    davinci_pcm_pointer() calls edma_get_position() and the latter has a comment
    indicating that "Its channel should not be active when this is called" whereas
    the channel is surely active when snd_pcm_ops.pointer is called.

    The operation of davinci-pcm in capture and playback appears to follow close
    the other pcm drivers who export SNDRV_PCM_INFO_BATCH except that davinci-pcm
    does not report it's positions from pointer() using the last transferred
    chunk. Instead it peeks directly into the edma controller to determine the
    current position as discussed above.

    Convert the davinci-pcm driver to BATCH mode: count the periods elapsed in the
    prtd->period member and use its value to report the 'pos' to the alsa
    framework in the davinci_pcm_pointer function.

    There is a phase offset of 2 periods between the position used by dma setup
    and the position reported in the pointer function. Either +2 in the dma
    setup or -2 in the pointer function (with wrapping, both) accounts for this
    offset -- I opted for the latter since it makes the first-time setup clearer.

    Signed-off-by: Ben Gardiner
    Reviewed-by: Steven Faludi
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Ben Gardiner
     
  • Extract functions that modify the prtd->period member in preparation for
    conversion to BATCH mode playback.

    Signed-off-by: Ben Gardiner
    Reviewed-by: Steven Faludi
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Ben Gardiner
     
  • The release of the dma channels was being performed in prepare and there was a
    edma_resume call for the asp-channel only being executed on START, RESUME and
    PAUSE_RELEASE.

    The mcasp on da850evm with ping-pong buffers enabled was exhibiting an audible
    glitch on every playback after the first. It was determined through trial and
    error that the following two changes fix this problem:

    1) Move the edma_start calls from prepare to trigger and 2) reverse the order
    of starting the asp and ram channels.

    Signed-off-by: Ben Gardiner
    Reviewed-by: Steven Faludi
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Ben Gardiner
     
  • Based on the registration of davinci-mcasp.1 in the davinci-evm platform
    setup for da830 and dm6467, davinci-pcm can handle more than the currently
    reported maximum channels of 2.

    Increase the maximum channels to 384 to match the maximum reported by
    davinci-mcasp.1.

    Signed-off-by: Ben Gardiner
    Reviewed-by: Steven Faludi
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Ben Gardiner
     
  • Based on the data_type test in ping_pong_dma_setup, davinci-pcm is capable of
    handling data of width up to and including 32bits.

    "
    if ((data_type == 0) || (data_type > 4)) {
    printk(KERN_ERR "%s: data_type=%i\n", __func__, data_type);
    return -EINVAL;
    }
    "

    Update the .format member of the snd_pcm_hardware instances it registers to
    reflect this capability.

    Signed-off-by: Ben Gardiner
    Reviewed-by: Steven Faludi
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Ben Gardiner
     
  • The setup of the pong channel uses EDMA_CHAN_SLOT instead of & 0x3f as the
    setup of the ping channel does.

    Make the setup of ping and pong symmetric. There is no functional change
    introduced by this patch.

    Signed-off-by: Ben Gardiner
    Reviewed-by: Steven Faludi
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Ben Gardiner
     

20 May, 2011

1 commit


26 Apr, 2011

4 commits

  • The current davinci_mcasp_set_dai_fmt() sets bits ACLKX and ACLKR in the PDIR
    register for the codec clock-master/frame-slave mode; however, this results in
    the ACLKX and ACLKR pins being outputs according to SPRUFM1 [1] which
    conflicts with "codec is clock master."

    Similarly to the previous patch in this series, "fix _CBM_CFS hw_params" --
    For codec clock-master/frame-slave mode (_CMB_CFS), clear bits ACLKX and ACLKR
    in the PDIR register to set the pins as inputs and hence allow externally
    sourced bit-clocks.

    [1] http://www.ti.com/litv/pdf/sprufm1

    Signed-off-by: Ben Gardiner
    Reviewed-by: James Nuss
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Ben Gardiner
     
  • The current davinci_mcasp_set_dai_fmt() sets bits ACLKXE and ACLKRE (CLKXM
    and CLKRM as they are reffered to in SPRUFM1 [1]) for codec clock-slave/
    frame-slave mode (_CBS_CFS) which selects internally generated bit-clock and
    frame-sync signals; however, it does the same thing again for codec
    clock-master/frame-slave mode (_CBM_CFS) in the very next case statement which
    is incorrectly selecting internally generated bit-clocks in this mode.

    For codec clock-master/frame-slave mode (_CBM_CFS), clear bits ACLKXE and
    ACLKRE to select externally-generated bit-clocks.

    [1] http://www.ti.com/litv/pdf/sprufm1

    Signed-off-by: Ben Gardiner
    Reviewed-by: James Nuss
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Ben Gardiner
     
  • The current driver creates value for set/clr of PDIR using (x<
    Reviewed-by: James Nuss
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Ben Gardiner
     
  • The current check for the number of tdm-slots specified by platform data is
    always true (x >= 2 || x
    Reviewed-by: James Nuss
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Ben Gardiner
     

23 Mar, 2011

1 commit


10 Feb, 2011

3 commits


04 Feb, 2011

1 commit


22 Jan, 2011

1 commit

  • 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
    Tested-by: Dan Sharon
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown
    Cc: stable@kernel.org (for 2.6.37)

    Rajashekhara, Sudhakar
     

05 Jan, 2011

1 commit


25 Nov, 2010

2 commits


22 Nov, 2010

1 commit


18 Nov, 2010

2 commits

  • Mark Brown
     
  • 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.

    --

    The multi-component commit put the initialisation of
    snd_soc_dai.[capture|playback]_dma_data into snd_soc_dai_ops.hw_params of the
    McBSP, McASP & VCIF drivers (davinci-i2s.c, davinci-mcasp.c & davinci-vcif.c).
    The initialisation had to be moved from the probe function in these drivers
    because davinci_*_dai changed from snd_soc_dai to snd_soc_dai_driver.

    Unfortunately, the DMA params pointer is needed by davinci_pcm_open (in
    davinci-pcm.c) before hw_params is called. I have moved the initialisation to
    a new snd_soc_dai_ops.startup function in each of these drivers. This fix
    indicates that all platforms that use davinci-pcm must have been broken and
    need to test with this fix.

    --

    The multi-component commit also changed the McBSP driver name from
    "davinci-asp" to "davinci-i2s" in davinci-i2s.c without updating the board
    level references to the driver name. This change is understandable, as there
    is a similarly named "davinci-mcasp" driver in davinci-mcasp.c.

    There is probably no 'correct' name for this driver. The DM6446 datasheet
    calls it the "ASP" and describes it as a "specialised McBSP". The DM355
    datasheet calls it the "ASP" and describes it as a "specialised ASP". The
    DM365 datasheet calls it the "McBSP". Rather than fix this problem by
    reverting to "davinci-asp", I've elected to avoid future confusion with the
    "davinci-mcasp" driver by changing it to "davinci-mcbsp", which is also
    consistent with the names of the functions in the driver. There are other
    fixes required, so it was never going to be as simple as a revert anyway.

    --

    The DM365 only has one McBSP port (of the McBSP platforms, only the DM355 has
    2 ports), so I've changed the the id of the platform_device from 0 to -1.

    --

    In davinci-evm.c, the DM6446 EVM can no longer share a snd_soc_dai_link
    structure with the DM355 EVM as they use different cpu DAI names (the DM355
    has 2 ports and the EVM uses the second port, but the DM6446 only has 1 port).
    This also means that the 2 boards need different snd_soc_card structures.

    --

    The codec_name entries in davinci-evm.c didn't match the i2c ids in the board
    files. I have only checked and fixed the details of the names used for the
    McBSP based platforms. Someone with a McASP based platform (eg DA8xx) should
    check the others.

    Signed-off-by: Chris Paulson-Ellis
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Chris Paulson-Ellis
     

06 Nov, 2010

1 commit

  • Decoupling Dynamic Audio Power Management (DAPM) from codec devices is
    required when developing ASoC further. Such as for other ASoC components to
    have DAPM widgets or when extending DAPM to handle cross-device paths.

    This patch decouples DAPM related variables from struct snd_soc_codec and
    moves them to new struct snd_soc_dapm_context that is used to encapsulate
    DAPM context of a device. ASoC core and API of DAPM functions are modified
    to use DAPM context instead of codec.

    This patch does not change current functionality and a large part of changes
    come because of structure and internal API changes.

    Core implementation is from Liam Girdwood with some
    minor core changes, codecs and machine driver conversions from
    Jarkko Nikula .

    Signed-off-by: Liam Girdwood
    Signed-off-by: Jarkko Nikula
    Cc: Nicolas Ferre
    Cc: Manuel Lauss
    Cc: Mike Frysinger
    Cc: Cliff Cai
    Cc: Kevin Hilman
    Cc: Ryan Mallon
    Cc: Timur Tabi
    Cc: Sascha Hauer
    Cc: Lars-Peter Clausen
    Cc: Arnaud Patard (Rtp)
    Cc: Wan ZongShun
    Cc: Eric Miao
    Cc: Jassi Brar
    Cc: Daniel Gloeckner
    Cc: Kuninori Morimoto
    Signed-off-by: Mark Brown

    Liam Girdwood
     

25 Oct, 2010

1 commit


19 Oct, 2010

1 commit

  • In this code, 0 is returned on failure, even though other
    failures return -ENOMEM or other similar values.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @a@
    identifier alloc;
    identifier ret;
    constant C;
    expression x;
    @@

    x = alloc(...);
    if (x == NULL) { }

    @@
    identifier f, a.alloc;
    expression ret;
    expression x,e1,e2,e3;
    @@

    ret = 0
    ... when != ret = e1
    *x = alloc(...)
    ... when != ret = e2
    if (x == NULL) { ... when != ret = e3
    return ret;
    }
    //

    Signed-off-by: Julia Lawall
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Julia Lawall
     

17 Oct, 2010

1 commit


05 Oct, 2010

1 commit

  • 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
    Signed-off-by: Martin Ambrose
    Signed-off-by: Mark Brown

    Troy Kisky
     

12 Aug, 2010

1 commit

  • This patch extends the ASoC API to allow sound cards to have more than one
    CODEC and more than one platform DMA controller. This is achieved by dividing
    some current ASoC structures that contain both driver data and device data into
    structures that only either contain device data or driver data. i.e.

    struct snd_soc_codec ---> struct snd_soc_codec (device data)
    +-> struct snd_soc_codec_driver (driver data)

    struct snd_soc_platform ---> struct snd_soc_platform (device data)
    +-> struct snd_soc_platform_driver (driver data)

    struct snd_soc_dai ---> struct snd_soc_dai (device data)
    +-> struct snd_soc_dai_driver (driver data)

    struct snd_soc_device ---> deleted

    This now allows ASoC to be more tightly aligned with the Linux driver model and
    also means that every ASoC codec, platform and (platform) DAI is a kernel
    device. ASoC component private data is now stored as device private data.

    The ASoC sound card struct snd_soc_card has also been updated to store lists
    of it's components rather than a pointer to a codec and platform. The PCM
    runtime struct soc_pcm_runtime now has pointers to all its components.

    This patch adds DAPM support for ASoC multi-component and removes struct
    snd_soc_socdev from DAPM core. All DAPM calls are now made on a card, codec
    or runtime PCM level basis rather than using snd_soc_socdev.

    Other notable multi-component changes:-

    * Stream operations now de-reference less structures.
    * close_delayed work() now runs on a DAI basis rather than looping all DAIs
    in a card.
    * PM suspend()/resume() operations can now handle N CODECs and Platforms
    per sound card.
    * Added soc_bind_dai_link() to bind the component devices to the sound card.
    * Added soc_dai_link_probe() and soc_dai_link_remove() to probe and remove
    DAI link components.
    * sysfs entries can now be registered per component per card.
    * snd_soc_new_pcms() functionailty rolled into dai_link_probe().
    * snd_soc_register_codec() now does all the codec list and mutex init.

    This patch changes the probe() and remove() of the CODEC drivers as follows:-

    o Make CODEC driver a platform driver
    o Moved all struct snd_soc_codec list, mutex, etc initialiasation to core.
    o Removed all static codec pointers (drivers now support > 1 codec dev)
    o snd_soc_register_pcms() now done by core.
    o snd_soc_register_dai() folded into snd_soc_register_codec().

    CS4270 portions:
    Acked-by: Timur Tabi

    Some TLV320aic23 and Cirrus platform fixes.
    Signed-off-by: Ryan Mallon

    TI CODEC and OMAP fixes
    Signed-off-by: Peter Ujfalusi
    Signed-off-by: Janusz Krzysztofik
    Signed-off-by: Jarkko Nikula

    Samsung platform and misc fixes :-
    Signed-off-by: Chanwoo Choi
    Signed-off-by: Joonyoung Shim
    Signed-off-by: Kyungmin Park
    Reviewed-by: Jassi Brar
    Signed-off-by: Seungwhan Youn

    MPC8610 and PPC fixes.
    Signed-off-by: Timur Tabi

    i.MX fixes and some core fixes.
    Signed-off-by: Sascha Hauer

    J4740 platform fixes:-
    Signed-off-by: Lars-Peter Clausen

    CC: Tony Lindgren
    CC: Nicolas Ferre
    CC: Kevin Hilman
    CC: Sascha Hauer
    CC: Atsushi Nemoto
    CC: Kuninori Morimoto
    CC: Daniel Gloeckner
    CC: Manuel Lauss
    CC: Mike Frysinger
    CC: Arnaud Patard
    CC: Wan ZongShun

    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Liam Girdwood
     

20 Jul, 2010

1 commit

  • 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
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Sekhar Nori
     

18 Jul, 2010

1 commit


13 Jul, 2010

1 commit


06 Jul, 2010

1 commit

  • i2s_accurate_sck switch can be used to have a better approximate
    sampling frequency.
    The clock is an externally visible bit clock and it is named
    i2s continuous serial clock (I2S_SCK).
    The trade off is between more accurate clock (fast clock)
    and less accurate clock (slow clock).
    The waveform will be not symmetric.
    Probably it is possible to get a better algorithm for calculating
    the divider, trying to keep a slower clock as possible.

    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
    Signed-off-by: Davide Bonfanti
    Acked-by: Liam Girdwood
    Acked-by: Sudhakar Rajashekhara
    Signed-off-by: Mark Brown

    Raffaele Recalcati