Commit graph

2888 commits

Author SHA1 Message Date
Takashi Iwai d3bbc28bd3 ASoC: Fixes for v5.8
An awful lot of mostly small fixes here, mainly for x86 based platforms
 and the CODEC drivers mainly used on them.  For the most part this is
 either minor device specific stuff which seems to come from detailed
 testing or robustness against errors which comes from people having done
 some fuzzing runs aginst the topology code.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl8Rzk0THGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0GWlB/9Y6g9MQ4Ih4Evsv4q/ZeJRnTGaKZMT
 7XjZRB64tTrFWbt38iGpRcjQLy5I5tVuGbdd7mPVKgZgSVxvoj4HQ4vf23rkNxon
 RuQIbFtI2rwvdWKDo9a0RkF+IwuWhmrupfN8DMZoJIyRyh99tDrLwGjmiUUXsVV2
 NyfcGerQjbngraK+2lQtnzbfX9d2qGiZVKEdczQVjJcgyNAYI2N22+3O1hFHmo80
 6f5BbRpaVPXpQmRBmFthTdgthrr6uZPDXDoEYw77V9okvCwthrjBIGDow4EkVTZk
 xRPKo7g2EFuLd18ro/J8nAJ1KDideKB4I5cFcz9QViVZbVftk2CrFrvg
 =V/55
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v5.8-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v5.8

An awful lot of mostly small fixes here, mainly for x86 based platforms
and the CODEC drivers mainly used on them.  For the most part this is
either minor device specific stuff which seems to come from detailed
testing or robustness against errors which comes from people having done
some fuzzing runs aginst the topology code.
2020-07-17 18:19:02 +02:00
Pierre-Louis Bossart 25612477d2
ASoC: soc-dai: set dai_link dpcm_ flags with a helper
Add a helper to walk through all the DAIs and set dpcm_playback and
dpcm_capture flags based on the DAIs capabilities, and use this helper
to avoid setting these flags arbitrarily in generic cards.

The commit referenced in the Fixes tag did not introduce the
configuration issue but will prevent the card from probing when
detecting invalid configurations.

Fixes: b73287f0b0 ('ASoC: soc-pcm: dpcm: fix playback/capture checks')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200707210439.115300-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 13:51:35 +01:00
Maxime Ripard 58f30150ff
ASoC: core: Remove only the registered component in devm functions
The ASoC devm_ functions that register a component
(devm_snd_soc_register_component and devm_snd_dmaengine_pcm_register) will
clean their component by running snd_soc_unregister_component.

snd_soc_unregister_component will then remove all the components for the
device that was used to register the component in the first place.

However, some drivers register several components (such as a DAI and a
dmaengine PCM) on the same device, and if the dmaengine PCM is registered
first, then the DAI will be cleaned up first and
snd_dmaengine_pcm_unregister will be called next.

snd_dmaengine_pcm_unregister will then lookup the dmaengine PCM component
on the device, and if there's one unregister that component and release its
dmaengine channels. That doesn't happen in practice though since the first
call to snd_soc_unregister_component removed all the components, so we
never get the chance to release the dmaengine channels.

In order to fix this, instead of removing all the components for a given
device, we can simply remove the component that was registered in the first
place. We should have the same number of component registration than we
have components, so it should work just fine.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20200707074237.287171-1-maxime@cerno.tech
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-07 11:55:46 +01:00
Vinod Koul f79a732a83 ALSA: compress: fix partial_drain completion state
On partial_drain completion we should be in SNDRV_PCM_STATE_RUNNING
state, so set that for partially draining streams in
snd_compr_drain_notify() and use a flag for partially draining streams

While at it, add locks for stream state change in
snd_compr_drain_notify() as well.

Fixes: f44f2a5417 ("ALSA: compress: fix drain calls blocking other compress functions (v6)")
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200629134737.105993-4-vkoul@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-07-07 11:52:18 +02:00
Hans de Goede 85ca6b17e2
ASoC: rt5670: Add new gpio1_is_ext_spk_en quirk and enable it on the Lenovo Miix 2 10
The Lenovo Miix 2 10 has a keyboard dock with extra speakers in the dock.
Rather then the ACL5672's GPIO1 pin being used as IRQ to the CPU, it is
actually used to enable the amplifier for these speakers
(the IRQ to the CPU comes directly from the jack-detect switch).

