1
0
Fork 0
Commit Graph

817 Commits (1bb33a98702d8360947f18a44349df75ba555d5d)

Author SHA1 Message Date
Mark Brown 79e24da00b Merge branch 'topic/update-bits' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into asoc-rcar 2016-03-02 12:58:58 +09:00
Kuninori Morimoto fd9adcfdc1 ASoC: rsnd: judge work SSI in runtime
Current rsnd supports multi SSI (maximum 4 SSI for 8ch),
and, it should determine whether using each SSI or not in runtime.
All SSIs are not used even if there are 4 SSI in case of stereo.

Current driver setups un-used SSI in such case. It is no problem,
but not needed. This patch judges it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-20 00:53:02 +09:00
Kuninori Morimoto 4f5c634d58 ASoC: rsnd: judge multi SSI in runtime
Current rsnd supports multi SSI (maximum 4 SSI for 8ch),
and, it should determine whether using each SSI or not in runtime.
Current judgement is vague, and had broken by
c308abe45e2("ASoC: rsnd: rsnd_ssi_is_multi_slave() macro uses
rsnd_ssi_multi_slaves()")
This patch makes clean it, and solve this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-20 00:53:02 +09:00
Kuninori Morimoto 615fb6c7b1 ASoC: rsnd: move rsnd_ssi_irq() position
prepare for runtime judging for SSI work

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-20 00:53:02 +09:00
Kuninori Morimoto 098bd8911a ASoC: rsnd: Parent SSI attach is not needed if not clock master
Parent SSI is needed if it is PIN sharing and clock master,
otherwise, not needed. But, whether clockk master is judged on
.set_fmt, thus, it can't call rsnd_ssi_parent_attach() on .probe.

Now, .pcm_new will be called after .set_fmt, so this patch reuses it
at this point.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-20 00:53:02 +09:00
Kuninori Morimoto 0dc6bf7502 ASoC: rsnd: tidyup SSI init/start sequence
SSI want to have SSIWSR settings and SSICR settings without EN bit
when init, and SSICR EN bit only when start timing.
Otherwise, SSI output signal might be unstable.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-20 00:53:02 +09:00
Kuninori Morimoto c8e969a85e ASoC: rsnd: add missing .irq callback for DMA
commit b5b442abd9 ("ASoC: rsnd: add .irq callback") added .irq callback
but SSI DMA is missing it. This patch adds it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-20 00:53:02 +09:00
Kuninori Morimoto 5bf5d8fc7f ASoC: rsnd: fixup forever loop bug on SSI
commit b5b442abd9 ("ASoC: rsnd: add .irq callback")
added .irq support, and it cares both parent SSI and normal SSI.
But it should care only normal SSI. Otherwise SSI might be
forever loop if SSI is used as both parent SSI and normal SSI
(= 2 users), and if under/over run error happen. Because irq disable
do nothing in such case. This patch solve this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-20 00:53:02 +09:00
Kuninori Morimoto 26d34b11af ASoC: rsnd: SSI function parameter uses "mod" instead of "ssi"
To reduce confusion, SSI uses "mod" instead of "ssi"
as function parameter

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-20 00:53:02 +09:00
Kuninori Morimoto 1120dbff2a ASoC: rsnd: indicates status failed SSI
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-20 00:53:02 +09:00
Kuninori Morimoto 0fbab951db ASoC: rsnd: setup SRC_ROUTE_MODE0 before SRC_SRCIR
SRC_ROUTE_MODE0 determines whether to use SRC.
Thus, it should be setup before SRC_SRCIR.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-20 00:53:02 +09:00
Kuninori Morimoto d2240f0dad ASoC: rsnd: rename RSND_DVC_CHANNELS to RSND_MAX_CHANNELS
The channels number is not only for DVC. Let's rename it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-20 00:53:02 +09:00
Kuninori Morimoto c308abe45e ASoC: rsnd: rsnd_ssi_is_multi_slave() macro uses rsnd_ssi_multi_slaves()
b4c83b171 ("ASoC: rsnd: add Multi channel support") added
Multi channel support, and current rsnd_ssi_is_multi_slave()'s check
method is !SSI equals SSIM1/2/3. But, SSI parent also hit to this macro.
Because of this reason, some stream which needs SSI parent clock
can't work correctly. This patch uses rsnd_ssi_multi_slaves() to
solve this issue. This issue was reported by Dung.

Reported-by: Nguyen Viet Dung <nv-dung@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-09 16:17:32 +00:00
Kuninori Morimoto b5b442abd9 ASoC: rsnd: add .irq callback
Current rsnd driver has .init/.start/.stop/.quit callbacks,
and it needs many IPs (SRC/CTU/MUX/DVC/CMD/SSIU/SSI).
Because of these relationship, it might get unnecessary
error IRQ when start/stop.
This patch adds new .irq callback and control IRQ enable/disable
timing to avoid it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-27 12:22:24 +00:00
Kuninori Morimoto 6a25c8da00 ASoC: rsnd: don't auto-recover when under/over run error
Renesas R-Car sound needs recovery (= restart) when under/over run
error occurred, and current driver tries it on under/over run error
handler automatically. But this recovery should be handled by userland,
not kernel. This patch stops XRUN when under/over run error occur, and
will leave the recovery of HW in userland.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-27 12:22:24 +00:00
Kuninori Morimoto 31739a689f ASoC: rsnd: disable SRC.out/in in same time
commit b761bf272b ("ASoC: rsnd: disable SRC.out only when stop timing")
disabled SRC.out/in in different timing, but was based on
picky HW information. Now, we have confirmed that we can disable
both in the same time. This patch do 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 38587f4cb7 ASoC: rsnd: tidyup Playback/Capture sequence
Based on datasheet sequence

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 dc037afdbc ASoC: rsnd: ctu: settings matches to datasheet
Current CTU settings was rough. This patch makes it match to datasheet.
But do nothing at this point.

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 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