Commit graph

855499 commits

Author SHA1 Message Date
Libin Yang 0e4cc44f50
ASoC: intel: skl_hda_dsp_common: create HDMI jack kctl
This patch call snd_jack_add_new_kctl() to create the HDMI jack kctls.
Userspace needs these kctls to detect the hdmi monitor hotplug.

In /usr/share/alsa/ucm, the config file needs to assign a jack kctl to
"JackControl" to let PA get the jack hotplug status.

Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190808192734.18286-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-08 20:57:01 +01:00
YueHaibing 8e082d8f42
ASoC: tscs454: remove unused variable 'PLL_48K_RATE'
The global variable 'PLL_48K_RATE' is never used
so just remove it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190808032552.45360-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-08 20:57:00 +01:00
Pierre-Louis Bossart 0e36f36b04
ASoC: soc-core: fix module_put() warning in soc_cleanup_component
The recent changes introduce warnings in the SOF load/unload module
tests. The code does not seem balanced with a confusion between
_close() and _remove() macros. Using _remove() fixes the issue and
removes the warning.

Suggested-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Fixes: 4a81e8f30d ('ASoC: soc-component: add snd_soc_component_get/put()')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20190808025131.32482-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-08 20:56:59 +01:00
Kuninori Morimoto 596becd3f8
ASoC: soc-core: dai_link check under soc_dpcm_debugfs_add()
soc_dpcm_debugfs_add(rtd) is checking rtd->dai_link pointer,
but, rtd->dai_link->dynamic have been already checked before calling it.

	static int soc_probe_link_dais(...) {
		dai_link = rtd->dai_link;
		...
=>		if (dai_link->dynamic)
=>			soc_dpcm_debugfs_add(rtd);
		...
	}

	void soc_dpcm_debugfs_add(rtd)
	{
=>		if (!rtd->dai_link)
			return;
		...
	}

These pointer checks are strange/pointless.
This patch checks dai_link->dynamic under soc_dpcm_debugfs_add().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/874l2tahnq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-08 20:56:58 +01:00
Kuninori Morimoto ee5b3f1141
ASoC: soc-core: define soc_dpcm_debugfs_add() for non CONFIG_DEBUG_FS
soc_dpcm_debugfs_add() is implemented at soc-pcm.c under CONFIG_DEBUG_FS.
Thus, soc-core.c which is only user of it need to use CONFIG_DEBUG_FS, too.

This patch defines soc_dpcm_debugfs_add() for non CONFIG_DEBUG_FS case.
Then, we can remove #ifdef CONFIG_DEBUG_FS from soc-core.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875zn9ahnv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-08 20:56:57 +01:00
Kuninori Morimoto b3da42519c
ASoC: soc-core: tidyup for card->deferred_resume_work
card->deferred_resume_work is used if CONFIG_PM_SLEEP was defined.
but
	1) It is defined even though CONFIG_PM_SLEEP was not defined
	2) random ifdef code is difficult to read.
This patch tidyup these issues.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877e7paho1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-08 20:56:56 +01:00
Kuninori Morimoto b245d273cb
ASoC: soc-core: remove unneeded list_empty() check for snd_soc_try_rebind_card()
list_for_each_entry_safe() will do nothing if it was empty list.
This patch removes unneeded list_empty() check for
list_for_each_entry_safe().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878ss5aho6.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-08 20:56:56 +01:00
Kuninori Morimoto d8ca7a0a85
ASoC: soc-core: call snd_soc_dapm_debugfs_init() at soc_init_card_debugfs()
We have 2 soc_init_card_debugfs() implementations for with/without DEBUG_FS.
But, snd_soc_instantiate_card() calls snd_soc_dapm_debugfs_init() under
ifdef DEBUG_FS after soc_init_card_debugfs(). This is very strange.
We can call snd_soc_dapm_debugfs_init() under soc_init_card_debugfs().

	#ifdef CONFIG_DEBUG_FS
=>	static void soc_init_card_debugfs(...)
	{
		...
	}
	...
	#else
