1
0
Fork 0
Commit Graph

28709 Commits (de2f62c6a59c21523468425bdfb66fa6734aa92f)

Author SHA1 Message Date
Daniel Baluta de2f62c6a5 MLK-20189-10: ASoC: fsl: dsp: Avoid unnecessary check
strtab is always non-null so remove unnecessary check.

This is a follow up of patch
167a6d79f ("ASoC: fsl: Skip checking for string section type")
and finally fixes CID3901026

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-11-14 09:47:51 +02:00
Colin Ian King 1e58af346c ASoC: sgtl5000: avoid division by zero if lo_vag is zero
In the case where lo_vag <= SGTL5000_LINE_OUT_GND_BASE, lo_vag
is set to zero and later vol_quot is computed by dividing by
lo_vag causing a division by zero error.  Fix this by avoiding
a zero division and set vol_quot to zero in this specific case
so that the lowest setting for i is correctly set.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-13 15:09:09 +02:00
Viorel Suman 302259f814 MLK-20189-9: ASoC: fsl: amix: remove dead code
Remove the dead code.

This fixes Coverity issue: CID1529915

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2018-11-13 15:09:09 +02:00
Viorel Suman 7b73200fa6 MLK-20189-8: ASoC: fsl_sai: use signed offset variable
Both dataline_off and dataline_off_dsd fields are unsigned,
thus checking negative values make no sense. Use a signed
variable to calculate offset instead.

This fixes Coverity issue: CID1899299

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2018-11-13 15:09:09 +02:00
Viorel Suman 9386717093 MLK-20189-7: ASoC: ak4458: check reset control status
Save error so that the following error checking now make sense.

This fixes Coverity issue: CID2828734

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2018-11-13 15:09:09 +02:00
Cosmin-Gabriel Samoila ad0ab32c08 MLK-20308 sound:asoc: fix re-enablement bug
When hwvad is enabled, if you try to re-enable it again, it should fail.
However, we were also double setting state to OFF on fail, which is
wrong because it resets the state and allows the second retry to enable
even if it wasn't disabled before.
Now we only return EBUSY.

Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
2018-11-13 14:34:36 +02:00
Cosmin-Gabriel Samoila 8c94563a3f MLK-20189 sound: asoc: fix unsigned compared against 0
An unsigned value can never be negative, so this test will always
evaluate the same way.

Fixes Coverity issue CID3618200

Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
2018-11-13 14:26:42 +02:00
Cosmin-Gabriel Samoila c262dde8ac MLK-20189 sound: asoc: fix dereference before null check
There may be a null pointer dereference, or else the comparison against
null is unnecessary.

Fixes Coverity issue CID5327850

Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
2018-11-13 13:55:36 +02:00
Daniel Baluta 167a6d79f4 MLK-20189-6: ASoC: fsl: Skip checking for string section type
e_shstrndx already contains the section header index, so
shdr->sh_type will always be SHT_STRTAB.

Remove this redundant check and make Coverity happy.

Fixes: CID3901026
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-11-09 13:08:30 +02:00
Daniel Baluta 2f83d82c72 MLK-20189-5: ASoC: fsl: dsp_proxy: Unlock proxy->lock on error path
xf_cmd_send_recv returns with lock taken if waiting was
interrupted by a signal.

This fixes Coverity issues: CID5233120 / CID5233060

Reviewed-by: S.j. Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-11-09 10:16:33 +02:00
Daniel Baluta 56efef908f MLK-20189-4: ASoC: fsl: library_load: Check return value for kernel_read
Bail out if kernel_read returns an error.

Fixes: CID1477415

Reviewed-by: S.j. Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-11-09 10:16:33 +02:00
Daniel Baluta 984f676b90 MLK-20189-3: ASoC: fsl: library_load: Remove dead code
At this point err is always 0. So, just remove the check.

Fixes: CID1477380

