Commit graph

999 commits

Author SHA1 Message Date
Kuninori Morimoto d0658b31c7 ASoC: rsnd: ctu: add rsnd_ctu_halt()
Based on datasheet process

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-22 17:12:25 +00:00
Kuninori Morimoto bd9a603fe7 ASoC: rsnd: ctu: add rsnd_mix_activation()
Based on datasheet

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-22 17:12:25 +00:00
Kuninori Morimoto 355cb84fbe ASoC: rsnd: attach Audio-DMAC-periperi correctly
SSI/SRC will try to attach DMAC as Audio-DMAC or Audio-DMAC-periperi.
It is fixed IP, but will be attached to each streams as different module
in case of MUX (= multi sound path will be merged).
This patch solves this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-22 17:12:25 +00:00
Kuninori Morimoto 5ba17b42e1 ASoC: rsnd: each mod has status again for CTU/MUX support
SSI will be used as normal SSI or as clock parent SSI. Therefor,
rsnd driver wants to control SSI and parent SSI separately. Otherwise it
can't use Playback/Capture in the same time.
And it has been done by c2dc47d5cf("ASoC: rsnd: rsnd_dai_stream has each
mod's status insted of rsnd_mod") before.

OTOH, rsnd driver doesn't want to control CTU/MUX/DVC/SSIU/SSI in
separately. Otherwise, these will be re-initialized during playing if
MUX merges 2 sounds.
Because of these picky reasons, this patch re-defines status on each mod,
and add new parent_ssi_status on rsnd_dai_stream.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-22 17:12:25 +00:00
Kuninori Morimoto 72154e5072 ASoC: rsnd: select each SRC correctly for CMD data path
To select CMD data patch, it should use correct SRC from each stream
in MUX case. But current code is selecting SRC from fixed stream.
This patch solves this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-22 17:12:25 +00:00
Kuninori Morimoto 654a12b863 ASoC: rsnd: don't overwrite io on rsnd_cmd_init()
Current rsnd_cmd_init() overwrites "io" which will be used end of this
function. This patch solved this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-22 17:12:25 +00:00
Kuninori Morimoto ea96380baa ASoC: rsnd: always call probe/remove for MUX
CTU/MUX/DVC/SSIU/SSI/Audio-DMAC-periperi might be used under multipath.
So, probe()/remove() need to be called multiple times.
This patch allows it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-22 17:12:25 +00:00
Kuninori Morimoto bfa3119c38 ASoC: rsnd: try to connect connected mod is not error
If system uses CTU/MUX, CTU/MUX/DVC will try to connect same CMD to
system, but it is not error in this case.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-22 17:12:25 +00:00
Kuninori Morimoto 6c001f3ab4 ASoC: rsnd: don't update status if rsnd_mod_call() doesn't match
If system uses CTU/MUX, and if probe error happened, it will try to
call rsnd_dai_call(remove, ...). Then, MUX/DVC/SSIU/SSI might be called
without calling rsnd_dai_call(probe, ...). Then, each mod status might
be un-matched. It doesn't call un-matched remove function by this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-22 17:12:25 +00:00
Kuninori Morimoto 4e880b2674 ASoC: rsnd: add debug message for rsnd_mod_call()
rsnd_mod_call() tries to call each IP's relevant function. But it is
difficult to understand which function returned error.
This patch adds debug message for this purpose

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-22 17:12:25 +00:00
Kuninori Morimoto 7c89746eed ASoC: rsnd: use rsnd_mod_init() for ADG
Current ADG doesn't use rsnd_mod_init(), but this limitation is no
longer necessary. Let's use common rsnd_mod_init()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-22 17:12:25 +00:00
Kuninori Morimoto 678ea00372 ASoC: rsnd: remove unsed *parent
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-22 17:12:25 +00:00
Mark Brown 5450487a09 Merge remote-tracking branches 'asoc/topic/rcar' and 'asoc/topic/rockchip' into asoc-next 2016-01-11 13:54:38 +00:00
Dan Carpenter 8012c983dd ASoC: rsnd: precedence error in rsnd_ssiu_init()
The bitwise OR has higher precedence than ?: so the val2 was always set
to 0x2.

Fixes: b4c83b1715 ('ASoC: rsnd: add Multi channel support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-06 10:38:39 +00:00
Andrzej Hajda e5d9cfc6f5 ASoC: rsnd: fix usrcnt decrementing bug
Field usrcnt is unsigned so it cannot be lesser than zero.
The patch fixes the check, moves it to the beginning of the function
and changes return value to -EIO in case of usercnt error.

The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2038576

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-30 17:13:20 +00:00
Mark Brown 14418aa7d4 Merge remote-tracking branches 'asoc/topic/samsung', 'asoc/topic/sh', 'asoc/topic/ssm2518' and 'asoc/topic/sti' into asoc-next 2015-12-23 00:23:51 +00:00
Mark Brown 81b6863cae Merge remote-tracking branches 'asoc/topic/pxa', 'asoc/topic/qcom', 'asoc/topic/rcar', 'asoc/topic/rk3036' and 'asoc/topic/rockchip' into asoc-next 2015-12-23 00:23:46 +00:00
Mark Brown a93202fa7b Merge remote-tracking branch 'asoc/topic/pcm-list' into asoc-next 2015-12-23 00:23:32 +00:00
Kuninori Morimoto b4c83b1715 ASoC: rsnd: add Multi channel support
This patch adds Multi channel support on Renesas R-Car sound.
This patch is tested on Salvator-X board, but it can't use
Multi channel, because supported format is different between
codec chip and R-Car.
Thus, it was tested on board which doesn't mount codec chip,
with oscilloscope.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-22 23:58:28 +00:00
Kuninori Morimoto 89b66174ec ASoC: rsnd: add rsnd_parse_connect_common() and remove complex macro
Current rsnd driver is using complex macro to parse DAI connection.
This patch adds new rsnd_parse_connect_common() and replace current
macro to it.
This is prepare for multi channel support

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-18 12:10:56 +00:00
Kuninori Morimoto 750fd445ac ASoC: rsnd: add rsnd_set_slot() / rsnd_get_slot_num()
TDM will use 6 or 8 slots on 1 SSI, and Multi channel will use
6 or 8 slots on few SSI (each SSI uses 2 slots).
Thus, this adds new slot control functions which can be prepare
for Multi channel support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-18 12:10:56 +00:00
Kuninori Morimoto c140284b80 ASoC: rsnd: tidyup rsnd_get_slot_xxx() naming
rsnd_get_slot_rdai() returns total slots (it returns 6 if total 6
channels) , and rsnd_get_slot_extend() returns extended SSI width
(it returns 8 if total 6 channels). This will be used on SSI multi
channel support too (It will return 2 if total 6 channels with 3 SSI).
But, it is using confusable naming.
This patch changes rsnd_get_slot_rdai() -> rsnd_get_slot(),
rsnd_get_slot_extend() -> rsnd_get_slot_width()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-18 12:10:56 +00:00
Kuninori Morimoto 5858a7d17e ASoC: rsnd: remove rsnd_get_slot_runtime()
Current Renesas sound driver is using rsnd_get_slot_runtime(), but
it is same as runtime->channels. This patch removes
rsnd_get_slot_runtime()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-18 12:10:56 +00:00
Kuninori Morimoto 49ee73b441 ASoC: rsnd: SSI/SSIU use rsnd_get_slot_extend() to check TDM
Current SSI/SSIU are using rsnd_get_slot_runtime() to check TDM,
but using rsnd_get_slot_extend() is more sane.
This patch fix it up

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-18 12:10:56 +00:00
Kuninori Morimoto 52dc685243 ASoC: rsnd: rsnd_dai_connect() returns error if it connect to existing mod
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-18 12:10:56 +00:00
Kuninori Morimoto c90269c1fb ASoC: rsnd: tidyup debug print position on rsnd_dma_attach()
It can't output corrent dma name *before* rsnd_mod_init().
It goes to *after* rsnd_mod_init() by this patch

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-18 12:10:56 +00:00
Kuninori Morimoto 5e7b9edd92 ASoC: rsnd: tidyup return value of rsnd_get_adinr_bit()
Renesas sound driver has rsnd_get_adinr_bit/chan() functions.
It is assuming _bit() returns ADINR :: OTBL,
and _chan() returns ADINR :: CHNUM.
Current _bit() returns both OTBL and CHNUM. This patch fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-18 12:10:56 +00:00
Kuninori Morimoto cdf310ce11 ASoC: rsnd: fixup SSIU control timing
SSIU should be controlled after SSI. This patch fix up it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-18 12:10:56 +00:00
Kuninori Morimoto af998f8531 ASoC: rsrc-card: tidyup dai format for DPCM
rsrc-card is DPCM supported version of simple-card. Thus it has similar
DT format. OTOH, snd_soc_dai_link requests cpu/codec, but one of them
will be snd-soc-dummy in DPCM case, and DPCM requests frontend/backend
dai_link. This means it might have multi backend/codec.
And, SND_SOC_DAIFMT_xxx is based on "codec". Because of these
difference, current rsrc card can't detect correct dai_fmt.
This patch detect correct dai fmt from 1st "codec".

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-17 12:14:31 +00:00
Kuninori Morimoto ae638b725e ASoC: rsrc-card: Remove support for setting differing DAI formats
1efb53a220 ("ASoC: simple-card: Remove support for setting differing
DAI formats") removed set_fmt support from simple-card.
rsrc-card follows same style, because it is based on simple-card.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-17 12:14:31 +00:00
Kuninori Morimoto 6dad9758a5 ASoC: rsrc-card: enable to use tdm_slot on DT
Renesas sound driver will use tdm slot on TDM Multi Mode support.
This patch enables tdm slot on rsrc card driver on DT.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-17 12:14:31 +00:00
Mark Brown 2b235a3da5 rcar: mux: Avoid use of ret uninitialised
We use ret as the return value from the rsnd_mix_probe() but if there
are no child nodes and no errors then we will never initialize ret leading
to build warnings. Ensure ret is initialized before we iterate over the
child nodes to avoid this.

Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-15 17:47:54 +00:00
Mark Brown 2e4118dac3 rcar: dvc: Avoid use of ret uninitialised
We use ret as the return value from the rsnd_dvc_probe() but if there
are no child nodes and no errors then we will never initialize ret leading
to build warnings. Ensure ret is initialized before we iterate over the
child nodes to avoid this.

Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-15 17:47:53 +00:00
Mark Brown 76ca997032 rcar: ctu: Avoid use of ret uninitialised
We use ret as the return value from the rsnd_ctu_probe() but if there
are no child nodes and no errors then we will never initialize ret leading
to build warnings. Ensure ret is initialized before we iterate over the
child nodes to avoid this.

Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-15 17:47:53 +00:00
Kuninori Morimoto a504b1ee41 ASoC: rsnd: tidyup data align position for capture
L/R channel data has been treated as inverted on R-Car sound 16bit mode,
Thus, 4689032b1("ASoC: rsnd: tidyup data align position") tidyuped data
align position. But it couldn't care about capture case. This patch
cares both playback/capture

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-08 12:47:46 +00:00
Kuninori Morimoto f98ed119a7 ASoC: rsnd: care SWSP bit for TDM/non-TDM
SSICR::SWSP bit controls WS signal low/high, but in case of TDM
it is inverted. This patch solves this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-02 11:15:27 +00:00
Kuninori Morimoto 575f1f929f ASoC: rsnd: rsrc-card: check return value of snd_soc_of_get_dai_name()
This patch adds missing check of snd_soc_of_get_dai_name().
It might not be able to use sound card, because it might returns
-EPROBE_DEFER.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-01 13:19:06 +00:00
Kuninori Morimoto 2ff2ecca06 ASoC: rsnd: fixup wrong snd_soc_dai_driver pointer access
drv pointer should be "base + offset" instead of
"current + offset". This patch fixup this issue, otherwise
third and subsequent pointer will be broken

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-01 13:19:06 +00:00
Kuninori Morimoto 186fadc132 ASoC: rsnd: add TDM Extend Mode support
Renesas R-Car can out TDM by
1) 6ch x 1 DAI as TDM Extend Mode
2) 2ch x 4 x 1 DAI as TDM split Mode
3) 2ch x 3 DAI or
   2ch x 4 DAI as TDM Multichannel Mode

This patch adds 1) TDM Extend Mode. Because of HW design,
this 6ch data will be outputed via 8ch data width.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-30 18:11:23 +00:00
Kuninori Morimoto 42ab9a791b ASoC: rsnd: dvc enables non-stereo sound
Current DVC is assuming that the sound is always stereo.
This patch makes it more flexible

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-30 18:11:23 +00:00
Kuninori Morimoto 8ec85e7f7e ASoC: rsnd: ssi enables non-stereo sound
Current SSI is assuming that the sound is always stereo. But, SSI needs
to calculate its frequency when master mode. Then This frequency depends
on each SSI's slots, and TDM mode (= TDM Extend Mode, TDM split Mode,
TDM Multichannel Mode).
This patch enables to use non-stereo sound.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-30 18:11:23 +00:00
Kuninori Morimoto 08bada26fe ASoC: rsnd: set SSIWSR setting on rsnd_ssi_config_init()
It will have TDM settings on SSIWSR. Actually, we would like to set
it on rsnd_ssi_config_init(), but we can't. Because SSI might be used
as clock master (It doesn't need to call rsnd_ssi_config_init() when
clock master mode).
This patch adds new ssi->wsr and set it on rsnd_ssi_start().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-30 18:11:23 +00:00
Kuninori Morimoto 840ada3b04 ASoC: rsnd: add rsnd_ssi_config_init()
In order to enhance code readability, this patch adds
rsnd_ssi_config_init() and moves SSICR register settings to it.
This is prepare patch for TDM support

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-30 18:11:23 +00:00
Kuninori Morimoto f13edb8b28 ASoC: rsnd: dvc: add rsnd_dvc_halt()
Based on datasheet process

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-30 18:11:23 +00:00
Kuninori Morimoto 95e6b0ddb0 ASoC: rsnd: mix: add rsnd_mix_halt()
Based on datasheet process

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-30 18:11:23 +00:00
Kuninori Morimoto 475a361a6f ASoC: rsnd: src: add rsnd_src_halt()
Based on datasheet process

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-30 18:11:23 +00:00
Kuninori Morimoto 87a6c5a815 ASoC: rsnd: dvc: rename rsnd_dvc_soft_reset() to rsnd_dvc_activation()
Based on datasheet naming

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-30 18:11:23 +00:00
Kuninori Morimoto 4fe32521d7 ASoC: rsnd: mix: rename rsnd_mix_soft_reset() to rsnd_mix_activation()
Based on datasheet naming

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-30 18:11:23 +00:00
Kuninori Morimoto 98efeeaeeb ASoC: rsnd: src: rename rsnd_src_soft_reset() to rsnd_src_activation()
Based on datasheet naming

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-30 18:11:23 +00:00
Kuninori Morimoto bf4e8d7c37 ASoC: rsnd: add missing SRC_O_BUSIF_MODE register
SRC_BUSIF_MODE has both IN/OUT register. Current src driver sets
IN register only. This patch sets missing OUT register.
IN/OUT register are using default setting, so, there is no
HW effect.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-30 18:11:23 +00:00
Kuninori Morimoto c45f7263a8 ASoC: rsnd: add missing ADINR::CHNUM on DVC/SRC/SSIU
DVC/SRC/SSIU needs ADINR::CHNUM settings too. This patch adds
these missing value.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-30 18:11:23 +00:00
Kuninori Morimoto 9445836430 ASoC: rsnd: don't use normal *mod in adg.c
adg.c is used from ssi/src/cmd. Thus don't use confusable *mod here.
This patch rename it to ssi_mod/src_mod/cmd_mod

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-30 18:11:23 +00:00
Kuninori Morimoto 5342dff232 ASoC: rsnd: tidyup semantics of rsnd_ssi_record_error()
rsnd_ssi_record_error() should recorde error, but it clears error too.
this patch fixes up semantic of rsnd_ssi_record_error that it records
error but doesn't clear error.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-27 12:38:53 +00:00
Kuninori Morimoto 8cc225f713 ASoC: rsnd: tidyup semantics of rsnd_src_record_error()
rsnd_src_error_record() should recorde error, but it clears error too.
this patch fixes up semantic of rsnd_src_error_record that it records
error but doesn't clear error.
And this patch renames
rsnd_src_error_clear()  to rsnd_src_status_clear()
rsnd_src_error_record() to rsnd_src_record_error()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-27 12:38:50 +00:00
Kuninori Morimoto 0719ecf7cb ASoC: rsnd: indicate register name for debug
Current rsnd driver is indicating how to use regmap debug method
on gen.c comment area.
regmap debug method indicates address and value, but rsnd driver is
using too many IPs (SSI/SSIU/SRC/CTU/MIX/DVC/CMD), and address.
Thus, we would like to know more useful information for debugging.
This patch indicates address name for debugging.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-27 12:38:50 +00:00
Arnd Bergmann a29d0f3ef9 ASoC: rcar: remove unused variable
After a recent cleanup, the soc_card variable became unused
and now produces a warning:

soc/sh/rcar/core.c: In function '__rsnd_kctrl_new':
soc/sh/rcar/core.c:801:23: warning: unused variable 'soc_card' [-Wunused-variable]

This removes the variable.

Fixes: 1a497983a5 ("ASoC: Change the PCM runtime array to a list")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-25 12:59:02 +00:00
Arnd Bergmann e6e969f1fd ASoC: sh: fix fsi build warnings for 64 bit
As this driver can now be compiled for ARM64, we get a new warning
as a result of passing a DMA filter data pointer through an 'int':

sound/soc/sh/fsi.c: In function 'fsi_dma_probe':
sound/soc/sh/fsi.c:1372:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     shdma_chan_filter, (void *)io->dma_id,

We already know that we only need the legacy filter function on
arch/sh, so we can hide the legacy DMA interface function
behind an #ifdef. This has the other advantage of no longer
depending on the shdma_chan_filter function to be visible.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-21 13:27:03 +00:00
Kuninori Morimoto c51eb1c66e ASoC: rsnd: tidyup void* cast for 64bit compiler
64bit compiler indicates this without this patch

linux/sound/soc/sh/rcar/core.c: In function 'rsnd_probe':
linux/sound/soc/sh/rcar/core.c:1002:16: warning: cast from pointer to\
     integer of different size [-Wpointer-to-int-cast]

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-20 18:07:02 +00:00
Mengdong Lin 1a497983a5 ASoC: Change the PCM runtime array to a list
Currently the number of DAI links is statically defined by the machine
driver at build time using an array. This makes it difficult to shrink/
grow the number of DAI links at runtime in order to reflect any changes
in topology.

We can change the DAI link array in the core to a list so that PCMs and
FE DAI links can be added and deleted at runtime to reflect changes in
use case and DSP topology. The machine driver can still register DAI links
as an array.

As the 1st step, this patch change the PCM runtime array to a list. A new
PCM runtime is added to the list when a DAI link is bound successfully.

Later patches will further implement the DAI link list.

More:
- define snd_soc_new/free_pcm_runtime() to create/free a runtime.
- define soc_add_pcm_runtime() to add a runtime to the rtd list.
- define soc_remove_pcm_runtimes() to clean up the runtime list.

- traverse the rtd list to probe the link components and dais.

- Add a field "num" to PCM runtime struct, used to specify the device
  number when creating the pcm device, and for a soc card to access
  its dai_props array.

- The following 3rd party machine/platform drivers iterate the rtd list
  to check the runtimes:
  sound/soc/intel/atom/sst-mfld-platform-pcm.c
  sound/soc/intel/boards/cht_bsw_rt5645.c
  sound/soc/intel/boards/cht_bsw_rt5672.c
  sound/soc/intel/boards/cht_bsw_max98090_ti.c

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-18 18:32:24 +00:00
Kuninori Morimoto 2ea6b0749c ASoC: rsnd: remove struct platform_device from probe/remove parameter
Current Renesas sound driver requests struct platform_device on
probe/remove for each modules. But driver can get it by
rsnd_priv_to_pdev(). This patch removes unnecessary parameter

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-18 18:08:16 +00:00
Kuninori Morimoto 2ea2cc86db ASoC: rsnd: remove struct rcar_snd_info
No board is using Renesas sound driver via platform boot now.
This means all user is using DT boot. Platform boot support is
no longer needed. But, it strongly depends on platform boot style.
Now, platform boot style was removed from driver.
This is cleanup patch, and remove pointless struct rcar_snd_info

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-18 18:08:16 +00:00
Kuninori Morimoto e797f58ead ASoC: rsnd: remove struct rsnd_of_data
No board is using Renesas sound driver via platform boot now.
This means all user is using DT boot. Platform boot support is
no longer needed. But, it strongly depends on platform boot style.
Now, platform boot style was removed from driver.
This is cleanup patch, and remove pointless struct rsnd_of_data

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-18 18:08:16 +00:00
Kuninori Morimoto 348d592c71 ASoC: rsnd: remove platform boot support from gen.c
No board is using Renesas sound driver via platform boot now.
This means all user is using DT boot. Platform boot support is
no longer needed. But, it strongly depends on platform boot style.
This patch removes platform boot support from gen.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-18 18:08:16 +00:00
Kuninori Morimoto 9eaa1a6f7e ASoC: rsnd: remove platform boot support from dvc.c
No board is using Renesas sound driver via platform boot now.
This means all user is using DT boot. Platform boot support is
no longer needed. But, it strongly depends on platform boot style.
This patch removes platform boot support from dvc.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-18 18:08:16 +00:00
Kuninori Morimoto c7fe4be840 ASoC: rsnd: remove platform boot support from mix.c
No board is using Renesas sound driver via platform boot now.
This means all user is using DT boot. Platform boot support is
no longer needed. But, it strongly depends on platform boot style.
This patch removes platform boot support from mix.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-18 18:08:16 +00:00
Kuninori Morimoto cfe7c0390a ASoC: rsnd: remove platform boot support from ctu.c
No board is using Renesas sound driver via platform boot now.
This means all user is using DT boot. Platform boot support is
no longer needed. But, it strongly depends on platform boot style.
This patch removes platform boot support from ctu.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-18 18:08:16 +00:00
Kuninori Morimoto adf6a68159 ASoC: rsnd: remove platform boot support from src.c
No board is using Renesas sound driver via platform boot now.
This means all user is using DT boot. Platform boot support is
no longer needed. But, it strongly depends on platform boot style.
This patch removes platform boot support from src.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-18 18:08:16 +00:00
Kuninori Morimoto 02534f2f80 ASoC: rsnd: remove platform boot support from ssi.c
No board is using Renesas sound driver via platform boot now.
This means all user is using DT boot. Platform boot support is
no longer needed. But, it strongly depends on platform boot style.
This patch removes platform boot support from ssi.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-18 18:08:16 +00:00
Kuninori Morimoto 94e2710cd2 ASoC: rsnd: remove platform boot support from core.c
No board is using Renesas sound driver via platform boot now.
This means all user is using DT boot. Platform boot support is
no longer needed. But, it strongly depends on platform boot style.
This patch removes platform boot support from core.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-18 18:08:16 +00:00
Kuninori Morimoto 75916f6524 ASoC: rsnd: SRC settings matches to datasheet
Current SRC settings order was rough. Now, Gen1 support was removed.
This patch makes it cleanup and match to datasheet.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-18 18:08:16 +00:00
Kuninori Morimoto d444080ef8 ASoC: rsnd: cleanup RSND_REG_xxx
SRC Gen1 support was removed. Current rsnd driver is sharing Gen1/Gen2
register index to reduce memory, but there is no effect anymore.
Let's remove share definition and merge RSND_REG_xxx

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-18 18:08:16 +00:00
Kuninori Morimoto e8e7b7bdc6 ASoC: rsnd: remove Gen1 support from SRC
This patch removes SRC Gen1 support which has no user on upstream.
Historically, SRC Gen1 was created as prepare for SRC Gen2 support.
It works well for Gen2 support, but Gen1 is not same as Gen2.
So now, Gen1 support is no longer needed. Thanks Gen1 and Bye-bye.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-18 18:08:16 +00:00
Kuninori Morimoto f46a93b820 ASoC: rsnd: ssi: 24bit data needs right-aligned settings
Data left/right aligned is controlled by PDTA bit on SSICR.
But default is left-aligned. Thus 24bit sound will be very small sound
without this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-17 11:43:46 +00:00
Kuninori Morimoto 85d4a62140 ASoC: rsnd: SND_SOC_RCAR doesn't depend on DMA_OF
8616774("ASoC: rnsd: fix build regression without CONFIG_OF")
added "depends on DMA_OF" in SND_SOC_RCAR to avoid compile error of

    sound/built-in.o: In function `rsnd_dma_request_channel':
    :(.text+0x9fb84): undefined reference to `of_dma_request_slave_channel'

But, it was OF base DMAEngine API definition issue, not SND_SOC_RCAR
issue. This patch remove DMA_OF dependence.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 17:45:31 +00:00
Kuninori Morimoto 68a550248e ASoC: rsnd: call clk_prepare()/clk_enable() for AUDIO_CLKx
ADG can output AUDIO_CLKOUTx, and these are generated from
AUDIO_CLKx. Thus we need to call clk_prepare()/clk_enable()
for AUDIO_CLKx.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto 81ad174db5 ASoC: rsnd: tidyup comment position of rsnd_mod_xxx
f1df12290("ASoC: rsnd: add common mod confirm method")
added rsnd_mod_make_sure(), but rsnd_mod_xxx() comment position
was wrong. This patch tidyup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto 13e0d17d08 ASoC: rsnd: MIX settings matches to datasheet
Current MIX settings order was rough.
This patch makes it match to datasheet.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto ca16cc6159 ASoC: rsnd: DVC settings matches to datasheet
Current DVC settings order was rough.
This patch makes it match to datasheet.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto dcc5a7b3b0 ASoC: rsnd: move CMD related operation to cmd.c
8cca6e11c1 ("ASoC: rsnd: use mod base common method on CMD")
added cmd.c. Let's move CMD related operation to cmd.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Geert Uytterhoeven 8b27418f30 ASoC: rsnd: Add missing initialization of ADG req_rate
If the "clock-frequency" DT property is not found, req_rate is used
uninitialized, and the "audio_clkout" clock will be created with an
arbitrary clock rate.

This uninitialized kernel stack data may leak to userspace through
/sys/kernel/debug/clk/clk_summary, cfr. the value in the "rate" column:

       clock     enable_cnt  prepare_cnt        rate   accuracy   phase
    --------------------------------------------------------------------
     audio_clkout         0            0  4001836240          0 0

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto 9c66eedc17 ASoC: rsnd: fixup rsnd_dmapp_stop() return value
45a4394d03("ASoC: rsnd: use mod base common method on DMA phase3")
Exchanged "void rsnd_dmapp_stop()" to "int rsnd_dmapp_stop()",
but it returns inverted value. This patch fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto f36a82264d ASoC: rsnd: call rsnd_src_quit() from rsnd_src_quit_gen2()
2d604e03("ASoC: rsnd: disable SRC.out only when stop timing")
added rsnd_src_quit_gen2(), but it should call rsnd_src_quit()
same as before. This patch fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto e7d850dd10 ASoC: rsnd: use mod base common method on SSI-parent
Renesas sound needs many devices
(SSI/SSIU/SRC/CTU/MIX/DVC/CMD/AudioDMAC/AudioDMACpp).
SSI/SRC/CTU/MIX/DVC are implemented as module.
SSI parent, SSIU are implemented as part of SSI
CMD is implemented as part of CTU/MIX/DVC
AudioDMAC/AudioDMACpp are implemented as part of SSI/SRC
It is nice sense that these all devices are implemented as mod.

This patch makes SSI parent mod base common method

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto c7f69ab536 ASoC: rsnd: use mod base common method on SSIU
Renesas sound needs many devices
(SSI/SSIU/SRC/CTU/MIX/DVC/CMD/AudioDMAC/AudioDMACpp).
SSI/SRC/CTU/MIX/DVC are implemented as module.
SSI parent, SSIU are implemented as part of SSI
CMD is implemented as part of CTU/MIX/DVC
AudioDMAC/AudioDMACpp are implemented as part of SSI/SRC
It is nice sense that these all devices are implemented as mod.

This patch makes SSIU mod base common method

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto 1b2ca0adf1 ASoC: rsnd: use mod base common method on CMD
Renesas sound needs many devices
(SSI/SSIU/SRC/CTU/MIX/DVC/CMD/AudioDMAC/AudioDMACpp).
SSI/SRC/CTU/MIX/DVC are implemented as module.
SSI parent, SSIU are implemented as part of SSI
CMD is implemented as part of CTU/MIX/DVC
AudioDMAC/AudioDMACpp are implemented as part of SSI/SRC
It is nice sense that these all devices are implemented as mod.

This patch makes CMD mod base common method

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto 497debaa80 ASoC: rsnd: use mod base common method on DMA phase3
Renesas sound needs many devices
(SSI/SSIU/SRC/CTU/MIX/DVC/CMD/AudioDMAC/AudioDMACpp).
SSI/SRC/CTU/MIX/DVC are implemented as module.
SSI parent, SSIU are implemented as part of SSI
CMD is implemented as part of CTU/MIX/DVC
AudioDMAC/AudioDMACpp are implemented as part of SSI/SRC
It is nice sense that these all devices are implemented as mod.

This patch makes DMA mod bse common method

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto 76c80b5b3f ASoC: rsnd: use mod base common method on DMA phase2
Renesas sound needs many devices
(SSI/SSIU/SRC/CTU/MIX/DVC/CMD/AudioDMAC/AudioDMACpp).
SSI/SRC/CTU/MIX/DVC are implemented as module.
SSI parent, SSIU are implemented as part of SSI
CMD is implemented as part of CTU/MIX/DVC
AudioDMAC/AudioDMACpp are implemented as part of SSI/SRC
It is nice sense that these all devices are implemented as mod.