=>	static inline void soc_init_card_debugfs(...)
	{
		...
	}
	#endif

	static int snd_soc_instantiate_card(struct snd_soc_card *card)
	{
		...
=>		soc_init_card_debugfs(card);

*	#ifdef CONFIG_DEBUG_FS
*		snd_soc_dapm_debugfs_init(&card->dapm, card->debugfs_card_root);
*	#endif
	}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a7clahob.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-08 20:56:55 +01:00
Kuninori Morimoto 9b98c7c2a0
ASoC: soc-core: tidyup for snd_soc_add_card_controls()
snd_soc_add_card_controls() registers controls by using
for(... i < num; ...). If controls was NULL, num should be zero.
Thus, we don't need to check about controls pointer.
This patch also cares missing return value.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87blx1ahoi.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-08 20:56:54 +01:00
Kuninori Morimoto daa480bde6
ASoC: soc-core: tidyup for snd_soc_dapm_add_routes()
snd_soc_dapm_add_routes() registers routes by using
for(... i < num; ...). If routes was NULL, num should be zero.
Thus, we don't need to check about route pointer.
This patch also cares missing return value.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87d0hhahon.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-08 20:56:53 +01:00
Kuninori Morimoto e6d7020c29
ASoC: soc-core: tidyup for snd_soc_add_component_controls()
snd_soc_add_component_controls() registers controls by using
for(... i < num; ...). If controls was NULL, num should be zero.
Thus, we don't need to check about controls pointer.
This patch also cares missing return value.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ef1xahor.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-08 20:56:52 +01:00
Daniel Baluta a860fac420
ASoC: fsl_sai: Add support for imx7ulp/imx8mq
SAI module on imx7ulp/imx8m features 2 new registers (VERID and PARAM)
at the beginning of register address space.

On imx7ulp FIFOs can held up to 16 x 32 bit samples.
On imx8mq FIFOs can held up to 128 x 32 bit samples.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20190806151214.6783-5-daniel.baluta@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-07 14:26:42 +01:00
Daniel Baluta 4f7a0728b5
ASoC: fsl_sai: Add support for SAI new version
New IP version introduces Version ID and Parameter registers
and optionally added Timestamp feature.

VERID and PARAM registers are placed at the top of registers
address space and some registers are shifted according to
the following table:

Tx/Rx data registers and Tx/Rx FIFO registers keep their
addresses, all other registers are shifted by 8.

SAI Memory map is described in chapter 13.10.4.1.1 I2S Memory map
of the Reference Manual [1].

In order to make as less changes as possible we attach an offset
to each register offset to each changed register definition. The
offset is read from each board private data.

[1]https://cache.nxp.com/secured/assets/documents/en/reference-manual/IMX8MDQLQRM.pdf?__gda__=1563728701_38bea7f0f726472cc675cb141b91bec7&fileExt=.pdf

Signed-off-by: Mihai Serban <mihai.serban@nxp.com>
[initial coding in the NXP internal tree]
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
[bugfixing and cleanups]
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
[adapted to linux-next]
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20190806151214.6783-4-daniel.baluta@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-07 14:26:04 +01:00
Daniel Baluta b84f50b0fc
ASoC: fsl_sai: Update Tx/Rx channel enable mask
Tx channel enable (TCE) / Rx channel enable (RCE) bits
enable corresponding data channel for Tx/Rx operation.

Because SAI supports up the 8 channels TCE/RCE occupy
up the 8 bits inside TCR3/RCR3 registers we need to extend
the mask to reflect this.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20190806151214.6783-3-daniel.baluta@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-07 14:26:04 +01:00
Daniel Baluta 5f0ac20ed6
ASoC: fsl_sai: Add registers definition for multiple datalines
SAI IP supports up to 8 data lines. The configuration of
supported number of data lines is decided at SoC integration
time.

