# /proc/acpi/battery and //proc/acpi/ac_adapter EMPTY

## sepultado

I hace a Acer Travelmate 4000... 

well my problem is that i cant get the process for the state of my Battery and Ac

If anyone of u could help me... i've searching and found crap. 

 :Crying or Very sad: 

----------

## R!tman

You have to comile support for ACPI into your kernel. Then, everything should work.

----------

## jmack1010

Check out acpi.sf.net

The patch is pretty straightforward on the website, let me know if you have any questions.

Joe

----------

## sepultado

Thank you... I already have it compile into the kernel... its not that.. but thanks

And also thanks for the Website... but please can u explain how the patching works... cause im not to sure of what to do there... cause usually i just compile every new kernel... with the pacthes that it comes... 

i guess that happends because im so used to gentoo-dev-sources.. that i just wait for it to come with the patch..

So if u could give a hint i'll really thank u.

 :Exclamation: 

----------

## jmack1010

ACPI in the stock gentoo-dev-sources and development sources is not as advanced or up to date as ACPI patch from acpi.sf.net.  

the patch is easy download it 

http://ftp.kernel.org/pub/linux/kernel/people/lenb/acpi/patches/release/2.6.10/acpi-20050125-2.6.10.diff.bz2

this is for the 2.6.10 kernel which i am assuming you have since it is the newest gentoo-dev-sources and then execute the command in /usr/src/linux-2.6.10-gentoo-r#:

bunzip2 -c <path to acpi-patch>/acpi-<version>.diff.bz2 | patch -p1

----------

## Archangel1

There's also a fair chance that your laptop has a broken ACPI implementation - there's a thread on these forums about "common ACPI problems (DSDT etc)" or something like that.

If ACPI is already in your kernel, that may be of some help.

----------

## jmack1010

What Archangel1 was talking about:

http://gentoo-wiki.com/HOWTO_Fix_Common_ACPI_Problems

on acpi.sf.net they have a database of fixed dsdt's however, i would try just applying the acpi patch for your kernel first.  This has the highest likelyhood of working.

Joe

----------

## jeezus84

i'm trying jmack's method, using the patch found on the patch found on the kernel website..

so i run the command and get the following output:

```

root@theMotherland log # bunzip2 -c /mnt/media/Downloads/Linux/acpi-20050309-2.6.11.diff.bz2 | patch -p0

can't find file to patch at input line 625

Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

--------------------------

|# This is a BitKeeper generated diff -Nru style patch.

|#

|# ChangeSet

|#   2005/03/18 00:00:20-05:00 len.brown@intel.com

|#   merge

|#

|# drivers/acpi/Kconfig

|#   2005/03/18 00:00:12-05:00 len.brown@intel.com +1 -2

|#   merge

|#

|# ChangeSet

|#   2005/03/17 23:26:54-05:00 len.brown@intel.com

|#   [ACPI] build fix in acpi_pci_irq_disable()

|#

|#   bk-acpi-acpi_pci_irq_disable-build-fix.patch

.

.

.

|# drivers/acpi/Kconfig

|#   2005/01/17 09:09:09-05:00 len.brown@intel.com +21 -0

|#   Import patch acpi_memhp_driver.patch

|#

|diff -Nru a/arch/i386/kernel/acpi/sleep.c b/arch/i386/kernel/acpi/sleep.c

|--- a/arch/i386/kernel/acpi/sleep.c    2005-03-18 00:57:26 -05:00

|+++ b/arch/i386/kernel/acpi/sleep.c    2005-03-18 00:57:26 -05:00

--------------------------

File to patch:        

```

and it stops here, waiting for input. So, uh, I have no idea what to do. Any ideas?

----------

## jmack1010

try patch -p1

----------

## jmack1010

also make sure that you are you are in your kernel source directory

----------

## rmh3093

you shouldnt need to patch your kernel if you are using the 2.6 series, all that patch does is update the curent inkernel acpi code, the changes it makes are not fixes so you wont notice anything, you problem lies within the bios/dsdt table, your best bet would be to look for a bios update and or try fixing your dsdt table

----------

## jeezus84

once I patch, will I have to recompile the kernel?

----------

## jmack1010

yes.  i guess I didn't really ask, you did make sure that you had acpi support already compiled into the kernel didn't you.  check you .config to see what acpi options you have compiled into your kernel.

----------

## carpman

