public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Carlos Corbacho <carlos@strangeworlds.co.uk>
To: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org,
	"Krzysztof Kosiński" <tweenk.pl@gmail.com>,
	"Len Brown" <len.brown@intel.com>
Subject: Re: [PATCH 87/98] Fix state reporting in tc1100-wmi
Date: Sat, 28 Mar 2009 09:14:56 +0000	[thread overview]
Message-ID: <200903280914.57293.carlos@strangeworlds.co.uk> (raw)
In-Reply-To: <1a8522f6537bc71153d2d19fdf238d4ff7fba17e.1238214620.git.len.brown@intel.com>

On Saturday 28 March 2009 04:32:02 Len Brown wrote:
> From: Krzysztof Kosiński <tweenk.pl@gmail.com>
>
> The tc1100-wmi driver should print the current states of wireless LAN and
> jogdial brightness control when "cat
> /sys/devices/platform/tc1100-wmi/wireless" and "cat
> /sys/devices/platform/tc1100-wmi/jogdial" are executed, respectively. What
> actually happens is that both of those commands print 0 regardless of the
> hardware state. The cause is that wmi_query_block returns an
> ACPI_TYPE_INTEGER rather than ACPI_TYPE_BUFFER as the driver assumes.
> Additionally, the driver intends to return a jogdial state that is inverted
> with respect to the commands required to set it (e.g. it intends to return
> 1 after the jogdial file was written with 0).
>
> This patch fixes both of those issues - the commands to query the
> state now work, and should return the same state that was written.
>
> http://bugzilla.kernel.org/show_bug.cgi?id=12286
>
> Signed-off-by: Krzysztof Kosiński <tweenk.pl@gmail.com>

Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk>

> Signed-off-by: Len Brown <len.brown@intel.com>
> ---
>  drivers/platform/x86/tc1100-wmi.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/platform/x86/tc1100-wmi.c
> b/drivers/platform/x86/tc1100-wmi.c index b4a4aa9..4416600 100644
> --- a/drivers/platform/x86/tc1100-wmi.c
> +++ b/drivers/platform/x86/tc1100-wmi.c
> @@ -94,9 +94,8 @@ static int get_state(u32 *out, u8 instance)
>  		return -ENODEV;
>
>  	obj = (union acpi_object *) result.pointer;
> -	if (obj && obj->type == ACPI_TYPE_BUFFER &&
> -		obj->buffer.length == sizeof(u32)) {
> -		tmp = *((u32 *) obj->buffer.pointer);
> +	if (obj && obj->type == ACPI_TYPE_INTEGER) {
> +		tmp = obj->integer.value;
>  	} else {
>  		tmp = 0;
>  	}
> @@ -109,7 +108,7 @@ static int get_state(u32 *out, u8 instance)
>  		*out = (tmp == 3) ? 1 : 0;
>  		return 0;
>  	case TC1100_INSTANCE_JOGDIAL:
> -		*out = (tmp == 1) ? 1 : 0;
> +		*out = (tmp == 1) ? 0 : 1;
>  		return 0;
>  	default:
>  		return -ENODEV;

-- 
E-Mail: carlos@strangeworlds.co.uk
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-03-28  9:16 UTC|newest]

Thread overview: 133+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-28  4:30 ACPI & driver patches for 2.6.30-rc0 Len Brown
2009-03-28  4:30 ` [PATCH 01/98] thermal: use integers rather than strings for thermal values Len Brown
2009-03-28  4:30   ` [PATCH 02/98] ACPI: move thermal trip handling to generic thermal layer Len Brown
2009-03-28  4:30   ` [PATCH 03/98] ACPI: introduce sysfs I/F for dynamic tables Len Brown
2009-03-28  4:30   ` [PATCH 04/98] ACPI: Add the dmi check to make acpi_enforce_resources strict Len Brown
2009-03-28  4:30   ` [PATCH 05/98] hp-wmi: notify of a potential docking state change on resume Len Brown
2009-03-28  4:30   ` [PATCH 06/98] acpi: fix of pmtimer overflow that make Cx states time incorrect Len Brown
2009-04-02 12:26     ` Thomas Renninger
2009-04-03 16:22       ` Len Brown
2009-03-28  4:30   ` [PATCH 07/98] ACPI: pci_link: clean up whitespace Len Brown
2009-03-28  4:30   ` [PATCH 08/98] ACPI: pci_link: remove unnecessary casts and initializations Len Brown
2009-03-28  4:30   ` [PATCH 09/98] ACPI: pci_link: remove unnecessary null pointer checks Len Brown
2009-03-28  4:30   ` [PATCH 10/98] ACPI: pci_link: simplify list of link devices Len Brown
2009-03-28  4:30   ` [PATCH 11/98] ACPI: PCI: use generic pci_swizzle_interrupt_pin() Len Brown
2009-03-28  4:30   ` [PATCH 12/98] ACPI: update Kconfig help texts (no functional changes) Len Brown
2009-03-28  4:30   ` [PATCH 13/98] ACPI: move private declarations to internal.h Len Brown
2009-03-28  4:30   ` [PATCH 14/98] ACPICA: Add error check to debug object dump routine Len Brown
2009-03-28  4:30   ` [PATCH 15/98] ACPICA: Allow OS override of all ACPI tables Len Brown
2009-03-28  4:30   ` [PATCH 16/98] ACPICA: Remove extraneous parameter in table manager Len Brown
2009-03-28  4:30   ` [PATCH 17/98] ACPICA: Add override for dynamic tables Len Brown
2009-03-28  4:30   ` [PATCH 18/98] ACPICA: Update FADT flag definitions Len Brown
2009-03-28  4:30   ` [PATCH 19/98] ACPICA: Update version to 20090123 Len Brown
2009-03-28  4:30   ` [PATCH 20/98] ACPICA: Split out PM1 status registers from the FADT Len Brown
2009-03-28  4:30   ` [PATCH 21/98] ACPICA: Check for non-zero address before being converted to GAS Len Brown
2009-04-02 11:59     ` Thomas Renninger
2009-04-03  1:09       ` Lin Ming
2009-04-03 16:41         ` Len Brown
2009-03-28  4:30   ` [PATCH 22/98] ACPICA: Update comments in module header Len Brown
2009-03-28  4:30   ` [PATCH 23/98] ACPICA: Fix writes to optional PM1B registers Len Brown
2009-03-28  4:30   ` [PATCH 24/98] ACPICA: Remove extra write for acpi_hw_clear_acpi_status Len Brown
2009-03-28  4:31   ` [PATCH 25/98] ACPICA: For PM1B registers, do not shift value read or written Len Brown
2009-03-28  4:31   ` [PATCH 26/98] ACPICA: Fix parameter validation for acpi_read/write Len Brown
2009-03-28  4:31   ` [PATCH 27/98] ACPICA: Remove redundant ACPI_BITREG_SLEEP_TYPE_B Len Brown
2009-03-28  4:31   ` [PATCH 28/98] ACPICA: Add function to handle PM1 control registers Len Brown
2009-03-28  4:31   ` [PATCH 29/98] ACPICA: Remove ACPI_GET_OBJECT_TYPE macro Len Brown
2009-03-28  4:31   ` [PATCH 30/98] ACPICA: Conditionally compile acpi_set_firmware_waking_vector64 Len Brown
2009-03-28  4:31   ` [PATCH 31/98] ACPICA: Debug output: print result of _OSI invocations Len Brown
2009-03-28  4:31   ` [PATCH 32/98] ACPICA: Debug output: decrease verbosity of DB_INFO debug level Len Brown
2009-03-28  4:31   ` [PATCH 33/98] ACPICA: Formatting update - no functional changes Len Brown
2009-03-28  4:31   ` [PATCH 34/98] ACPICA: Optimize ACPI register locking Len Brown
2009-03-28  4:31   ` [PATCH 35/98] ACPICA: Rename ACPI bit register access functions Len Brown
2009-03-28  4:31   ` [PATCH 36/98] ACPICA: Restructure " Len Brown
2009-03-28  4:31   ` [PATCH 37/98] ACPICA: Update table header print function Len Brown
2009-03-28  4:31   ` [PATCH 38/98] ACPICA: Update version to 20090220 Len Brown
2009-03-28  4:31   ` [PATCH 39/98] ACPICA: Add manifest constants for bit register values Len Brown
2009-03-28  4:31   ` [PATCH 40/98] ACPICA: Formatting update - no functional changes Len Brown
2009-03-28  4:31   ` [PATCH 41/98] ACPICA: FADT: Fix extraneous length mismatch warning Len Brown
2009-04-02 11:53     ` Thomas Renninger
2009-03-28  4:31   ` [PATCH 42/98] ACPICA: Fix AcpiWalkNamespace race condition with table unload Len Brown
2009-03-28  4:31   ` [PATCH 43/98] ACPICA: Change handling of PM1 Status register ignored bit Len Brown
2009-03-28  4:31   ` [PATCH 44/98] ACPICA: Preserve all PM control reserved and ignored bits Len Brown
2009-03-28  4:31   ` [PATCH 45/98] ACPICA: New: I/O port protection Len Brown
2009-03-28  4:31   ` [PATCH 46/98] ACPICA: Remove obsolete acpi_os_validate_address interface Len Brown
2009-03-28  4:31   ` [PATCH 47/98] ACPICA: Clear PM register write-only bits on reading Len Brown
2009-03-28  4:31   ` [PATCH 48/98] ACPICA: Remove unused code, no functional change Len Brown
2009-03-28  4:31   ` [PATCH 49/98] ACPICA: Condense some protected ports Len Brown
2009-03-28  4:31   ` [PATCH 50/98] ACPICA: Fix PCI configuration space port address range Len Brown
2009-03-28  4:31   ` [PATCH 51/98] ACPICA: FADT: Favor 32-bit register addresses for compatibility Len Brown
2009-04-02 12:11     ` Thomas Renninger
2009-04-03 16:12       ` Len Brown
2009-03-28  4:31   ` [PATCH 52/98] ACPICA: FADT: Favor 32-bit FACS and DSDT addresses Len Brown
2009-03-28  4:31   ` [PATCH 53/98] ACPICA: Fix index value in package warning message Len Brown
2009-03-28  4:31   ` [PATCH 54/98] ACPICA: Update version to 20090320 Len Brown
2009-03-28  4:31   ` [PATCH 55/98] sony-laptop: Add support for new Sony platform API Len Brown
2009-03-28  4:31   ` [PATCH 56/98] sony-laptop: Enable EC on newer hardware Len Brown
2009-03-28  4:31   ` [PATCH 57/98] sony-laptop: Add support for extra keyboard events Len Brown
2009-03-29 10:53     ` Matthias Welwarsky
2009-03-29 15:03       ` Matthew Garrett
2009-03-29 15:51         ` Matthias Welwarsky
2009-03-29 16:02           ` Matthew Garrett
2009-03-29 16:38             ` Matthias Welwarsky
2009-03-29 16:41               ` Matthew Garrett
2009-03-29 17:08                 ` Matthias Welwarsky
2009-03-29 17:13                   ` Matthew Garrett
2009-03-29 17:56                     ` Matthias Welwarsky
2009-03-30  3:52                 ` Mattia Dongili
2009-03-30  6:20                   ` Matthias Welwarsky
2009-03-30 22:18                     ` Matthias Welwarsky
2009-03-31  4:28                       ` Mattia Dongili
2009-03-28  4:31   ` [PATCH 58/98] sony-laptop: Add rfkill support on new models Len Brown
2009-03-29 11:52     ` Matthias Welwarsky
2009-03-29 15:06       ` Matthew Garrett
2009-04-01 13:00         ` Mattia Dongili
2009-04-01 13:15           ` Matthias Welwarsky
2009-04-07 16:46             ` Mattia Dongili
     [not found]     ` <200903291317.48139.matze@welwarsky.de>
2009-04-03 16:52       ` Len Brown
2009-04-03 17:30         ` Matthew Garrett
2009-03-28  4:31   ` [PATCH 59/98] sony-laptop: Add support for extended hotkeys Len Brown
2009-03-28  4:31   ` [PATCH 60/98] sony-laptop: merge Type4 into Type3 Len Brown
2009-03-28  4:31   ` [PATCH 61/98] sony-laptop: VGN-A317M hotkey support Len Brown
2009-03-28  4:31   ` [PATCH 62/98] sony-laptop: Eliminate BKL in ioctls Len Brown
2009-03-28  4:31   ` [PATCH 63/98] sony-laptop: detect the ICH9 chipset as Type3 Len Brown
2009-03-28  4:31   ` [PATCH 64/98] sony-laptop: notify the hardware of a state change in wwanpower Len Brown
2009-03-28  4:31   ` [PATCH 65/98] sony-laptop: Add FW specific hotkey events Len Brown
2009-03-28  4:31   ` [PATCH 66/98] sony-laptop: Make sony_pic_set_wwanpower not take mutexes Len Brown
2009-03-28  4:31   ` [PATCH 67/98] sony-laptop: update copyright Len Brown
2009-03-28  4:31   ` [PATCH 68/98] sony-laptop: Kill the BKL Len Brown
2009-03-28  4:31   ` [PATCH 69/98] ACPI: skip DMI power state check when ACPI disabled Len Brown
2009-03-28  4:31   ` [PATCH 70/98] ACPI: call acpi_scan_init() explicitly rather than as initcall Len Brown
2009-03-28  4:31   ` [PATCH 71/98] ACPI: call acpi_ec_init() " Len Brown
2009-03-28  4:31   ` [PATCH 72/98] ACPI: call acpi_power_init() " Len Brown
2009-03-28  4:31   ` [PATCH 73/98] ACPI: call acpi_system_init() " Len Brown
2009-03-28  4:31   ` [PATCH 74/98] ACPI: call acpi_debug_init() " Len Brown
2009-03-28  4:31   ` [PATCH 75/98] ACPI: call init_acpi_device_notify() " Len Brown
2009-03-28  4:31   ` [PATCH 76/98] ACPI: call acpi_sleep_proc_init() " Len Brown
2009-03-28  4:31   ` [PATCH 77/98] ACPI: call acpi_wakeup_device_init() " Len Brown
2009-03-28  4:31   ` [PATCH 78/98] ACPI: tidy up makefile Len Brown
2009-03-28  4:31   ` [PATCH 79/98] ACPI: cpufreq: use new bit register access function Len Brown
2009-03-28  4:31   ` [PATCH 80/98] ACPI: update thermal for bus_id removal Len Brown
2009-03-28  4:31   ` [PATCH 81/98] thermal: support forcing support for passive cooling Len Brown
2009-04-02 12:35     ` Thomas Renninger
2009-04-03 16:25       ` Len Brown
2009-03-28  4:31   ` [PATCH 82/98] ACPI: remove unused acpi_device_ops .lock and .scan methods Len Brown
2009-03-28  4:31   ` [PATCH 83/98] ACPI: remove unused acpi_device_ops .shutdown method Len Brown
2009-03-28  4:31   ` [PATCH 84/98] ACPI: remove unused acpi_bus_ops flags Len Brown
2009-03-28  4:32   ` [PATCH 85/98] ACPI: Avoid wiping out pr->performance during preregistering Len Brown
2009-03-28  4:32   ` [PATCH 86/98] ACPI: cap off P-state transition latency from buggy BIOSes Len Brown
     [not found]     ` <200904021450.26935.trenn@suse.de>
2009-04-03 16:35       ` Len Brown
2009-04-05 22:17         ` Thomas Renninger
2009-04-07  5:48           ` Len Brown
2009-03-28  4:32   ` [PATCH 87/98] Fix state reporting in tc1100-wmi Len Brown
2009-03-28  9:14     ` Carlos Corbacho [this message]
2009-03-28  4:32   ` [PATCH 88/98] ACPI video: check the return value of acpi_video_device_lcd_get_level_current Len Brown
2009-03-28  4:32   ` [PATCH 89/98] ACPI video: check the return value of acpi_video_device_lcd_set_level Len Brown
2009-03-28  4:32   ` [PATCH 90/98] ACPI video: support _BCL packages that don't export brightness levels when machine is on AC/Battery Len Brown
2009-03-28  4:32   ` [PATCH 91/98] ACPI video: support reversed _BCL method in ACPI video driver Len Brown
2009-03-28  4:32   ` [PATCH 92/98] ACPI video: support _BQC/_BCL/_BCM methods that use index values Len Brown
2009-03-28  4:32   ` [PATCH 93/98] ACPI video: support buggy BIOSes with _BCQ implemented Len Brown
2009-03-28  4:32   ` [PATCH 94/98] ACPI: Populate DIDL before registering ACPI video device on Intel Len Brown
2009-03-28  4:32   ` [PATCH 95/98] ACPI: suspend: Add the Pansonic CF51 box to the dmi check table Len Brown
2009-03-28  4:32   ` [PATCH 96/98] ACPI: battery: add power_{now,avg} properties to power_class Len Brown
2009-03-28  4:32   ` [PATCH 97/98] ACPI video: add a warning message if _BQC is not found Len Brown
2009-03-28  4:32   ` [PATCH 98/98] ACPI: get_throttling_state() cannot be larger than state_count Len Brown

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=200903280914.57293.carlos@strangeworlds.co.uk \
    --to=carlos@strangeworlds.co.uk \
    --cc=len.brown@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=tweenk.pl@gmail.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