This patch adds definitions for all related data TX/RX registers:
	* TDR0..7, Transmit data register
	* TFR0..7, Transmit FIFO register
	* RDR0..7, Receive data register
	* RFR0..7, Receive FIFO register

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20190806151214.6783-2-daniel.baluta@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-07 14:26:03 +01:00
Cezary Rojewski abf31feea2
ASoC: Intel: Update request-reply IPC model
struct ipc_message contains fields: header, tx_data and tx_size which
represent TX i.e. request while RX is represented by rx_data and rx_size
with reply's header equivalent missing.

Reply header may contain some vital information including, but not
limited to, received payload size. Some IPCs have entire payload found
within RX header instead. Content and value of said header is context
dependent and may vary between firmware versions and target platform.
Current model does not allow such IPCs to function at all.

Rather than appending yet another parameter to an already long list of
such for sst_ipc_tx_message_XXXs, declare message container in form of
struct sst_ipc_message and add them to parent's ipc_message declaration.

Align haswell, baytrail and skylake with updated request-reply model and
modify their reply processing functions to save RX header within message
container. Despite the range of changes, status quo is achieved.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20190723144341.21339-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-07 14:26:02 +01:00
Kuninori Morimoto b8ba3b572c
ASoC: soc-core: tidyup for snd_soc_dapm_new_controls()
snd_soc_dapm_new_controls() registers controls by using
for(... i < num; ...). It means if widget was NULL, num should be zero.
Thus, we don't need to check about widget pointer.
This patch also cares missing return value.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ftmdahow.wl-kuninori.morimoto.gx@renesas.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-07 14:25:58 +01:00
Kuninori Morimoto 32d2c172fe
ASoC: soc-core: reuse rtdcom at snd_soc_rtdcom_add()
snd_soc_rtdcom_add() is using both "rtdcom" and "new_rtdcom" as
variable name, but these are not used at same time.
Let's reuse rtdcom.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h86tahp2.wl-kuninori.morimoto.gx@renesas.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-07 14:25:54 +01:00
Kuninori Morimoto 4284906450
ASoC: soc-core: don't use for_each_card_links_safe() at snd_soc_find_dai_link()
It doesn't removes list during loop at snd_soc_find_dai_link().
We don't need to use _safe loop.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87imr9ahp9.wl-kuninori.morimoto.gx@renesas.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-07 14:25:50 +01:00
Kuninori Morimoto 5b99a0aad0
ASoC: soc-core: check return value of snd_soc_add_dai_link()
snd_soc_add_dai_link() might return error, we need to check it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k1bpahpd.wl-kuninori.morimoto.gx@renesas.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-07 14:25:47 +01:00
Kuninori Morimoto 6634e3d6ea
ASoC: soc-core: add comment for for_each_xxx
soc-core has many for_each_xxx, but it is a little bit
difficult to know which list is relead to which for_each_xxx.
This patch adds missing comment for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lfw5ahpj.wl-kuninori.morimoto.gx@renesas.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-07 14:25:41 +01:00
Kuninori Morimoto ad64bfbd09
ASoC: soc-core: set component->debugfs_root NULL
To be more safety code, let's set NULL to component->debugfs_root
when it was cleanuped.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87muglahq0.wl-kuninori.morimoto.gx@renesas.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-07 14:25:28 +01:00
Daniel Baluta 371be51a92
ASoC: dt-bindings: Introduce compatible strings for 7ULP and 8MQ
For i.MX7ULP and i.MX8MQ register map is changed. Add two new compatbile
strings to differentiate this.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20190806151214.6783-6-daniel.baluta@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-07 14:19:43 +01:00
Pierre-Louis Bossart bb67dd1878
ASoC: SOF: Intel: hda: fix MSI handling
The addition of a kernel module parameter to optionally disable MSI
had the side effect of permanently disabling it.

The return value of pci_alloc_irq_vectors() is the number of allocated
vectors or a negative number on error, so testing with the ! operator
is not quite right. It was one optimization too far.

Restore previous behavior to use MSI by default, unless the user
selects not to do so or the allocation of irq_vectors fails.