DMA will be implemented as module. Then rsnd_dma_ops will be rebased
to rsnd_mod_ops, but these are similar, but different function.
This patch modify rsnd_dma_ops same style as rsnd_mod_ops.
This is prepare for final merge

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto 940e947926 ASoC: rsnd: use mod base common method on DMA phase1
Renesas sound needs many devices
(SSI/SSIU/SRC/CTU/MIX/DVC/CMD/AudioDMAC/AudioDMACpp).
SSI/SRC/CTU/MIX/DVC are implemented as module.
SSI parent, SSIU are implemented as part of SSI
CMD is implemented as part of CTU/MIX/DVC
AudioDMAC/AudioDMACpp are implemented as part of SSI/SRC
It is nice sense that these all devices are implemented as mod.

DMA will be implemented as module. Then rsnd_dma will be mod base.
This patch makes rsnd_dma mod base, but still not yet completely
finished. This mod is not yet installed to system at this point.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto e10369d88c ASoC: rsnd: use common rsnd_ssi_status_xxx()
Current ssi.c driver has random access to SSISR register. Let's use
common rsnd_ssi_status_xxx() function

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto 2daf71ad8d ASoC: rsnd: avoid pointless loop in rsnd_mod_interrupt()
Current Renesas sound driver doesn't have 1:1 relationship between
stream <-> mod because it is supporting MIX. Because of this reason
rsnd_mod_interrupt() is searching correspond mod by for loop.
But this loop is not needed, because each mod has own type.
This patch avoid pointless loop by using mod->type.

This patch is good for SSI-parent support, because stream might have
2 SSI as SSI-parent/child. SSI interrupt handler will be called twice
if stream has SSI-parent without this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto 69e32a58bd ASoC: rsnd: Don't stop HW even if a large number of errors occur
Current SSI/SRC restarts HW if under/over flow happened to avoid L/R
invert issue. But it will stop HW if too many error happen.
But if it stops on HW, other side under/over flow happen. OTHA, it will
be forever loop interrupt if something strange error happen on
HW/driver without escape route of large number error.

To avoid this issue, it indicates error message if large number error
occur, and disables error interrupt.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto c2dc47d5cf ASoC: rsnd: rsnd_dai_stream has each mod's status insted of rsnd_mod
Renesas sound needs many devices
(SSI/SSIU/SRC/CTU/MIX/DVC/CMD/AudioDMAC/AudioDMACpp).
SSI/SRC/CTU/MIX/DVC are implemented as module.
SSI parent, SSIU are implemented as part of SSI
CMD is implemented as part of CTU/MIX/DVC
AudioDMAC/AudioDMACpp are implemented as part of SSI/SRC
It is nice sense that these all devices are implemented as mod.

Current rsnd is controling each mod's status on mod. But it was not
good design for SSI, because stream might has SSI-parent.
In such case, it can't play/capture in same time, because SSI-parent
is used as normal SSI in other stream, but it shares same status.
To avoid this issue each mod's status is controlled by rsnd_dai_stream
instead of rsnd_mod.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto b761bf272b ASoC: rsnd: disable SRC.out only when stop timing
Because SRC is connected to DMA and DMA want to keep dreq when stop
timing. This patch makes SRC stop SRC.out only when stop timing. And
it stops both SRC.out/SRC.in when quit timing

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto 37447b46e8 ASoC: rsnd: move rsnd_src_ssi_irq_enable/disable() to ssi.c
Part of SSI IRQ enable/disable was controlled by SRU (on Gen1)
or CMD (on Gen2). Because of this reason SSI IRQ function was
implemented under src.c. but it is not understandable.
Let's move it to ssi.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto 40854c648e ASoC: rsnd: fixup rsnd_dma_of_path method for mod base common method
Renesas sound needs many devices
(SSI/SSIU/SRC/CTU/MIX/DVC/CMD/AudioDMAC/AudioDMACpp).
SSI/SRC/CTU/MIX/DVC are implemented as module.
SSI parent, SSIU are implemented as part of SSI
CMD is implemented as part of CTU/MIX/DVC
AudioDMAC/AudioDMACpp are implemented as part of SSI/SRC
It is nice sense that these all devices are implemented as mod.

Current rsnd_dma_of_path is assuming that all mods are related to DMA.
But it will be wrong. This patch tidyup this wrong assumption

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto 48d582819f ASoC: rsnd: remove all modules when PIO fallback
Current Renesas sound is supporting PIO fallback if it can't use DMA.
In such case, it should remove all attached modules, but current driver
is missing about CTU/MIX. Because current implement requests
specific mod for remove.
To avoid same things in future, this patch removes all mods,
and re-connects SSI when PIO fallback case.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto 27924f3208 ASoC: rsnd: enable to use rsnd_dai_connect() from each mod
Renesas sound needs many devices
(SSI/SSIU/SRC/CTU/MIX/DVC/CMD/AudioDMAC/AudioDMACpp).
SSI/SRC/CTU/MIX/DVC are implemented as module.
SSI parent, SSIU are implemented as part of SSI
CMD is implemented as part of CTU/MIX/DVC
AudioDMAC/AudioDMACpp are implemented as part of SSI/SRC
It is nice sense that these all devices are implemented as mod.

DMAC/SSIU/SSI-parent/CMD will be implemented as module, but these are
not customer controlled module. These should be automatically install
to system. Because of this, rsnd_dai_connect() should be called from
each mod. SSI can be very special, because it will be installed as
SSI-parent / SSI-child. Thus, new rsnd_dai_connect() has type parameter
which should be mod->type except SSI-parent

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto 81ecbb654e ASoC: rsnd: rename rsnd_dma_init() to rsnd_dma_attach()
Renesas sound needs many devices
(SSI/SSIU/SRC/CTU/MIX/DVC/CMD/AudioDMAC/AudioDMACpp).
SSI/SRC/CTU/MIX/DVC are implemented as module.
SSI parent, SSIU are implemented as part of SSI
CMD is implemented as part of CTU/MIX/DVC
AudioDMAC/AudioDMACpp are implemented as part of SSI/SRC
It is nice sense that these all devices are implemented as mod.

DMA will be implemented as module. Then each rsnd_dma_ops will be
rsnd_mod_ops. But current rsnd_dma_ops::init means "DMA attach".
This patch removes .init from rsnd_dma_ops, and renames
rsnd_dma_init() to rsnd_dma_attach()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto 3e5afa73a9 ASoC: rsnd: DMA related definition goes to dma.c
Renesas sound needs many devices
(SSI/SSIU/SRC/CTU/MIX/DVC/CMD/AudioDMAC/AudioDMACpp).
SSI/SRC/CTU/MIX/DVC are implemented as module.
SSI parent, SSIU are implemented as part of SSI
CMD is implemented as part of CTU/MIX/DVC
AudioDMAC/AudioDMACpp are implemented as part of SSI/SRC
It is nice sense that these all devices are implemented as mod.

DMA will be implemented as module. Current DMA definition is no longer
needed on rsnd.h. Let's move it to dma.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto 232c00b6e5 ASoC: rsnd: DMA become SSI/SRC member
Renesas sound needs many devices
(SSI/SSIU/SRC/CTU/MIX/DVC/CMD/AudioDMAC/AudioDMACpp).
SSI/SRC/CTU/MIX/DVC are implemented as module.
SSI parent, SSIU are implemented as part of SSI
CMD is implemented as part of CTU/MIX/DVC
AudioDMAC/AudioDMACpp are implemented as part of SSI/SRC
It is nice sense that these all devices are implemented as mod.

Current rsnd_mod is member of rsnd_mod. But the DMA user is only
SSI/SRC. This DMA will be implemented as module. As 1st step, DMA
become SSI/SRC member by this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16 10:09:29 +00:00
Kuninori Morimoto 7115cb913d ASoC: rsnd: make sure SRC In Rate feature enablement
SRC In Rate convert feature cannot be used if data path is using DVC.
This patch judges it, and not allowed to use it in such case.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-10 19:02:02 +00:00
Mark Brown 2a148b6f27 ASoC: Updates for v4.4
Not much core work here, a few small tweaks to interfaces but mainly the
 changes here are driver ones.  Highlights include:
 
  - Updates to the topology userspace interface
  - Big updates to the Renesas support from Morimoto-san
  - Most of the support for Intel Sky Lake systems.
  - New drivers for Asahi Kasei Microdevices AK4613, Allwinnner A10,
    Cirrus Logic WM8998, Dialog DA7219, Nuvoton NAU8825 and Rockchip
    S/PDIF.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJWLbbGAAoJECTWi3JdVIfQH7oH/1VdN2ozP9A03p24aC5qso1F
 VWOBnG4pkw1G6J5qK2lemMDeJdRdTfreICUAa9Tw9kOSfTIb6F3X8kCw8tbwlw0I
 4phgmyo23P53OfLZFMkQi/RCfwItnE0sszqhvoumUg0ryjYxg2JT+gTMgwvVo7Pq
 hf6m6a3we5pxLIIYP4wlQgOKwUJe4B4nC37ExySf24Dlo/DzmWDtfQbGvmyluFzb
 MB1qzEvAc/KC3LZFkIFmhfg2/caNRhcQrzkUCYrLR3t+oz9P1zCpYTII7VDdMg7L
 SM2VoL+ynEAdBqa38Ozwxvd/mpHwinlAeiikuwz1PyxVOqZvZqqiWzD8eUJkhZk=
 =/F/Q
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v4.3-rc6' into asoc-fix-rcar

ASoC: Updates for v4.4

Not much core work here, a few small tweaks to interfaces but mainly the
changes here are driver ones.  Highlights include:

 - Updates to the topology userspace interface
 - Big updates to the Renesas support from Morimoto-san
 - Most of the support for Intel Sky Lake systems.
 - New drivers for Asahi Kasei Microdevices AK4613, Allwinnner A10,
   Cirrus Logic WM8998, Dialog DA7219, Nuvoton NAU8825 and Rockchip
   S/PDIF.
2015-11-10 19:01:58 +00:00
Kuninori Morimoto 021c5d9469 ASoC: rsnd: fixup SCU_SYS_INT_EN1 address
cfcefe0126 ("ASoC: rsnd: add recovery support for under/over flow
error on SRC") added SCU_SYS_INT_EN1 address, but it should be
0x1d4, not 0x1c4. This patch fixup it.

Fixes: cfcefe0126 ("ASoC: rsnd: add recovery support for under/over flow error on SRC")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2015-11-06 12:06:48 +00:00
Mark Brown 71831ef699 Merge remote-tracking branches 'asoc/topic/rt298', 'asoc/topic/rt5640', 'asoc/topic/samsung' and 'asoc/topic/sh' into asoc-next 2015-10-26 11:16:13 +09:00
Mark Brown 512def88cb Merge remote-tracking branches 'asoc/topic/rcar', 'asoc/topic/rl6347a', 'asoc/topic/rockchip' and 'asoc/topic/rt286' into asoc-next 2015-10-26 11:16:10 +09:00
Kuninori Morimoto b415b4d312 ASoC: rsnd: remove duplicate parameter from rsnd_ssi_xxx()
rsnd_ssi_use_busif() and rsnd_ssi_is_pin_sharing() are the function
which returns current SSI status. But these requests duplicated parameter.
This patch removes duplicated parameter.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-22 13:30:01 +01:00
Kuninori Morimoto 69819f527a ASoC: rsnd: remove unused rsnd_dma_to_ssi() macro
rsnd_dma_to_ssi() is no longer used, let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-22 13:30:01 +01:00
Kuninori Morimoto c992934501 ASoC: rsnd: rename rsnd_mod_hw_start/stop to rsnd_mod_power_on/off
rsnd_mod_hw_start/stop were unclear naming.
It became rsnd_mod_power_on/off by this patch

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-22 13:30:01 +01:00
Kuninori Morimoto 89e3e2c352 ASoC: rsnd: fixup rsnd_dai_call() behavior for .stop/.quit
Current rsnd_dai_call returns immediately if rsnd_mod_call return fail.
Thus, each callback-count can be unbalanced for example .init was OK,
start was OK, but, .stop was not OK. This case .quit should be called
but isn't called. And, rsnd_dai_stream_quit() also not be called.
rsnd_dai_call() should call all .stop/.quit eventhough it returns error.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-22 13:30:01 +01:00
Kuninori Morimoto 32a96d558d ASoC: rsnd: fixup rsnd_dai_call() behavior for unimplemented method
Current rsnd_dai_call didn't count callback-count if callback
wasn't implemented. Thus, it counts can be unbalance.
ex) .start : implemented
    .stop  : not implemented
This patch solve this issue

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-22 13:30:01 +01:00
Kuninori Morimoto 1355720a3b ASoC: rsnd: fixup rsnd_mod_call() behavior for debug
Indicating each module method as debug message before executing is
readable/understandable.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-22 13:30:01 +01:00
Kuninori Morimoto b05ce4c091 ASoC: rsnd: fixup devm_request_irq() option on ssi.c
bfc0cfe("ASoC: rsnd: don't use rsnd_mod_to_io() on rsnd_ssi_xxx()")
tidyuped devm_request_irq() option from ssi to mod, but devm_free_irq()
on rsnd_ssi_dma_remove() didn't modified. This patch fixups this issue.
Otherwise kernel will output WARNING message.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-22 13:30:01 +01:00
Kuninori Morimoto 9993c16d46 ASoC: rsnd: fixup struct rsnd_gen::res array size
struct rsnd_gen :: res array size should be RSND_BASE_MAX,
not RSND_REG_MAX. This patch fixup it, and indicates whether
each data array size is based on what

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-22 13:30:01 +01:00
Kuninori Morimoto c9b9638f61 ASoC: rsnd: fixup print debug message after read
debug meesage for rsnd_mod_read() should be prints after read

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-22 13:30:01 +01:00
Kuninori Morimoto 8a98b4223d ASoC: rsnd: Gen1 probe is not error
Probing from Gen1 is not error. This patch fixup it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-16 15:21:35 +01:00
Kuninori Morimoto 4362495734 ASoC: rsnd: Announce for removing Gen1 SRU support
Gen1 SRU support was created for preparation of Gen2 SRC support,
but no-one is using this feature (sampling rate convert) on Gen1.
BockW had used SRU before, but it was pass through mode.
This means it is same as SSI. And BockW "platform base" code was
removed from upstream code. It is now supported via DT, but it doesn't
use SRU. More detail, r8a7778.dtsi has "rcar_sound,src" entry, but
no-one is using this feature today. SRU probing has no relation to this
removing. This means there is no effect for DT compatibility, no issues
on upstream kernel.

