[alsa-devel] [PATCH 0/x][RFC] ASoC: replace codec/platform to component

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Wed Dec 6 03:32:04 CET 2017


Hi Mark

Finally, all prepare patch-set were accepted.
These are [RFC] of codec/platform replace to component patch-set.
It will be almost 200 patches in total.
Thus, to avoid patch bomb (in case of rejection),
I pickuped few patches and post these as [RFC].

Main is replacing codec/platform to component

	xxx_codec_xxx()    -> xxx_component_xxx()
	xxx_platform_xxx() -> xxx_component_xxx()

Note1 is that it is using devm_ version register function,
and removed unregister from .remove
(sometimes, removes .remove function itself)

	- snd_soc_register_xxx()
	+ devm_snd_soc_register_component()
	...
	- snd_soc_unregister_xxx()

Note2 is that rtd->platform will be removed, thus it will be replaced
to snd_soc_rtdcom_lookup() with driver name

	- rtd->platform
	+ snd_soc_rtdcom_lookup(rtd, DRV_NAME)

Note3 is that codec driver needs to have some flags which is needed for Codec

	-static const struct snd_soc_codec_driver xxx_codec;
	+static const struct snd_soc_component_driver xxx_codec = {
	+	.idle_bias_on		= 1,
	+	.pmdown_time		= 1,
	+	.endianness		= 1,
	+	.non_legacy_dai_naming	= 1,
	+};

here,
 .idle_bias_on was originally .idle_bias_off
 .pmdown_time  was originally .ignore_pmdown_time
 .endianness            is needed for Codec endianness check
 .non_legacy_dai_naming is needed for Codec DAI name matching

Note4 is that some driver is controlling CPU/Platform in one driver
as 2 component. Now we can merge these into one component.

	- snd_soc_register_platform(xxx)  // for Platform
	- snd_soc_register_component(xxx) // for CPU
	+ snd_soc_register_component(xxx) // for CPU/Platform

Note4 is that [1/x] patch which removes (!rtd->platform) check from
soc-core is needed for all platforms.
This check is no longer needed for component version.

If these [RFC] were OK, I will post all replacement patch-set.
I think good timing to posting is around next -rc1 or merge-window

About removing all unneeded codec/platform patch-set,
when is good timing ?
	+1 version: includes replacement patch-set
	+2 version: includes remove      patch-set
or
	+1 version: includes both replacement/remove patch-set

Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list