From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 070A7C04EB9 for ; Mon, 3 Dec 2018 15:51:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C83182087F for ; Mon, 3 Dec 2018 15:51:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C83182087F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726687AbeLCPvs (ORCPT ); Mon, 3 Dec 2018 10:51:48 -0500 Received: from mx2.suse.de ([195.135.220.15]:46062 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726560AbeLCPvs (ORCPT ); Mon, 3 Dec 2018 10:51:48 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A47C2AE46; Mon, 3 Dec 2018 15:51:43 +0000 (UTC) Date: Mon, 03 Dec 2018 16:51:43 +0100 Message-ID: From: Takashi Iwai To: ayman.bagabas@gmail.com Cc: alsa-devel@alsa-project.org, Hui Wang , Andy Shevchenko , Darren Hart , Jaroslav Kysela , Kailang Yang , linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: Re: [PATCH v8 2/3] x86: add support for Huawei WMI hotkeys. In-Reply-To: References: <20181129235742.14332-1-ayman.bagabas@gmail.com> <20181129235742.14332-3-ayman.bagabas@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/26 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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