Gen2 SRC was created from Gen1 SRU, these are similar but not same IP.
Keeping Gen1 SRU in current driver is a little bit difficult,
and no-one is using it today. Gen1 sound is still supported via SSI.
Gen1 SRU support will be removed in the next kernel version.
This patch announces it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-14 10:11:10 +01:00
Masanari Iida 4272975a34 ASoC: sh: Fit typo in Kconfig
s/SUR/SRU/g

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-12 16:58:31 +01:00
Geert Uytterhoeven dcc448e619 ASoC: rsnd: Remove obsolete platform data support
Since commit 3d7608e4c1 ("ARM: shmobile: bockw: remove legacy
board file and config"), Renesas R-Car SoCs are only supported in
generic DT-only ARM multi-platform builds.  The driver doesn't need to
use platform data anymore, hence remove platform data configuration.

Move <sound/rcar_snd.h> to sound/soc/sh/rcar/, as it's no longer needed
by platform code.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 12:19:51 +01:00
Mark Brown 727e53a12f Merge remote-tracking branches 'asoc/topic/sh', 'asoc/topic/simple', 'asoc/topic/spear', 'asoc/topic/sunxi' and 'asoc/topic/tlv320aic3x' into asoc-next 2015-09-23 11:01:27 -07:00
Kuninori Morimoto 462c30bc8b ASoC: rsnd: fixup clkout_name[] index error for single AUDIO_CLKOUT SoC
2a46db4a3("ASoC: rsnd: add AUDIO_CLKOUT support") added AUDIO_CLKOUT
support for ADG. But single AUDIO_CLKOUT needs clkout_name[CLKOUT],
not clkout_name[i]. Kernel will have NULL pointer access without this
patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16 20:40:39 +01:00
Kuninori Morimoto e2f8445176 ASoC: rsnd: SND_SOC_RCAR depends on COMMON_CLK
2a46db4a3("ASoC: rsnd: add AUDIO_CLKOUT support") uses
of_clk_add_provider() which is requesting struct clk_onecell_data.
But it is COMMON_CLK feature. SND_SOC_RCAR depends on COMMON_CLK

This patch also solved compile error of 7486d80f7("ASoC: rsnd: remove
unneeded sh_clk header")

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16 20:40:02 +01:00
Kuninori Morimoto 2a46db4a37 ASoC: rsnd: add AUDIO_CLKOUT support
Renesas sound has AUDIO_CLKOUT (in Gen1/Gen2) AUDIO_CLKOUT1/2/3 (in Gen3)
This patch support these patches as clock provider.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:32 +01:00
Kuninori Morimoto 248e88c2fb ASoC: rsnd: adg: ignore undefined clock error
undefined clock is not error. Accept such case. And this is prepare
for clock out support in the same time.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:32 +01:00
Kuninori Morimoto 3af6c3ac91 ASoC: rsnd: tidyup ADG debug message for clock selection
It didn't have "\n", and indicated different data

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:32 +01:00
Kuninori Morimoto eae6fff4f1 ASoC: rsnd: tidyup ADG clock calculate method
Current ADG clock calculation needs ADG and SSI settings.
Thus, SSI side clock request function depends on ADG settings.
After reconsideration,  we can close this method inside ADG.
This function uses new method. And it becomes preparation for
AUDIO_CLKOUT support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:32 +01:00
Kuninori Morimoto 5c6901d98b ASoC: rsnd: ADG initial setup on rsnd_adg_ssi_clk_init()
ADG is special IP since it doesn't have MSTP. And now, ADG has common
mod base register access. We can now setup ADG initial setting when
probe timing. It is needed if sound card is based on AUIDO_CLK which
is used as Master clock.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:31 +01:00
Kuninori Morimoto f1df122907 ASoC: rsnd: add common mod confirm method
Renesas sound has SSI/SRC/DVC/MIX/ADG modules, and these have original
register mapping. Thus this driver is using regmap field, and each module
is using it based on each module ID.

Sometimes, each module needs other module to controlling. but current each
function is using just "mod" as parameter name. This is confusable.
For example, if SSI0 and SRC2 are connected, and if SRC module function
has bug of module access, and if it needs to control connected SSI,
SRC function will access to SSI2 (It should access to SSI0, but it uses
SRC's ID 2). This is easy to happen in current driver style.

To avoid this kind of confusable trouble, this patch adds module confirm
macro for debug purpose.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:31 +01:00
Kuninori Morimoto 1665a9e5e2 ASoC: rsnd: ADG uses mod base common method
Renesas sound has ADG IP, but it is special device.
(It is clock generater, and it doesn't need MSTP)
Thus, ADG didn't use mod base common method on rsnd driver.
But it can be confusable point. Let's use common method

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:31 +01:00
Kuninori Morimoto b76e218ae5 ASoC: rsnd: add rsnd_mod_get() macro and use it
Renesas sound driver has SSI/SRC/DVC/CTU/MIX, and these are controlled
as modules. And these module are member of each modules's private data.
It used own method to get module pointer, but Let's use common method

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:31 +01:00
Kuninori Morimoto ac37a45b0b ASoC: rsnd: Add Gen3 initial support
Renesas sound Gen3 is updated version of Gen2. We need to update
driver for it, but basically it should works as Gen2 compatible.
This is initial support for Gen3. Gen3 specific feature will be
incrementally added in the future

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:31 +01:00
Kuninori Morimoto 7486d80f7d ASoC: rsnd: remove unneeded sh_clk header
sh_clk header is not needed, and it will create confusion.
Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:29 +01:00
Kuninori Morimoto b9bfe9d5f7 ASoC: rsnd: rename rsnd_src_pcm_new() to rsnd_src_pcm_new_gen2()
rsnd_src_pcm_new() is used only from Gen2. make it clear in function name,
and remove unneeded Gen1 check.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:28 +01:00
Kuninori Morimoto c25f20e1de ASoC: rsnd: tidyup rsnd_dma_to_xxx() position
rsnd_dma_to_xxx() macro should exist in same place

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:28 +01:00
Axel Lin 1ff68f5590 ASoC: sh: siu_dai: Convert to use resource managed APIs
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 18:39:05 +01:00
Mark Brown cfed47d7b5 Merge remote-tracking branches 'asoc/topic/rt5677', 'asoc/topic/sh', 'asoc/topic/simple', 'asoc/topic/sirf-codec' and 'asoc/topic/spear' into asoc-next 2015-08-30 15:56:44 +01:00
Mark Brown 532161e6cc Merge remote-tracking branches 'asoc/topic/rcar', 'asoc/topic/reg-default', 'asoc/topic/rl6231', 'asoc/topic/rockchip' and 'asoc/topic/rt286' into asoc-next 2015-08-30 15:55:54 +01:00
Axel Lin e8de871e19 ASoC: sh: dma-sh7760: Convert to devm_snd_soc_register_platform
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-30 12:15:10 +01:00
Axel Lin 92eca20bbe ASoC: sh: ssi: Convert to devm_snd_soc_register_component
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-28 17:28:49 +01:00
Geert Uytterhoeven 1af2cc64b1 ASoC: rsnd: Silence DMA slave ID compile warning on 64-bit
On arm64:

    sound/soc/sh/rcar/dma.c: In function 'rsnd_dmaen_init':
    sound/soc/sh/rcar/dma.c:180:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
	     (void *)id);
	     ^
    include/linux/dmaengine.h:1185:75: note: in definition of macro 'dma_request_channel'
     #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y)
									       ^

Add an intermediate cast to "uintptr_t" to kill the compile warning.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-11 17:13:25 +01:00
Lars-Peter Clausen e773c2f964 ASoC: rcar ctu: Staticise local symbols
rsnd_of_parse_ctu() is not used outside this file so it can be static.
Fixes the following sparse warning:

	sound/soc/sh/rcar/ctu.c:72:6: warning: symbol 'rsnd_of_parse_ctu' was
		not declared. Should it be static?

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-29 15:06:08 +01:00
Kuninori Morimoto 48725e9cc8 ASoC: rsnd: tidyup parameter assignment position
84e95355602c("ASoC: rsnd: show debug message for SSI/SRC/DVC connection")
added debug message on rsnd_dai_connect(), but the relationship of
parameter check was absurdity. This patch tidyup it.
It is reported via Smatch/Dan

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-21 11:39:42 +01:00
Kuninori Morimoto 70fb10529f ASoC: rsnd: add MIX (Mixer) support
This patch adds MIX (Mixer) initial support for rsnd driver.
It is assuming that this MIX is used via DPCM.

This is sample code for playback.

	CPU0  : [MEM] -> [SRC1] -> [CTU02] -+
					    |
					    +-> [MIX0] -> [DVC0] -> [SSI0]
	                                    |
	CPU1  : [MEM] -> [SRC2] -> [CTU03] -+

	sound {
		compatible = "renesas,rsrc-card";

		...

		cpu@0 {
			sound-dai = <&rcar_sound 0>;
		};

		cpu@1 {
			sound-dai = <&rcar_sound 1>;
		};

		codec {
			...
		};
	};

	rcar_sound {

		...

		rcar_sound,dai {
			dai0 {
				playback = <&src1 &ctu02 &mix0 &dvc0 &ssi0>;
			};
			dai1 {
				playback = <&src2 &ctu03 &mix0 &dvc0 &ssi0>;
			};
		};
	};

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-17 19:26:06 +01:00
Kuninori Morimoto 9269e3c3cf ASoC: rsnd: add CTU (Channel Transfer Unit) prototype support
This patch adds CTU (Channel Transfer Unit) support for rsnd driver.
But, it does nothing to data at this point, but is required for MIX
support.

CTU design is a little different from other IPs (CTU0 is including
CTU00 - CTU03, and CTU1 is including CTU10 - CTU13, these have different
register mapping) We need to care about it on this driver.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-17 19:26:06 +01:00
Kuninori Morimoto 7dfb491945 ASoC: rsnd: update Audio DMA path search method
Current rsnd driver is assuming Audio DMAC / Audio DMAC peri peri
are used from SSI/SSIU/SRC/DVC. But we will add CTU/MIX to this driver.
Then, current DMA path searching method is not understandable, and good
enough for this purpose. This patch update DMA path search method, more
simply.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-17 19:26:06 +01:00
Kuninori Morimoto 78edead449 ASoC: rsnd: tidyup SRC position on each code
This is cleanup for CTU/MIX support

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:29:22 +01:00
Kuninori Morimoto 5cbbadd3d5 ASoC: rsnd: add rsnd_io_to_mod()
Sometimes we would like to get each module directly, especially data path
searching. this patch adds rsnd_io_to_mod() macro, and existing
rsnd_io_to_mod_xxx() use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:29:22 +01:00
Kuninori Morimoto ddea1b2e83 ASoC: rsnd: dma: add DMA name on .ops
Current rsnd driver is using Audio DMAC (via DMAEngine) and
Audio DMAC peri peri (via original method), and usage of these DMAC
are different. Indicates its naming is useful for debugging.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:29:22 +01:00
Kuninori Morimoto 9469b8b609 ASoC: rsnd: check the Gen1 at the beginning of DVC probe
DVC doesn't support Gen1, check it beginning of probe

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:29:22 +01:00
Kuninori Morimoto 98d358af07 ASoC: rsnd: tidyup rsnd_dma_ops definition place
rsnd_dma_ops is used only from dma.c, rsnd.h doesn't need it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:29:22 +01:00
Kuninori Morimoto 84e9535560 ASoC: rsnd: show debug message for SSI/SRC/DVC connection
It can help for connection debug

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:29:22 +01:00
Kuninori Morimoto 4689032b11 ASoC: rsnd: tidyup data align position
Sound L/R order of SSI is different from Linux sound data order.
So current rsnd driver is using DALIGN (= data align) to exchange data
align on SSIU. OTOH, CMD/SRC/SSIU have DALIGN register. Now inverted
sound volume will be exchanged if user used volume control on DVC.
Because SSIU which exchanges data align is located after DVC.

	MEM -> SRC -> DVC -> SSI

This patch exchanges data align SRC if possible

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:29:21 +01:00
Kuninori Morimoto bfe1360d79 ASoC: rsnd: add rsnd_get_adinr_chan()
Current rsnd driver has rsnd_get_adinr_bit() to get bit settings for
ADINR (= Audio Information Register) of SSIU/SRC/DVC.
This patch adds rsnd_get_adinr_chan() to get channel settings for
ADINR (= Audio Information Register) of CTU/MIX.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:29:21 +01:00
Kuninori Morimoto 3023b384d0 ASoC: rsnd: tidyup ADINR function name
Renesas sound IP (= SSIU/SRC/CTU/MIX/DVC) have ADINR
(= Audio Information Register), but some of them (= SSIU/SRC/DVC)
are for audio data bits, some of them (= CTU/MIX) are for audio data
channels.
Current rsnd driver is supporting SSIU/SRC/DVC, and these ADINR were
for bits. This patch rename rsnd_get_adinr() to rsnd_get_adinr_bit(),
and we will have rsnd_get_adinr_chan() for CTU/MIX.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:29:21 +01:00
Kuninori Morimoto d1ade514e8 ASoC: rsnd: add rsnd_src_initialize_lock/unlock()
Renesas SCU (Sampling Rate Convert Unit) includes SRC/CTU/MIX/DVC,
and these have similar register. xxxIR (Initialization Register) is one
of them. These xxxIR need be set to 1 during initialization.
Current rsnd driver has src.c / dvc.c, and we will have mix.c.
It is readable if these have same named function.
This patch adds rsnd_src_initialize_lock/unlock() and make sure it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:29:21 +01:00
Kuninori Morimoto 3bb3d363e5 ASoC: rsnd: add rsnd_dvc_initialize_lock/unlock()
Renesas SCU (Sampling Rate Convert Unit) includes SRC/CTU/MIX/DVC,
and these have similar register. xxxIR (Initialization Register) is one
of them. These xxxIR need be set to 1 during initialization.
Current rsnd driver has src.c / dvc.c, and we will have mix.c.
It is readable if these have same named function.
This patch adds rsnd_dvc_initialize_lock/unlock() and make sure it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:29:21 +01:00
Kuninori Morimoto e2c0841619 ASoC: rsnd: add rsnd_path_parse() for CTU/MIX/DVC route setting
Current sound data route settings is done in dvc.c, and it doesn't care
about CTU/MIX at this poinnt, but we need to care about these.
OTOH, rsnd driver already has rsnd_path_xxx() functions for data path which
are good match for CTU/MIX/DVC path selectio.
This patch adds new rsnd_path_parse() to select sound data route which will
care about CTU/MIX/DVC path.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:29:21 +01:00
Kuninori Morimoto c8cf15f64f ASoC: rsnd: rename rsnd_path_parse/break() into add/remove
parse/break is a little ambiguous/confusable name for rsnd module path.
Especially for CTU/MIX support. It was renamed to add/remove

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:29:21 +01:00
Kuninori Morimoto d6f8d5b442 ASoC: rsnd: enable module multi connection
'8a4e379b54f8("ASoC: rsnd: remove io from rsnd_mod")' removed mod/io
relationship. rsnd_dai_connect() mod/io check is no longer needed

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:29:20 +01:00
Kuninori Morimoto 379febfd2e ASoC: rsnd: src: make sure SRC soft reset
Renesas SCU (Sampling Rate Convert Unit) includes SRC/CTU/MIX/DVC,
and these have similar register. xxxRSR (Software reset Register) is one
of them. These xxxRSR need be set to 1 to 0 when software reset.
Current rsnd driver has src.c / dvc.c, and we will have mix.c.
It is readable if these have same named function.
This patch adds rsnd_src_soft_reset() and make sure it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:29:20 +01:00
Kuninori Morimoto 636e4bad5c ASoC: rsnd: dvc: make sure DVC soft reset
Renesas SCU (Sampling Rate Convert Unit) includes SRC/CTU/MIX/DVC,
and these have similar register. xxxRSR (Software reset Register) is one
of them. These xxxRSR need be set to 1 to 0 when software reset.
Current rsnd driver has src.c / dvc.c, and we will have mix.c.
It is readable if these have same named function.
This patch adds rsnd_dvc_soft_reset() and make sure it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:29:20 +01:00
Kuninori Morimoto da599fd34b ASoC: rsnd: move SRC specific macro into src.c
rsnd_src_nr() is used only from src.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:10:34 +01:00
Kuninori Morimoto 4f35fabaa3 ASoC: rsnd: move DVC specific macro into dvc.c
rsnd_dvc_nr() is used only from dvc.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:10:34 +01:00
Kuninori Morimoto 72413c107e ASoC: rsnd: rsnd_mod_id() return -1 if mod was NULL
enabling to use same method for exception case is useful.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:10:33 +01:00
Kuninori Morimoto 1a1bf58aaf ASoC: rsnd: add workaround for SRC sync convert + DVC
We couldn't use SRC sync convert mode together with DVC,
but we can use workaround for it.
This patch adds workaround and can use SRC sync convert + DVC

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:10:33 +01:00
Kuninori Morimoto a48e3f9747 ASoC: rsnd: fixup each module counter on __rsnd_mod_call()
'5451ea443b ("ASoC: rsnd: count each mod (SSI/SRC/DVC)")' counts each
module's callback status, but counts 1st callback only.
This patch fixup it. Otherwise, multi-called function will be trouble

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:10:33 +01:00
Kuninori Morimoto efa991dc91 ASoC: rsnd: rename INT_ENABLE to SSI_INT_ENABLE
based on datasheet

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:10:33 +01:00
Kuninori Morimoto cdde84d10d ASoC: rsnd: rename BUSIF_DALIGN to SSI_BUSIF_DALIGN
based on datasheet

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:10:33 +01:00
Kuninori Morimoto 6abcae32ea ASoC: rsnd: remove unnecessary 'out of memory' message from DVC
Current checkpatch.pl indicates 'out of memory' message is unnecessary.
Let's remove it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:10:32 +01:00
Kuninori Morimoto 33363f7a18 ASoC: rsnd: remove unnecessary 'out of memory' message from SRC
Current checkpatch.pl indicates 'out of memory' message is unnecessary.
Let's remove it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:10:32 +01:00
Kuninori Morimoto afa7007296 ASoC: rsnd: remove unnecessary 'out of memory' message from SSI
Current checkpatch.pl indicates 'out of memory' message is unnecessary.
Let's remove it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:10:32 +01:00
Kuninori Morimoto b7419dd736 ASoC: rsrc-card: use snd_soc_of_parse_audio_route/prefix for routing
using common audio routing path method makes sense.
Let's use snd_soc_of_parse_audio_route/prefix.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:10:32 +01:00
Geert Uytterhoeven be9ae23092 ASoC: fsi: Remove obsolete sh_fsi2 platform_device_id entry
Since the removal of the r8a7740 legacy board code in commit
1fa59bda21 ("ARM: shmobile: Remove legacy board code for
Armadillo-800 EVA"), all former users of the "sh_fsi2" platform device
name are only supported in generic DT-only ARM multi-platform builds.
The driver doesn't need to match platform devices by name anymore, hence
remove the corresponding platform_device_id entry.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 09:58:00 +01:00
Kuninori Morimoto 7b47ab47b3 ASoC: rsnd: gen: add rsnd_force_write()
rsnd_force_write() is similar to rsnd_write(),
but rsnd_force_write() write data to register even though
it is same value.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-10 11:39:37 +01:00
Linus Torvalds 4570a37169 sound updates for 4.2-rc1
It was a busy development cycle at this time, as you can see a wide
 range of changes in diffstat.  There are no big changes but many
 refactoring and improvements.  Here we go some highlights:
 
 * ALSA core:
 - Procfs codes were cleaned up to use seq_file
 - Procfs can be opt out via Kconfig (only for EXPERT)
 - Two types of jack API were unified finally; now both kctl and input
   jack devs are handled via a single function call.
 
 * HD-audio
 - Continued code restructuring for the future ASoC driver; now HDA
   controller driver is split to a core helper module.
 - Preliminary codes for Skylake audio support in HDA core.
 - Proper i915 gfx power well management for SKL & co
 - Enabled runtime PM as default for Intel HDMI/DP codecs
 - Newer Tegra chip supports
 - More quirks for Dell headsets, Alienware (with CA0132), etc.
 - A couple of DRM ELD helper API functions
 
 * ASoC
 - Support for loading ASoC topology maps from firmware, intended to be
   used to allow self-describing DSP firmware images to be built which
   can map controls added by the DSP to userspace without the kernel
   needing to know about individual DSP firmwares
 - Lots of refactoring to avoid direct access to snd_soc_codec where
   it's not needed supporting future refactoring
 - Big refactoring, cleanup and enhancement for the Wolfson ADSP driver
 - Cleanup series for TI TAS2552 and R-CAR drivers
 - Fixes and improvements on RT56xx codecs
 - Support for TI TAS571x power amplifiers
 - Support for Qualcomm APQ8016 and ZTE ZX296702 SoCs
 - Support for x86 systems with RT5650 and Qualcomm Storm
 - Support for Mediatek AFE (Audio Front End) unit
 - Other various small fixes to ASoC codec drivers
 
 * Firewire
 - Enhanced to allow non-blocking streams to use timestamp
   synchronization
 - Improve support for DM1500 and BeBoBv3
 
 * Misc
 - Cleanup of old pci API functions over all PCI sound drivers
 - Fix long-standing regression of the old powermac i2c setup
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJVitjmAAoJEGwxgFQ9KSmksW8P/2ngNzNpo/bmmGh6xjB7GWU9
 RDAkqhKd6yvcClQojGS9n4a9CJ8nk5tdqTr9rMp58N7DRv6GYCPdq0A+lLOih+yC
 UPcTkTMBKm6UtvJjEcaasMxhvs5xno345oo5KrBdvlfv1rXe83dTtzEsybWYkaVD
 dJbbr5QFaiyj5cTp9nanK5kyTyDDXCdP+vjBGv5u9+GbVxQ6Eenyts89uSqEZs1F
 ltoBrl4VotXyqHKneJ0ttUKEimcVIgu8rCXH0sTtCg0SZVJFi+UXzI/VkkS+expL
 x9bNN6bw5UT9LA8+qybFRETx+8qchFsffzeUEle4wkIpVKXt/VqjP3GIvp6umlF5
 RhU5Wumf2KuIVjgVsYxd7bUkmHr4ywpqS3vSWMWU90FApJay7exatzLPyUVN0AxH
 pdAizc8NWFk1kVtWq8jr9agEdxDt2l+E9UXij+ViGyouMZL1oSvOo9NgovfwvfC6
 qKUisUkq53p1uPOW/U5gvF7bee2enEXMI9YUY1Z8MHx7nloq+25Nqma8P0gYthB8
 6Qk+t1oqC2p7ZMSkyVHH9nySQmoLITZHZmsHqqpLW+jFtanhuckDI75AvmrScs+r
 3+2YZXxPI0caZZ1qxMCd7Clmh7ZcSeRe73HXSXmF0xrLffISM3Yg3ZN10cbWQRj2
 D6TiHCspLpn+pcYLcWJ2
 =D78E
 -----END PGP SIGNATURE-----

Merge tag 'sound-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound updates from Takashi Iwai:
 "It was a busy development cycle at this time, as you can see a wide
  range of changes in diffstat.  There are no big changes but many
  refactoring and improvements.  Here we go some highlights:

  ALSA core:
   - Procfs codes were cleaned up to use seq_file
   - Procfs can be opt out via Kconfig (only for EXPERT)
   - Two types of jack API were unified finally; now both kctl and input
     jack devs are handled via a single function call.

  HD-audio:
   - Continued code restructuring for the future ASoC driver; now HDA
     controller driver is split to a core helper module.
   - Preliminary codes for Skylake audio support in HDA core.
   - Proper i915 gfx power well management for SKL & co
   - Enabled runtime PM as default for Intel HDMI/DP codecs
   - Newer Tegra chip supports
   - More quirks for Dell headsets, Alienware (with CA0132), etc.
   - A couple of DRM ELD helper API functions

  ASoC:
   - Support for loading ASoC topology maps from firmware, intended to
     be used to allow self-describing DSP firmware images to be built
     which can map controls added by the DSP to userspace without the
     kernel needing to know about individual DSP firmwares
   - Lots of refactoring to avoid direct access to snd_soc_codec where
     it's not needed supporting future refactoring
   - Big refactoring, cleanup and enhancement for the Wolfson ADSP
     driver
   - Cleanup series for TI TAS2552 and R-CAR drivers
   - Fixes and improvements on RT56xx codecs
   - Support for TI TAS571x power amplifiers
   - Support for Qualcomm APQ8016 and ZTE ZX296702 SoCs
   - Support for x86 systems with RT5650 and Qualcomm Storm
   - Support for Mediatek AFE (Audio Front End) unit
   - Other various small fixes to ASoC codec drivers

  Firewire:
   - Enhanced to allow non-blocking streams to use timestamp
     synchronization
   - Improve support for DM1500 and BeBoBv3

  Misc:
   - Cleanup of old pci API functions over all PCI sound drivers
   - Fix long-standing regression of the old powermac i2c setup"

* tag 'sound-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (533 commits)
  ALSA: pcm: Fix pcm_class sysfs output
  ALSA: hda-beep: Update authors dead email address
  ASoC: wm_adsp: Move DSP Rate controls into the codec
  ASoC: wm8995: Fix setting sysclk for WM8995_SYSCLK_MCLK2 case
  ALSA: hda: provide default bus io ops extended hdac
  ALSA: hda: add hda link cleanup routine
  ALSA: hda: add hdac_ext stream creation and cleanup routines
  ASoC: rsrc-card: remove unused ret
  ALSA: HDAC: move SND_HDA_PREALLOC_SIZE to core
  ASoC: mediatek: Add machine driver for rt5650 rt5676 codec
  ASoC: mediatek: Add machine driver for MAX98090 codec
  ASoC: mediatek: Add AFE platform driver
  ASoC: rsnd: remove io from rsnd_mod
  ASoC: rsnd: move rsnd_mod_is_working() to rsnd_io_is_working()
  ASoC: rsnd: don't use rsnd_mod_to_io() on snd_kcontrol
  ASoC: rsnd: don't use rsnd_mod_to_io() on rsnd_src_xxx()
  ASoC: rsnd: don't use rsnd_mod_to_io() on rsnd_ssi_xxx()
  ASoC: rsnd: don't use rsnd_mod_to_io() on rsnd_dma_xxx()
  ASoC: rsnd: don't use rsnd_mod_to_io() on rsnd_get_adinr()
  ASoC: rsnd: add common interrupt handler for SSI/SRC/DMA
  ...
2015-06-25 17:15:18 -07:00
Linus Torvalds 2ad7b44f5d Merge branch 'for-linus-clk' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
Pull clkdev updates from Russell King:
 "This series addresses some breakage in clkdev caused by a previous
  patch set from the clk tree which introduced per-user clk structures.
  This basically renamed the existing 'struct clk' to 'struct clk_hw',
  and introduced a new 'struct clk'.

  This change will break anyone using clk_add_alias() with the common
  clk code enabled.  Thankfully, the intersection of users of
  clk_add_alias() and those using the common clk code is practically
  zero, but this is something which should be fixed to keep the code
  sane.

  The problem is that clk_add_alias() does this:

        r = clk_get(...);
        l = clkdev_alloc(r, ...);
        clk_put(...);

  which causes the alias to store a pointer to 'r', which has been
  freed.

  The original patch set tried to work around this problem incorrectly -
  at clk_get() time, it tried to convert the struct clk to a struct
  clk_hw, and then creating a new struct clk from that.  Clearly, if the
  original struct clk has been freed, then we have a use-after-free bug.

  We have other places in the tree which do something similar, so this
  series also addresses those locations too.

  This series addresses this problem by converting clkdev to store and
  use the clk_hw pointer.  This allows clk_get() to only have to create
  it's per-user struct clk from the clk_hw.  We can also get to the
  desired clk_hw at clk_add_alias() or clk lookup creation time, when
  the struct clk is "alive".

  We also perform some cleanups of the code:

   - replacing looped calls to clkdev_add() with clkdev_add_table()

   - replacing open-coded lookup allocation (which should have been
     using clkdev_alloc()) and subsequent clkdev_add() with
     clkdev_create()

   - replacing open-coded clk_add_alias() with clk_add_alias()"

* 'for-linus-clk' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
  clk: s2mps11: use clkdev_create()
  ASoC: migor: use clkdev_create()
  ARM: omap2: use clkdev_add_alias()
  ARM: omap2: use clkdev_create()
  ARM: orion: use clkdev_create()
  ARM: lpc32xx: convert to use clkdev_add_table()
  SH: use clkdev_add_table()
  clkdev: add clkdev_create() helper
  clkdev: const-ify connection id to clk_add_alias()
  clkdev: get rid of redundant clk_add_alias() prototype in linux/clk.h
  clkdev: drop __init from clkdev_add_table()
  clk: update clk API documentation to clarify clk_round_rate()
  clkdev: use clk_hw internally
2015-06-23 15:50:46 -07:00
Mark Brown f76b240206 Merge remote-tracking branch 'asoc/topic/rcar' into asoc-next 2015-06-22 11:19:46 +01:00
Mark Brown 71d8c2d783 Merge remote-tracking branches 'asoc/topic/qcom', 'asoc/topic/rcar', 'asoc/topic/rt286' and 'asoc/topic/rt5640' into asoc-next 2015-06-22 10:24:33 +01:00
Kuninori Morimoto 329d0c0cf1 ASoC: rsrc-card: remove unused ret
'047000278da3a17f8("ASoC: rsrc-card: cleanup for DPCM")'
cleanuped rsrc-card driver, but then, unused ret was left.
Below warning happen without this patch

${LINUX}/sound/soc/sh/rcar/rsrc-card.c: In function 'rsrc_card_startup':
${LINUX}/sound/soc/sh/rcar/rsrc-card.c:78:6: warning: unused variable \
	'ret' [-Wunused-variable]

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-17 11:25:11 +01:00
Kuninori Morimoto 8a4e379b54 ASoC: rsnd: remove io from rsnd_mod
Each Renesas sound mod (= SSI/SRC/DVC) might be called from many path
if it supports MIXer. In such case, mod <-> io is no longer 1:1
relationship. rsnd_mod_to_io() is no longer needed. Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:05 +01:00
Kuninori Morimoto d5bbe7de56 ASoC: rsnd: move rsnd_mod_is_working() to rsnd_io_is_working()
Each Renesas sound mod (= SSI/SRC/DVC) might be called from many paths
if it supports MIXer. In such case, mod <-> io is no longer 1:1
relationship.
This patch checks module working status via io instead of mod

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:04 +01:00
Kuninori Morimoto b65a7cccb5 ASoC: rsnd: don't use rsnd_mod_to_io() on snd_kcontrol
Each Renesas sound mod (= SSI/SRC/DVC) might be called from many paths
if it supports MIXer. In such case, mod <-> io is no longer 1:1
relationship. This patch removes rsnd_mod_to_io() from snd_kcontrol
and related function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:04 +01:00
Kuninori Morimoto 88c61cff4d ASoC: rsnd: don't use rsnd_mod_to_io() on rsnd_src_xxx()
Each Renesas sound mod (= SSI/SRC/DVC) might be called from many paths
if it supports MIXer. In such case, mod <-> io is no longer 1:1
relationship. This patch removes rsnd_mod_to_io() from rsnd_src_xxx()
and related function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:04 +01:00
Kuninori Morimoto bfc0cfe6b7 ASoC: rsnd: don't use rsnd_mod_to_io() on rsnd_ssi_xxx()
Each Renesas sound mod (= SSI/SRC/DVC) might be called from many paths
if it supports MIXer. In such case, mod <-> io is no longer 1:1
relationship. This patch removes rsnd_mod_to_io() from rsnd_ssi_xxx()
and related function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:04 +01:00
Kuninori Morimoto 9b99e9a7c5 ASoC: rsnd: don't use rsnd_mod_to_io() on rsnd_dma_xxx()
Each Renesas sound mod (= SSI/SRC/DVC) might be called from many paths
if it supports MIXer. In such case, mod <-> io is no longer 1:1
relationship. This patch removes rsnd_mod_to_io() from rsnd_dma_xxx()
and related function

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:04 +01:00
Kuninori Morimoto 4e2639ff38 ASoC: rsnd: don't use rsnd_mod_to_io() on rsnd_get_adinr()
Each Renesas sound mod (= SSI/SRC/DVC) might be called from many paths
if it supports MIXer. In such case, mod <-> io is no longer 1:1
relationship. This patch removes rsnd_mod_to_io() from rsnd_get_adinr()
and its related function

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:03 +01:00
Kuninori Morimoto f501b7a4e7 ASoC: rsnd: add common interrupt handler for SSI/SRC/DMA
Each Renesas sound mod (= SSI/SRC/DVC) might be called from many paths
if it supports MIXer. In such case, mod <-> io is no longer 1:1
relationship. Then, interrupt handler can't use rsnd_mod_to_io().
This patch adds SSI/SRC/DMA common interrupt handler frame

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:03 +01:00
Kuninori Morimoto 2c0fac19de ASoC: rsnd: adds struct rsnd_dai_stream as on each fuction as parameter
Each Renesas sound mod (= SSI/SRC/DVC) might be called from many paths
if it supports MIXer. In such case, mod <-> io is no longer 1:1
relationship. This means we can't call rsnd_mod_to_io() any more.
This patch adds struct rsnd_dai_stream to each function as parameter.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:03 +01:00
Kuninori Morimoto 2099bc8eb0 ASoC: rsnd: rsnd_mod has rsnd_priv
Each Renesas sound mod (= SSI/SRC/DVC) might be called from many paths
if it supports MIXer. In such case, mod <-> io is no longer 1:1
relationship. This means we can't use rsnd_mod_to_io() in SSI/SRC/DMA
interrupt handler. In such case, we need to check all io in interrupt
handler, and then, "priv" is needed.
This patch adds rsnd_priv pointer in rsnd_mod for prepare it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:03 +01:00
Kuninori Morimoto 5451ea443b ASoC: rsnd: count each mod (SSI/SRC/DVC)
Each Renesas sound mod (= SSI/SRC/DVC) might be called from many paths
if it supports MIXer. Then, we don't need to re-call each mod function
that had been called. This patch count each mod status.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:02 +01:00
Kuninori Morimoto 047000278d ASoC: rsrc-card: cleanup for DPCM
rsrc-card driver is based on simple-card driver which is caring about
CPU / Codec connection. OTOH, rsrc-card is used for DPCM system.
FE portion is constituted by CPU and dummy Codec, and BE is constituted
by dummy CPU and Codec in DPCM system.
Because of this, current rsrc-card is doing pointless method. It works well
if FE/BE was 1:1, but not good for multi FE/BE.
This patch cleanups rsrc-card driver for DPCM. and this is prepare for
MIX support for Renesas sound driver.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:02 +01:00
Kuninori Morimoto 061015f7bf ASoC: rsrc-card: tidyup return value of clock error
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:02 +01:00
Kuninori Morimoto fe3bd18432 ASoC: rsrc-card: move rsrc_card_parse_daifmt() to upper side
This is prepare for DPCM cleanup

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:02 +01:00
Kuninori Morimoto 8bd616c4f7 ASoC: rsnd-card: tidyup rsrc_priv_to_()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:02 +01:00
Kuninori Morimoto 1683e1a413 ASoC: rsrc-card: remove unused name
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:01 +01:00
Kuninori Morimoto 3433bf0798 ASoC: rsrc-card: enable multi cpu/codec for DPCM
Current rsrc-card is assuming 1 FE (= CPU), 1 BE (= codec) on card.
But, it will support multi FE/BE card. This is prepare for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:01 +01:00
Kuninori Morimoto 3c7e64dd89 ASoC: rsrc-card: tidyup priv->snd_card setup timing
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:01 +01:00
Kuninori Morimoto d72f4a885e ASoC: rsrc-card: used "fe.xxx"/"be.xxx" name for dai_link
Current dai_link name is using "cpu_dai_name + codec_dai_name",
but one of them is always "snd-soc-dummy-dai" when DPCM.
This patch uses "fe.xxx" for cpu, "be.xxx" for codec.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:01 +01:00
Kuninori Morimoto 75defee0f1 ASoC: rsnd: don't call snd_pcm_period_elapsed() under spin lock
'a9e1ac1a9e4585b5("ASoC: rsnd: spin lock for interrupt handler")'
added spin lock under interrupt handler to solve HW restart issue.

OTOH, current rsnd driver calls snd_pcm_period_elapsed() from
rsnd_dai_pointer_update(). but, it will be called under spin lock
if SSI was PIO mode.

If it was called under spin lock, it will call
snd_pcm_update_state() -> snd_pcm_drain_done().
Then, it calls rsnd_soc_dai_trigger() and will be dead-lock.
This patch doesn't call rsnd_dai_pointer_update() under spin lock

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:01 +01:00
Kuninori Morimoto 12927a8f80 ASoC: rsnd: don't care under/over run error when PIO
PIO is used only for checking data path / codec settings. And underrun
is very normal when PIO mode. Let's don't care about under/over run
error when PIO case. Otherwise, 1) too many HW restart happens, 2) some
sounds which need much data transfer can't play since it falls into
error detection method which was created for DMA transfer

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:34:00 +01:00
Mark Brown a178831a63 Merge remote-tracking branches 'asoc/topic/max98095', 'asoc/topic/omap', 'asoc/topic/pxa', 'asoc/topic/qcom' and 'asoc/topic/rcar' into asoc-next 2015-06-05 18:54:57 +01:00
Kuninori Morimoto 02299d9875 ASoC: rsnd: spin lock for interrupt handler
Renesas R-Car driver interrupt handler was not locked before.
But now, SSI/SRC interrupt handler calls restart function
which should be called under spin lock.
Below error might happen witout this patch.

Unable to handle kernel NULL pointer dereference at virtual address 00000048
pgd = edfac000
[00000048] *pgd=6e0f0831, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1] SMP ARM
CPU: 0 PID: 2009 Comm: aplay Not tainted 4.1.0-rc2-dirty #4
Hardware name: Generic R8A7790 (Flattened Device Tree)
task: eeac9040 ti: eebe8000 task.ti: eebe8000
PC is at rsnd_get_adinr+0x28/0x60
LR is at rsnd_src_ssiu_start+0xdc/0x19c
pc : [<c0409790>]    lr : [<c040c068>]    psr: a0000193
sp : eebe9e58  ip : eebe9e68  fp : eebe9e64
r10: c06ed9d0  r9 : ee919d10  r8 : 00000001
r7 : 00000001  r6 : ee1cb090  r5 : 00000000  r4 : edcaa418
r3 : 00000000  r2 : eea8ce00  r1 : 80000193  r0 : edcaa418
...

Reported-by: Cao Minh Hiep <cm-hiep@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Tested by: Cao Minh Hiep <cm-hiep@jinso.co.jp>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-22 14:15:26 +01:00
Kuninori Morimoto b723550d7e ASoC: rsnd: rsrc-card uses FE/BE merged format when DPCM
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-22 14:13:09 +01:00
Kuninori Morimoto 5626ad0866 ASoC: rsnd: add rsnd_dai_stream_quit()
Current Renesas R-Car sound driver calls rsnd_dai_stream_init() when
start, but it didn't call paired function. This patch adds
rsnd_dai_stream_quit() for it. This is prepare for interrupt error
status check feature support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Tested by: Cao Minh Hiep <cm-hiep@jinso.co.jp>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-21 11:58:48 +01:00
Kuninori Morimoto b847357979 ASoC: rsnd: indicate unknown HW start
rsnd_ssi_hw_stop() should be called after rsnd_ssi_hw_start().
This patch indicates unknown hw_stop as error

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Tested by: Cao Minh Hiep <cm-hiep@jinso.co.jp>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-21 11:46:00 +01:00
Kuninori Morimoto ae11a9be5a ASoC: rsnd: revert lock for calls to rsnd_dai_call
This reverts commit 'e9c390df671f ("ASoC: rsnd: make sure it uses lock when
it calls rsnd_dai_call)' The additional locks make 1") lock issue when boot
2) lock issue when unbind/rmmod. And there is no problem without these
locks. This patch revert it.

Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-12 11:44:07 +01:00
Russell King d76a4476a0 ASoC: migor: use clkdev_create()
clkdev_create() is a shorter way to write clkdev_alloc() followed by
clkdev_add().  Use this instead.

Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-05-06 11:58:59 +01:00
Mark Brown a78001b013 Merge remote-tracking branches 'asoc/fix/email', 'asoc/fix/fsl-ssi', 'asoc/fix/pm', 'asoc/fix/qcom' and 'asoc/fix/rcar' into asoc-linus 2015-04-29 13:37:28 +01:00
Kuninori Morimoto da620d722a ASoC: rsnd: care snd_kcontrol's index
rsnd might be used in multi-codec sound card.
Then, same name kcontrol will be registered many times, and it will
be error. This patch fixes this issue by using .index

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-27 20:57:39 +01:00
Kuninori Morimoto 919567d914 ASoC: rsnd: make sure SSI parent/child uses same number of sound channel.
SSI parent/child need to use same number of sound data channel
if these are sharing clock/ws pin. this patch makes it sure.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-27 20:57:38 +01:00
Kuninori Morimoto 8c5c79a1cd ASoC: rsnd: tidyup SSI parent related function/macro names
Current rsnd driver is using SSI parent related function/macro as
"clock" related. but it is not only clock related.
tidyup function/macro naming.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-27 20:57:38 +01:00
Kuninori Morimoto e9c390df67 ASoC: rsnd: make sure it uses lock when it calls rsnd_dai_call
rsnd_dai_call() should be called under rsnd_lock

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-27 20:57:38 +01:00
Kuninori Morimoto eb2535f542 ASoC: rsnd: add rsnd_dai_to_priv() macro
Using standardized function/macro name is useful in driver

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-27 20:57:38 +01:00
Linus Torvalds d6a4c0e5d3 Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave-dmaengine updates from Vinod Koul:

 - new drivers for:
        - Ingenic JZ4780 controller
        - APM X-Gene controller
        - Freescale RaidEngine device
        - Renesas USB Controller

  - remove device_alloc_chan_resources dummy handlers

  - sh driver cleanups for peri peri and related emmc and asoc patches
    as well

  - fixes and enhancements spread over the drivers