i have this problem, have run the checks as describe in thread Fix Common ACPI Problems (DSDT, ECDT, etc.) from which i only got one warning

```

dsdt.dsl  2768:     Method (_WAK, 1, NotSerialized)

Warning  2026 -                ^ Reserved method must return a value (_WAK) 

```

not sure if this is issue and have posted in that thread to find out.

ACPI is in kernel

```

cat /usr/src/linux/.config | grep ACPI

# Power management options (ACPI, APM)

# ACPI (Advanced Configuration and Power Interface) Support

CONFIG_ACPI=y

CONFIG_ACPI_BOOT=y

CONFIG_ACPI_INTERPRETER=y

# CONFIG_ACPI_SLEEP is not set

CONFIG_ACPI_AC=m

CONFIG_ACPI_BATTERY=m

CONFIG_ACPI_BUTTON=m

CONFIG_ACPI_VIDEO=m

CONFIG_ACPI_FAN=m

CONFIG_ACPI_PROCESSOR=m

CONFIG_ACPI_THERMAL=m

# CONFIG_ACPI_ASUS is not set

# CONFIG_ACPI_IBM is not set

# CONFIG_ACPI_TOSHIBA is not set

# CONFIG_ACPI_CUSTOM_DSDT is not set

CONFIG_ACPI_BLACKLIST_YEAR=2000

# CONFIG_ACPI_DEBUG is not set

CONFIG_ACPI_BUS=y

CONFIG_ACPI_EC=y

CONFIG_ACPI_POWER=y

CONFIG_ACPI_PCI=y

CONFIG_ACPI_SYSTEM=y

# CONFIG_ACPI_CONTAINER is not set

CONFIG_X86_ACPI_CPUFREQ=m

# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set

CONFIG_PNPACPI=y

# CONFIG_SERIAL_8250_ACPI is not set

```

dmsg is 

```

ACPI: RSDP (v000 PTLTD                                 ) @ 0x000f7fe0

ACPI: RSDT (v001 PTLTD    RSDT   0x06040000  LTP 0x00000000) @ 0x1befbcce

ACPI: FADT (v001 NEC    ND000080 0x06040000 MSTF 0x0100000e) @ 0x1befee74

ACPI: SSDT (v001 PTLTD  POWERNOW 0x06040000  LTP 0x00000001) @ 0x1befeee8

ACPI: DSDT (v001    NEC ND000080 0x06040000 MSFT 0x0100000e) @ 0x00000000

ACPI: setting ELCR to 0200 (from 06b8)

ACPI: Subsystem revision 20050211

ACPI: Interpreter enabled

ACPI: Using PIC for interrupt routing

ACPI: PCI Root Bridge [PCI0] (00:00)

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]

ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 *7 10)

ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 7 10) *9

ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 *5 7 10)

ACPI: PCI Interrupt Link [LNKD] (IRQs 3 *4 5 7 10)

ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 7 10) *9

ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 7 *10)

ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 7 10) *0, disabled.

ACPI: PCI Interrupt Link [LNKH] (IRQs *3 4 5 7 10)

ACPI: Embedded Controller [EC0] (gpe 27)

ACPI: Power Resource [QFAN] (off)

Linux Plug and Play Support v0.97 (c) Adam Belay

pnp: PnP ACPI init

pnp: PnP ACPI: found 7 devices

ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 5

PCI: setting IRQ 5 as level-triggered

ACPI: PCI interrupt 0000:00:02.6[C] -> GSI 5 (level, low) -> IRQ 5

ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 4

PCI: setting IRQ 4 as level-triggered

ACPI: PCI interrupt 0000:00:04.0[A] -> GSI 4 (level, low) -> IRQ 4

ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 7

PCI: setting IRQ 7 as level-triggered

ACPI: PCI interrupt 0000:00:02.5[A] -> GSI 7 (level, low) -> IRQ 7

ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 10

PCI: setting IRQ 10 as level-triggered

ACPI: PCI interrupt 0000:00:0a.0[A] -> GSI 10 (level, low) -> IRQ 10

ACPI: PCI Interrupt Link [LNKH] enabled at IRQ 3

PCI: setting IRQ 3 as level-triggered

ACPI: PCI interrupt 0000:00:03.2[D] -> GSI 3 (level, low) -> IRQ 3

ACPI: PCI Interrupt Link [LNKE] enabled at IRQ 10

ACPI: PCI interrupt 0000:00:03.0[A] -> GSI 10 (level, low) -> IRQ 10

ACPI: PCI Interrupt Link [LNKF] enabled at IRQ 10

ACPI: PCI interrupt 0000:00:03.1[B] -> GSI 10 (level, low) -> IRQ 10

ACPI: PCI interrupt 0000:00:02.7[C] -> GSI 5 (level, low) -> IRQ 5

powernow: PowerNOW! Technology present. Can scale: frequency and voltage.

powernow: No PST tables match this cpuid (0x7a0)

powernow: This is indicative of a broken BIOS.

powernow: Trying ACPI perflib

powernow: no support for ACPI processor found.  Please recompile your kernel with ACPI processor

powernow: ACPI and legacy methods failed

```

