public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* lid state reported incorrectly; no ac events
@ 2003-07-23 14:28 Fedor Karpelevitch
  0 siblings, 0 replies; 9+ messages in thread
From: Fedor Karpelevitch @ 2003-07-23 14:28 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hi, folks.

I have a Presario 900 laptop (I mention this in case the problem is 
specific to this model) and acpi interface appears to be reporting 
lid state incorretly: /proc/acpi/button/lid/LID/state says "state: 
closed" when lid is open and "state: open" when it is closed. Is it 
supposed to be like that?

I figured it comes from this place in drivers/acpi/button.c :

-----------------------
        
status=acpi_evaluate_integer(button->handle,"_LID",NULL,&state);
        if (ACPI_FAILURE(status)){
            p += sprintf(p, "state:      unsupported\n");
        }
        else{
            p += sprintf(p, "state:      %s\n", (state ? "open" :
"closed"));
        }
-----------------------

so state!=0 is interpreted as "open" whereas (it seems to me) since it 
is state of the _button_ (not the lid itself), it would be logical 
that state!=0 means that button is depressed (which means that the 
lid is closed). Am I making sense here? 
The only question here is what happens on other laptops or whether 
this is specified in ACPI docs somewhere?

The other question (issue?) I have is that in acpid log I only see 
messages for power and lid buttons and the battery (BTW when exactly 
do these fire? is it only when battery is critically low/fully 
charged or more often?). I expected to see AC connected/disconnected 
events and maybe thermal events too. When I compile with acpi 
debugging output I do see messages on ac plugging/unplugging so I 
assume it gets detected correctly, but event does not fire. Is that 
ok or is it a bug?

And the last one. Is there any reason why events when lid is closed 
and opened are identical. It would be more convinient if they were 
distinct. Of course one can always read lid state on event, but 
having event provide that info would be handy.

I hope my questions make sense.

Fedor.


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: lid state reported incorrectly; no ac events
@ 2003-07-25 20:58 Grover, Andrew
       [not found] ` <F760B14C9561B941B89469F59BA3A847E97081-sBd4vmA9Se4Lll3ZsUKC9FDQ4js95KgL@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Grover, Andrew @ 2003-07-25 20:58 UTC (permalink / raw)
  To: Fedor Karpelevitch, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

> From: Fedor Karpelevitch [mailto:fedor-ugkMPi23kyXAHCkTjeiZhQ@public.gmane.org] 
> so state!=0 is interpreted as "open" whereas (it seems to me) 
> since it 
> is state of the _button_ (not the lid itself), it would be logical 
> that state!=0 means that button is depressed (which means that the 
> lid is closed). Am I making sense here? 
> The only question here is what happens on other laptops or whether 
> this is specified in ACPI docs somewhere?

10.3.1 _LID
Evaluates to the current status of the lid.
Result Code:
Zero: The lid is closed
Non-zero: The lid is open

> The other question (issue?) I have is that in acpid log I only see 
> messages for power and lid buttons and the battery (BTW when exactly 
> do these fire? is it only when battery is critically low/fully 
> charged or more often?). I expected to see AC connected/disconnected 
> events and maybe thermal events too. When I compile with acpi 
> debugging output I do see messages on ac plugging/unplugging so I 
> assume it gets detected correctly, but event does not fire. Is that 
> ok or is it a bug?

Probably just not handled by acpid.

> And the last one. Is there any reason why events when lid is closed 
> and opened are identical. It would be more convinient if they were 
> distinct. Of course one can always read lid state on event, but 
> having event provide that info would be handy.

I think the current way is a little more flexible.

Regards -- Andy


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: lid state reported incorrectly; no ac events
       [not found] ` <F760B14C9561B941B89469F59BA3A847E97081-sBd4vmA9Se4Lll3ZsUKC9FDQ4js95KgL@public.gmane.org>
@ 2003-07-25 22:19   ` Fedor Karpelevitch
  2003-07-25 23:04   ` Fedor Karpelevitch
  1 sibling, 0 replies; 9+ messages in thread
