All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ângelo Miguel Arrifano" <miknix@gmail.com>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: andi@firstfloor.org, Zhang Rui <rui.zhang@intel.com>,
	Len Brown <lenb@kernel.org>, "Li, Shaohua" <shaohua.li@intel.com>,
	linux-acpi@vger.kernel.org
Subject: Re: [PATCH] ACPI: Platform driver to support App Hot Startup (PNP0C32)
Date: Mon, 1 Sep 2008 01:21:29 +0200	[thread overview]
Message-ID: <20080901012129.304c50cf.miknix@gmail.com> (raw)
In-Reply-To: <20080831220038.GA5573@srcf.ucam.org>

On Sun, 31 Aug 2008 23:00:38 +0100
Matthew Garrett <mjg59@srcf.ucam.org> wrote:

> On Mon, Sep 01, 2008 at 12:38:56AM +0200, Ângelo Miguel Arrifano wrote:
> > On Thu, 28 Aug 2008 14:40:55 +0100
> > Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> > +	else if (event == QUICKSTART_EVENT_RUNTIME) {
> > +		input_report_key(quickstart_input, quickstart->btn->id, 1);
> > +		input_sync(quickstart_input);
> > +		input_report_key(quickstart_input, quickstart->btn->id, 0);
> > +		input_sync(quickstart_input);
> > 
> > The button usage ID is used as key code.
> 
> Right, that's probably not how you want to do it. Keycodes should be the 
> things in include/linux/input.h. The problem you have is that there's no 
> way of mapping the usage ID to the keycode without knowing the specific 
> laptop layout. The right way of doing this is to use the usage ID as a 
> scancode, and then implement the get and setkeycode functions. Userspace 
> can then alter the keymap. Check the wistron_btns driver for an example 
> of this.
> 
> > Buffer dump:
> > QBTN: 03 00 00 00 01 00 00 00 58 78 6c 4c 00 81 ff ff 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
> > DBTN: 03 00 00 00 01 00 00 00 58 78 6c 4c 00 81 ff ff 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00
> > MUBN: 03 00 00 00 01 00 00 00 58 78 6c 4c 00 81 ff ff 00 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00
> > PIBN: 03 00 00 00 01 00 00 00 58 78 6c 4c 00 81 ff ff 00 00 00 00 00 00 00 00 06 00 00 00 00 00 00 00
> > WEBN: 03 00 00 00 01 00 00 00 58 78 6c 4c 00 81 ff ff 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00
> > LVBN: 03 00 00 00 01 00 00 00 58 78 6c 4c 00 81 ff ff 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00
> > VOBN: 03 00 00 00 01 00 00 00 58 78 6c 4c 00 81 ff ff 00 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00
> >                                                                               +---------------------+
> > Does it return a QWORD?? Why is it at the end of the buffer?
> 
> This is the raw dump of what GHID returns? I'm not quite clear on what's 
> going on here.

Yes, GHID returns a auto-allocated buffer of 32bytes.

For instance, the returned buffer for WEBN device is:
03 00 00 00 01 00 00 00 58 78 6c 4c 00 81 ff ff 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00
                                                                        /\
4 is the button usage ID (see bellow). I don't know why is in that place and why the rest of the garbage.
> 
> > +	/* <<The GHID method can return a BYTE, WORD, or DWORD.
> > +	 * The value must be encoded in little-endian byte
> > +	 * order (least significant byte first).>> */
> > +	ACPI_MOVE_32_TO_32(&usageid, buffer.pointer + (buffer.length - 8));
> > +	quickstart->btn->id = usageid;
> > 
> > I need your help in here, I doubt this code runs for anyone but me.
> 
> Right. For instance, GHID on another system I have here is just:
> 
>                         Method (GHID, 0, NotSerialized)
>                         {
>                             Acquire (MUT1, 0xFFFF)
>                             And (MBTB, 0x02, Local0)
>                             Release (MUT1)
>                             If (Local0)
>                             {
>                                 Notify (DAL2, 0x02)
>                             }
> 
>                             Return (Buffer (One)
>                             {
>                                 0x02
>                             })
> 
> which doesn't look like your code would cope at all.

The GHID method here is also similar:

           Method (GHID, 0, NotSerialized)
            {
                If (LEqual (HOTB, 0x10))
                {
                    Notify (WEBN, 0x02)
                    Store (Zero, HOTB)
                }

                Return (Buffer (One)
                {
                    /* 0000 */    0x04
                })
            }

Shouldn't GHID be returning a 1 byte buffer?
> 
> -- 
> Matthew Garrett | mjg59@srcf.ucam.org

Are you able to dump the returned buffer somewhere?

Thanks,
Angelo Arrifano
--
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:[~2008-08-31 22:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-14 15:17 [PATCH] ACPI: Platform driver to support App Hot Startup (PNP0C32) Ângelo Miguel Arrifano
2008-03-25  6:59 ` Zhang, Rui
2008-03-26 17:51   ` Ângelo Miguel Arrifano
2008-03-27  2:30     ` Shaohua Li
2008-03-27 16:03       ` Ângelo Miguel Arrifano
2008-03-28  1:36         ` Shaohua Li
2008-03-28 19:39           ` Ângelo Miguel Arrifano
2008-08-24 16:39             ` Ângelo Miguel Arrifano
2008-08-25  1:29               ` Zhang Rui
2008-08-26 18:43                 ` Andi Kleen
2008-08-28 12:37                   ` Ângelo Miguel Arrifano
2008-08-28 13:08                     ` Andi Kleen
2008-08-28 13:47                       ` Ângelo Miguel Arrifano
2008-08-28 15:36                         ` Andi Kleen
2008-08-28 13:40                     ` Matthew Garrett
2008-08-31 22:38                       ` Ângelo Miguel Arrifano
2008-08-31 22:00                         ` Matthew Garrett
2008-08-31 23:21                           ` Ângelo Miguel Arrifano [this message]

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=20080901012129.304c50cf.miknix@gmail.com \
    --to=miknix@gmail.com \
    --cc=andi@firstfloor.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=rui.zhang@intel.com \
    --cc=shaohua.li@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.