lkml.org 
[lkml]   [2018]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 3/3] ALSA: hda: add support for Huawei WMI MicMute LED
On Fri, Nov 2, 2018 at 8:30 PM Takashi Iwai <tiwai@suse.de> wrote:
> On Fri, 02 Nov 2018 19:12:44 +0100,
> Andy Shevchenko wrote:
> >
> > > + if (action == HDA_FIXUP_ACT_PROBE) {
> > > + if (!huawei_wmi_micmute_led_set_func)
> > > + huawei_wmi_micmute_led_set_func = symbol_request(huawei_wmi_micmute_led_set);
> > > + if (!huawei_wmi_micmute_led_set_func) {
> > > + codec_warn(codec, "Failed to find huawei_wmi symbol huawei_wmi_micmute_led_set\n");
> > > + return;
> > > + }
> > > + removefunc = (huawei_wmi_micmute_led_set_func(false) < 0)
> > > + || (snd_hda_gen_add_micmute_led(codec, update_huawei_wmi_micmute_led) < 0);
> > > +
> > > + }
> > > +
> > > + if (huawei_wmi_micmute_led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) {
> > > + symbol_put(huawei_wmi_micmute_led_set);
> > > + huawei_wmi_micmute_led_set_func = NULL;
> > > + }
> > > +}
> >
> > Takashi, is it a way how the rest sound drivers are written? B/c this
> > symbol_request(s) look to me a bit ugly.
>
> It's a workaround for not having a hard dependency. The HD-audio
> codec driver is generic, and we don't want to load the multiple WMI
> drivers always for using a Realtek codec.
>
> Ugly, yes, but simple enough.

Okay, thanks for elaboration.

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2018-11-02 19:35    [W:0.051 / U:1.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site