From: Fedor Karpelevitch @ 2003-07-25 22:19 UTC (permalink / raw)
  To: Grover, Andrew, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Пятница 25 Июль 2003 01:58 pm, Grover, Andrew wrote:
> > From: Fedor Karpelevitch [mailto:fedor-ugkMPi23kyXAHCkTjeiZhQ@public.gmane.org]
> > so state!=0 is interpreted as "open" whereas (it seems to me)
> > since it
> > is state of the _button_ (not the lid itself), it would be
> > logical that state!=0 means that button is depressed (which means
> > that the lid is closed). Am I making sense here?
> > The only question here is what happens on other laptops or
> > whether this is specified in ACPI docs somewhere?
>
> 10.3.1 _LID
> Evaluates to the current status of the lid.
> Result Code:
> Zero: The lid is closed
> Non-zero: The lid is open

so I guess this is a bug of this laptop. What would be a proper way to 
handle this? Blacklist? Special compile option?

>
> > The other question (issue?) I have is that in acpid log I only
> > see messages for power and lid buttons and the battery (BTW when
> > exactly do these fire? is it only when battery is critically
> > low/fully charged or more often?). I expected to see AC
> > connected/disconnected events and maybe thermal events too. When
> > I compile with acpi debugging output I do see messages on ac
> > plugging/unplugging so I assume it gets detected correctly, but
> > event does not fire. Is that ok or is it a bug?
>
> Probably just not handled by acpid.

Thanks, I'll look into that...

fedor.


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: lid state reported incorrectly; no ac events
@ 2003-07-25 22:30 Grover, Andrew
       [not found] ` <F760B14C9561B941B89469F59BA3A8470255EEAA-sBd4vmA9Se4Lll3ZsUKC9FDQ4js95KgL@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Grover, Andrew @ 2003-07-25 22:30 UTC (permalink / raw)
  To: Fedor Karpelevitch, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

> From: Fedor Karpelevitch [mailto:fedor-ugkMPi23kyXAHCkTjeiZhQ@public.gmane.org] 
> > 10.3.1 _LID
> > Evaluates to the current status of the lid.
> > Result Code:
> > Zero: The lid is closed
> > Non-zero: The lid is open
> 
> so I guess this is a bug of this laptop. What would be a 
> proper way to 
> handle this? Blacklist? Special compile option?

I'm not sure. 

How the heck does this work on Windows? Either they're getting the right
answer (if so, how? What does the ASL for the _LID method look like?) or
something else is going on. Hmm.

Regards -- Andy


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: lid state reported incorrectly; no ac events
       [not found] ` <F760B14C9561B941B89469F59BA3A8470255EEAA-sBd4vmA9Se4Lll3ZsUKC9FDQ4js95KgL@public.gmane.org>