Add a quirk for having an ext speaker-amplifier enable pin on GPIO1
and replace the Lenovo Miix 2 10's dmi_system_id table entry's wrong
GPIO_DEV quirk (which needs to be renamed to GPIO1_IS_IRQ) with the
new RT5670_GPIO1_IS_EXT_SPK_EN quirk, so that we enable the external
speaker-amplifier as necessary.

Also update the ident field for the dmi_system_id table entry, the
Miix models are not Thinkpads.

Fixes: 67e03ff3f3 ("ASoC: codecs: rt5670: add Thinkpad Tablet 10 quirk")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1786723
Link: https://lore.kernel.org/r/20200628155231.71089-4-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-29 20:37:20 +01:00
Takashi Iwai 91ef3d9f9f ASoC: Fixes for v5.8
This is a collection of mostly small fixes, mostly fixing fallout from
 some of the DPCM changes that went in last time around which shook out
 some issues on i.MX and Qualcomm platforms.  The addition of a managed
 version of snd_soc_register_dai() is to fix resource leaks.
 
 There's also a few new device IDs for x86 systems.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl7wlcQTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0K9NB/0e4qOoGEyxmf6rbAnT1zvBu0vQu2qR
 ABkcCztt/tS/QJ1BSDHX/hALj9jr6RuAtn1pL4ynVGxJ86TByrrwLX1WhtKTk+DW
 TEgiPrFAKLlCwLVxgFdF0LORicv5zZEehi9+zP1HKt31Zsv2KNvTtwaF1WymIEd5
 LYVvYhtAKMmpjPN2WjlDSuita+fc/e5dm26n8hi3DJKIBVsLBbSxd1s1kwlqqnPh
 KbJjVrp5sWNhCyKu2hW8Sv1ovh40WbZ1TnzlDTiLinz0TCyqUyqEatuJ4RgRLmsW
 G3IAvm0rNjqyIF8TbQvYvvMZ0BZe/2SHdNXBtOXjXUYxhmnLvfAXocTf
 =FNgB
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v5.8-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v5.8

This is a collection of mostly small fixes, mostly fixing fallout from
some of the DPCM changes that went in last time around which shook out
some issues on i.MX and Qualcomm platforms.  The addition of a managed
version of snd_soc_register_dai() is to fix resource leaks.

There's also a few new device IDs for x86 systems.
2020-06-22 13:49:14 +02:00
Pierre-Louis Bossart 0fae253af5
ASoC: soc-devres: add devm_snd_soc_register_dai()
The registration of DAIs may be done at two distinct times, once
during a component registration and later when loading a
topology. Since devm_ managed resources are freed in the reverse order
they were allocated, when a component starts unregistering DAIs by
walking through the DAI list, the memory allocated for the
topology-registered DAIs was freed already, which leads to 100%
reproducible KASAN use-after-free reports.

This patch suggests a new devm_ function to force the DAI list to be
updated prior to freeing the memory chunks referenced by the list
pointers.

Suggested-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
BugLink: https://github.com/thesofproject/linux/issues/2186
Link: https://lore.kernel.org/r/20200612205938.26415-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15 14:15:11 +01:00
Shengjiu Wang a9a21e1eaf
ASoC: dmaengine_pcm: export soc_component_to_pcm
In DPCM case, Front-End needs to get the dma chan which has
been requested by Back-End and reuse it.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/429c6ae1f3c5b47eb893f475d531d71cdcfe34c0.1591947428.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-12 14:18:02 +01:00
Shengjiu Wang 6fbea6b6a8
ASoC: soc-card: export snd_soc_lookup_component_nolocked
snd_soc_lookup_component_nolocked can be used for the DPCM case
that Front-End needs to get the unused platform component but
added by Back-End cpu dai driver.