Thing is when i had ubuntu installed it seemed to work, not fully but it worked.

----------

## jmack1010

The nforce3 motherboards have big time bugs with their bios/dsdt.  your best bet is to try to find someone who has fixed their dsdt table or you may get a bios update?!?!  At least it looks like you have a desktop so power management isn't as much an issue, however, I know how frustrating it is.  Sorry for the real lack of help ;(.

----------

## carpman

 *jmack1010 wrote:*   

> The nforce3 motherboards have big time bugs with their bios/dsdt.  your best bet is to try to find someone who has fixed their dsdt table or you may get a bios update?!?!  At least it looks like you have a desktop so power management isn't as much an issue, however, I know how frustrating it is.  Sorry for the real lack of help ;(.

 

Hello should have said this is on my notebook not system in sig, my notebook is a Packard Bell (NEC) EasyNote C3 255.

----------

## makatee

carpman, your problem is easily fixable. here is the fix to your error ( had the same one myself in my buggy dsdt  :Smile:  )  Go to your dsdt file and find where it gives you error 2026. The problem lies within not having a return statement in the coding. 

348:    Method (\_WAK, 1, NotSerialized)

349-    {

350-455 ..............

456-    Return(Package(0x02){0x00, 0x00})

457-    }

Dont mind the line numbers at all, but the "Return(Package(0x02){0x00, 0x00})" is the line you should add. If you are confused about your code at all post it here and we'll help you out with it. Other than that, recompile the dsdt and then you have to either use the static patch so the kernel reads the dsdt table or the initrd method ( what i prefer) which just directly calls the rebuilt dsdt from your grub/lilo file. Hope this helps

----------

## carpman

thanks for reply ok found this in dsdt.dsl

```

 Method (_WAK, 1, NotSerialized)

    {

        Store (0x66, \_SB.DBPG)

        If (LEqual (Arg0, 0x03)) {}

        If (LEqual (Arg0, 0x04))

        {

            Notify (\_SB.PWB, 0x02)

        }

    }

```

From what you say i need something like

```

 Method (_WAK, 1, NotSerialized)

    {

        Store (0x66, \_SB.DBPG)

        If (LEqual (Arg0, 0x03)) {}

        If (LEqual (Arg0, 0x04))

        {

            Notify (\_SB.PWB, 0x02)

        }

    Return(Package(0x02){0x00, 0x00}) 

    }

```

After which i do 

```

./iasl -tc dsdt.dsl

```

Then i need to choose kernel inclusion method.

----------

## carpman

OK recompiled dsdt ok and no errors or warning, decided to go for kernel method so enabled

```

[*] Include custom DSDT

(dsdt_table.h) Custom DSDT file to included

```

Copied file

```

cp dsdt.hex /usr/src/linux/include/acpi/dsdt_table.h

```

When trying to compile kernel get following

```

 make && make modules_install

  CHK     include/linux/version.h

  SPLIT   include/linux/autoconf.h -> include/config/*

make[1]: `arch/i386/kernel/asm-offsets.s' is up to date.

  CHK     include/linux/compile.h

  CHK     usr/initramfs_list

  CC      drivers/acpi/osl.o

drivers/acpi/osl.c:61:38: dsdt_table.h: No such file or directory

drivers/acpi/osl.c: In function `acpi_os_table_override':

drivers/acpi/osl.c:258: error: `AmlCode' undeclared (first use in this function)

drivers/acpi/osl.c:258: error: (Each undeclared identifier is reported only once

drivers/acpi/osl.c:258: error: for each function it appears in.)

make[2]: *** [drivers/acpi/osl.o] Error 1

make[1]: *** [drivers/acpi] Error 2

make: *** [drivers] Error 2

```

Now have checked that file was copied and present in dir and it is!

----------