Reviewed-by: S.j. Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-11-09 10:16:33 +02:00
Daniel Baluta 3f25235525 MLK-20189-2: ASoC: dsp: Replace atomic_dec_return with atomic_dec
Return value is not used so better use atomic_dec.
This also silences coverity warning CID3344689.

Reviewed-by: S.j. Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-11-09 10:16:33 +02:00
Daniel Baluta 8464574897 MLK-20189-1: ASoC: fsl: dsp: Unlock proxy->lock on error path
xf_cmd_recv will return with lock taken in two cases:
	* msg was received
	* waiting for msg was interrupted by a signal

Make sure we unlock proxy->lock in both cases.

This fixes Coverity issue: CID3335482.

Reviewed-by: S.j. Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-11-09 10:16:33 +02:00
Shengjiu Wang 532a86fb06 MLK-20247: ASoC: imx-rpmsg: fix error when m4 image is not loaded
The reason is same as commit d4eb8ab263 ("MLK-19854-1: ASoC:
imx-cs42888: fix error when m4 image is not loaded")

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-11-09 15:33:15 +08:00
Shengjiu Wang eef266eed8 MLK-20277-3: ASoC: imx-pcm-rpmsg: change the state of substream in resume
In LPA mode, the system will be resumed by audio notification, when the
period size is small, there will be occasion that when notification
the underrun is happen, but the substream runtime state is not running
so the aplay won't trigger stop first, then start. just only trigger
the start, which don't comply with the convention.
So in this patch, we change the substream runtime state to running, when
the notification happened at resume.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-11-09 14:03:12 +08:00
Shengjiu Wang 2d8a7e5990 MLK-20277-2: ASoC: rpmsg_ak4497: remove digital_mute function
For the LPA mode, when the system enter suspend, the M4 will
continue to play the data, but for normal ALSA case, the digital
mute should be called at suspend, so the codec will be mute,
which conflict with the requirement of LPA.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-11-09 14:03:12 +08:00
Shengjiu Wang 8036a8b198 MLK-20277-1: ASoC: imx-pcm-rpmsg: reset the period index at stop
With the case that underrun happened, the aplay will trigger
stop and start, if the period index is not reset at stop, the
counter of period will be wrong

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-11-09 14:03:11 +08:00
Cosmin-Gabriel Samoila 904ab2a6d4 MLK-20253 sound: asoc: remove verbose messages from micfil
Enable and disable procedures contain info and warn prints. This
introduces delay in initialization / disablement procedures and we have
kept only the necessary prints in case of error.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-11-08 13:26:56 +02:00
Ranjani Vaidyanathan bf852ad46f MLK-20222-4 sound: Update SCFW API
Update SCFW API to the following commit:
"
   ("430d1e3646fbe75e339e18abf2330565eac906e0")
   Author: Chuck Cannon <chuck.cannon@nxp.com>
   Date:   Fri Nov 2 15:25:45 2018 -0500

   SCF-105: RN updates.
"

Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
2018-11-02 17:21:17 -05:00
Cosmin-Gabriel Samoila 9f8cf447d1 MLK-20100 sound: asoc: make hwvad work after system suspend/resume
Implemented system suspend resume functions to call hwvad enable/disable
then do runtime_force_suspend/resume.
Since hwvad can run independently, when user calls enable/disable, we
will have to increment/decrement usage counter by calling
runtime_*_sync but to avoid doing this when disable/enable is called
from system_suspend/resume since we called pm_runtime functions - this
is why we have added the sync parameter in enable/disable_hwvad.
However, we ignore the busy flag because the module wasn't designed to
work with arecord and hwvad in parralel and we only print a warning.
Since hwvad and recording share the same clock and initialization
procedures require module to be disabled, the busy flag will be set
when having both features enabled.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-11-02 18:21:19 +02:00
Daniel Baluta 8964b2b0e5 MLK-20094: ASoC: fsl: dsp: Fix crash in compress cleanup path
We must find a way to no longer touch resources after they are
cleand up.

Now, after a stress test we get the following crash:

[ 2156.863772] fsl-dsp 596e8000.dsp: xf_pool_alloc failed
[ 2156.869337] Unable to handle kernel NULL pointer dereference at
virtual address 00000060
[ 2157.148594] [<ffff000008d8839c>] _raw_spin_lock+0x14/0x48
[ 2157.153995] [<ffff000008b3e0b8>] xf_cmd_send_recv_complete+0x40/0xf0
[ 2157.160354] [<ffff000008b3e470>] xf_close+0x40/0x88
[ 2157.165239] [<ffff000008b3f7a4>] xaf_comp_delete+0x5c/0x70
[ 2157.170730] [<ffff000008b40530>] dsp_platform_compr_free+0xa0/0xe8
[ 2157.176917] [<ffff000008b287fc>] soc_compr_free_fe+0x144/0x1a0
[ 2157.182754] [<ffff000008b11b24>] snd_compr_free+0x64/0x98

This happens because:

	1) dsp_platform_process work handler waits in a loop for
	   messages to arrive.
	2) when cplay process finishes it cleans up most of the
	   resources.
	3) when another cplay process starts it reinitializes the
	  resources including queues for example.
	4) a message will be generated and kernel will crash because
	   dsp_platform_process uses the older queues.

