linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "Lee, Chun-Yi" <joeyli.kernel@gmail.com>
Cc: platform-driver-x86@vger.kernel.org, mjg59@srcf.ucam.org,
	carlos@strangeworlds.co.uk, linux-input@vger.kernel.org,
	tiwai@novell.com, trenn@novell.com, jbenc@suse.cz,
	corentin.chary@gmail.com, GregKH@novell.com, "Lee,
	Chun-Yi" <jlee@novell.com>
Subject: Re: [PATCH 4/4] Detect the WiFi/Bluetooth/3G devices available
Date: Mon, 18 Oct 2010 08:55:47 -0700	[thread overview]
Message-ID: <20101018155547.GA10559@core.coreip.homeip.net> (raw)
In-Reply-To: <1287414463-13973-1-git-send-email-jlee@novell.com>

Hi,

On Mon, Oct 18, 2010 at 11:07:43PM +0800, Lee, Chun-Yi wrote:
> +static void type_aa_dmi_decode(const struct dmi_header *header, void *dummy)
> +{
> +	/* We are looking for OEM-specific Type Aah */
> +	if (header->type != ACER_DMI_DEV_TYPE_AA)
> +		return;
> +
> +	type_aa = (struct hotkey_function_type_aa *) header;
> +
> +	printk(ACER_INFO "Function biti map for Communication Button: 0x%x\n",
> +		type_aa->commun_func_bitmap);
> +	if (!!(type_aa->commun_func_bitmap & ACER_WMID3_GDS_WIRELESS))
> +		interface->capability |= ACER_CAP_WIRELESS;
> +	if (!!(type_aa->commun_func_bitmap & ACER_WMID3_GDS_THREEG))
> +		interface->capability |= ACER_CAP_THREEG;
> +	if (!!(type_aa->commun_func_bitmap & ACER_WMID3_GDS_BLUETOOTH))
> +		interface->capability |= ACER_CAP_BLUETOOTH;

The "!!" is completely redundant here.

> +}
> +
>  static acpi_status WMID_set_capabilities(void)
>  {
>  	struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL};
> @@ -844,16 +875,17 @@ static acpi_status WMID_set_capabilities(void)
>  		return AE_ERROR;
>  	}
>  
> -	/* Not sure on the meaning of the relevant bits yet to detect these */
> -	interface->capability |= ACER_CAP_WIRELESS;
> -	interface->capability |= ACER_CAP_THREEG;
> +	dmi_walk(type_aa_dmi_decode, NULL);
> +	if (!type_aa) {
> +		interface->capability |= ACER_CAP_WIRELESS;
> +		interface->capability |= ACER_CAP_THREEG;
> +		if (devices & 0x10)
> +			interface->capability |= ACER_CAP_BLUETOOTH;
> +	}

Since you are storing "type_aa" anyways it probably would be better to
set all capabilities here, in one place...

Thanks.

-- 
Dmitry

  reply	other threads:[~2010-10-18 15:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-18 15:07 [PATCH 4/4] Detect the WiFi/Bluetooth/3G devices available Lee, Chun-Yi
2010-10-18 15:55 ` Dmitry Torokhov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-10-20  4:12 Joey Lee
2010-10-30 16:36 [PATCH 1/4] Add acer wmi hotkey events support Lee, Chun-Yi
2010-10-30 16:36 ` [PATCH 2/4] Enabled Acer Launch Manager mode Lee, Chun-Yi
2010-10-30 16:36   ` [PATCH 3/4] Add 3G rfkill sysfs file Lee, Chun-Yi
2010-10-30 16:36     ` [PATCH 4/4] Detect the WiFi/Bluetooth/3G devices available Lee, Chun-Yi
2010-10-30 16:44 Joey Lee
2010-11-08  4:54 Joey Lee
2010-11-12  8:36 Joey Lee
2010-11-24 17:39 [PATCH 0/4] Add new wmi support to acer-wmi driver Lee, Chun-Yi
2010-11-24 17:39 ` [PATCH 1/4] Add acer wmi hotkey events support Lee, Chun-Yi
2010-11-24 17:39   ` [PATCH 2/4] Enabled Acer Launch Manager mode Lee, Chun-Yi
2010-11-24 17:39     ` [PATCH 3/4] Add 3G rfkill sysfs file Lee, Chun-Yi
2010-11-24 17:39       ` [PATCH 4/4] Detect the WiFi/Bluetooth/3G devices available Lee, Chun-Yi
2010-12-04  1:03 [PATCH 0/4] Add new wmi support to acer-wmi driver Lee, Chun-Yi
2010-12-04  1:03 ` [PATCH 1/4] Add acer wmi hotkey events support Lee, Chun-Yi
2010-12-04  1:03   ` [PATCH 2/4] Enabled Acer Launch Manager mode Lee, Chun-Yi
2010-12-04  1:03     ` [PATCH 3/4] Add 3G rfkill sysfs file Lee, Chun-Yi
2010-12-04  1:03       ` [PATCH 4/4] Detect the WiFi/Bluetooth/3G devices available Lee, Chun-Yi

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=20101018155547.GA10559@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=GregKH@novell.com \
    --cc=carlos@strangeworlds.co.uk \
    --cc=corentin.chary@gmail.com \
    --cc=jbenc@suse.cz \
    --cc=jlee@novell.com \
    --cc=joeyli.kernel@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=tiwai@novell.com \
    --cc=trenn@novell.com \
    /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;
as well as URLs for NNTP newsgroup(s).