mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "Ayman Bagabas" <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 v7 2/3] x86: add support for Huawei WMI hotkeys.
Date: Tue, 27 Nov 2018 12:02:39 +0100	[thread overview]
Message-ID: <s5hwooyye9c.wl-tiwai@suse.de> (raw)
In-Reply-To: <20181127025752.6459-3-ayman.bagabas@gmail.com>

Some more forgotten bits...

On Tue, 27 Nov 2018 03:57:48 +0100,
Ayman Bagabas wrote:
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
....
> +config HUAWEI_WMI
> +	tristate "Huawei WMI hotkeys driver"
> +	depends on ACPI_WMI
> +	depends on INPUT
> +	select INPUT_SPARSEKMAP
> +	select LEDS_TRIGGERS
> +	select LEDS_TRIGGER_AUDIO

I guess "select LEDS_CLASS" is needed as well.
Other drivers had already it.

> --- /dev/null
> +++ b/drivers/platform/x86/huawei-wmi.c
....
> +static int huawei_wmi_micmute_led_set(bool on)
> +{
> +	acpi_handle handle;
> +	char *method;
> +	union acpi_object args[3];
> +	struct acpi_object_list arg_list = {
> +		.pointer = args,
> +		.count = ARRAY_SIZE(args),
> +	};
> +
> +	handle = ACPI_HANDLE(&inputdev->dev);
> +	args[0].type = args[1].type = args[2].type = ACPI_TYPE_INTEGER;
> +	args[1].integer.value = 0x04;
> +
> +	if (acpi_has_method(handle, method = "\\_SB.PCI0.LPCB.EC0.SPIN")) {

This looks ugly...  And checkpatch also complains.

> +		args[0].integer.value = 0;
> +		args[2].integer.value = on ? 1 : 0;
> +	} else if (acpi_has_method(handle, method = "\\_SB.PCI0.LPCB.EC0.WPIN")) {
> +		args[0].integer.value = 1;
> +		args[2].integer.value = on ? 0 : 1;
> +	} else {
> +		dev_err(&inputdev->dev, "Unable to find ACPI method\n");
> +		return -ENOSYS;
> +	}

Can these checks be done at initialization phase?  It doesn't seem
needed to be executed at each call.


thanks,

Takashi

  parent reply	other threads:[~2018-11-27 11:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-27  2:57 [PATCH v7 0/3] Huawei laptops Ayman Bagabas
2018-11-27  2:57 ` [PATCH v7 1/3] ALSA: hda: fix front speakers on Huawei MBXP Ayman Bagabas
2018-11-27  2:57 ` [PATCH v7 2/3] x86: add support for Huawei WMI hotkeys Ayman Bagabas
2018-11-27  9:45   ` Takashi Iwai
2018-11-28  0:58     ` ayman.bagabas
2018-11-27 11:02   ` Takashi Iwai [this message]
2018-11-27 15:52     ` Andy Shevchenko
2018-11-28  0:49       ` ayman.bagabas
2018-11-28  8:44         ` Takashi Iwai
2018-11-27  2:57 ` [PATCH v7 3/3] ALSA: hda: add support for Huawei WMI micmute LED Ayman Bagabas
     [not found] <20181126234624.31264-1-ayman.bagabas@gmail.com>
2018-11-26 23:46 ` [PATCH v7 2/3] x86: add support for Huawei WMI hotkeys 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=s5hwooyye9c.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®