A solution for this is to make sure dsp_platform_process work loop
is stopped at cleanup time.

We use is_active state and signal dsp_platform_process handler to
finish because we are on the cleanup path.

While at it replace cancel_work with cancel_work sync to be sure
that work handler ends before going on with the rest of the cleanup.

Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-11-02 18:09:16 +02:00
Shengjiu Wang e8401a450c MLK-20183-2: ASoC: imx-cdnhdmi: reconfigure the mclk for HDMI on imx8mq
In order to support 44kHz and 48kHz sample rate together, we need to
reconfigure the parent clock of mclk.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-11-02 19:16:53 +08:00
Shengjiu Wang e366eb506e MLK-19750-3: ASoC: rpmsg_cs42xx8: enhance async mode for rpmsg_cs42xx8
with this patch,codec driver can support tx and rx in
different master/slave mode, for example, tx in master mode,
rx in slave mode

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-11-01 10:03:29 +08:00
Shengjiu Wang 874fabab6f MLK-19750-2: ASoC: cs42xx8: enhance the async mode for cs42xx8
with this patch, codec driver can support tx and rx in
different master/slave mode, for example, tx in master mode,
rx in slave mode

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-11-01 10:03:29 +08:00
Shengjiu Wang 018e6aee7d MLK-19750-1: ASoC: fsl_esai: enhance async mode
With this patch, esai driver can support tx and rx in
different master/slave mode.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-11-01 10:03:29 +08:00
Cosmin-Gabriel Samoila d67a67e8b1 MLK-20102 sound: asoc: fix VAD channel select
The documentation specifies that VADCHSEL is used to select
the channel number on which hwvad detector will work. However,
we have used this field wrong (similar to the recording where
you can enable, disable multiple channels at the time).
This patch fixes hwvad and you can enable it by writing 0 to 7
in /sys/devices/platform/30080000.micfil/hwvad/enable or any
other number to disable it.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-31 09:34:19 +02:00
Cosmin-Gabriel Samoila 1ebac560b2 MLK-19662 sound: asoc: add support for recording and hwvad in parallel
Remove all clock disable from driver suspend/hwvad_disable
to avoid crashing one or another when recording stops or
voice is detected and hwvad is disabled.
Another change done to make this work is to remove atomic
variables that guard mutual exclusion between recording and
VAD.
We have also added a restriction such that recording rate
should be the same as hwvad rate when hwvad is enabled to
avoid changing the mclk rate.
However, the hwvad can be enabled before or after recording
but not when recording is done. On the other hand, recording
can be triggered at any time.
I am not sure we are supposed to support recording and hwvad
in parallel since micfil documentation requires PDM to be
disabled when any initialization or reconfiguration of hwvad
is done. An workaround to make this working is never disabling
the pdm module from hwvad functions and this seems to work,
even we are not following the whole reconfiguration procedure.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-10-30 11:16:58 +02:00
Daniel Baluta fb214bbcec MLK-19972-2: ASoC: fsl: dsp: Fix component creation cleanup path
Because we don't correctly free resources when an error occurs
on component creation path we can end up with partially initialized
components.

