28 Feb, 2019

1 commit

  • …ie/sound into for-next

    ASoC: More changes for v5.1

    Another batch of changes for ASoC, no big core changes - it's mainly
    small fixes and improvements for individual drivers.

    - A big refresh and cleanup of the Samsung drivers, fixing a number of
    issues which allow the driver to be used with a wider range of
    userspaces.
    - Fixes for the Intel drivers to make them more standard so less likely
    to get bitten by core issues.
    - New driver for Cirrus Logic CS35L26.

    Takashi Iwai
     

15 Feb, 2019

1 commit


13 Feb, 2019

2 commits

  • There are currently two ways to specify custom DMA channel names:
    - through the SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME flag and
    snd_dmaengine_dai_dma_data data structure,
    - through chan_names field of struct snd_dmaengine_pcm_config.

    In order to replace the DAI DMA data method with the custom DMA config
    one on non-DT platforms the dmaengine_pcm_new() function is extended
    to also consider channel names specified in the custom DMA config.
    If both config->chan_names and dma_data->chan_name are provided
    the former will be used.

    Signed-off-by: Sylwester Nawrocki
    Acked-by: Krzysztof Kozlowski
    Signed-off-by: Mark Brown

    Sylwester Nawrocki
     
  • Currently when of_node of the "PCM" device is null
    dmaengine_pcm_request_chan_of() function will bail out, including cases
    when custom DMA device is intended to be used. To have the channels
    properly requested when custom DMA device is provided extend the of_node
    test to also consider dma_dev->of_node.

    Signed-off-by: Sylwester Nawrocki
    Acked-by: Krzysztof Kozlowski
    Signed-off-by: Mark Brown

    Sylwester Nawrocki
     

07 Feb, 2019

1 commit


19 Aug, 2018

1 commit

  • Pull DMAengine updates from Vinod Koul:
    "This round brings couple of framework changes, a new driver and usual
    driver updates:

    - new managed helper for dmaengine framework registration

    - split dmaengine pause capability to pause and resume and allow
    drivers to report that individually

    - update dma_request_chan_by_mask() to handle deferred probing

    - move imx-sdma to use virt-dma

    - new driver for Actions Semi Owl family S900 controller

    - minor updates to intel, renesas, mv_xor, pl330 etc"

    * tag 'dmaengine-4.19-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (46 commits)
    dmaengine: Add Actions Semi Owl family S900 DMA driver
    dt-bindings: dmaengine: Add binding for Actions Semi Owl SoCs
    dmaengine: sh: rcar-dmac: Should not stop the DMAC by rcar_dmac_sync_tcr()
    dmaengine: mic_x100_dma: use the new helper to simplify the code
    dmaengine: add a new helper dmaenginem_async_device_register
    dmaengine: imx-sdma: add memcpy interface
    dmaengine: imx-sdma: add SDMA_BD_MAX_CNT to replace '0xffff'
    dmaengine: dma_request_chan_by_mask() to handle deferred probing
    dmaengine: pl330: fix irq race with terminate_all
    dmaengine: Revert "dmaengine: mv_xor_v2: enable COMPILE_TEST"
    dmaengine: mv_xor_v2: use {lower,upper}_32_bits to configure HW descriptor address
    dmaengine: mv_xor_v2: enable COMPILE_TEST
    dmaengine: mv_xor_v2: move unmap to before callback
    dmaengine: mv_xor_v2: convert callback to helper function
    dmaengine: mv_xor_v2: kill the tasklets upon exit
    dmaengine: mv_xor_v2: explicitly freeup irq
    dmaengine: sh: rcar-dmac: Add dma_pause operation
    dmaengine: sh: rcar-dmac: add a new function to clear CHCR.DE with barrier
    dmaengine: idma64: Support dmaengine_terminate_sync()
    dmaengine: hsu: Support dmaengine_terminate_sync()
    ...

    Linus Torvalds
     

27 Jul, 2018

1 commit

  • The conversion from PCM format type to bits needs an explicit cast,
    and it'll be uglier. Since we have a standard macro for that, let's
    use it instead.

    This patch fixes the sparse warning:
    sound/soc/soc-generic-dmaengine-pcm.c:200:63: warning: restricted snd_pcm_format_t degrades to integer

    Signed-off-by: Takashi Iwai
    Signed-off-by: Mark Brown

    Takashi Iwai
     

26 Jul, 2018

1 commit

  • It seems that __user prefix was forgotten to be added to
    dmaengine_copy_user callback while we refactored the user-copy PCM
    core.

    This patch adds the missing prefix, remove the superfluous cast, and
    add the needed cast (__force is needed for downgrading from user
    pointer to kernel pointer), too.

    Spotted by a sparse warning like:
    sound/soc/soc-generic-dmaengine-pcm.c:397:27: warning: incorrect type in initializer (incompatible argument 4 (different address spaces))

    Signed-off-by: Takashi Iwai
    Signed-off-by: Mark Brown

    Takashi Iwai
     