Fixes: 672ff5e359 ('ASoC: SOF: Intel: hda: add a parameter to disable MSI')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190806170603.10815-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-07 14:19:32 +01:00
Shuming Fan 0922c7a51c
ASoC: rt1011: Add a flag for the R0 calibration test
The factory test needs to know whether the calibration completed.
This flag helps to confirm the calibration completed or not.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20190806091459.14382-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-07 14:19:13 +01:00
Shuming Fan 3403b808a0
ASoC: rt1011: Add R0 temperature and TDM1 ADC2DAT Swap control
- The user level application could set the R0 temperature after booting system.
  The degree Celsius of R0 temperature store in the non-volatile space
  when doing R0 calibration.
- TDM1 ADC2DAT Swap controls use to control TDM slot2/3 data

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20190806091435.14329-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-07 14:18:55 +01:00
Kuninori Morimoto 79776da098
ASoC: soc-component: add snd_soc_pcm_component_pcm_free()
Current ALSA SoC is directly using component->driver->xxx,
thus, the code nested deeply, and it makes code difficult to read,
and is not good for encapsulation.

We want to implement component related function at soc-component.c,
but, some of them need to care whole snd_soc_pcm_runtime (= rtd)
connected component.

Let's call component related function which need to care with
for_each_rtdcom() loop as snd_soc_pcm_component_xxx().
This patch adds new snd_soc_pcm_component_pcm_free() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k1c54czu.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:27:16 +01:00
Kuninori Morimoto 7484291e9b
ASoC: soc-component: add snd_soc_pcm_component_pcm_new()
Current ALSA SoC is directly using component->driver->xxx,
thus, the code nested deeply, and it makes code difficult to read,
and is not good for encapsulation.

We want to implement component related function at soc-component.c,
but, some of them need to care whole snd_soc_pcm_runtime (= rtd)
connected component.

Let's call component related function which need to care with
for_each_rtdcom() loop as snd_soc_pcm_component_xxx().
This patch adds new snd_soc_pcm_component_pcm() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lfwl4czy.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:26:50 +01:00
Kuninori Morimoto 205875e1a1
ASoC: soc-component: add snd_soc_pcm_component_mmap()
Current ALSA SoC is directly using component->driver->ops->xxx,
thus, the code nested deeply, and it makes code difficult to read,
and is not good for encapsulation.

We want to implement component related function at soc-component.c,
but, some of them need to care whole snd_soc_pcm_runtime (= rtd)
connected component.

Let's call component related function which need to care with
for_each_rtdcom() loop as snd_soc_pcm_component_xxx().
This patch adds new snd_soc_pcm_component_mmap() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87muh14d02.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:26:24 +01:00
Kuninori Morimoto 9c712e4f57
ASoC: soc-component: add snd_soc_pcm_component_page()
Current ALSA SoC is directly using component->driver->ops->xxx,
thus, the code nested deeply, and it makes code difficult to read,
and is not good for encapsulation.

We want to implement component related function at soc-component.c,
but, some of them need to care whole snd_soc_pcm_runtime (= rtd)
connected component.

Let's call component related function which need to care with
for_each_rtdcom() loop as snd_soc_pcm_component_xxx().
This patch adds new snd_soc_pcm_component_page() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o91h4d06.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:25:59 +01:00
Kuninori Morimoto 82d81f5cce
ASoC: soc-component: add snd_soc_pcm_component_copy_user()
Current ALSA SoC is directly using component->driver->ops->xxx,
thus, the code nested deeply, and it makes code difficult to read,
and is not good for encapsulation.

We want to implement component related function at soc-component.c,
but, some of them need to care whole snd_soc_pcm_runtime (= rtd)
connected component.

Let's call component related function which need to care with
for_each_rtdcom() loop as snd_soc_pcm_component_xxx().
This patch adds new snd_soc_pcm_component_copy_user() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pnlx4d0a.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:25:33 +01:00
Kuninori Morimoto 96a47908d8
ASoC: soc-component: add snd_soc_pcm_component_ioctrl()
Current ALSA SoC is directly using component->driver->ops->xxx,
thus, the code nested deeply, and it makes code difficult to read,
and is not good for encapsulation.