If the component is gotten, then we can get the dma chan created
by Back-End component and reused it in Front-End.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/55f6e0d76f67a517b9a44136d790ff2a06b5caa8.1591947428.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-12 14:18:01 +01:00
Takashi Iwai 7318234c8d ASoC: Updates for v5.8
This has been another very active release with a bunch of new drivers,
 lots of fixes everywhere and continued core improvements from
 Morimoto-san:
 
  - Lots of core cleanups and refactorings from Morimoto-san, factoring
    out common operations and making the card abstraction more solid.
  - Continued work on cleaning up and improving the Intel drivers, along
    with some new platform support for them.
  - Fixes to make the Marvell SSPA driver work upstream.
  - Support for AMD Renoir ACP, Dialog DA7212, Freescale EASRC and
    i.MX8M, Intel Elkhard Lake, Maxim MAX98390, Nuvoton NAU8812 and
    NAU8814 and Realtek RT1016.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl7U8IoTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0PkwB/0UF8YoNrLFb9wqo62sUAPYp2d9t6AW
 qDmRdNoULlT+diyr3ufQOaW7yMgVfSN1ek2btl/IDhuy96lIVb1tVPs7mJvxDOqk
 P/a5jxl0mWn0bmuMaajShtPc/IL2GAnYoLGIWZS+2U5CCQonKUL95DdlMcWn44lt
 lMa6jK9KfCMMbaocic24XmZDYfyxhRBpKWQC7Mq/i6pw3yZgOTSUCkS42Koy6NXs
 aDMHgCZKutigzEEZEDWDJ9LWqplALAQAiEUoKDWXBDBQ94nWbKkwjig4WDtC8Wao
 sgCubdWM4fvLf102PcAkn0xYDC68zNSS3NuZTp7k5gyXzkepoyCfKviX
 =8UOT
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v5.8' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Updates for v5.8

This has been another very active release with a bunch of new drivers,
lots of fixes everywhere and continued core improvements from
Morimoto-san:

 - Lots of core cleanups and refactorings from Morimoto-san, factoring
   out common operations and making the card abstraction more solid.
 - Continued work on cleaning up and improving the Intel drivers, along
   with some new platform support for them.
 - Fixes to make the Marvell SSPA driver work upstream.
 - Support for AMD Renoir ACP, Dialog DA7212, Freescale EASRC and
   i.MX8M, Intel Elkhard Lake, Maxim MAX98390, Nuvoton NAU8812 and
   NAU8814 and Realtek RT1016.
2020-06-01 20:26:07 +02:00
Mark Brown 358c7c61fd
Merge remote-tracking branch 'asoc/for-5.8' into asoc-linus 2020-06-01 13:01:15 +01:00
Mark Brown a72ff08faf
Merge remote-tracking branch 'asoc/for-5.7' into asoc-linus 2020-06-01 13:01:13 +01:00
Kuninori Morimoto fcbbcc325b
ASoC: soc-card: add snd_soc_card_remove_dai_link()
Card related function should be implemented at soc-card now.
This patch adds it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87mu5szv2h.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:42 +01:00
Kuninori Morimoto cbc7a6b5a8
ASoC: soc-card: add snd_soc_card_add_dai_link()
Card related function should be implemented at soc-card now.
This patch adds it.

This patch adds missing return when error case.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87o8q8zv2m.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:41 +01:00
Kuninori Morimoto d41278ea05
ASoC: soc-card: add snd_soc_card_set_bias_level_post()
Card related function should be implemented at soc-card now.
This patch adds it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87pnaozv2s.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:40 +01:00
Kuninori Morimoto 39caefda0a
ASoC: soc-card: add snd_soc_card_set_bias_level()
Card related function should be implemented at soc-card now.
This patch adds it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87sgfkzv4g.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:39 +01:00
Kuninori Morimoto b0275d956f
ASoC: soc-card: add snd_soc_card_remove()
Card related function should be implemented at soc-card now.
This patch adds it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87tv00zv4p.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:38 +01:00
Kuninori Morimoto 5c0eac036d
ASoC: soc-card: add snd_soc_card_late_probe()
Card related function should be implemented at soc-card now.
This patch adds it.

card has "card->probe" and "card->late_probe" callbacks,
and "late_probe" callback is called after "probe".
This means, we can set "card->probed" flag afer "late_probe"
for all cases.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87v9kgzv4w.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:37 +01:00
Kuninori Morimoto 73de4b0268
ASoC: soc-card: add snd_soc_card_probe()
Card related function should be implemented at soc-card now.
This patch adds it.