* 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (59 commits)
  dmaengine: dw: don't prompt for DW_DMAC_CORE
  dmaengine: shdmac: avoid unused variable warnings
  dmaengine: fix platform_no_drv_owner.cocci warnings
  dmaengine: pch_dma: fix memory leak on failure path in pch_dma_probe()
  dmaengine: at_xdmac: unlock spin lock before return
  dmaengine: xgene: devm_ioremap() returns NULL on error
  dmaengine: xgene: buffer overflow in xgene_dma_init_channels()
  dmaengine: usb-dmac: Fix dereferencing freed memory 'desc'
  dmaengine: sa11x0: report slave capabilities to upper layers
  dmaengine: vdma: Fix compilation warnings
  dmaengine: fsl_raid: statify fsl_re_chan_probe
  dmaengine: Driver support for FSL RaidEngine device.
  dmaengine: xgene_dma_init_ring_mngr() can be static
  Documentation: dma: Add documentation for the APM X-Gene SoC DMA device DTS binding
  arm64: dts: Add APM X-Gene SoC DMA device and DMA clock DTS nodes
  dmaengine: Add support for APM X-Gene SoC DMA engine driver
  dmaengine: usb-dmac: Add Renesas USB DMA Controller (USB-DMAC) driver
  dmaengine: renesas,usb-dmac: Add device tree bindings documentation
  dmaengine: edma: fixed wrongly initialized data parameter to the edma callback
  dmaengine: ste_dma40: fix implicit conversion
  ...