Freeing such partially initialized components most of the time leads
to kernel crashing in pain.

Avoid this by making sure we either:
	* return a fully initialized component, comp->active = true
	* don't "create" the component at all, comp->active = false

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 13:35:59 +02:00
Daniel Baluta 68db475b4f MLK-19972-1: ASoC: fsl: dsp: Fix compr_set_param cleanup path
In case of error no cleanup was done leaving thus reasources
in an undefined state.

This can cause crashes like this:

[   34.259281] fsl-dsp 596e8000.dsp: load codec wrap lib error
[   34.266333] fsl-dsp 596e8000.dsp: create component failed, type = 1,
err = -2
[   34.273493] err pool alloc ret = -2
[   34.298363] Unable to handle kernel NULL pointer dereference at
virtual address 00000000

... which happens when lib_dsp_codec_wrap.so is not present.

While at it, we also realign some lines of code in order to avoid
going over the 80 characters limit that Linux kernel coding style
preaches on.

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 13:35:59 +02:00
Shengjiu Wang e101e57de0 MLK-20034-1: ASoC: imx-ak4458: constrain the mclk rate for DSD
When enable DSD for ak4458 with imx8mm platform, in DSD256 mode
the mclk calculated from ak4458_get_mclk_rate is 256fs, but
the codec require the mclk should be 512fs. so just hard code
the clock to be 512fs in DSD mode.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-10-29 11:10:38 +08:00
Cosmin-Gabriel Samoila 6fef4d2b05 MLK-19936-4: sound: asoc:add clock source control in alsa mixer
Add control to select clock source from alasamixer or select
auto mode where clock source is automatically selected.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Cosmin-Gabriel Samoila 4160d0939f MLK-19936-3: sound: asoc: add rate in machine driver hw_params func
Add rate when calling dai sysclk so we can set rate after
we change the pdm_src parrent.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Cosmin-Gabriel Samoila e8cb2e2f40 MLK-19936-1 : sound: asoc: add support for different sample rates
At this moment, using audio_pll1 offers accurate clock for 48KHz only
and audio_pll2 offers accurate clock for 44.1KHz only.
With this patch, we dynamically switch between audio PLL1 and audio
PLL2 to support both 48KHz and 44.1KHZ rates.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Daniel Baluta 33f3c39a40 MLK-19949: ASoC: dsp: Fix codec libraries search path
Old implementation uses /usr/lib/imx-mm/audio-codec
to look for codec libraries.

Also this is the patch where Yocto rootfs stores the codec
libraries. So until we align Yocto with the kernel lets
change the driver to use the old path.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Shengjiu Wang 3600d74cba MLK-19854-1: ASoC: imx-wm8960: fix error when m4 image is not loaded
With rpmsg sound, when the m4 image is not loaded. There is error log

[ 46.275223] imx-wm8960 sound-rpmsg-wm8960: ASoC: CODEC DAI rpmsg-wm8960-hifi not registered
[ 46.284543] imx-wm8960 sound-rpmsg-wm8960: snd_soc_register_card failed (-517)

The issue is caused by that codec is not registered, the sound
card registration will fail

So add check in probe function for codec dai is ready or not.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-10-29 11:10:38 +08:00
Shengjiu Wang d4eb8ab263 MLK-19854-1: ASoC: imx-cs42888: fix error when m4 image is not loaded
With rpmsg sound, when the m4 image is not loaded. There is error log

[ 46.257647] imx-cs42888 sound-rpmsg-cs42888: ASoC: CODEC DAI cs42888 not registered
[ 46.265413] imx-cs42888 sound-rpmsg-cs42888: snd_soc_register_card failed (-517)

The issue is that codec is not register, the sound registeration will fail

So add check in probe function for codec dai ready or not.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-10-29 11:10:38 +08:00
Daniel Baluta a0cffd9a92 MLK-18497-13: ASoC: fsl: dsp: Skip SDRAM section update if fw is already loaded
If the DSP firmware binary is already loaded it is wrong to update
SDRAM located sections because we will overwrite and data stored there.

This makes suspend/resume work.

Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Daniel Baluta 5e49abd2a3 MLK-18497-12: ASoC: fsl: imx-dsp: Add DSP machine driver
Finally! We register DSP as a sound card.

Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Daniel Baluta b1b39c3b3c MLK-18497-11: ASoC: fsl: compress: Introduce compress implemenation
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Daniel Baluta 894ec89380 MLK-18497-10: ASoC: fsl: dsp: Refactor fsl_dsp_{open|close}
DSP driver now supports two interfaces. Old ioctl chardev based
interface and ALSA compress inteface.

Because some part of the open/close code is common introduce
two new functions which encapsulate the common functionality.

Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Daniel Baluta 454123b0c9 MLK-18497-9: ASoC: fsl: dsp: Export xf_client_alloc
While at it add include guard to dsp.h

Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Daniel Baluta da20ca1f54 MLK-18497-8: ASoC: fsl: dsp: Add DSP audio platform driver
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Daniel Baluta 6f3c7e2478 MLK-18497-7: ASoC: fsl: xaf_afi: Introduce component API
This is based on Xtensa Audio framework
userspace implemention API.

Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Daniel Baluta 34e8fd6971 MLK-18497-6: ASoC: fsl: dsp: Add Xtensa library handling API
This is based on RF-2016.4-linux package received from Cadence
and introduce the API for loading shared libraries into memory.

Based on this we create xf_load_lib/xf_load_unlib functions
which are used to tell DSP framework that codec libraries
are mapped in memory and it can start using them.

Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Daniel Baluta 21fa331157 MLK-18497-5: ASoC: fsl: dsp_proxy: Introduce client API
This will allow DSP driver to create/destroy a client on
DSP audio-framework proxy.

Registering a client on remote DSP proxy means creating
a component.

The implementation is similar with userspace application
proxy implementation.

Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Daniel Baluta c9594348db MLK-18497-4: ASoC: fsl: dsp: Add message buffer pool API
Memory is allocated to clients from memory pools. A memory pool
allocation is requested to DSP framework via XF_ALLOC command and
freed via XF_FREE.

Memory pool allocation API offers two functions:
	* xf_pool_alloc, allocate a number of buffers of given length
	* xf_pool_free, free memory area allocated for a pool.

Once a buffer pool is allocated users can handle buffers using the
following API:
	* xf_buffer_get(pool), gets a buffer from a pool
	* xf_buffer_put(buf), puts back a buffer into its pool

Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Daniel Baluta cc72baf6bd MLK-18497-3: ASoC: fsl: dsp_proxy: Add new send/recv helpers
This commit adds 3 new function helpers for sending
messages to DSP framework and waiting for response.

While at it cleanup spaces around struct client fields.

Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Daniel Baluta 2817467173 MLK-18497-2: ASoC: fsl: dsp_proxy: Add missing xf_unlock
xf_cmd_send_recv function returns with a lock taken
in case of success. Fix this, now!

This bug is present since the beginning of time and it didn't
show up because no one used xd_cmd_alloc/xf_cmd_free.

Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Daniel Baluta de0fb4c5d3 MLK-18497-1: ASoC: fsl: dsp_proxy: Fix license headers
This is a cleanup patch to have all the headers style
consistent across DSP driver.

Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00