@ 2003-07-25 22:49   ` Fedor Karpelevitch
  0 siblings, 0 replies; 9+ messages in thread
From: Fedor Karpelevitch @ 2003-07-25 22:49 UTC (permalink / raw)
  To: Grover, Andrew, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Пятница 25 Июль 2003 03:30 pm, Grover, Andrew wrote:
> > From: Fedor Karpelevitch [mailto:fedor-ugkMPi23kyXAHCkTjeiZhQ@public.gmane.org]
> >
> > > 10.3.1 _LID
> > > Evaluates to the current status of the lid.
> > > Result Code:
> > > Zero: The lid is closed
> > > Non-zero: The lid is open
> >
> > so I guess this is a bug of this laptop. What would be a
> > proper way to
> > handle this? Blacklist? Special compile option?
>
> I'm not sure.
>
> How the heck does this work on Windows? Either they're getting the

I do not no. I never installed Windows on this laptop. Since it comes 
with it's own customized Windows install it could be hacked (for 
example)

> right answer (if so, how? What does the ASL for the _LID method
> look like?) 

Sorry, but how do I tell? I can provide whatever info if you tell me 
where to get it from...

> or something else is going on. Hmm.
>
> Regards -- Andy

thanks, Fedor.


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: lid state reported incorrectly; no ac events
@ 2003-07-25 22:55 Grover, Andrew
  0 siblings, 0 replies; 9+ messages in thread
From: Grover, Andrew @ 2003-07-25 22:55 UTC (permalink / raw)
  To: Fedor Karpelevitch, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

> From: Fedor Karpelevitch [mailto:fedor-ugkMPi23kyXAHCkTjeiZhQ@public.gmane.org] 
> > How the heck does this work on Windows? Either they're getting the
> 
> I do not no. I never installed Windows on this laptop. Since it comes 
> with it's own customized Windows install it could be hacked (for 
> example)

Doubtful.

> > right answer (if so, how? What does the ASL for the _LID method
> > look like?) 
> 
> Sorry, but how do I tell? I can provide whatever info if you tell me 
> where to get it from...

cat /proc/acpi/dsdt >dsdt.dat

Send me dsdt.dat.

Thanks -- Andy


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: lid state reported incorrectly; no ac events
       [not found] ` <F760B14C9561B941B89469F59BA3A847E97081-sBd4vmA9Se4Lll3ZsUKC9FDQ4js95KgL@public.gmane.org>
  2003-07-25 22:19   ` Fedor Karpelevitch
@ 2003-07-25 23:04   ` Fedor Karpelevitch
  1 sibling, 0 replies; 9+ messages in thread
From: Fedor Karpelevitch @ 2003-07-25 23:04 UTC (permalink / raw)
  To: Grover, Andrew, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Пятница 25 Июль 2003 01:58 pm, Grover, Andrew wrote:

>
> > The other question (issue?) I have is that in acpid log I only
> > see messages for power and lid buttons and the battery (BTW when
> > exactly do these fire? is it only when battery is critically
> > low/fully charged or more often?). I expected to see AC
> > connected/disconnected events and maybe thermal events too. When
> > I compile with acpi debugging output I do see messages on ac
> > plugging/unplugging so I assume it gets detected correctly, but
> > event does not fire. Is that ok or is it a bug?
>
> Probably just not handled by acpid.

looking at acpid docs it should handle it (and any event from event 
interface), so apparently ac events do not get to event interface 
somehow...

fedor


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: lid state reported incorrectly; no ac events
@ 2003-07-25 23:36 Grover, Andrew
       [not found] ` <F760B14C9561B941B89469F59BA3A8470255EEAB-sBd4vmA9Se4Lll3ZsUKC9FDQ4js95KgL@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Grover, Andrew @ 2003-07-25 23:36 UTC (permalink / raw)
  To: Fedor Karpelevitch, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

> From: Fedor Karpelevitch [mailto:fedor-ugkMPi23kyXAHCkTjeiZhQ@public.gmane.org] 
> > right answer (if so, how? What does the ASL for the _LID method
> > look like?) 
> 
> Sorry, but how do I tell? I can provide whatever info if you tell me 
> where to get it from...

Thanks for sending me your DSDT. Here is the _LID control method:

(ECOK is a variable that is set after the EC driver initializer
properly. It should be set to 1 fairly early on.)
(LIDS is a 1 bit field in the EmbeddedController operation region.)

Method (_LID, 0, NotSerialized)
{
    If (\_SB.PCI0.ISA.EC.ECOK)
    {
        If (\_SB.PCI0.ISA.EC.LIDS)
        {
            Return (0x00)
        }
        Else
        {
            Return (0x01)
        }
    }
    Else
    {
        Return (0x00)
    }
}

Seems pretty straightforward. "If the EC is initialized, read the LIDS
bit and return the opposite".

Could you perhaps add the following line after the call to
acpi_ec_read() in the function acpi_ec_space_handler in file
drivers/acpi/ec.c?

printk("ACPI: Read %x from EC address %x\n", temp, address);

Then, clear the dmesg buffer "dmesg -c"
And then cat state once with the lid open, and if you can figure out a
way, with the lid closed, too. 
And then send me dmesg contents.

Thanks -- Regards -- Andy


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: lid state reported incorrectly; no ac events
       [not found] ` <F760B14C9561B941B89469F59BA3A8470255EEAB-sBd4vmA9Se4Lll3ZsUKC9FDQ4js95KgL@public.gmane.org>