10 Jul, 2018

1 commit

  • 'cmd_pause' DMA channel capability means that respective DMA engine
    supports both pausing and resuming given DMA channel. However, in some
    cases it is important to know if DMA channel can be paused without the
    need to resume it. This is a typical requirement for proper residue
    reading on transfer timeout in UART drivers. There are also some DMA
    engines with limited hardware, which doesn't really support resuming.

    Reporting pause and resume capabilities separately allows UART drivers to
    properly check for the really required capabilities and operate in DMA
    mode also in systems with limited DMA hardware. On the other hand drivers,
    which rely on full channel suspend/resume support, should now check for
    both 'pause' and 'resume' features.

    Existing clients of dma_get_slave_caps() have been checked and the only
    driver which rely on proper channel resuming is soc-generic-dmaengine-pcm
    driver, which has been updated to check the newly added capability.
    Existing 'cmd_pause' now only indicates that DMA engine support pausing
    given DMA channel.

    Signed-off-by: Marek Szyprowski
    Acked-by: Mark Brown
    Signed-off-by: Vinod Koul

    Marek Szyprowski
     

02 Jul, 2018

1 commit


27 Feb, 2018

1 commit

  • This reverts commit f91b1e73ccde71d4bc69ae10d475196df38844ab.

    As explained by Lars-Peter Clausen:

    "This creates a resource leak. dmaengine_pcm_request_chan_of() requests
    bothtransmit and receive channels. It might return with an error if one
    of them fails, but the other one succeeded. In this case we need to call
    dmaengine_pcm_release_chan() to free the requested channel"

    So revert the commit.

    Signed-off-by: Fabio Estevam
    Signed-off-by: Mark Brown

    Fabio Estevam
     

26 Feb, 2018

4 commits


22 Feb, 2018

1 commit

  • After the conversion from platform to component the following warnings
    are seen:

    fsl-ssi-dai 2028000.ssi: ASoC: Failed to create component debugfs
    directory
    fsl-spdif-dai 2004000.spdif: ASoC: Failed to create component debugfs
    directory

    As explained by Mark Brown:

    "It's a legit warning - we shouldn't really be creating two components
    for the same device. However this is a bit of a corner case as it's the
    dmaengine platform driver which is kind of a virtual device, it's not
    really the device that we use with DMA that's being represented but
    rather the link between that and the DMA controller."

    Disambiguate the DMA component name by adding a "dma" debugfs_prefix
    entry.

    Suggested-by: Mark Brown
    Signed-off-by: Fabio Estevam
    Signed-off-by: Mark Brown

    Fabio Estevam
     

12 Feb, 2018

1 commit


24 Jan, 2017

1 commit

  • This reverts commit c6644119a3f80ea644bde10009d5e1013b5aff29 and
    restores the ability to specify DMA channel names per DAI dma_data.
    Unfortunately the functionality removed in the patch being reverted
    cannot be entirely replaced by specifying DMA channel names in struct
    snd_dmaengine_pcm_config as that does not cover devices with more than
    2 DMA channels.

    Together with patch "ASoC: Revert "samsung: Remove unneeded
    initialization of chan_name"" this fixes broken sound on the s3c24xx
    SoC platforms.

    Signed-off-by: Sylwester Nawrocki
    Signed-off-by: Mark Brown

    Sylwester Nawrocki
     

26 Oct, 2016

1 commit

  • Since commit 194c7dea00c68c1b1f8ff26304fa937a006f66dd
    "ASoC: dmaengine: add custom DMA config to snd_dmaengine_pcm_config"
    custom DMA channels can be also specified in chan_names[] field of
    struct snd_dmaengine_pcm_config. This patch removes chan_name field
    of struct snd_dmaengine_dai_dma_data as it is now unused.

    Signed-off-by: Sylwester Nawrocki
    Acked-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown

    Sylwester Nawrocki
     

28 Apr, 2016

1 commit

  • dmaengine_pcm currently only supports setups where FIFO reads/writes
    correspond to exactly one sample, eg 16-bit sample data is transferred
    via 16-bit FIFO accesses, 32-bit data via 32-bit accesses.

    This patch adds support for setups with fixed width FIFOs where
    multiple samples are packed into a larger word.

    For example setups with a 32-bit wide FIFO register that expect
    16-bit sample transfers to be done with the left+right sample data
    packed into a 32-bit word.

    Support for packed transfers is controlled via the
    SND_DMAENGINE_PCM_DAI_FLAG_PACK flag in snd_dmaengine_dai_dma_data.flags

    If this flag is set dmaengine_pcm doesn't put any restriction on the
    supported formats and sets the DMA transfer width to undefined.

    This means control over the constraints is now transferred to the DAI
    driver and it's responsible to provide proper configuration and
    check for possible corner cases that aren't handled by the ALSA core.

    Signed-off-by: Matthias Reichl
    Acked-by: Lars-Peter Clausen
    Tested-by: Martin Sperl
    Signed-off-by: Mark Brown

    Matthias Reichl
     

