Commit graph

33609 commits

Author SHA1 Message Date
Kuninori Morimoto
e198048bdc
ASoC: qcom: q6routing: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sgob90ep.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:46:51 +01:00
Kuninori Morimoto
8b83c90dba
ASoC: qcom: lpass-platform: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tv8r90eu.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:46:33 +01:00
Kuninori Morimoto
ba40ab6275
ASoC: samsung: idma: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v9t790f2.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:46:14 +01:00
Kuninori Morimoto
932eaf7c79
ASoC: sh: siu_pcm: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87wodn90f7.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:46:06 +01:00
Kuninori Morimoto
db5b4ee952
ASoC: sh: dma-sh7760: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y2y390fc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:45:57 +01:00
Kuninori Morimoto
be513045d6
ASoC: sh: fsi: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zhij90fh.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:45:39 +01:00
Kuninori Morimoto
9dcefa7232
ASoC: sh: rsnd: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871rvvaf02.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:45:21 +01:00
Kuninori Morimoto
1c91d77e17
ASoC: sof: pcm: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/8736gbaf07.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:45:01 +01:00
Kuninori Morimoto
6702eed85b
ASoC: sprd: sprd-pcm-dma: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/874l0raf0c.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:44:40 +01:00
Kuninori Morimoto
2149908976
ASoC: stm: stm32_adfsdm: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875zl7af0h.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:44:32 +01:00
Kuninori Morimoto
a857e073ff
ASoC: txx9: txx9aclc: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877e5naf0m.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:44:23 +01:00
Kuninori Morimoto
c645ea1179
ASoC: uniphier: aio-dma: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878sq3af0r.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:44:05 +01:00
Kuninori Morimoto
2bcba42492
ASoC: xilinx: xlnx_formatter_pcm: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87bluzaf0y.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:43:44 +01:00
Kuninori Morimoto
17d48a3186
ASoC: xtensa: xtfpga-i2s: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87d0ffaf14.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:43:25 +01:00
Kuninori Morimoto
297bdfd4f5
ASoC: au1x: dma: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87eezvaf1f.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:43:14 +01:00
Kuninori Morimoto
58c2dbe110
ASoC: au1x: dbdma2: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ftkbaf1k.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:43:06 +01:00
Kuninori Morimoto
a94e3f2dd2
ASoC: atmel: atmel-pcm-pdc: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h84raf1o.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:42:57 +01:00
Kuninori Morimoto
8c028a4038
ASoC: amd: acp-pcm-dma: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87imp7af1t.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:42:38 +01:00
Kuninori Morimoto
f52368f364
ASoC: amd: acp3x-pcm-dma: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k19naf1y.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:42:20 +01:00
Kuninori Morimoto
bb3613515e
ASoC: intel: sst-baytrail-pcm: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lfu3af24.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:42:11 +01:00
Kuninori Morimoto
9b9974d3d5
ASoC: intel: sst-mfld-platform-pcm: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87muejaf2a.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:41:52 +01:00
Kuninori Morimoto
3507bb5fe4
ASoC: intel: skl-pcm: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

*Note*

Only Intel skl-pcm has .get_time_info implementation, but ALSA SoC
framework doesn't call it so far.
To keep its implementation, this patch keeps .get_time_info,
but it is still not called.
Intel guy need to support it in the future.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8yzaf2f.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:41:33 +01:00
Kuninori Morimoto
86c05f3446
ASoC: intel: sst-haswell-pcm: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pnjfaf2u.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:41:14 +01:00
Kuninori Morimoto
8ec241c495
ASoC: soc-core: add snd_soc_pcm_lib_ioctl()
add snd_soc_pcm_lib_ioctl() to bypass to snd_pcm_lib_ioctl()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r23vaf39.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:40:48 +01:00
Kuninori Morimoto
c64bfc9066
ASoC: soc-core: add new pcm_construct/pcm_destruct
Current snd_soc_component_driver has pcm_new/pcm_free, but,
it doesn't have "component" at parameter.
Thus, each callback can't know it is called for which component.
Each callback currently is getting "component" by using
snd_soc_rtdcom_lookup() with driver name.

It works today, but, will not work in the future if we support multi
CPU/Codec/Platform, because 1 rtd might have multiple same driver
name component.

To solve this issue, each callback need to be called with component.
This patch adds new pcm_construct/pcm_destruct with "component"
parameter.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sgobaf3g.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:40:22 +01:00
Kuninori Morimoto
e2cb4a1454
ASoC: soc-core: merge snd_pcm_ops member to component driver
Current snd_soc_component_driver has snd_pcm_ops, and each driver can
have callback via it (1).
But, it is mainly created for ALSA, thus, it doesn't have "component"
as parameter for ALSA SoC (1)(2).
Thus, each callback can't know it is called for which component.
Thus, each callback currently is getting "component" by using
snd_soc_rtdcom_lookup() with driver name (3).

	--- ALSA SoC  ---
	...
	if (component->driver->ops &&
	    component->driver->ops->open)
(1)		return component->driver->ops->open(substream);
	...

	--- driver ---
(2)	static int xxx_open(struct snd_pcm_substream *substream)
	{
		struct snd_soc_pcm_runtime *rtd = substream->private_data;
(3)		struct snd_soc_component *component = snd_soc_rtdcom_lookup(..);
		...
	}

It works today, but, will not work in the future if we support multi
CPU/Codec/Platform, because 1 rtd might have multiple components which
have same driver name.

To solve this issue, each callback needs to be called with component.
We already have many component driver callback.
This patch copies each snd_pcm_ops member under component driver,
and having "component" as parameter.

	--- ALSA SoC  ---
	...
	if (component->driver->open)
=>		return component->driver->open(component, substream);
	...

	--- driver ---
=>	static int xxx_open(struct snd_soc_component *component,
			    struct snd_pcm_substream *substream)
	{
		...
	}

*Note*

Only Intel skl-pcm has .get_time_info implementation, but ALSA SoC
framework doesn't call it so far.
To keep its implementation, this patch keeps .get_time_info,
but it is still not called.
Intel guy need to support it in the future.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tv8raf3r.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:39:53 +01:00
Jiaxin Yu
9e985503ee
ASoC: mt8183: fix audio playback slowly after playback during bootup
Before regmap_reinit_cache we must reset audio regs as default values.
So we use reset controller unit(toprgu) to reset audio hw.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Reviewed-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
Link: https://lore.kernel.org/r/1569580317-21181-5-git-send-email-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:39:45 +01:00
Peter Ujfalusi
cfc28ac124
ASoC: pcm3168a: Use fixup instead of constraint for channels and formats
The snd_pcm_hw_constraint_minmax() works fine when a single codec is
connected to a single CPU DAI, but in multicodec or DPCM setup the
constraints placed by the driver will apply to the whole PCM stream (FE
included) and thus prevents more than 8 playback channels for example.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20191008115720.7135-1-peter.ujfalusi@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:39:17 +01:00
Dan Murphy
edd6d53932
ASoC: tas2770: Fix snd_soc_update_bits error handling
According the documentation for snd_soc_update_bits the API
will return a 1 if the update was successful with a value change,
a 0 if the update was successful with no value change or a negative
if the command just failed.

So the value of return in the driver needs to be checked for being less
then 0 or the caller may indicate failure when the value actually
changed.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20191007171157.17813-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-07 19:09:04 +01:00
Dan Murphy
40f90ef0a7
ASoc: tas2770: Remove unused defines and variables
Remove unused defines and structure variables that are not
referenced by the code.  If these are needed for future
enhancements then they should be added at that time.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20191007171157.17813-3-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-07 19:08:42 +01:00
Dan Murphy
5911e6729e
ASoC: tas2770: Remove unneeded read of the TDM_CFG3 register
Remove the unneeded and incorrect read of the TDM_CFG3 register.
The read is done but the value is never used.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20191007171157.17813-2-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-07 19:08:22 +01:00
Dan Carpenter
a9d2736714
ASoC: fsl_mqs: Fix error handling in probe
There are several problems in the error handling in fsl_mqs_probe().

1) "ret" isn't initialized on some paths.  GCC has a feature which
   warns about uninitialized variables but the code initializes "ret"
   to zero at the start of the function so the checking is turned off.
2) "gpr_np" is a pointer so initializing it to zero is confusing and
   generates a Sparse warning.
3) of_parse_phandle() doesn't return error pointers on error, it returns
   NULL.
4) If devm_snd_soc_register_component() fails then the function should
   free the "gpr_np".

Fixes: 9e28f6532c ("ASoC: fsl_mqs: Add MQS component driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20191004102208.GB823@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-07 13:53:23 +01:00
YueHaibing
e9e8fc9ed6
ASoC: fsl_mqs: remove set but not used variable 'bclk'
Fixes gcc '-Wunused-but-set-variable' warning:

sound/soc/fsl/fsl_mqs.c: In function fsl_mqs_hw_params:
sound/soc/fsl/fsl_mqs.c:54:6: warning: variable bclk set but not used [-Wunused-but-set-variable]

It is never used, so can be removed.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20191006105522.58560-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-07 13:53:04 +01:00
YueHaibing
03fe492e83
ASoc: tas2770: Fix build error without GPIOLIB
If GPIOLIB is not set, building fails:

sound/soc/codecs/tas2770.c: In function tas2770_reset:
sound/soc/codecs/tas2770.c:38:3: error: implicit declaration of function gpiod_set_value_cansleep; did you mean gpio_set_value_cansleep? [-Werror=implicit-function-declaration]
   gpiod_set_value_cansleep(tas2770->reset_gpio, 0);
   ^~~~~~~~~~~~~~~~~~~~~~~~
   gpio_set_value_cansleep
sound/soc/codecs/tas2770.c: In function tas2770_i2c_probe:
sound/soc/codecs/tas2770.c:749:24: error: implicit declaration of function devm_gpiod_get_optional; did you mean devm_regulator_get_optional? [-Werror=implicit-function-declaration]
  tas2770->reset_gpio = devm_gpiod_get_optional(tas2770->dev,
                        ^~~~~~~~~~~~~~~~~~~~~~~
                        devm_regulator_get_optional
sound/soc/codecs/tas2770.c:751:13: error: GPIOD_OUT_HIGH undeclared (first use in this function); did you mean GPIOF_INIT_HIGH?
             GPIOD_OUT_HIGH);
             ^~~~~~~~~~~~~~
             GPIOF_INIT_HIGH

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 1a476abc72 ("tas2770: add tas2770 smart PA kernel driver")
Suggested-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20191006104631.60608-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-07 13:52:45 +01:00
Stephen Boyd
67ad656bdd
ASoC: jz4740: Use of_device_get_match_data()
This probe function is only called if the device is backed by a DT node,
so switch this call to of_device_get_match_data() to reduce code size
and simplify a bit. This also avoids needing to reference a potentially
undefined variable because of_device_get_match_data() doesn't need to
know anything beyond the struct device to find the match table.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Paul Cercueil <paul@crapouillou.net>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: <alsa-devel@alsa-project.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20191004214334.149976-8-swboyd@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-07 13:52:26 +01:00
Kuninori Morimoto
0881ab6e74
ASoC: soc-ops: use snd_soc_card_get_kcontrol() at snd_soc_limit_volume()
snd_soc_limit_volume() is finding snd_kcontrol by using original coding,
but we already have snd_soc_card_get_kcontrol().
Let's use existing function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y2y3afgd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-03 14:37:20 +01:00
Kuninori Morimoto
d8145989ff
ASoC: soc-core: setup card->rtd_num at snd_soc_instantiate_card()
card->rtd_num is used to count rtd. Initialize it at
snd_soc_instantiate_card() is very natural and less confusion.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zhijafgk.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-03 14:37:01 +01:00
Kuninori Morimoto
50014499e6
ASoC: soc-core: use devm_xxx for component related resource
dai / component related resources are created when component is
registered, and it will be freed when component was unregistered.
These resources are not re-used after that.
This means, we can use devm_xxx for dai / component, without
thinking about kfree().
This patch uses devm_xxx for these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/8736gbbu1a.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-03 14:36:39 +01:00
Kuninori Morimoto
0f23f718ec
ASoC: soc-core: add soc_setup_card_name()
ALSA needs to setup shortname, longname, and driver.
These methods are very similar.
This patch adds new soc_setup_card_name() and setup these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/874l0rbu1i.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-03 14:36:20 +01:00
Kuninori Morimoto
7ce6088f60
ASoC: soc-core: remove soc_remove_dai_links()
It is easy to read code if it is cleanly using paired function/naming,
like start <-> stop, register <-> unregister, etc, etc.
But, current ALSA SoC code is very random, unbalance, not paired, etc.
It is easy to create bug at the such code, and it will be difficult to
debug.

soc_cleanup_card_resources() (a) which is paired function of
snd_soc_instantiate_card() (A) is calling soc_remove_dai_links() (*)
to remove card related resources, but it is breaking
add/remove balance (B)(b)(C)(c)(D)(d), in other words
these should be called from soc_cleanup_card_resources() (a)
from balance point of view.

More headacke is that it is using original removing method for
dai_link even though we already have snd_soc_remove_dai_link()
which is the function for it (d).

This patch removes snd_soc_remove_dai_links() and balance up code.

	static void soc_remove_dai_links(...)
	{
		...
(b)		soc_remove_link_dais(card);
(c)		soc_remove_link_components(card);

		for_each_card_links_safe(card, link, _link) {
			...
			/* it should use snd_soc_remove_dai_link() here */
(d)			list_del(&link->list);
		}
	}

(a)	static int soc_cleanup_card_resources(...)
	{
		...

		/* remove and free each DAI */
(*)		soc_remove_dai_links(card);
		...
	}

(A)	static int snd_soc_instantiate_card(struct snd_soc_card *card)
	{
		...
		/* add predefined DAI links to the list */
		for_each_card_prelinks(card, i, dai_link)
(B)			snd_soc_add_dai_link(card, dai_link);
		...
		/* probe all components used by DAI links on this card */
(C)		ret = soc_probe_link_components(card);
		...
		/* probe all DAI links on this card */
(D)		ret = soc_probe_link_dais(card);
		...
	}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875zl7bu1r.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-03 14:36:01 +01:00
Kuninori Morimoto
4dc0e7df62
ASoC: soc-core: use devm_kzalloc() for rtd
Current rtd, rtd->dev, rtd->codec_dais are created by normal kzalloc(),
but we want to use devm_kzalloc() as much as possible.

Created rtd->dev is registered by device_register() at
soc_new_pcm_runtime(), and it will be freed at
soc_free_pcm_runtime() by device_unregister().

This means, if we can use devm_kzalloc(rtd->dev, xxx) for
rtd / rtd->codec_dais, all these are automatically freed
via soc_free_pcm_runtime().
This patch uses devm_kzalloc(rtd->dev, xxx) for rtd / rtd->codec_dais.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877e5nbu1z.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-03 14:35:42 +01:00
kbuild test robot
5a74239930
tas2770: fix platform_no_drv_owner.cocci warnings
sound/soc/codecs/tas2770.c:796:3-8: No need to set .owner here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Fixes: 1a476abc72 ("tas2770: add tas2770 smart PA kernel driver")
CC: Frank Shi <shifu0704@thundersoft.com>
Signed-off-by: kbuild test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20191001175504.ufhyxh66psrht42k@332d0cec05f4
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-03 14:33:20 +01:00
Sylwester Nawrocki
dca6408d6f
ASoC: samsung: Rename Arndale card driver
Rename arndale_rt5631.c to just arnddale.c as we support other CODECs
than RT5631.  While at it replace spaces in Kconfig with tabs.

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Link: https://lore.kernel.org/r/20191002105652.24821-3-s.nawrocki@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-02 12:52:04 +01:00
Sylwester Nawrocki
03081cc370
ASoC: samsung: arndale: Add support for WM1811 CODEC
The Arndale boards come with different types of the audio daughter
board.  In order to support the WM1811 one we add new definition of
an ASoC card which will be registered when the driver matches on
"samsung,arndale-wm1811" compatible.  There is no runtime detection of
the audio daughter board type at the moment, compatible string of the
audio card needs to be adjusted in DT, e.g. by the bootloader,
depending on actual audio board (CODEC) used.

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Link: https://lore.kernel.org/r/20191002105652.24821-2-s.nawrocki@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-02 12:51:42 +01:00
Sylwester Nawrocki
aaa68472ed
ASoC: samsung: arndale: Simplify DAI link initialization
There is only one DAI link so we can drop an unnecessary loop statement.
Use card->dai_link in place of direct static arndale_rt5631_dai[] array
dereference as a prerequisite for adding support for other CODECs.
Unnecessary assignment of dai_link->codecs->name to NULL is removed.

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Link: https://lore.kernel.org/r/20191002105652.24821-1-s.nawrocki@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-02 12:51:24 +01:00
Mark Brown
25317997cb
Merge branch 'asoc-5.4' into asoc-5.5 2019-10-02 12:50:40 +01:00
Liam Girdwood
3a9e204d4e
ASoC: SOF: Intel: Add context data to any IPC timeout.
Helps with FW debug as it provides DSP IPC processing context.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190927200538.660-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-01 18:35:36 +01:00
Marcin Rajwa
f567ff6c76
ASoC: SOF: Intel: hda: fix reset of host_period_bytes
This patch prevents the reset of host period bytes
and uses no_stream_position to record requests
for stream position.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190927200538.660-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-01 18:35:28 +01:00
Ranjani Sridharan
8692d498d6
ASoC: SOF: core: check for mandatory fw_ready op during SOF probe
fw_ready should be a mandatory op. Make sure fw_ready ops is set
during probe.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190927200538.660-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-01 18:34:50 +01:00
Liam Girdwood
9a06508bf7
ASoC: SOF: ipc: retain DSP context after FW exception.
Add config option to prevent DSP entering D3 after any FW exception.
This can then be used to dump FW context for debug.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190927200538.660-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-01 18:34:28 +01:00