We want to implement component related function at soc-component.c,
but, some of them need to care whole snd_soc_pcm_runtime (= rtd)
connected component.

Let's call component related function which need to care with
for_each_rtdcom() loop as snd_soc_pcm_component_xxx().
This patch adds new snd_soc_pcm_component_ioctrl() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r26d4d0f.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:25:08 +01:00
Kuninori Morimoto 0035e2565b
ASoC: soc-component: add snd_soc_pcm_component_pointer()
Current ALSA SoC is directly using component->driver->ops->xxx,
thus, the code nested deeply, and it makes code difficult to read,
and is not good for encapsulation.

We want to implement component related function at soc-component.c,
but, some of them need to care whole snd_soc_pcm_runtime (= rtd)
connected component.

Let's call component related function which need to care with
for_each_rtdcom() loop as snd_soc_pcm_component_xxx().
This patch adds new snd_soc_pcm_component_pointer() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sgqt4d0j.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:24:42 +01:00
Kuninori Morimoto 7951b14611
ASoC: soc-component: move snd_soc_component_set_bias_level()
Current soc-dapm / soc-core are using a long way round to call
.set_bias_level.

	if (driver->set_bias_level)
		dapm->set_bias_level = ...;
	...
	if (dapm->set_bias_level)
		ret = dapm->set_bias_level(...);

We can directly call it via driver->set_bias_level.
One note here is that both Card and Component have dapm,
but, Card's dapm doesn't have dapm->component.
We need to check it.

This patch moves snd_soc_component_set_bias_level() to soc-component.c
and updates parameters.
dapm->set_bias_level is no longer needed

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tvb94d0n.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:24:17 +01:00
Kuninori Morimoto 8e2a990d76
ASoC: soc-component: move snd_soc_component_stream_event()
Current soc-dapm / soc-core are using a long way round to call
.stream_event.

	if (driver->stream_event)
		dapm->stream_event = ...;
	...
	if (dapm->stream_event)
		ret = dapm->stream_event(...);

We can directly call it via driver->stream_event.
One note here is that both Card and Component have dapm,
but, Card's dapm doesn't have dapm->component.
We need to check it.

This patch moves snd_soc_component_stream_event() to soc-component.c
and updates parameters.
dapm->stream_event is no longer needed

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v9vp4d0r.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:23:51 +01:00
Kuninori Morimoto 9d415fbf77
ASoC: soc-component: move snd_soc_component_seq_notifier()
Current soc-dapm / soc-core are using a long way round to call
.seq_notifier.

	if (driver->seq_notifier)
		dapm->seq_notifier = ...;
	...
	if (dapm->seq_notifier)
		ret = dapm->seq_notifier(...);

We can directly call it via driver->seq_notifier.
One note here is that both Card and Component have dapm,
but, Card's dapm doesn't have dapm->component.
We need to check it.