One note here is that card has "card->probe" and "card->late_probe"
callbacks.
Because it needs to care "late_probe", "card->probed" flag is set
under if (card->probe) at snd_soc_card_probe().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87wo4wzv54.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:36 +01:00
Kuninori Morimoto 27f07cacc9
ASoC: soc-card: add probed bit field to snd_soc_card
We already have bit field to control snd_soc_card.
Let's add "probed" field on it instead of local variable.

One note here is that soc_cleanup_card_resources()
will be called as (A) formal cleanup or as (B) error handling,
thus, it needs to distinguish these.

In (A) case, card will have "instantiated" flag if all probe
callback functions were called without error.
Thus, snd_soc_unbind_card() is using it to judging card was probed.
But this this patch removes it, because it is no longer needed.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87r1v4zv36.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:36 +01:00
Kuninori Morimoto 739443d1f1
ASoC: soc-card: add snd_soc_card_resume_post()
Card related function should be implemented at soc-card now.
This patch adds it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87y2pczv5d.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:35 +01:00
Kuninori Morimoto 934c752c38
ASoC: soc-card: add snd_soc_card_resume_pre()
Card related function should be implemented at soc-card now.
This patch adds it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87zh9szv5k.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:34 +01:00
Kuninori Morimoto d17b60b2c4
ASoC: soc-card: add snd_soc_card_suspend_post()
Card related function should be implemented at soc-card now.
This patch adds it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/871rn425j3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:33 +01:00
Kuninori Morimoto 130dc08c82
ASoC: soc-card: add snd_soc_card_suspend_pre()
Card related function should be implemented at soc-card now.
This patch adds it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87367k25jc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:32 +01:00
Kuninori Morimoto bf5bb8db5b
ASoC: soc-card: move snd_soc_card_subclass to soc-card
Card related function should be implemented at soc-card now.
This patch moves it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/874ks025jn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:31 +01:00
Kuninori Morimoto 65a75718d6
ASoC: soc-card: move snd_soc_card_get_codec_dai() to soc-card
Card related function should be implemented at soc-card now.
This patch moves it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/875zcg25jv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:30 +01:00
Kuninori Morimoto 63efed582c
ASoC: soc-card: move snd_soc_card_set/get_drvdata() to soc-card
Card related function should be implemented at soc-card now.
This patch moves it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/877dww25k4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:29 +01:00
Kuninori Morimoto 3359e9b6fa
ASoC: soc-card: move snd_soc_card_jack_new() to soc-card
Card related function should be implemented at soc-card now.
This patch moves it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/878shc25kc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:28 +01:00
Kuninori Morimoto 209c6cdfd2
ASoC: soc-card: move snd_soc_card_get_kcontrol() to soc-card
Card related function should be implemented at soc-card now.
This patch moves it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87a71s25kj.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:27 +01:00
Kuninori Morimoto 1793936bc9
ASoC: add soc-card.c
Current ALSA SoC has some snd_soc_card_xxx() functions,
and card->xxx() callbacks.
But, it is implemented randomly at random place.

To collect all card related functions into one place,
this patch creats new soc-card.c.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87blm825kt.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:27 +01:00
Kuninori Morimoto 317ec67593
ASoC: soc.h: convert bool to bit field for snd_soc_card
snd_soc_card has many bool, but it can be bit field.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87d06o25l2.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:26 +01:00
Takashi Iwai 6d28484026 Merge branch 'for-linus' into for-next
Back-merge 5.7-devel branch for further development.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-05-28 10:08:50 +02:00
Charles Keepax f4aa5e214e
ASoC: dapm: Move dai_link widgets to runtime to fix use after free
The newly added CODEC to CODEC DAI link widget pointers in
snd_soc_dai_link are better placed in snd_soc_pcm_runtime.
snd_soc_dai_link is really intended for static configuration of
the DAI, and the runtime for dynamic data.  The snd_soc_dai_link
structures are not destroyed if the card is unbound. The widgets
are cleared up on unbind, however if the card is rebound as the
snd_soc_dai_link structures are reused these pointers will be left at
their old values, causing access to freed memory.

Fixes: 595571cca4 ("ASoC: dapm: Fix regression introducing multiple copies of DAI widgets")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200526161930.30759-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-27 13:24:13 +01:00
Mark Brown f202272cab
Merge series "ASoC: add soc-link" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark

Current ALSA SoC is handling dai_link related operation,
but it is implmemented directly without using function/macro,
and at random place.

This v4 patch-set creates new snd_soc_link_xxx() functions
which handles dai_link related operation,
and implmement these at new soc-link.c.

v3 -> v4

	- add Reviewed-by from Ranjani and Pierre-Louis
	- fix bisection error at [2/7]

v2 -> v3

	- add missing #include <sound/soc-link.h> in soc-link.c

v1 -> v2
	- #include <sound/soc-link.h> is added on each c source file
	  instead of soc.h
	- not have extra error message after snd_soc_link_xxx(),
	  because it already indicate it via snc_link_ret()
	- snd_soc_link_compr_xxx() doesn't have rtd parameter,
	  because it can be created from cstream

Link: https://lore.kernel.org/r/87lflk4yk3.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/874ksa59wc.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/877dx868op.wl-kuninori.morimoto.gx@renesas.com

Kuninori Morimoto (7):
  ASoC: add soc-link.c
  ASoC: soc-link: move soc_rtd_xxx()
  ASoC: soc-link: remove unneeded parameter from snd_soc_link_xxx()
  ASoC: soc-link: add snd_soc_link_be_hw_params_fixup()
  ASoC: soc-link: add snd_soc_link_compr_startup()
  ASoC: soc-link: add snd_soc_link_compr_shutdown()
  ASoC: soc-link: add snd_soc_link_compr_set_params()

 include/sound/soc-link.h |  27 +++++++
 sound/soc/Makefile       |   2 +-
 sound/soc/soc-compress.c |  46 ++++--------
 sound/soc/soc-core.c     |  18 ++---
 sound/soc/soc-dai.c      |   9 ++-
 sound/soc/soc-link.c     | 150 +++++++++++++++++++++++++++++++++++++++
 sound/soc/soc-pcm.c      |  86 ++++------------------
 7 files changed, 219 insertions(+), 119 deletions(-)
 create mode 100644 include/sound/soc-link.h
 create mode 100644 sound/soc/soc-link.c

--
2.17.1

Thank you for your help !!

Best regards
---
Kuninori Morimoto
2020-05-25 15:31:13 +01:00
Karol Trzcinski 4c4a975178
ASoC: SOF: ext_manifest: parse compiler version
The compiler version and description can be extracted from the
extended manifest content. This information known at build time
does not need to be provided in a mailbox.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200520165911.21696-6-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-25 14:59:37 +01:00
Karol Trzcinski 8d809c15ac
ASoC: SOF: ext_manifest: parse windows
The window description can be extracted from the extended manifest
content. This information known at build time does not need to be
provided in a mailbox.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200520165911.21696-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-25 14:59:36 +01:00
Karol Trzcinski 3e2a89d3ee
ASoC: SOF: ext_manifest: parse firmware version
The firmware version can be extracted from the extended
manifest content. This information known at build time
does not need to be provided in a mailbox.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200520165911.21696-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-25 14:59:35 +01:00
Karol Trzcinski a80cf1987a
ASoC: SOF: Introduce extended manifest
Extended manifest is a place to store build time known firmware
metadata, for example firmware version or used compiler description.
Given information is read on host side before firmware startup.
This part of output binary is located as a first structure in binary
file.
Extended manifest should be skipped in firmware loading routine.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200520165911.21696-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-25 14:59:34 +01:00
Kuninori Morimoto eab810f37f
ASoC: soc-link: add snd_soc_link_compr_set_params()
dai_link related function should be implemented at soc-link.c.
This patch adds snd_soc_link_compr_set_params().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87sgfo3k6q.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-25 14:22:14 +01:00
Kuninori Morimoto 0e532c99b4
ASoC: soc-link: add snd_soc_link_compr_shutdown()
dai_link related function should be implemented at soc-link.c.
This patch adds snd_soc_link_compr_shutdown().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87tv043k6u.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-25 14:22:13 +01:00
Kuninori Morimoto 9ab711cb84
ASoC: soc-link: add snd_soc_link_compr_startup()
dai_link related function should be implemented at soc-link.c.
This patch adds snd_soc_link_compr_startup().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87v9kk3k6y.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-25 14:22:12 +01:00
Kuninori Morimoto 0cbbf8a039
ASoC: soc-link: add snd_soc_link_be_hw_params_fixup()
dai_link related function should be implemented at soc-link.c.
This patch adds snd_soc_link_be_hw_params_fixup().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87wo503k73.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-25 14:22:11 +01:00
Kuninori Morimoto 7cf3c5b4a0
ASoC: soc-link: remove unneeded parameter from snd_soc_link_xxx()
"rtd" can be created from "substream".
Let's cleanup snd_soc_link_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87y2pg3k78.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-25 14:22:10 +01:00
Kuninori Morimoto a5e6c10900
ASoC: soc-link: move soc_rtd_xxx()
dai_link related function should be implemented at
soc-link.c.
This patch moves soc-pcm soc_rtd_xxx()
to soc-link as snd_soc_link_xxx()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87zh9w3k7k.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-25 14:22:09 +01:00
Kuninori Morimoto 02e756363f
ASoC: add soc-link.c
Current ALSA SoC has many dai_link->xxx() functions.
But, it is implemented randomly at random place.