2015-04-24 09:49:37 -07:00
Kuninori Morimoto d1acba2fde ASoC: rsnd: set dmaen->chan = NULL when error case
rsnd_dmaen_quit() is assuming dmaen->chan is NULL if it failed
to get DMAEngine channel. but, current dmaen->chan might have
error value when error case (this driver is checking it by IS_ERR_OR_NULL())
This patch makes sure dmaen->chan is NULL when error case.
Otherwise, it will contact to unknown address in rsnd_dmaen_quit()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-15 17:05:27 +01:00
Mark Brown 1fa1e0731d Merge remote-tracking branches 'asoc/topic/omap', 'asoc/topic/qcom', 'asoc/topic/rcar' and 'asoc/topic/rt286' into asoc-next 2015-04-12 19:49:11 +01:00
Mark Brown b7af54a992 Merge remote-tracking branches 'asoc/topic/dmaengine', 'asoc/topic/fsi', 'asoc/topic/fsl' and 'asoc/topic/fsl-ssi' into asoc-next 2015-04-12 19:48:59 +01:00
Mark Brown 250acc709e Merge remote-tracking branches 'asoc/fix/ak4642', 'asoc/fix/atmel', 'asoc/fix/cs4271', 'asoc/fix/davinci' and 'asoc/fix/rcar' into asoc-linus 2015-04-12 19:48:22 +01:00
Arnd Bergmann 8616774968 ASoC: rnsd: fix build regression without CONFIG_OF
The r-car sound driver only works when CONFIG_OF is set, and
after a recent change has a compile-time dependency as well:

sound/built-in.o: In function `rsnd_dma_request_channel':
:(.text+0x9fb84): undefined reference to `of_dma_request_slave_channel'

This could be fixed either by adding a static inline wrapper
for the function, or by adding a Kconfig dependency. This
implements the second approach, which seems appropriate
because the driver in fact has a hard dependency.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 72adc61f46 ("ASoC: rsnd: 1st DMAC dma-names cares subnode")
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-11 23:05:18 +01:00
Kuninori Morimoto 43cb6954f8 ASoC: rsnd: add Synchronous SRC mode
Renesas R-Car sound SRC (= Sampling Rate Converter) has
Asynchronous/Synchronous SRC mode. Asynchronous mode is already
supported via DPCM. This patch adds Synchronous mode on it.

The condition of enabling Synchronous mode are
- SoC is clock master
- Sound uses SRC
- Sound doesn't use DVC
- Sound card uses DPCM (= rsrc-card card)

	amixer set "SRC Out Rate" on
	aplay xxx.wav &
	amixer set "SRC Out Rate" 48000

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-01 21:23:37 +01:00
Uwe Kleine-König 969b861906 ASoC: rcar: mark device data as constant
A driver's device data should and can be const. This is a follow-up on
commit 33187fb4a2 (ASoC: rsnd: constify of_device_id array) which
marked the of_device_id as const.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-01 09:58:40 +01:00
Uwe Kleine-König 9a42ab04aa ASoC: fsi: mark several data structures as const
A driver's platform_device_id and device data should and can be const.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-01 09:31:19 +01:00
Uwe Kleine-König 3b6281cf28 ASoC: fsi: reorder code to make a forward declaration superfluous
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-01 09:31:19 +01:00
Uwe Kleine-König 1c6ae56c5d ASoC: fsi: fix license specification
According to the file header only GPL v2 applies to it. Fix the
MODULE_LICENSE parameter accordingly.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-31 14:31:19 +01:00
Kuninori Morimoto 3b7843ff61 ASoC: rsnd: add DPCM based sampling rate convert
This patch supports DPCM based sampling rate convert on Renesas sound
driver. It assumes...
 1. SRC is implemented as FE
 2. BE dai_link supports .be_hw_params_fixup

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-27 16:00:49 -07:00
Kuninori Morimoto b543b52a44 ASoC: rsnd: remove useless debug message
This patch removes useless debug message. especially some kind of
"probed" message will be printed from core.c if it has #define DEBUG

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-27 16:00:47 -07:00
Mark Brown f8d04e7d91 Merge branch 'asoc-fix-rcar' into HEAD 2015-03-27 16:00:39 -07:00
Kuninori Morimoto 2f78dd7f40 ASoC: rsnd: call clk_prepare/unprepare() in probe/remove
clk_prepare_enable()/clk_disable_unprepare() uses mutex inside,
in concretely clk_prepare()/clk_unprepare().And it uses __schedule().
Then, raw_spin_lock/unlock_irq() is called, and it breaks Renesas
sound driver's spin lock irq.
This patch separates thesse into clk_prepare()/clk_unprepare() and
clk_enable/clk_disable. And call clk_prepare()/clk_unprepare() from
probe/remove function. Special thanks to Das Biju.

Reported-by: Das Biju <biju.das@bp.renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-27 15:59:17 -07:00
Kuninori Morimoto af7e2be966 ASoC: rsrc-card: add .be_hw_params_fixup support for convert rate
Current rsnd-dpcm-card is supporting DPCM FE/BE sound card.
This patch adds .be_hw_params_fixup and enabled sampling convert rate.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-27 15:58:20 -07:00
Kuninori Morimoto 415f1cb29d ASoC: rsrc-card: add Renesas sampling rate convert sound card support
Renesas sound card has "sampling rate convert" feature which
should be implemented via DPCM.
But, sound card driver point of view, it is difficult to add
this DPCM feature on simple-card driver. Especially, DT binding
support is very difficult.

This patch implements DPCM feature on DT as Renesas specific sound card.
This new driver is copied from current simple-card driver.
Main difference between simple-card and this driver are...
 1. removed unused feature from simple-card
 2. removed driver named prefix from DT property
 3. CPU will be FE, CODEC will be BE with snd-soc-dummy
 4. it supports sampling rate convert via .be_hw_params_fixup
 5. board specific routing is implemented in driver

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-27 15:58:20 -07:00
Krzysztof Kozlowski 2f4b1e6bb2 ASoC: rsnd: Fix duplicate const for DVC ramp rates
Replace duplicated const keyword for 'dvc_ramp_rate' with proper
array of const pointers to const strings.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-24 10:08:58 -07:00
Kuninori Morimoto f8c3c30943 ASoC: rsnd: add dai_link stream name
This patch adds missing dai_link stream_name
which is used when DPCM

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-22 18:20:51 +00:00
Kuninori Morimoto d2c4b80c5b ASoC: rsnd: show debug info for sampling rate convert
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-22 18:12:17 +00:00
Kuninori Morimoto 072bd1e7e1 ASoC: rsnd: tidyup error message format
This driver sometimes fixups debug/error message format
30cc4faf70
(ASoC: rsnd: tidyup debug message format and timing)
337b0b4c5f
(ASoC: rsnd: error meesage indicates its port)
But, it still exist un-fomated error message. This patch fixup it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-22 18:12:16 +00:00
Kuninori Morimoto 639b231f86 ASoC: rsnd: no more SRC restart when unusual situation
It will be SRC interrupt endless loop f unusual situation happen.
This patch adds restart limit for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-22 18:12:16 +00:00
Kuninori Morimoto 044930b4a6 ASoC: rsnd: no more SSI restart when unusual situation
It will be SSI interrupt endless loop f unusual situation happen.
This patch adds restart limit for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-22 18:12:15 +00:00
Fabian Frederick 33187fb4a2 ASoC: rsnd: constify of_device_id array
of_device_id is always used as const.
(See driver.of_match_table and open firmware functions)

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-22 18:06:35 +00:00
Fabian Frederick c660c0a805 ASoC: fsi: constify of_device_id array
of_device_id is always used as const.
(See driver.of_match_table and open firmware functions)

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-22 18:05:50 +00:00
Kuninori Morimoto 530b7b4a52 ASoC: rsnd: add regmap_config::name for debugfs
Renesas sound driver needs SSI/SRC/DVC regmaps, but it didn't have
regmap_config::name for devm_regmap_init_mmio().
Thus, debugfs initialization code tried to use same driver name
many times, and failed.
This patch adds eacy own name for regmap_config::name

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-11 11:56:51 +00:00
Kuninori Morimoto 8537483a17 ASoC: rsnd: recover PIO mode for new dma interface
Renesas sound driver needs 1st/2nd DMA interface,
and 1st DMA is using DMAEngine, and 2nd is using local method now.
2nd DMA had been DMAEngine, but it was moved to local method by previous
patchset. But then, it lost PIO mode fallback when probe.
this patch recovers it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-11 11:56:50 +00:00
Geert Uytterhoeven 6ec6fb6f23 ASoC: rsnd: Use %pad to print dma_addr_t in rsnd_dmapp_init()
sound/soc/sh/rcar/dma.c: In function 'rsnd_dmapp_init':
sound/soc/sh/rcar/dma.c:341:2: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat=]
  dev_dbg(dev, "id/src/dst/chcr = %d/%x/%x/%08x\n",
  ^
sound/soc/sh/rcar/dma.c:341:2: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat=]

Fixes: 288f392e72 ("ASoC: rsnd: add Audio DMAC peri peri support rework")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-11 11:56:42 +00:00
Kuninori Morimoto 72adc61f46 ASoC: rsnd: 1st DMAC dma-names cares subnode
Renesas R-Car sound (= rsnd) needs 2 DMAC which are called as
Audio DMAC (= 1st DMAC) and Audio DMAC peri peri (2nd DMAC).
And rsnd had assumed that 1st / 2nd DMACs are implemented as DMAEngine.
But, in result of DMA ML discussion, 2nd DMAC was concluded that it is
not a general purpose DMAC (2nd DMAC is for Device to Device inside
sound system). Additionally, current DMAEngine can't support Device to
Device, and we don't have correct DT bindings for it at this point.
So the easiest solution for it is that move it from DMAEngine to rsnd
driver.

dma-names on DT was implemented as no difference between 1st / 2nd
DMAC's, since rsnd had assumed that both DMACs are implemented as
DMAEngine. That style was "src_dst". But now, 2nd DMAC was implemented
as non DMAEngine, and it doesn't need dma-names anymore. So, this
dma-names rule is no longer needed.

And additionally, dma-names was assumed that it has all
(= SSI/SSIU/SRC/DVC) nodes under sound node.

In upstream code, no SoC/platform is supporting DMA for rsnd driver yet.
This means there is no compatible issue if this patch changes
dma-names's rule of DT.