This patch moves snd_soc_component_seq_notifier() to soc-component.c,
and updates parameters.
dapm->seq_notifier is no longer needed

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87wog54d0v.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:23:25 +01:00
Kuninori Morimoto a2a3417525
ASoC: soc-component: add snd_soc_component_of_xlate_dai_name()
Current ALSA SoC is directly using component->driver->xxx,
thus, it is deep nested, and makes code difficult to read,
and is not good for encapsulation.
This patch adds new snd_soc_component_of_xlate_dai_name() and use it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y30l4d0z.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:22:59 +01:00
Kuninori Morimoto 2c7b170481
ASoC: soc-component: add snd_soc_component_of_xlate_dai_id()
Current ALSA SoC is directly using component->driver->xxx,
thus, it is deep nested, and makes code difficult to read,
and is not good for encapsulation.
This patch adds new snd_soc_component_of_xlate_dai_id() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zhl14d14.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:22:33 +01:00
Kuninori Morimoto 03b34dd7d8
ASoC: soc-component: add snd_soc_component_remove()
Current ALSA SoC is directly using component->driver->xxx,
thus, it is deep nested, and makes code difficult to read,
and is not good for encapsulation.
This patch adds new snd_soc_component_remove() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871ryd5rlo.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:22:08 +01:00
Kuninori Morimoto 08e837dd9e
ASoC: soc-component: add snd_soc_component_probe()
Current ALSA SoC is directly using component->driver->xxx,
thus, it is deep nested, and makes code difficult to read,
and is not good for encapsulation.
This patch adds new snd_soc_component_probe() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/8736it5rlt.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:21:42 +01:00
Kuninori Morimoto e40fadbcef
ASoC: soc-component: add snd_soc_component_is_suspended()
Current ALSA SoC is directly using component->xxx,
But, it is not good for encapsulation.
This patch adds new snd_soc_component_is_suspended() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/874l395rlx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:21:17 +01:00
Kuninori Morimoto 9a840cbac7
ASoC: soc-component: add snd_soc_component_resume()
Current ALSA SoC is directly using component->driver->xxx,
thus, it is deep nested, and makes code difficult to read,
and is not good for encapsulation.
This patch adds new snd_soc_component_resume() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875znp5rm2.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:20:51 +01:00
Kuninori Morimoto 66c51573b8
ASoC: soc-component: add snd_soc_component_suspend()
Current ALSA SoC is directly using component->driver->xxx,
thus, it is deep nested, and makes code difficult to read,
and is not good for encapsulation.
This patch adds new snd_soc_component_suspend() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877e855rn0.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:20:16 +01:00
Kuninori Morimoto 5693d50c83
ASoC: soc-component: add snd_soc_component_trigger()
Current ALSA SoC is directly using component->driver->ops->xxx,
thus, it is deep nested, and makes code difficult to read,
and is not good for encapsulation.
This patch adds new snd_soc_component_trigger() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878ssl5rn5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:19:49 +01:00
Kuninori Morimoto eae7136aa2
ASoC: soc-component: add snd_soc_component_hw_free()
Current ALSA SoC is directly using component->driver->ops->xxx,
thus, it is deep nested, and makes code difficult to read,
and is not good for encapsulation.
This patch adds new snd_soc_component_hw_free() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a7d15rna.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:19:23 +01:00
Kuninori Morimoto 245c539a12
ASoC: soc-component: add snd_soc_component_hw_params()
Current ALSA SoC is directly using component->driver->ops->xxx,
thus, it is deep nested, and makes code difficult to read,
and is not good for encapsulation.
This patch adds new snd_soc_component_hw_params() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87blxh5rnf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:18:57 +01:00
Kuninori Morimoto 6d53723380
ASoC: soc-component: add snd_soc_component_prepare()
Current ALSA SoC is directly using component->driver->ops->xxx,
thus, it is deep nested, and makes code difficult to read,
and is not good for encapsulation.
This patch adds new snd_soc_component_prepare() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87d0hx5rnm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:18:32 +01:00
Kuninori Morimoto 3672beb8ca
ASoC: soc-component: add snd_soc_component_close()
Current ALSA SoC is directly using component->driver->ops->xxx,
thus, it is deep nested, and makes code difficult to read,
and is not good for encapsulation.
This patch adds new snd_soc_component_close() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ef2d5rnr.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:18:06 +01:00
Kuninori Morimoto ae2f484928
ASoC: soc-component: add snd_soc_component_open()
Current ALSA SoC is directly using component->driver->ops->xxx,
thus, it is deep nested, and makes code difficult to read,
and is not good for encapsulation.
This patch adds new snd_soc_component_open() and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ftmt5rnx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:17:40 +01:00
Kuninori Morimoto 4a81e8f30d
ASoC: soc-component: add snd_soc_component_get/put()
ALSA SoC is calling try_module_get()/module_put() based on
component->driver->module_get_upon_open.
To keep simple and readable code, we should create its function.
This patch adds new snd_soc_component_get/put().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h8795ro4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-05 16:17:15 +01:00