This patch creats new soc-link.c and collect dai_link related
operation into it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/871rn84ys5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-25 14:22:08 +01:00
Mark Brown 4ace9a0ec7
Merge series "ASoC: SOF: Intel and IMX updates for 5.8" from Kai Vehmanen <kai.vehmanen@linux.intel.com>:
Hi,

here's a series of minor fixes and improvements to SOF. Add support
for smart amplifier component type. Cover more systems by relaxing
match rules for the generic Soundwire machine driver. Fix issues with
driver unload and address a few compiler warnings.

Daniel Baluta (2):
  ASoC: SOF: Do nothing when DSP PM callbacks are not set
  ASoC: SOF: define INFO_ flags in dsp_ops

Keyon Jie (1):
  ASoC: SOF: topology: add support to smart amplifier

Marcin Rajwa (2):
  ASoC: SOF: add a power_down_notify method
  ASoC: SOF: inform DSP that driver is going to be removed

Pierre-Louis Bossart (2):
  ASoC: SOF: imx: make dsp_ops static
  ASoC: SOF: imx: make imx8m_dsp_ops static

randerwang (1):
  ASoC: SOF: Intel: sdw: relax sdw machine select constraints

 include/sound/sof/topology.h |  2 ++
 sound/soc/sof/core.c         |  6 ++++++
 sound/soc/sof/imx/imx8.c     |  2 +-
 sound/soc/sof/imx/imx8m.c    |  8 +++++++-
 sound/soc/sof/intel/hda.c    | 10 +++++++++-
 sound/soc/sof/pm.c           | 19 +++++++++++++++++--
 sound/soc/sof/sof-priv.h     |  1 +
 sound/soc/sof/topology.c     |  1 +
 8 files changed, 44 insertions(+), 5 deletions(-)

--
2.26.0
2020-05-18 16:43:50 +01:00
Kuninori Morimoto 0812a08ac8
ASoC: cleanup dai / component active code
No one is using dai->active, snd_soc_component_is_active().
Let's remove these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87imgy58hp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18 16:15:16 +01:00
Kuninori Morimoto 5552f8d728
ASoC: soc-dai: add snd_soc_dai_stream_active()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/874ksi6n48.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18 16:15:02 +01:00
Kuninori Morimoto 488b2ca599
ASoC: soc-component: add snd_soc_component_active()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/875zcy6n4d.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18 16:15:02 +01:00
Kuninori Morimoto efffd9b344
ASoC: soc-dai: add snd_soc_dai_active()
Current snd_soc_dai_action() is updating
dai->stream_active for Playback/Capture (A),
dai->active        for DAI (B)

        void snd_soc_dai_action(struct snd_soc_dai *dai,
                                int stream, int action)
        {
(A)             dai->stream_active[stream]      += action;
(B)             dai->active                     += action;
                dai->component->active          += action;
        }

But, these are very verbose, because we can calculate
DAI active from stream_active.

This patch adds snd_soc_dai_active() which calculate
DAI active from DAI stream_active.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/877dxe6n4i.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18 16:15:01 +01:00