From: Takashi Iwai <tiwai@suse.de>
To: ayman.bagabas@gmail.com
Cc: alsa-devel@alsa-project.org, Hui Wang <hui.wang@canonical.com>,
Andy Shevchenko <andy@infradead.org>,
Darren Hart <dvhart@infradead.org>,
Jaroslav Kysela <perex@perex.cz>,
Kailang Yang <kailang@realtek.com>,
linux-kernel@vger.kernel.org,
platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v8 2/3] x86: add support for Huawei WMI hotkeys.
Date: Mon, 03 Dec 2018 16:51:43 +0100 [thread overview]
Message-ID: <s5h5zway5f4.wl-tiwai@suse.de> (raw)
In-Reply-To: <eaa9d7a8898df9487031995429ff11892c9cd0ca.camel@gmail.com>
On Mon, 03 Dec 2018 16:46:01 +0100,
ayman.bagabas@gmail.com wrote:
>
> > > + priv->cdev.name = "platform::micmute";
> > > + priv->cdev.max_brightness = 1;
> > > + priv->cdev.brightness_set_blocking =
> > > huawei_wmi_micmute_led_set;
> > > + priv->cdev.default_trigger = "audio-micmute";
> > > + priv->cdev.brightness = ledtrig_audio_get(LED_AUDIO_MICMUTE);
> > > + priv->cdev.dev = &wdev->dev;
> >
> > What about suspend/resume?
> > When the driver is bound wit HD-audio, the HD-audio will restore the
> > state at resume, so it would work. But, by providing the LED class
> > device, it is supposed to work even without HD-audio, so it might
> > make
> > sense to pass LED_CORE_SUSPENDRESUME, too.
>
> Besides that, is there anything needed for wmi_device suspend/resume?
AFAIK, the wmi_driver itself doesn't need anything. The input also
doesn't need, so most likely only LED.
> > > +static int __init huawei_wmi_init(void)
> > > +{
> > > + if (!(wmi_has_guid(WMI0_EVENT_GUID) ||
> > > wmi_has_guid(AMW0_EVENT_GUID))) {
> > > + pr_debug("Compatible WMI GUID not found\n");
> > > + return -ENODEV;
> > > + }
> >
> > This is superfluous when you implement with wmi_driver.
> > In theory, the supported GUID can be added dynamically via sysfs,
> > too.
> >
>
> I left it that way so it doesn't insert the module if these GUIDs were
> not found.
But they aren't loaded on such devices unless you do explicitly.
If they are done explicitly, there must be a reason to do so, hence
you don't need to block it :)
> Should I drop that and use module_wmi_driver instead?
Yes, that's cleaner. Let's try to make it as simple as possible at
first.
thanks,
Takashi
next prev parent reply other threads:[~2018-12-03 15:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-29 23:57 [PATCH v8 0/3] Huawei laptops Ayman Bagabas
2018-11-29 23:57 ` [PATCH v8 1/3] ALSA: hda: fix front speakers on Huawei MBXP Ayman Bagabas
2018-11-29 23:57 ` [PATCH v8 2/3] x86: add support for Huawei WMI hotkeys Ayman Bagabas
2018-12-03 12:00 ` Takashi Iwai
2018-12-03 14:18 ` Andy Shevchenko
2018-12-03 14:22 ` Takashi Iwai
2018-12-03 14:23 ` Andy Shevchenko
2018-12-03 15:46 ` ayman.bagabas
2018-12-03 15:51 ` Takashi Iwai [this message]
2018-12-03 14:22 ` Andy Shevchenko
2018-11-29 23:57 ` [PATCH v8 3/3] ALSA: hda: add support for Huawei WMI micmute LED Ayman Bagabas
2018-12-03 12:00 ` Takashi Iwai
2018-12-03 15:48 ` ayman.bagabas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5h5zway5f4.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=andy@infradead.org \
--cc=ayman.bagabas@gmail.com \
--cc=dvhart@infradead.org \
--cc=hui.wang@canonical.com \
--cc=kailang@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®