25 Jun, 2019
1 commit
-
Change kzalloc to devm_kzalloc, so compr gets automatically freed when
it's no longer needed.Signed-off-by: Amadeusz Sławiński
Reviewed-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown
06 Feb, 2019
2 commits
-
The trigger and set_params callbacks are called from 3 and 2 separate
loops respectively, tidy up the code a little by factoring these out
into helper functions.Signed-off-by: Charles Keepax
Signed-off-by: Mark Brown -
For callbacks configuring the state of the components (trigger,
set_params, ack and set_metadata) simplify the code a little and make
intention clearer by aborting as soon as an error is encountered. The
operation has already failed and there is nothing to be gained from
processing the callbacks on additional components. The operations
currently abort after the callbacks, so this simply shortens the
error path.For callbacks returning information from the driver (copy,
get_metadata, pointer, get_codec_caps, get_caps and get_params)
only look for the first callback provided, currently the code will
call every callback only returning the information provided by the
last. Since we can only return one set of data, it makes no sense to
request the data from every component. Again this just makes the
currently supported feature set a little more clear.Signed-off-by: Charles Keepax
Signed-off-by: Mark Brown
21 Sep, 2018
1 commit
-
To be more readable code, this patch adds
new for_each_dpcm_be() macro, and replace existing code to it.Signed-off-by: Kuninori Morimoto
Signed-off-by: Mark Brown
07 Aug, 2018
1 commit
-
For some reason order of startup/hw_params/prepare are reversed
in dynamic compress usecase when compared to dpcm usecase. This is
a issue with platforms like QCOM where it expects the BE to be
initialized before FE.Interestingly the compress trigger callback order is inline with dpcm.
Am not 100% sure why the compress audio case has been reversed.
This patch is making the order inline with dpcm.If the reverse ordering is just co-incendental then this change
makes sense and will avoid inventing some new mechanism to cope
with ordering.Signed-off-by: Srinivas Kandagatla
Signed-off-by: Mark Brown
02 Jul, 2018
1 commit
-
Signed-off-by: Kuninori Morimoto
Signed-off-by: Mark Brown
11 May, 2018
2 commits
-
Signed-off-by: Charles Keepax
Acked-by: Vinod Koul
Signed-off-by: Mark Brown -
There are only one set of ops on the compressed stream so no need to
reassign the copy callback repeatedly, stop after copy is seen to be
necessary.Signed-off-by: Charles Keepax
Acked-by: Vinod Koul
Signed-off-by: Mark Brown
26 Apr, 2018
3 commits
-
There are 2 loops calling open and 4 loops calling free for all the
components on a DAI link. Factor out these loops into helper functions
to make the code a little clearer.Signed-off-by: Charles Keepax
Acked-by: Vinod Koul
Signed-off-by: Mark Brown -
As all drivers have been moved over to the new generic component
code remove the now unused platform specific code.Signed-off-by: Charles Keepax
Acked-by: Vinod Koul
Signed-off-by: Mark Brown -
The core should only call free on a component if said component has
already had open called on it. This is not presently the case and most
compressed drivers in the kernel assume it will be. This causes null
pointer dereferences in the drivers as they attempt clean up for stuff
that was never put in place.This is fixed by aborting calling open callbacks once a failure is
encountered and then during clean up only iterating through the
component list to that point.This is a fairly quick fix to the issue, to allow backporting. There
is more refactoring to follow to tidy the code up a little.Fixes: 9e7e3738ab0e ("ASoC: snd_soc_component_driver has snd_compr_ops")
Signed-off-by: Charles Keepax
Acked-by: Vinod Koul
Signed-off-by: Mark Brown
26 Jan, 2018
4 commits
-
The error message prints are a little inconsisent, tidy them up to be a
little more consistent with current style recommendations.Signed-off-by: Charles Keepax
Signed-off-by: Mark Brown -
Signed-off-by: Charles Keepax
Signed-off-by: Mark Brown -
…roonie/sound into asoc-compress
-
The soc_compr_copy callback is currently broken. Since the
changes to move the compr_ops over to the component the return
value is not correctly propagated, always returning zero on
success rather than the number of bytes copied. This causes
user-space to stall continuously reading as it does not believe
it has received any data.Furthermore, the changes to move the compr_ops over to the
component iterate through the list of components and will call
the copy callback for any that have compressed ops. There isn't
currently any consensus on the mechanism to combine the results
of multiple copy callbacks.To fix this issue for now halt searching the component list when
we locate a copy callback and return the result of that single
callback. Additional work should probably be done to look at the
other ops, tidy things up, and work out if we want to support
multiple components on a single compressed, but this is the only
fix required to get things working again.Fixes: 9e7e3738ab0e ("ASoC: snd_soc_component_driver has snd_compr_ops")
Signed-off-by: Charles Keepax
Signed-off-by: Mark Brown
Cc: stable@vger.kernel.org
05 Dec, 2017
1 commit
-
rtd->codec will be removed soon.
rtd->codec = rtd->codec_dai->codec, thus,
we can use rtd->codec_dai->component instead of it.Signed-off-by: Kuninori Morimoto
Signed-off-by: Mark Brown
23 Oct, 2017
1 commit
-
Platform will be replaced into Component in the future.
snd_soc_platform_driver has snd_compr_ops, but snd_soc_component_driver
doesn't have. To prepare for replacing, this patch adds snd_compr_ops on
component driver.platform will be replaced into component, and its code will be removed.
But during replacing, both platform and component process code exists.
To keep compatibility, to avoid platform NULL access and to avoid
platform/component duplicate operation during replacing process, this
patch has such code. Some of this code will be removed when platform was
removed.Signed-off-by: Kuninori Morimoto
Signed-off-by: Mark Brown
16 Aug, 2017
1 commit
-
For dynamic compress rtd, the codec_dai may not have any actual
meaning(like snd-soc-dummy-dai), so compress id can just use the
value of dai_link->stream_name. But for others, its codec_dai
has actual meaning, so compress id can include codec_dai name.Signed-off-by: Peng Donglin
Signed-off-by: Mark Brown
10 Aug, 2017
1 commit
-
Omit extra messages for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring
Signed-off-by: Mark Brown
20 Jun, 2017
1 commit
-
Currently compress driver hardcodes direction as playback to get
substream from the stream. This results in getting the incorrect
substream for compressed capture usecase.
To fix this, remove the hardcoding and derive substream based on
the stream direction.Signed-off-by: Satish Babu Patakokila
Signed-off-by: Banajit Goswami
Acked-By: Vinod Koul
Signed-off-by: Mark Brown
Cc: stable@vger.kernel.org
13 Nov, 2016
1 commit
-
ASoC Compress ops have only platform ops and no DAI ops unlike PCM device
where we have both platform ops as well as DAI ops.So add compress dai ops and add this new structure to the ASoC core to make
compressed devices a first class ASoC citizenAgain like PCM ops, drivers are free to implement either or both of
these ops based on device needs.Signed-off-by: Vinod Koul
Signed-off-by: Mark Brown
16 Aug, 2016
1 commit
-
After we have called dpcm_path_get we should make sure to call
dpcm_path_put on all error paths. This was not happening causing the
allocated widget list to be leaked, this patch corrects this by adding a
dpcm_path_put to the error path.Signed-off-by: Charles Keepax
Signed-off-by: Mark Brown
22 Jun, 2016
1 commit
-
Both soc_compr_pointer and the platform driver pointer callback return
ints but current soc_compr_pointer always returns 0. Update this so we
return the actual value from the platform driver callback. This doesn't
fix any issues simply makes the code more consistent.Signed-off-by: Charles Keepax
Acked-by: Vinod Koul
Signed-off-by: Mark Brown
12 Jan, 2016
1 commit
-
…ie/sound into for-next
ASoC: Last updates for v4.5
A bunch more updates for v4.5, mainly driver work:
- More topology API enhancements from Mengdong Lin working towards
making everything more component based and being able to specify PCM
links via topology.
- Large sets driver updates from Cirrus, Intel (mainly more Skylake
support) and Renesas.
- New driver for AMD ACP
- Rename PCM1792a driver to be generic pcm179x
08 Jan, 2016
1 commit
-
The detection of direction for compress was only taking into account codec
capabilities and not CPU ones. Fix this by checking the CPU side capabilities
as wellCc:
Tested-by: Ashish Panwar
Signed-off-by: Vinod Koul
Signed-off-by: Mark Brown
30 Nov, 2015
1 commit
-
Make snd_compress_new take an id string (like snd_pcm_new).
This string can be included in the procfs info.This patch also updates soc_new_compress() to create an ID
based on the stream and dai name, as done for PCM streams.Signed-off-by: Richard Fitzgerald
Acked-by: Vinod Koul
Signed-off-by: Takashi Iwai
22 Oct, 2015
1 commit
-
We don't always need soc-compress in soc, here add a config item
SND_SOC_COMPRESS, when nobody select it, the soc-compress will
not be compiled.Here also change Kconfig to 'select SND_SOC_COMPRESS' for drivers
that needed soc-compress.Signed-off-by: Jie Yang
Signed-off-by: Mark Brown
15 Jan, 2015
1 commit
-
In soc_new_compress() when rtd->dai_link->dynamic is set, we create the pcm
substreams with this call:ret = snd_pcm_new_internal(rtd->card->snd_card, new_name, num,
1, 0, &be_pcm);which passes 0 as capture_count leading to
be_pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream
being NULL, hence when trying to set rtd a few lines below we get an oops.
Fix by using rtd->dai_link->dpcm_playback and rtd->dai_link->dpcm_capture as
playback_count and capture_count to snd_pcm_new_internal().Signed-off-by: Qais Yousef
Signed-off-by: Mark Brown
Cc: stable@vger.kernel.org
22 Oct, 2014
1 commit
-
The actions taken in both branches are identical, so we can simplify the
code. Spotted by Coverity.Signed-off-by: Daniel Mack
Signed-off-by: Mark Brown
24 Sep, 2014
1 commit
-
Fix double unlock of fe card mutex introduced by patch 8f70e515a8bb
"ASoC: soc-pcm: fix dpcm_path_get error handling"The first unlock is at line 106, and the unlock is at line 149. we
should remove the first unlock.Reported-by: Dan Carpenter
Signed-off-by: Qiao Zhou
Signed-off-by: Mark Brown
10 Sep, 2014
1 commit
-
dpcm_path_get may return -ENOMEM when allocating memory for list
fails. We should not keep processing path or start up dpcm dai in
this case.Signed-off-by: Qiao Zhou
Acked-by: Vinod Koul
Signed-off-by: Mark Brown
17 Jul, 2014
1 commit
-
Multiple codecs does not make sense in the case of compressed
stream.Exit with error if it happens.
Signed-off-by: Benoit Cousson
Tested-by: Lars-Peter Clausen
Reviewed-by: Lars-Peter Clausen
Acked-by: Vinod Koul
Signed-off-by: Mark Brown
22 Jun, 2014
1 commit
-
The component struct already has a name and id field which are initialized to
the same values as the same fields in the CODEC and platform structs. So remove
them from the CODEC and platform structs and used the ones from the component
struct instead.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Mark Brown
14 May, 2014
1 commit
-
The return statement was not indented correctly. I lined up the
condition a bit as well.Signed-off-by: Dan Carpenter
Signed-off-by: Mark Brown
13 May, 2014
1 commit
-
This was initially removed in commit 6423c1875 ("ASoC: Remove runtime field from
DAI"), but was, presumably by accident, brought back in commit f0fba2ad1 ("ASoC:
multi-component - ASoC Multi-Component Support"). But has never been
initialized to anything but NULL ever since. This commit removes it again.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Mark Brown
06 Mar, 2014
2 commits
-
We have the same code that increments and decrements the active field of the
various PCM runtime components (all with the same bugs). Factor this out into
common helper functions.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Mark Brown -
For CODEC to CODEC links we should only immediately power down if both CODECs
are configured to ignore the power down delay. Factor the logic for this
into a helper function that can be used for both compressed and normal PCMs.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Mark Brown
18 Jan, 2014
1 commit
-
Currently compressed audio streams are statically routed from the /dev
to the DAI link. Some DSPs can route compressed data to multiple BE DAIs
like they do for PCM data.Add support to allow dynamically routed compressed streams using the existing
DPCM infrastructure. This patch adds special FE versions of the compressed ops
that work out the runtime routing.Signed-off-by: Liam Girdwood
Acked-by: Vinod Koul
Signed-off-by: Mark Brown
12 Aug, 2013
1 commit
-
There is no need for the power down work to be done on a per CPU workqueue
especially considering the fairly long delay before powerdown.Signed-off-by: Mark Brown
Acked-by: Vinod Koul
29 Jul, 2013
1 commit
-
the compress metadata handlers were wrongly named sst_xxx
Signed-off-by: Vinod Koul
Signed-off-by: Mark Brown