28 Apr, 2015

1 commit

  • Whether residue can be reported or not is not a property of the audio
    controller but of the DMA controller. The FLAG_NO_RESIDUE was initially
    added when the DMAengine framework had no support for describing the residue
    reporting capabilities of the controller. Support for this was added quite a
    while ago and recently the DMAengine framework started to complain if a
    driver does not describe its capabilities and a lot of patches have been
    merged that add support for this where it was missing. So it should be safe
    to assume that driver on actively used platforms properly implement the DMA
    capabilities API.

    This patch makes the FLAG_NO_RESIDUE internal and no longer allows audio
    controller drivers to manually set the flag. If a DMA driver against
    expectations does not support reporting its capabilities for now the generic
    DMAengine PCM driver will now emit a warning and simply assume that residue
    reporting is not supported. In the future this might be changed to aborting
    with an error.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown

    Lars-Peter Clausen
     

19 Feb, 2015

1 commit

  • Pull dmaengine updates from Vinod Koul:
    "This update brings:

    - the big cleanup up by Maxime for device control and slave
    capabilities. This makes the API much cleaner.

    - new IMG MDC driver by Andrew

    - new Renesas R-Car Gen2 DMA Controller driver by Laurent along with
    bunch of fixes on rcar drivers

    - odd fixes and updates spread over driver"

    * 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (130 commits)
    dmaengine: pl330: add DMA_PAUSE feature
    dmaengine: pl330: improve pl330_tx_status() function
    dmaengine: rcar-dmac: Disable channel 0 when using IOMMU
    dmaengine: rcar-dmac: Work around descriptor mode IOMMU errata
    dmaengine: rcar-dmac: Allocate hardware descriptors with DMAC device
    dmaengine: rcar-dmac: Fix oops due to unintialized list in error ISR
    dmaengine: rcar-dmac: Fix spinlock issues in interrupt
    dmaenegine: edma: fix sparse warnings
    dmaengine: rcar-dmac: Fix uninitialized variable usage
    dmaengine: shdmac: extend PM methods
    dmaengine: shdmac: use SET_RUNTIME_PM_OPS()
    dmaengine: pl330: fix bug that cause start the same descs in cyclic
    dmaengine: at_xdmac: allow muliple dwidths when doing slave transfers
    dmaengine: at_xdmac: simplify channel configuration stuff
    dmaengine: at_xdmac: introduce save_cc field
    dmaengine: at_xdmac: wait for in-progress transaction to complete after pausing a channel
    ioat: fail self-test if wait_for_completion times out
    dmaengine: dw: define DW_DMA_MAX_NR_MASTERS
    dmaengine: dw: amend description of dma_dev field
    dmatest: move src_off, dst_off, len inside loop
    ...

    Linus Torvalds
     

06 Jan, 2015

1 commit


22 Dec, 2014

1 commit


19 Aug, 2014

1 commit

  • The platform and CODEC probe and remove code is now largely identical. This
    patch consolidates it at the component level.

    The resulting code is slightly larger due to all the boiler plate code setting
    up the indirection for the table based control and DAPM registration. Once all
    drivers have been update to no longer use the snd_soc_codec_driver and
    snd_soc_platform_driver specific fields for this the indirection can be removed
    again.

    This patch contains two noteworthy hacks that are only meant to be temporary to
    be able to update drivers and the core in separate incremental patches.

    The first hack is related to that some DPCM platforms expect that the DAPM
    widgets for the DAIs of a snd_soc_component are created in the DAPM context of
    the snd_soc_platform that has the same parent device. For handling this the
    steal_sibling_dai_widgets attribute is introduced. It gets set for
    snd_soc_platforms that register DAPM elements. When creating the DAI widgets for
    a component this flag is checked and if it is found on one of the siblings the
    component will not create any DAI widgets in its own DAPM context. If the
    attribute is set on a platform it will look for siblings components and create
    DAI widgets for them in its own context. The fix for this will be to update
    the offending drivers to only register a single component rather than two.

    The second hack deals with the fact that the ASoC card suspend and resume code
    still needs a list of CODECs that have been registered for the card. To handle
    this the generic probe and remove path have a check to see if the component is
    CODEC and if yes add/remove it to the card's CODEC list. While it is possible to
    clean up the suspend/resume code to not need the CODEC list anymore this is a
    bit of a chicken and egg problem since it will become easier to clean up the
    suspend/resume code once there is a unified component layer.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown

    Lars-Peter Clausen
     

