-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 03/02/2016 05:03 AM, Mark Brown wrote:
On Tue, Mar 01, 2016 at 09:19:15AM +0100, Arnaud Pouliquen wrote:
Some Controls defined in DAI need to be associated to PCM device (e.g. IEC60958).
This allows to perform post initialization in DAI after PCM device creation.
Rather than add an explicit callback and make drivers open code this I'd prefer to see us either just move the control creation entirely (I can't immediately think of a particular need for the current ordering) or add a data based mechanism like we currently have. Why do we need to do this via a callback?
For time being I identify only a need to link controls to pcm device. So no other justification to implement the pcm_new callback.
I implemented the pcm_new callback because straightforward way to handle generic iec958 control proposed in [PATCH v3 1/4] ALSA: pcm: add IEC958 channel status control helper
Here is an alternative but with higher impact in soc-core: 1)Create 2 helper functions in soc-core: - snd_soc_add_dai_pcm_controls: =>register a control that needs to be linked to pcm device. if dai probed(pcm device exist) => link control to pcm device else postpone link creation in soc_probe_link_dais - snd_soc_add_dai_iec_control same but based on snd_pcm_create_iec958_ctrl
2) add 2 news fields in snd-soc-dai struct struct snd_kcontrol *pcm_kctl /* list control that will be linked to pcm device*/ struct snd_pcm_iec958_params *params /* if not null iec control is created */
Abandon helper function for iec control should simplify implementation but that also makes sense to have helper for this generic control...
Is is sometime that should be more reasonable?
Thanks Arnaud