This patch assumes dma-names for 1st DMAC are tx/rx base, and listed
in each SSI/SRC/DVC subnode
ex)
	rcar_sound,dvc {
		dvc0: dvc@0 {
			dmas = <&audma0 0xbc>;
			dma-names = "tx";
		};
	...

	rcar_sound,src {
		src0: src@0 {
			...
			dmas = <&audma0 0x85>, <&audma1 0x9a>;
			dma-names = "rx", "tx";
		};
	...

	rcar_sound,ssi {
		ssi0: ssi@0 {
			...
			dmas = <&audma0 0x01>, <&audma1 0x02>, <&audma0 0x15>, <&audma1 0x16>;
			dma-names = "rx", "tx", "rxu", "txu";
		};
	...

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:30 +00:00
Kuninori Morimoto 93b986e246 ASoC: rsnd: dvc: add rsnd_dvc_of_node()
This patch adds rsnd_dvc_of_node() to get DVC subnode from DT.
This is prepare for new DT bindings for 1st DMAC

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:30 +00:00
Kuninori Morimoto 82e76ed38e ASoC: rsnd: src: add rsnd_src_of_node()
This patch adds rsnd_src_of_node() to get SRC subnode from DT.
This is prepare for new DT bindings for 1st DMAC

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:30 +00:00
Kuninori Morimoto 04e627baa6 ASoC: rsnd: ssi: add rsnd_ssi_of_node()
This patch adds rsnd_ssi_of_node() to get SSI subnode from DT.
This is prepare for new DT bindings for 1st DMAC

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:30 +00:00
Kuninori Morimoto e879a9ddf4 ASoC: rsnd: enable rsnd_ssi_use_busif() for DMA
Renesas R-Car sound driver uses SSI, but the DMA interfaces are
SSI/SSIU. This interface is based on SSI/SRC/DVC connection.
And DMA function needs to know which interface is used somehow.
This patch enables rsnd_ssi_use_busif() for DMA.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:30 +00:00
Kuninori Morimoto 0d00a52182 ASoC: rsnd: use union with rsnd_dmaen / rsnd_dmapp
Renesas R-Car needs 2 DMACs.1st DMAC is DMAEngine, and 2nd DMAC is
implemented as local code. These 2 DMACs are never shared.
We can use union for these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:30 +00:00
Kuninori Morimoto aaf4fce019 ASoC: rsnd: remove rsnd_dma::dir
DMAEngine direction can be calculated from rsnd_dai_stream,
So, rsnd_dma::dir does not make sense now.
Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:30 +00:00
Kuninori Morimoto 56f2906ae2 ASoC: rsnd: remove rsnd_dma::addr
DMAEngine for Renesas R-Car driver is used only for Audio DMAC now.
rsnd_dma::addr was added to support Audio DMAC peri peri,
but it is no longer needed. Let's remove it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:30 +00:00
Kuninori Morimoto 288f392e72 ASoC: rsnd: add Audio DMAC peri peri support rework
Renesas R-Car sound (= rsnd) needs 2 DMAC which are called as
Audio DMAC (= 1st DMAC) and Audio DMAC peri peri (2nd DMAC).
And rsnd had assumed that 1st / 2nd DMACs are implemented as DMAEngine.
But, in result of DMA ML discussion, 2nd DMAC was concluded that it is
not a general purpose DMAC (2nd DMAC is for Device to Device inside
sound system). Additionally, current DMAEngine can't support Device to
Device, and we don't have correct DT bindings for it at this point.
So the easiest solution for it is that move it from DMAEngine to rsnd
driver.
Audio DMAC peri peri is controlled from sound driver without DMAEngine
by this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:30 +00:00
Kuninori Morimoto 3c68565b6c ASoC: rsnd: enable to care 1st / 2nd DMAC on rsnd_dma_xxx()
rsnd driver needs to care about Audio DAMC (via DMAEngine),
Audio DMAC peri peri (via local method) on rsnd driver.
This patch adds new rsnd_dma_ops and care it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:29 +00:00
Kuninori Morimoto 747c71b12e ASoC: rsnd: move rsnd_gen_dma_addr() from gen.c to dma.c
Now, we have dma.c for Audio DMAC / Audio DMAC peri peri.
rsnd_gen_dma_addr() should go there.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:29 +00:00
Kuninori Morimoto bfe834be95 ASoC: rsnd: add dma.c for Audio DMAC / Audio DMAC peri peri
Renesas sound driver had been assumed that Audio DMAC /
Audio DMAC peri peri are implemented by DMAEngine. But, result of DMA
ML discussion, it was concluded that it is not a general purpose DMAC.
And it should be moved from current DMAEngine to rsnd driver.
So, Audio DMAC peri peri become non DMAEngine.

OTOH, ALSA SoC has soc-generic-dmaengine-pcm implementation. but it
seems difficult to use this generic implementation on rsnd driver at
this point, since it needs to fallback to PIO mode if DMA can't use.
and additionally it needs 2 DMAC (= Audio DMAC / Audio DMAC peri peri).
These are not "generic" feature.

Of course I will try to use this generic dmaengine in the future somehow,
but just use current style at this point until it can formally use 2 DMACs.
This patch adds new dma.c and moves current dma code to dma.c from core.c.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:29 +00:00
Kuninori Morimoto c5212b4556 ASoC: rsnd: add rsnd_gen_get_phy_addr() to get physical address
physical address is required from Audio DMAC peri peri.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:29 +00:00
Kuninori Morimoto 7277911c87 ASoC: rsnd: enable to get resource by name
rsnd driver needs to support Audio DMAC peri peri inside sound driver.
getting resource by name is useful for it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:29 +00:00
Kuninori Morimoto 4ce3b17bd4 ASoC: rsnd: tidyup rsnd_dma_to_mod() macro declaration position
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:29 +00:00
Kuninori Morimoto 8a2ff4262c ASoC: rsnd: remove un-needed parameter from rsnd_dma_quit()
priv is not used on rsnd_dma_quit()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:29 +00:00
Kuninori Morimoto 9c706ab29f ASoC: rsnd: remove unused rsnd_dma_available()
rsnd_dma_available() is not used. Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:29 +00:00
Kuninori Morimoto 4715219ece ASoC: rsnd: remove un-needed parameter from rsnd_dma_init()
It can get DMA direction via rsnd_dai_stream.
Remove un-needed is_play from rsnd_dma_init().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:29 +00:00
Kuninori Morimoto c303cf0895 ASoC: rsnd: remove SH-DMA-BASE specific implementation
Renesas R-Car sound had SH-DMA-BASE specific implementation before,
but, now, it is no longer needed. Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-07 15:04:29 +00:00
Mark Brown e0427428db Merge remote-tracking branch 'asoc/fix/rsnd' into asoc-linus 2015-03-04 20:42:41 +00:00
Kuninori Morimoto 7c6cc8f201 ASoC: fsi: Configure DMA slave settings
Current FSI driver is assuming that dst_addr/src_addr of DMAEngine
will be set by platform data. But it should be set via
dmaengine_slave_config(). Special thanks to Arnd

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-23 16:13:23 +05:30
Kuninori Morimoto 5b7cdc8068 ASoC: fsi: remove slave_id settings for DMAEngine
Current fsi sets dma_slave_config :: slave_id field for DMAEngine,
but it is no longer needed. Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-23 16:13:22 +05:30
Kuninori Morimoto 0b1f6ec7a5 ASoC: rsnd: set device data before snd_soc_register_platform/component
Set device data before snd_soc_register_platform/component.
Otherwise, it will use NULL pointer if user calls unbind -> bind or
rmmod -> insmod

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-09 16:24:31 +08:00
Mark Brown cb6bfd3de4 Merge remote-tracking branches 'asoc/topic/rx51', 'asoc/topic/samsung', 'asoc/topic/sh', 'asoc/topic/simple' and 'asoc/topic/sta32x' into asoc-next 2015-02-04 20:57:18 +00:00
Mark Brown d84dbf3351 Merge remote-tracking branches 'asoc/topic/omap', 'asoc/topic/pxa' and 'asoc/topic/rcar' into asoc-next 2015-02-04 20:57:16 +00:00
Mark Brown d40d19447b Merge remote-tracking branches 'asoc/topic/doc', 'asoc/topic/dwc', 'asoc/topic/fsi', 'asoc/topic/fsl' and 'asoc/topic/fsl-asrc' into asoc-next 2015-02-04 20:57:11 +00:00
Kuninori Morimoto d7c42ff8c3 ASoC: rsnd: call missing snd_soc_unregiter_component/platform()
Current Renesas R-Car sound driver doesn't call
snd_soc_unregiter_component/platform() in .remove.
This patch call these functions.

Reported-by: Nguyen Viet Dung <nv-dung@jinso.co.jp>
Reported-by: Bui Duc Phuc <bd-phuc@jinso.co.jp>
Reported-by: Cao Minh Hiep <cm-hiep@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-02 18:37:56 +00:00
Kuninori Morimoto d1f83d6ef4 ASoC: rsnd: call missing snd_ctl_remove()
Current Renesas R-Car sound driver is using snd_ctl_xxx()
functions, but it didn't call snd_ctl free_one() / snd_ctl_remove().
This patch call these functions.

Reported-by: Nguyen Viet Dung <nv-dung@jinso.co.jp>
Reported-by: Bui Duc Phuc <bd-phuc@jinso.co.jp>
Reported-by: Cao Minh Hiep <cm-hiep@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-02 18:37:56 +00:00
Kuninori Morimoto 8048b91ffc ASoC: rsnd: tidyup DVC/SRC/SSI order
Current R-Car sound driver calls SRC -> SSI -> DVC functions,
but, it should be DVC -> SRC -> SSI.
Otherwise, SSI (= interface of codec) will have underrun error
when playback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:37:49 +00:00
Kuninori Morimoto 1ceeab2679 ASoC: rsnd: tidyup DMA start/stop timing on SSI
Current DMA starts after SSI, and stops before SSI. but we need
to reverse these order. Otherwise, under/over run error might happen.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:37:49 +00:00
Kuninori Morimoto 765ae7c8dd ASoC: rsnd: ignore DIRQ when DMA transfer
SSI interrupt handler of R-Car sound driver will be called
when DIRQ (= Data read/write timing for PIO) or
UIRQ / OIRQ (= under/over run error).
DIRQ "interrupt" doesn't occur when DMA transfer, but then,
DIRQ "status bit" might occur. we need to ignore this DIRQ
operation when DMA. Otherwise, driver will push/pop as PIO.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:37:48 +00:00
Kuninori Morimoto 337b0b4c5f ASoC: rsnd: error meesage indicates its port
Current SRC/SSI output its error, but it desn't indicate
port number. it is un-understandable.
Let's indicate port number for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:37:48 +00:00
Kuninori Morimoto 1b13d118ee ASoC: rsnd: save priv in struct rsnd_dai
Current rsnd driver has rsnd_mod_to_priv() macro, and struct rsnd_mod
has struct rsnd_priv pointer. But, it is waste of memory from data
structure point of view.
Today we can link mod <-> io <-> rdai each other, so saving priv in
rdai is very reasonable.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:37:48 +00:00
Kuninori Morimoto 690602fcd8 ASoC: rsnd: replace rdai to priv in each function
Current rsnd driver's function requests rdai, but it is not used.
Adding priv is more reasonable. Let's replace it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:37:48 +00:00
Kuninori Morimoto f708d944fe ASoC: rsnd: remove unsed rdai parameter from each function
Current rsnd driver's many functions requests struct rsnd_dai (= rdai),
but, 1) we can get rdai from rsnd_io_to_rsnd(), 2) almost all rdai
is not used. Let's remove these rdai.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:37:48 +00:00
Kuninori Morimoto 985a4f6e61 ASoC: rsnd: replace rsnd_dai_is_play() to rsnd_io_is_play()
Current rsnd driver can use rsnd_io_to_rdai()
we can get play/capture direction via io now.
Let's replace rsnd_dai_is_play() to rsnd_io_is_play()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:37:48 +00:00
Kuninori Morimoto 54cb556247 ASoC: rsnd: add rsnd_io_to_rdai()
Current rsnd driver request rdai in everywhere, but each mod should
reach to rdai by itself. this patch adds missing rsnd_io_to_rdai().

io   = rsnd_mod_to_io(mod);
rdai = rsnd_io_to_rdai(io);

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:37:48 +00:00
Kuninori Morimoto 7c57d76f51 ASoC: rsnd: remove rsnd_dai_get_platform_info() macro
rsnd_dai_get_platform_info() is not used. Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:37:48 +00:00
Kuninori Morimoto 2842aa7192 ASoC: rsnd: remove unused rsnd_dai_id()
rsnd_dai_id() was not used. Let's remove it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:37:48 +00:00
Kuninori Morimoto 3ed6448c95 ASoC: rsnd: rename rsnd_dai_is_clk_master() to rsnd_rdai_is_clk_master()
struct rsnd_dai is called as "rdai", and struct snd_soc_dai is called
as "dai" on this driver. but macro/function have confusable naming.
This patch rename rsnd_dai_is_clk_master() to rsnd_rdai_is_clk_master()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:37:48 +00:00
Kuninori Morimoto 710d088923 ASoC: rsnd: rename rsnd_dai_get() to rsnd_rdai_get()
struct rsnd_dai is called as "rdai", and struct snd_soc_dai is called
as "dai" on this driver. but macro/function have confusable naming.
This patch rename rsnd_dai_get() to rsnd_rdai_get()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:37:48 +00:00
Kuninori Morimoto 8564295231 ASoC: rsnd: rsnd_mod controls clock
Current rsnd driver's mod (= ssi/src/dvc) have each own clk,
but, these are needed to start/stop each mod.
This patch adds struct clk in rsnd_mod, and start/stop these
via rsnd_mod_hw_start/stop() macro

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:37:48 +00:00
Kuninori Morimoto 9d0e202f13 ASoC: rsnd: tidyup rsnd_io_to_xxx() macro declaration position
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:37:48 +00:00
Kuninori Morimoto 798cbb400a ASoC: rsnd: remove unsed .rate
rsnd_ssi::rate is not used. Let's remove it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:37:47 +00:00
Kuninori Morimoto cfcefe0126 ASoC: rsnd: add recovery support for under/over flow error on SRC
L/R channel will be switched if under/over flow error happen on
Renesas R-Car sound device by the HW bugs. Then, HW restart is required
for salvage. This patch add salvage support for SRC.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-12 12:59:32 +00:00
Lars-Peter Clausen 9cb2a25ce6 ASoC: migor: Use static DAI format setup
Set the dai_fmt field in the dai_link struct instead of manually calling
snd_soc_dai_fmt(). This makes the code cleaner and shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-06 17:34:32 +00:00
Lars-Peter Clausen 0db54e74a9 ASoC: sh: Remove unnecessary snd_pcm_lib_preallocate_free_for_all()
The ALSA core takes care that all preallocated memory is freed when the PCM
itself is freed. There is no need to do this manually in the driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-05 21:30:05 +00:00
Lars-Peter Clausen ddf3335b3e ASoC: rcar: Remove unnecessary snd_pcm_lib_preallocate_free_for_all()
The ALSA core takes care that all preallocated memory is freed when the PCM
itself is freed. There is no need to do this manually in the driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-05 21:29:47 +00:00
Markus Elfring 180cf794d4 ASoC: fsi: Deletion of unnecessary checks before the function call "clk_enable"
The clk_enable() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-05 19:03:00 +00:00
Linus Torvalds e6b5be2be4 Driver core patches for 3.19-rc1
Here's the set of driver core patches for 3.19-rc1.
 
 They are dominated by the removal of the .owner field in platform
 drivers.  They touch a lot of files, but they are "simple" changes, just
 removing a line in a structure.
 
 Other than that, a few minor driver core and debugfs changes.  There are
 some ath9k patches coming in through this tree that have been acked by
 the wireless maintainers as they relied on the debugfs changes.
 
 Everything has been in linux-next for a while.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlSOD20ACgkQMUfUDdst+ylLPACg2QrW1oHhdTMT9WI8jihlHVRM
 53kAoLeteByQ3iVwWurwwseRPiWa8+MI
 =OVRS
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core update from Greg KH:
 "Here's the set of driver core patches for 3.19-rc1.

  They are dominated by the removal of the .owner field in platform
  drivers.  They touch a lot of files, but they are "simple" changes,
  just removing a line in a structure.

  Other than that, a few minor driver core and debugfs changes.  There
  are some ath9k patches coming in through this tree that have been
  acked by the wireless maintainers as they relied on the debugfs
  changes.

  Everything has been in linux-next for a while"

* tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
  Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
  fs: debugfs: add forward declaration for struct device type
  firmware class: Deletion of an unnecessary check before the function call "vunmap"
  firmware loader: fix hung task warning dump
  devcoredump: provide a one-way disable function
  device: Add dev_<level>_once variants
  ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
  ath: use seq_file api for ath9k debugfs files
  debugfs: add helper function to create device related seq_file
  drivers/base: cacheinfo: remove noisy error boot message
  Revert "core: platform: add warning if driver has no owner"
  drivers: base: support cpu cache information interface to userspace via sysfs
  drivers: base: add cpu_device_create to support per-cpu devices
  topology: replace custom attribute macros with standard DEVICE_ATTR*
  cpumask: factor out show_cpumap into separate helper function
  driver core: Fix unbalanced device reference in drivers_probe
  driver core: fix race with userland in device_add()
  sysfs/kernfs: make read requests on pre-alloc files use the buffer.
  sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
  fs: sysfs: return EGBIG on write if offset is larger than file size
  ...
2014-12-14 16:10:09 -08:00
Mark Brown 6e6d57d07a Merge remote-tracking branches 'asoc/topic/rcar', 'asoc/topic/rockchip', 'asoc/topic/rt286' and 'asoc/topic/rt5631' into asoc-next 2014-12-08 13:12:07 +00:00
Mark Brown fed25395ff Merge remote-tracking branches 'asoc/topic/davinci', 'asoc/topic/doc', 'asoc/topic/dpcm', 'asoc/topic/dwc' and 'asoc/topic/fsi' into asoc-next 2014-12-08 13:11:56 +00:00
Mark Brown 0a7e4ca1aa Merge remote-tracking branches 'asoc/topic/ac97', 'asoc/topic/ad193x', 'asoc/topic/adau1373' and 'asoc/topic/adau17x1' into asoc-next 2014-12-08 13:11:45 +00:00
Kuninori Morimoto 6cfad78961 ASoC: rsnd: rename SSI function name of PIO
Current R-Car sound SSI PIO/DMA mode are using interrupt.
it is no longer "xxx_pio_xxx", rename it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-07 13:46:38 +00:00
Kuninori Morimoto 4e7d606cd5 ASoC: rsnd: add salvage support for under/over flow error on SSI
L/R channel will be switched if under/over flow error happen on
Renesas R-Car sound device by the HW bugs. Then, HW restart is required
for salvage. This patch add salvage support for SSI.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-07 13:45:27 +00:00
Kuninori Morimoto f0ef0cb84b ASoC: rsnd: remove un-necessary parameter from rsnd_src_start/stop()
rsnd_src_start/stop() requests struct rsnd_dai as parameter.
but, it is not used, and become more complex in L/R error handling.
Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-03 18:51:40 +00:00
Kuninori Morimoto 49229850be ASoC: rsnd: share SSI starting method between PIO/DMA mode
Basically, SSI starting method is same between PIO/DMA mode.
Let's share it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-03 18:51:40 +00:00
Kuninori Morimoto 933cc8cb08 ASoC: rsnd: set SRC_ROUTE_MODE0 on each rsnd_src_set_convert_rate()
Current src.c sets SRC_ROUTE_MODE0 on rsnd_src_start(), but, set it in
rsnd_src_set_convert_rate() is natural.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-03 18:51:40 +00:00
Kuninori Morimoto 603cefa59b ASoC: rsnd: initialize SRC on rsnd_src_init()
Current src initialize SRC on rsnd_src_set_convert_rate()
but, it should be done on rsnd_src_init().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-03 18:51:40 +00:00
Kuninori Morimoto b167a5780c ASoC: rsnd: use rsnd_src_convert_rate() once on rsnd_src_set_convert_rate_gen2()
using many rsnd_src_convert_rate() is not readable.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-03 18:51:40 +00:00