05 Jul, 2014

1 commit


16 Jan, 2014

1 commit


15 Jan, 2014

2 commits

  • The dmaengine framework now exposes the granularity with which it is able to
    report the transfer residue for a certain DMA channel. Check the granularity in
    the generic dmaengine PCM driver and
    a) Set the SNDRV_PCM_INFO_BATCH if the granularity is per period or worse.
    b) Fallback to the (race condition prone) period counting if the driver does
    not support any residue reporting.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown

    Lars-Peter Clausen
     
  • Currently we have two different snd_soc_platform_driver structs in the generic
    dmaengine PCM driver. One for dmaengine drivers that support residue reporting
    and one for those which do not. When registering the PCM component we check
    whether the NO_RESIDUE flag is set or not and use the corresponding
    snd_soc_platform_driver. This patch modifies the driver to only have one
    snd_soc_platform_driver struct where the pointer() callback checks the
    NO_RESIDUE flag at runtime. This allows us to set the NO_RESIDUE flag after the
    PCM component has been registered. This becomes necessary when querying whether
    the dmaengine driver supports residue reporting from the dmaengine driver itself
    since the DMA channel might only be requested after the PCM component has been
    registered.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown

    Lars-Peter Clausen
     

17 Dec, 2013

1 commit

  • Because the "ASoC: dmaengine-pcm: Provide default config" has provided
    us one defualt config of DMA. When using this, the config parameter of
    devm_snd_dmaengine_pcm_register() will be NULL, so here we need to have
    a check before using it.

    Signed-off-by: Xiubo Li
    Acked-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown

    Xiubo Li
     

12 Dec, 2013

1 commit

  • Check the return value of dma_request_slave_channel_reason() to see if
    deferred probe happens, not the variable the return value will be
    assigned to later.

    Reported-by: kbuild test robot
    Fixes: 5eda87b890f8 ("ASoC: dmaengine: support deferred probe for DMA channels")
    Signed-off-by: Stephen Warren
    Signed-off-by: Mark Brown

    Stephen Warren
     

11 Dec, 2013

1 commit

  • Enhance dmaengine_pcm_request_chan_of() to support deferred probe for
    DMA channels, by using the new dma_request_slave_channel_or_err() API.
    This prevents snd_dmaengine_pcm_register() from succeeding without
    acquiring DMA channels due to the relevant DMA controller not yet being
    registered.

    Signed-off-by: Stephen Warren
    Acked-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown

    Stephen Warren
     

10 Dec, 2013

4 commits

  • Add fields to struct snd_dmaengine_pcm_config to allow custom:

    - DMA channel names.

    This is useful when the default "tx" and "rx" channel names don't
    apply, for example if a HW module supports multiple channels, each
    having different DMA channel names. This is the case with the FIFOs
    in Tegra's AHUB. This new facility can replace
    SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME.

    - DMA device

    This allows requesting DMA channels for a device other than the device
    which is registering the "PCM" driver. This is quite unusual, but is
    currently useful on Tegra. In much HW, and in Tegra20, each DAI HW
    module contains its own FIFOs which DMA writes to. However, in Tegra30,
    the DMA FIFOs were split out AHUB HW module, which then routes the data
    through a cross-bar, and into the DAI HW modules. However, the current
    ASoC driver structure does not expose this detail, and acts as if the
    FIFOs are still part of the DAI HW modules. Consequently, the "PCM"
    driver is registered with the DAI HW module, yet the DMA channels must
    be looked up in the AHUB HW module's device tree node. This new config
    field allows that to happen. Eventually, the Tegra drivers will be
    reworked to fully expose the AHUB, and this config field can be
    removed.

    Signed-off-by: Stephen Warren
    Acked-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown

    Stephen Warren
     
  • Mark Brown
     
  • If snd_dmaengine_pcm_register()'s call to snd_soc_add_platform() fails,
    all objects allocated during registration are leaked. Fix this by adding
    error-handling code.

    Signed-off-by: Stephen Warren
    Acked-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown

    Stephen Warren
     
  • Restructure the internals of dmaengine_pcm_request_chan_of() as a loop
    over all channels to be allocated. This makes it easier to add logic
    that applies to all allocated channels, without having to duplicate that
    logic in each of the half-duplex/full-duplex paths.

    Signed-off-by: Stephen Warren
    Acked-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown

    Stephen Warren
     

02 Dec, 2013

1 commit


08 Nov, 2013

2 commits


07 Nov, 2013

1 commit

  • We currently assume that the DMA Slave Config will be fully populated
    by the platform, however some DMA Engines make decisions based on zero
    (default) flags such as DMA_SLAVE_BUSWIDTH_UNDEFINED and as this is a
    static declaration we need to memset it to clear the data area.

    Signed-off-by: Lee Jones
    Acked-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown

    Lee Jones