@ 2003-07-26  6:38   ` Fedor Karpelevitch
  0 siblings, 0 replies; 9+ messages in thread
From: Fedor Karpelevitch @ 2003-07-26  6:38 UTC (permalink / raw)
  To: Grover, Andrew, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: text/plain, Size: 1861 bytes --]

On Пятница 25 Июль 2003 04:36 pm, Grover, Andrew wrote:
> > From: Fedor Karpelevitch [mailto:fedor-ugkMPi23kyXAHCkTjeiZhQ@public.gmane.org]
> >
> > > right answer (if so, how? What does the ASL for the _LID method
> > > look like?)
> >
> > Sorry, but how do I tell? I can provide whatever info if you tell
> > me where to get it from...
>
> Thanks for sending me your DSDT. Here is the _LID control method:
>
> (ECOK is a variable that is set after the EC driver initializer
> properly. It should be set to 1 fairly early on.)
> (LIDS is a 1 bit field in the EmbeddedController operation region.)
>
> Method (_LID, 0, NotSerialized)
> {
>     If (\_SB.PCI0.ISA.EC.ECOK)
>     {
>         If (\_SB.PCI0.ISA.EC.LIDS)
>         {
>             Return (0x00)
>         }
>         Else
>         {
>             Return (0x01)
>         }
>     }
>     Else
>     {
>         Return (0x00)
>     }
> }
>
> Seems pretty straightforward. "If the EC is initialized, read the
> LIDS bit and return the opposite".
>
> Could you perhaps add the following line after the call to
> acpi_ec_read() in the function acpi_ec_space_handler in file
> drivers/acpi/ec.c?
>
> printk("ACPI: Read %x from EC address %x\n", temp, address);
>
> Then, clear the dmesg buffer "dmesg -c"
> And then cat state once with the lid open, and if you can figure
> out a way, with the lid closed, too.
> And then send me dmesg contents.

see attachment. The first two lines are with the open lid, and the 
second two - with closed ( not sure why each line is printed twice - 
I only did cat ...LID/state once for each case );

hope this sheds some light.

Also I checked the problem with absence of AC events - acpid is not to 
blame: I stopped it and did cat /proc/acpi/event, and then 
unplugged/plugged AC, but never saw any events ( if i push lid button 
events do show up).

Fedor

[-- Attachment #2: dmesg.txt --]
[-- Type: text/plain, Size: 132 bytes --]

ACPI: Read 91 from EC address 83
ACPI: Read 91 from EC address 83
ACPI: Read 10 from EC address 83
ACPI: Read 10 from EC address 83

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-07-26  6:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-23 14:28 lid state reported incorrectly; no ac events Fedor Karpelevitch
  -- strict thread matches above, loose matches on Subject: below --
2003-07-25 20:58 Grover, Andrew
     [not found] ` <F760B14C9561B941B89469F59BA3A847E97081-sBd4vmA9Se4Lll3ZsUKC9FDQ4js95KgL@public.gmane.org>
2003-07-25 22:19   ` Fedor Karpelevitch
2003-07-25 23:04   ` Fedor Karpelevitch
2003-07-25 22:30 Grover, Andrew
     [not found] ` <F760B14C9561B941B89469F59BA3A8470255EEAA-sBd4vmA9Se4Lll3ZsUKC9FDQ4js95KgL@public.gmane.org>
2003-07-25 22:49   ` Fedor Karpelevitch
2003-07-25 22:55 Grover, Andrew
2003-07-25 23:36 Grover, Andrew
     [not found] ` <F760B14C9561B941B89469F59BA3A8470255EEAB-sBd4vmA9Se4Lll3ZsUKC9FDQ4js95KgL@public.gmane.org>
2003-07-26  6:38   ` Fedor Karpelevitch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox