Renesas sound has SRC (= Sampling Rate Converter),
but, the HW implementation depends on its generation.
It was part of SRU on Gen1, and SCU on Gen2.
This SCU needs DMA transfer to use it.
Current rsnd driver is using it as DMA transfer buffer
(= no rate convert), and Gen1 is only supported at this point.
This patch cleanup it with focusing about SRC and Gen2 part.
ssi clock which is calculated from rsnd_ssi_master_clk_start()
should have flexibility since Renesas sound has
SRC (= Sampling Rate Converter).
But current implementation is using runtime->rate directly.
This patch tidyup rsnd_ssi_master_clk_start() parameter
as preparation of future SRC support
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Renesas sound has SRC (= Sampling Rate Converter),
but, the HW implementation depends on its generation.
It was part of SRU on Gen1, and SCU on Gen2.
This SCU needs DMA transfer to use it.
Current rsnd driver is using it as DMA transfer buffer
(= no rate convert), and Gen1 is only supported at this point.
This patch cleanup it with focusing about SRC and Gen2 part.
rsnd_scu_set_hpbif() is renamed to rsnd_scu_rate_ctrl(),
since its naming doesn't indicate the function meaning.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Renesas sound has SRC (= Sampling Rate Converter),
but, the HW implementation depends on its generation.
It was part of SRU on Gen1, and SCU on Gen2.
This SCU needs DMA transfer to use it.
Current rsnd driver is using it as DMA transfer buffer
(= no rate convert), and Gen1 is only supported at this point.
This patch cleanup it with focusing about SRC and Gen2 part.
SRC_CTRL/BUSIF_MODE are used for transfer start.
This patch adds rsnd_scu_transfer_start() and merge these
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Renesas sound has SRC (= Sampling Rate Converter),
but, the HW implementation depends on its generation.
It was part of SRU on Gen1, and SCU on Gen2.
This SCU needs DMA transfer to use it.
Current rsnd driver is using it as DMA transfer buffer
(= no rate convert), and Gen1 is only supported at this point.
This patch cleanup it with focusing about SRC and Gen2 part.
rsnd_scu_set_route() is needed only Gen1.
This patch renames it to rsnd_scu_set_route_if_gen1()
and it adds comment to rsnd_reg member
in order to clarify it is used for Gen1.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
ASoC: rsnd: make sure variable name for 44.1kHz/48kHz
This driver is assuming that
RBGA is used as source clock of 44.1kHz category, and
RBGB is used as source clock of 48kHz category.
This patch clarifies the variable name.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
ASoC: rsnd: add rsnd_adg_set_ssi_clk() and cleanup adg
This patch adds rsnd_adg_set_ssi_clk() to access to
AUDIO_CLK_SEL0/1/2, and removes last user of
rsnd_write/read/bset which is very low level function.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Current rcar driver gen.c is using rcar_gen_ops
which was made with the assumption that
Gen1 and Gen2 need different behavior.
but it was not needed.
This patch removes unnecessary complex method.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
ASoC: rcar: remove .path_init/exit from rsnd_gen_ops
rsnd_gen_ops has .path_init/exit callback function
which cares SRU/SSI (if Gen1) SCU/SSIU/SSI (if Gen2)
path settings.
But, the differences between Gen1/Gen2 are cared
in ssi.c/scu.c, and the path itself is same in Gen1/Gen2.
This patch removes .path_init/exit callback.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Current rcar driver is supporting Gen1,
and Gen2 will be supported soon.
Then, some registers are used from Gen1 only,
or from Gen2 only.
To avoid NULL pointer access, this patch adds
register accessible check function.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
The repmap initialization difference between Gen1/Gen2 is
only register offset.
This patch separates rsnd_gen1_regmap_init()
into common part and Gen1 specific part.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Dan Carpenter [Fri, 8 Nov 2013 09:46:53 +0000 (12:46 +0300)]
ASoC: rcar: some dubious one-bit signed bitfields
Because these are signed they can either be 0 or -1 instead of 0 and 1
as intended. It doesn't cause a problem from what I can see, but it's
dangerous and Sparse complains:
sound/soc/sh/rcar/rsnd.h:177:25:
error: dubious one-bit signed bitfield
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Mark Brown [Sat, 19 Oct 2013 20:38:26 +0000 (21:38 +0100)]
ASoC: dmaengine: Use filter_data rather than dma_data for compat requests
When using the legacy filter function channel requests we currently pass
the audio specific struct snd_dmaengine_dai_dma_data which isn't likely to
be helpful for actual filtering. Since there's already a field in the
structure called filter_data clearly intended for use here convert the
driver to use that.
All existing users of plain filter functions have been converted to use
an explicit compat function to override this behaviour except i.MX which
is working around this issue in its filter function and is updated to
just use filter_data directly here.
Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Mark Brown [Sat, 19 Oct 2013 16:43:51 +0000 (17:43 +0100)]
ASoC: dmaengine: Support custom channel names
Some devices have more than just simple TX and RX DMA channels, for example
modern Samsung I2S IPs support a secondary transmit DMA stream which is
mixed into the primary stream during playback. Allow such devices to
specify the names of the channels to be requested in their dma_data.
Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Hebbar, Gururaja [Wed, 23 Oct 2013 12:30:14 +0000 (15:30 +0300)]
ASoC: davinci-evm: Add device tree binding
Device tree support for Davinci Machine driver
When the board boots with device tree, the driver will receive card,
codec, dai interface details (like the card name, DAPM routing map,
phandle for the audio components described in the dts file, codec mclk
speed). The card will be set up based on this information. Since the
routing is provided via DT we can mark the card fully routed so core
can take care of disconnecting the unused pins.
Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com> Signed-off-by: Darren Etheridge <detheridge@ti.com> Signed-off-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Mark Brown [Sat, 19 Oct 2013 13:13:04 +0000 (14:13 +0100)]
ASoC: ep93xx: Open code dma channel request
Currently the ep93xx DMA code is one of the few users relying on the fact
that the compat code uses the dma_data as the filter data for non-DT
channel requests. Since the rest of the core expects this to be a struct
snd_dmaengine_dai_data this isn't terribly helpful this will be changed to
use the already existing filter data so avoid breaking ep93xx by open
coding the current behaviour.
Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
The serial-dir array gives this information so there is no need to have the
num-serializer property in DT description.
Just ignore the property in the driver the DTS files can be updated
separately without regression.
Update the documentation at the same time for davinci-mcasp
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Jyri Sarha [Fri, 18 Oct 2013 15:37:45 +0000 (18:37 +0300)]
ASoC: davinci-mcasp: Improve DT bindings document
Makes interrupts property optional as the interrupts are not currently
used by the driver and adds interrupt-names property to name listed
interrupts. Currently know interrupt names are "tx" and "rx".
- Improve tdm-slots propery description
- Improve op-mode property description
- Add pinctrl-names and pinctrl-0 properties
- Remove #address-cells and #size-cells as they are not needed.
- Bracket named interrupts property tuples for uniformity.
- Add missing "for" to serial-dir prop in DT bindings doc.
Signed-off-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Jyri Sarha [Fri, 18 Oct 2013 15:37:43 +0000 (18:37 +0300)]
ASoC: davinci-mcasp: Extract DMA channels directly from DT
Extract DMA channels directly from DT as they can not be found from
platform resources anymore. This is a work-around until davinci audio
driver is updated to use dmaengine.
Signed-off-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Jyri Sarha [Fri, 18 Oct 2013 15:37:42 +0000 (18:37 +0300)]
ASoC: davinci-mcasp: Add location for data port registers to DT
This patch adds a separate register location for data port registers to
mcasp DT bindings. On am33xx SoCs the McASP registers are mapped
trough L4 interconnect, but data port registers are also mapped trough
L3 bus to a different memory location.
Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com> Signed-off-by: Darren Etheridge <detheridge@ti.com> Signed-off-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Vinod Koul [Mon, 21 Oct 2013 13:37:34 +0000 (19:07 +0530)]
ASoC: dont call dapm_sync while reporting jack always
While reporting the jack status snd_soc_jack_report() invokes snd_soc_dapm_sync()
always. This should be required when we have pins associated with jack and
reporting enables or disables these.
So add a check for this case
Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Mark Brown [Sun, 20 Oct 2013 17:14:20 +0000 (18:14 +0100)]
ASoC: si476x: Fix locking of core
The conversion of the si476x to regmap removed locking of the core during
register updates, allowing things like power state changes for the MFD to
happen during a register update. Avoid this by taking the core lock in the
DAI operations (which are the only things that do register updates) as we
used to do in the open coded register I/O functions.
Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Andrey Smirnov <andrew.smirnov@gmail.com>
R-Car sound has clock pin for each SSI, and sometimes,
these pins are shared with paired SSI.
It may sometimes become "SSI-A clock pin is master" and
"SSI-B clock pin is slave", but "SSI-A/B clock pins are shared".
SSI-B needs SSI-A clock in this case.
Current R-Car sound driver is using RSND_SSI_xxx flag
to control this kind of shared pin behavior.
But, this information, especially clock master setting,
can be got from ASoC set_fmt settings.
This patch removes rsnd_ssi_mode_init() and extend rsnd_ssi_mode_set()
to controlling pin settings via .set_fmt.
This patch doesn't removes RSND_SSI_CLK_FROM_ADG flag at this point
to avoid conflict branch merging between ASoC <-> SH-ARM.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Current SSI needs RSND_SSI_DEPENDENT flag to
decide dependent/independent mode.
And SCU needs RSND_SCU_USE_HPBIF flag
to decide HPBIF is enable/disable.
But these 2 means same things.
This patch adds new rsnd_scu_hpbif_is_enable()
function, and merges above methods.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
ASoC: simple-card: un-implemented set_fmt is not error
Current simple-card returns error if DAI doesn't
support .set_fmt callback.
But the error is -ENOTSUPP (= not supported),
and it is not error.
This patch avoids such case
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Mark Brown [Thu, 17 Oct 2013 20:13:19 +0000 (21:13 +0100)]
ASoC: dai: Provide interface for setting DMA data at probe time
Allow DMA data to be set at probe time for devices that can do that,
avoiding the need to do it every time we start a stream and supporting
non-DT dmaengine users using the helpers.
This patch adds some default settings for the generic dmaengine PCM driver for
the case that no config has been supplied. The following defaults are used:
* Use snd_dmaengine_pcm_prepare_slave_config for preparing the DMA slave
config.
* 512kB for the prealloc buffer size. This value has been chosen based on
'feels about right' and is not backed up by any scientific facts. We
may need to come up with something smarter in the future but it should
work fine for now.
With this infrastructure in place we can finally write DAI drivers which are
independent of the DMA controller they are connected to. This is e.g. useful if
the DAI IP core is reused across different SoCs, but the SoCs uses different DMA
controllers.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
ASoC: dmaengine-pcm: Add support for querying DMA capabilities
Currently each platform making use the the generic dmaengine PCM driver still
needs to provide a custom snd_pcm_hardware struct which specifies the
capabilities of the DMA controller, e.g. the maximum period size that can be
supported. This patch adds code which uses the newly introduced
dma_get_slave_caps() API to query this information from the dmaengine driver.
The new code path will only be taken if the 'pcm_hardware' field of the
snd_dmaengine_pcm_config struct is NULL.
The patch also introduces a new 'fifo_size' field to the
snd_dmaengine_dai_dma_data struct which is used to initialize the
snd_pcm_hardware 'fifo_size' field and needs to be set by the DAI driver.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>