[alsa-devel] [RFC v3 06/11] ASoC: hdac_hda: add ASoC based HDA codec driver

Ughreja, Rakesh A rakesh.a.ughreja at intel.com
Sat Dec 16 08:48:35 CET 2017



>-----Original Message-----
>From: Takashi Iwai [mailto:tiwai at suse.de]
>Sent: Friday, December 15, 2017 9:18 PM
>To: Ughreja, Rakesh A <rakesh.a.ughreja at intel.com>
>Cc: alsa-devel at alsa-project.org; broonie at kernel.org;
>liam.r.girdwood at linux.intel.com; pierre-louis.bossart at linux.intel.com; Koul, Vinod
><vinod.koul at intel.com>; Patches Audio <patches.audio at intel.com>
>Subject: Re: [RFC v3 06/11] ASoC: hdac_hda: add ASoC based HDA codec driver
>

>> >Can we check differently?  For example, we may put some difference in
>> >the driver and check it here instead of the static IS_ENABLED().
>>
>> Do you think a module parameter is a good idea ?
>
>I don't think so.  We do need to consider a better way.
>
>Maybe an alternative is to give the additional indirect calls.
>That is, put some new ops or hook to the bus for calling some extra
>probing task in addition to the standard codec probe.
>

I am not sure if I understand you fully, so asking some follow up
Questions.

I am assuming you are asking me to implement something like following.
Where I have to implement snd_hda_get_mode() function which would
return "true" if we need to register the driver as "asoc" driver.

Is that right understanding ?

int __hda_codec_driver_register(struct hda_codec_driver *drv, const char *name,
                               struct module *owner)
{
        /*
         * check if we need to register ASoC HDA driver
         */
#if IS_ENABLED(CONFIG_SND_SOC_HDAC_HDA)
        int asoc_mode = snd_hda_get_mode();
        if (asoc_mode) {
                drv->core.id_table = drv->id;
                return __hdac_hda_codec_driver_register(&drv->core, name, owner);
        }
#endif
        return __hda_legacy_codec_driver_register(drv, name, owner);
}

If above is true then the follow up question is, what are the criteria to determine
the mode. Since I cannot assume that the bus instance is already created at the
time of driver registration, I am not sure how to determine what kind of platform
driver would be loaded in future.

Regards,
Rakesh



More information about the Alsa-devel mailing list