Re: [RFC v3 06/11] ASoC: hdac_hda: add ASoC based HDA codec driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 16 Dec 2017 08:48:35 +0100,
Ughreja, Rakesh A wrote:
> 
> 
> 
> >-----Original Message-----
> >From: Takashi Iwai [mailto:tiwai@xxxxxxx]
> >Sent: Friday, December 15, 2017 9:18 PM
> >To: Ughreja, Rakesh A <rakesh.a.ughreja@xxxxxxxxx>
> >Cc: alsa-devel@xxxxxxxxxxxxxxxx; broonie@xxxxxxxxxx;
> >liam.r.girdwood@xxxxxxxxxxxxxxx; pierre-louis.bossart@xxxxxxxxxxxxxxx; Koul, Vinod
> ><vinod.koul@xxxxxxxxx>; Patches Audio <patches.audio@xxxxxxxxx>
> >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.

My assumption is that there is only one hda_codec_driver_register().
The legacy code needs to be rewritten to implement the standard
probe/remove as preliminary.  Any the rest differentiation is done via
additional callbacks at probe/remove time.


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux