linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kyle Evans <kvans32@gmail.com>
To: Matthew Garrett <matthew.garrett@nebula.com>
Cc: "Pali Rohár" <pali.rohar@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"platform-driver-x86@vger.kernel.org"
	<platform-driver-x86@vger.kernel.org>
Subject: Re: BUG: Fn keys not working on EliteBook 8460p after fabf85e3ca15d5b94058f391dac8df870cdd427a
Date: Sat, 13 Apr 2013 13:39:15 -0400	[thread overview]
Message-ID: <51699843.7060905@gmail.com> (raw)
In-Reply-To: <1365870087.13667.7.camel@x230.lan>

On 04/13/2013 12:21 PM, Matthew Garrett wrote:
> On Sat, 2013-04-13 at 08:36 -0400, Kyle Evans wrote:
>> Sure, sorry about that. I was hoping the GUID would be enough. I'll see
>> what I can come up with.
> Sure there's no WMI method that makes the EC write? It's a little weird
> for WMI drivers to have to hit the EC directly.
>
I have no idea, I didn't know what a DSDT was before trying to get these 
buttons working.

...A quick grep reveals acpi_wmi_ec_space_handler, is that what I should 
use? It calls ec_write itself, but has more function parameters and of 
course error checking to make sure you don't screw up those extra 
parameters. Seems inefficient to me. Or, maybe like it was designed for 
an automated code routine.

Looking further, I don't see any other drivers that use it, ec_write 
seems to be the standard.

Your call though, you are the master in this domain and you wrote the 
driver.



static acpi_status
acpi_wmi_ec_space_handler(u32 function, acpi_physical_address address,
                       u32 bits, u64 *value,
                       void *handler_context, void *region_context)
{
         int result = 0, i = 0;
         u8 temp = 0;

         if ((address > 0xFF) || !value)
                 return AE_BAD_PARAMETER;

         if (function != ACPI_READ && function != ACPI_WRITE)
                 return AE_BAD_PARAMETER;

         if (bits != 8)
                 return AE_BAD_PARAMETER;

         if (function == ACPI_READ) {
                 result = ec_read(address, &temp);
                 (*value) |= ((u64)temp) << i;
         } else {
                 temp = 0xff & ((*value) >> i);
                 result = ec_write(address, temp);
         }

         switch (result) {
         case -EINVAL:
                 return AE_BAD_PARAMETER;
                 break;
         case -ENODEV:
                 return AE_NOT_FOUND;
                 break;
         case -ETIME:
                 return AE_TIME;
                 break;
         default:
                 return AE_OK;
         }
}


  reply	other threads:[~2013-04-13 17:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-13  1:31 BUG: Fn keys not working on EliteBook 8460p after fabf85e3ca15d5b94058f391dac8df870cdd427a Pali Rohár
2013-04-13  1:35 ` Matthew Garrett
2013-04-13 12:36   ` Kyle Evans
2013-04-13 16:21     ` Matthew Garrett
2013-04-13 17:39       ` Kyle Evans [this message]
2013-04-13 17:42         ` Matthew Garrett
2013-04-16 16:26         ` Matthew Garrett
2013-04-17 13:56           ` Pali Rohár
2013-04-17 15:37           ` Kyle Evans
2013-04-17 17:59             ` Matthew Garrett
2013-04-17 18:55               ` Kyle Evans
2013-04-18 13:55               ` Kyle Evans
2013-04-18 15:58                 ` Matthew Garrett
2013-04-18 16:48                   ` Kyle Evans
2013-04-18 16:53                     ` Matthew Garrett
2013-08-14  8:19 ` BUG: Again: Fn keys not working on EliteBook 8460p after b253c9d1d858a3f115f791ee4fe2b9399ae7dbbd Pali Rohár
2013-08-14 19:16   ` [PATCH] hp-wmi; Limit hotkey enable funtion Kyle Evans

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=51699843.7060905@gmail.com \
    --to=kvans32@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.garrett@nebula.com \
    --cc=pali.rohar@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).