Hi, thanks for this!
The normal behavior in my machine is: I can change the brightness up an down with F12 and scroll lock keys, I have the on-screen icon/bar, and the slider in the screen prefpane. I also have the AppleBacklightDisplay loaded under GFX0 in the IOReg. The problem is the brightness does not change smoothly (seems the values OSX sets for the display are not correct).
This is the section of the original DSDT that is in charge of brightness (I think) under (LCD) device:
Name (C1AF, Package (0x0D) /*backlight control of supported brightness levels*/
{
0x64,
0x33,
0x1E,
0x25,
0x2C,
0x33,
0x3A,
0x41,
0x48,
0x4F,
0x56,
0x5D,
0x64 /*set in AAPL01,BacklightIntensity for testing*/
})
Name (C1B0, 0x00)
Method (_BCL, 0, Serialized)
{
If (LAnd (LEqual (C1B0, 0x00), And (C06C, 0x10)))
{
Store (C06E, Local0)
Store (0x00, Local1)
While (LLess (Local1, 0x0B))
{
Store (DerefOf (Index (Local0, Local1)), Local2)
Multiply (Local2, 0x64, Local3)
Divide (Add (Local3, 0x7F), 0xFF, Local4, Local2)
Store (Local2, Index (C1AF, Add (Local1, 0x02)))
Increment (Local1)
}
Store (DerefOf (Index (C1AF, 0x05)), Index (C1AF, 0x01))
Store (Local2, Index (C1AF, 0x00))
Store (0x01, C1B0)
}
Return (C1AF)
}
Name (C1B1, 0x64)
Method (_BCM, 1, Serialized)
{
Store (0x00, Local0)
If (LGreater (\OSDW (), 0x05))
{
Or (C05B, 0x40, C05B)
Store (0x01, Local0)
}
Store (Arg0, C1B1)
Store (Match (C1AF, MGE, Arg0, MTR, 0x00, 0x02), Local1)
If (LEqual (Local1, Ones))
{
Subtract (SizeOf (C1AF), 0x01, Local1)
}
Subtract (Local1, 0x02, Local1)
If (Local0)
{
Store (Local1, C072)
If (LEqual (C169 (), 0x00))
{
\_SB.C1B2 (0xEA74, 0x04, Local1, 0x00, 0x00)
}
Signal (\_SB.C1AC)
}
}
Method (_BQC, 0, Serialized)
{
Store (C1B1, Local0)
Return (Local0)
}
I think (correct me if Im wrong) the register to write the brightness value is C1AF (within the EC device)
I've tried the kext and added the code under the PNLF device:
Device (PNLF)
{
Name (_HID, EisaId ("APP0002"))
Name (_CID, "backlight")
Name (_UID, 0x0A)
Name (_STA, 0x0B)
Method (BRGE, 1, Serialized)
{
Store (Arg0, ^^PCI0.LPCB.EC.C1AF)
Return (^^PCI0.LPCB.EC.C1AF)
}
Method(_BCL, 0x0, NotSerialized)
{
Return(Package(0x12)
{
0x64,
0x14,
0x14,
0x19,
0x1e,
0x23,
0x28,
0x2d,
0x32,
0x37,
0x3c,
0x41,
0x46,
0x4b,
0x50,
0x55,
0x5a,
0x64
})
}
Name(BCLP, Package(0x10)
{
0x14,
0x19,
0x1e,
0x23,
0x28,
0x2d,
0x32,
0x37,
0x3c,
0x41,
0x46,
0x4b,
0x50,
0x55,
0x5a,
0x64
})
Name(BCLL, Package(0x10)
{
0x0,
0x1,
0x2,
0x3,
0x4,
0x5,
0x6,
0x7,
0x8,
0x9,
0xa,
0xb,
0xc,
0xd,
0xe,
0xf
})
Method(_BCM, 0x1, NotSerialized)
{
Store(Match(BCLP, MEQ, Arg0, MTR, 0x0, 0x0), Local0)
If(LNot(LEqual(Local0, Ones)))
{
Store(DerefOf(Index(BCLL, Local0, )), \_SB_.PCI0.LPCB.EC_.C1AF)
}
}
Method(_BQC, 0x0, NotSerialized)
{
Store(\_SB_.PCI0.LPCB.EC_.C1AF, Local0)
If(LNot(LGreater(Local0, 0xf)))
{
Return(DerefOf(Index(BCLP, Local0, )))
}
Else
{
Return(Zero)
}
}
}
As you see I've replaced 'EC0.BRTS' with 'EC.C1AF' but I still get the same buggy brightness change.
I get this on boot:
11/12/10 4:04:46 PM kernel Acpi brightness levels:16, lowest brightness:20, highest brightness:100
11/12/10 4:04:46 PM kernel We still don't have brightness entry in ioreg... waiting...
And the io reg:
Screen_shot_2010_11_12_at_4.47.24_PM.png 87.77K
313 downloads