ec/smsc/mec1308/acpi: Replace Store(a,b) with ASL 2.0 syntax
Replace `Store (a, b)` with `b = a`. Change-Id: I0a419c861e84cd96e8337957dc62a7ca5b981e14 Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/70640 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
This commit is contained in:
parent
612801d0f8
commit
4da79a7f25
|
@ -47,13 +47,13 @@ Device (BAT0)
|
||||||
// Method to enable full battery workaround
|
// Method to enable full battery workaround
|
||||||
Method (BFWE)
|
Method (BFWE)
|
||||||
{
|
{
|
||||||
Store (One, BFWK)
|
BFWK = One
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method to disable full battery workaround
|
// Method to disable full battery workaround
|
||||||
Method (BFWD)
|
Method (BFWD)
|
||||||
{
|
{
|
||||||
Store (Zero, BFWK)
|
BFWK = Zero
|
||||||
}
|
}
|
||||||
|
|
||||||
// Swap bytes in a word
|
// Swap bytes in a word
|
||||||
|
@ -64,7 +64,7 @@ Device (BAT0)
|
||||||
And (Local1, 0xFF00, Local1)
|
And (Local1, 0xFF00, Local1)
|
||||||
Or (Local0, Local1, Local0)
|
Or (Local0, Local1, Local0)
|
||||||
If (Local0 == 0xFFFF) {
|
If (Local0 == 0xFFFF) {
|
||||||
Store (0xFFFFFFFF, Local0)
|
Local0 = 0xFFFFFFFF
|
||||||
}
|
}
|
||||||
Return (Local0)
|
Return (Local0)
|
||||||
}
|
}
|
||||||
|
@ -81,15 +81,15 @@ Device (BAT0)
|
||||||
Method (_BIF, 0, Serialized)
|
Method (_BIF, 0, Serialized)
|
||||||
{
|
{
|
||||||
// Update fields from EC
|
// Update fields from EC
|
||||||
Store (SWAB (BTDA), PBIF[1])
|
PBIF[1] = SWAB (BTDA)
|
||||||
Store (SWAB (BTDF), PBIF[2])
|
PBIF[2] = SWAB (BTDF)
|
||||||
Store (SWAB (BTDV), PBIF[4])
|
PBIF[4] = SWAB (BTDV)
|
||||||
Store (SWAB (BTDL), PBIF[6])
|
PBIF[6] = SWAB (BTDL)
|
||||||
|
|
||||||
// Get battery info from mainboard
|
// Get battery info from mainboard
|
||||||
Store (\BATM, PBIF[9])
|
PBIF[9] = \BATM
|
||||||
Store (\BATS, PBIF[10])
|
PBIF[10] = \BATS
|
||||||
Store (\BATV, PBIF[12])
|
PBIF[12] = \BATV
|
||||||
|
|
||||||
Return (PBIF)
|
Return (PBIF)
|
||||||
}
|
}
|
||||||
|
@ -105,8 +105,8 @@ Device (BAT0)
|
||||||
//
|
//
|
||||||
|
|
||||||
// Get battery state from EC
|
// Get battery state from EC
|
||||||
Store (BTST, Local0)
|
Local0 = BTST
|
||||||
Store (Zero, Local1)
|
Local1 = Zero
|
||||||
|
|
||||||
// Check if AC is present
|
// Check if AC is present
|
||||||
If (ACEX) {
|
If (ACEX) {
|
||||||
|
@ -114,17 +114,17 @@ Device (BAT0)
|
||||||
And (Local0, 0x03, Local1)
|
And (Local0, 0x03, Local1)
|
||||||
} Else {
|
} Else {
|
||||||
// Always discharging when on battery power
|
// Always discharging when on battery power
|
||||||
Store (0x01, Local1)
|
Local1 = 0x01
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flag if the battery level is critical
|
// Flag if the battery level is critical
|
||||||
And (Local0, 0x04, Local4)
|
And (Local0, 0x04, Local4)
|
||||||
Or (Local1, Local4, Local1)
|
Or (Local1, Local4, Local1)
|
||||||
Store (Local1, PBST[0])
|
PBST[0] = Local1
|
||||||
|
|
||||||
// Notify if battery state has changed since last time
|
// Notify if battery state has changed since last time
|
||||||
If (Local1 != BSTP) {
|
If (Local1 != BSTP) {
|
||||||
Store (Local1, BSTP)
|
BSTP = Local1
|
||||||
Notify (BAT0, 0x80)
|
Notify (BAT0, 0x80)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,17 +132,17 @@ Device (BAT0)
|
||||||
// 1: BATTERY PRESENT RATE
|
// 1: BATTERY PRESENT RATE
|
||||||
//
|
//
|
||||||
|
|
||||||
Store (SWAB (BTPR), Local1)
|
Local1 = SWAB (BTPR)
|
||||||
If (Local1 != 0xFFFFFFFF && Local1 >= 0x8000) {
|
If (Local1 != 0xFFFFFFFF && Local1 >= 0x8000) {
|
||||||
Xor (Local1, 0xFFFF, Local1)
|
Xor (Local1, 0xFFFF, Local1)
|
||||||
Local1++
|
Local1++
|
||||||
}
|
}
|
||||||
Store (Local1, PBST[1])
|
PBST[1] = Local1
|
||||||
|
|
||||||
//
|
//
|
||||||
// 2: BATTERY REMAINING CAPACITY
|
// 2: BATTERY REMAINING CAPACITY
|
||||||
//
|
//
|
||||||
Store (SWAB (BTRA), Local1)
|
Local1 = SWAB (BTRA)
|
||||||
If (Local1 != 0xFFFFFFFF && Local1 >= 0x8000) {
|
If (Local1 != 0xFFFFFFFF && Local1 >= 0x8000) {
|
||||||
Xor (Local1, 0xFFFF, Local1)
|
Xor (Local1, 0xFFFF, Local1)
|
||||||
Local1++
|
Local1++
|
||||||
|
@ -153,21 +153,21 @@ Device (BAT0)
|
||||||
// nor discharging. Linux expects a full battery
|
// nor discharging. Linux expects a full battery
|
||||||
// to report same capacity as last full charge.
|
// to report same capacity as last full charge.
|
||||||
// https://bugzilla.kernel.org/show_bug.cgi?id=12632
|
// https://bugzilla.kernel.org/show_bug.cgi?id=12632
|
||||||
Store (SWAB (BTDF), Local2)
|
Local2 = SWAB (BTDF)
|
||||||
|
|
||||||
// See if within ~3% of full
|
// See if within ~3% of full
|
||||||
ShiftRight (Local2, 5, Local3)
|
ShiftRight (Local2, 5, Local3)
|
||||||
If (Local1 > Local2 - Local3 && Local1 < Local2 + Local3)
|
If (Local1 > Local2 - Local3 && Local1 < Local2 + Local3)
|
||||||
{
|
{
|
||||||
Store (Local2, Local1)
|
Local1 = Local2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Store (Local1, PBST[2])
|
PBST[2] = Local1
|
||||||
|
|
||||||
//
|
//
|
||||||
// 3: BATTERY PRESENT VOLTAGE
|
// 3: BATTERY PRESENT VOLTAGE
|
||||||
//
|
//
|
||||||
Store (SWAB (BTVO), PBST[3])
|
PBST[3] = SWAB (BTVO)
|
||||||
|
|
||||||
Return (PBST)
|
Return (PBST)
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,16 +58,16 @@ Device (EC0)
|
||||||
Method (_REG, 2, NotSerialized)
|
Method (_REG, 2, NotSerialized)
|
||||||
{
|
{
|
||||||
// Initialize AC power state
|
// Initialize AC power state
|
||||||
Store (ACEX, \PWRS)
|
\PWRS = ACEX
|
||||||
|
|
||||||
// Initialize LID switch state
|
// Initialize LID switch state
|
||||||
Store (LIDS, \LIDS)
|
\LIDS = LIDS
|
||||||
|
|
||||||
// Enable OS control of fan speed
|
// Enable OS control of fan speed
|
||||||
Store (One, FCOS)
|
FCOS = One
|
||||||
|
|
||||||
// Force a read of CPU temperature
|
// Force a read of CPU temperature
|
||||||
Store (CPUT, Local0)
|
Local0 = CPUT
|
||||||
/* So that we don't get a warning that Local0 is unused. */
|
/* So that we don't get a warning that Local0 is unused. */
|
||||||
Local0++
|
Local0++
|
||||||
}
|
}
|
||||||
|
@ -83,15 +83,15 @@ Device (EC0)
|
||||||
}
|
}
|
||||||
Method (_ON) {
|
Method (_ON) {
|
||||||
If (FCOS) {
|
If (FCOS) {
|
||||||
Store (One, FSL0)
|
FSL0 = One
|
||||||
Store (0, \FLVL)
|
\FLVL = 0
|
||||||
Notify (\_TZ.THRM, 0x81)
|
Notify (\_TZ.THRM, 0x81)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Method (_OFF) {
|
Method (_OFF) {
|
||||||
If (FCOS) {
|
If (FCOS) {
|
||||||
Store (Zero, FSL0)
|
FSL0 = Zero
|
||||||
Store (1, \FLVL)
|
\FLVL = 1
|
||||||
Notify (\_TZ.THRM, 0x81)
|
Notify (\_TZ.THRM, 0x81)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,15 +108,15 @@ Device (EC0)
|
||||||
}
|
}
|
||||||
Method (_ON) {
|
Method (_ON) {
|
||||||
If (FCOS) {
|
If (FCOS) {
|
||||||
Store (One, FSL1)
|
FSL1 = One
|
||||||
Store (1, \FLVL)
|
\FLVL = 1
|
||||||
Notify (\_TZ.THRM, 0x81)
|
Notify (\_TZ.THRM, 0x81)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Method (_OFF) {
|
Method (_OFF) {
|
||||||
If (FCOS) {
|
If (FCOS) {
|
||||||
Store (Zero, FSL1)
|
FSL1 = Zero
|
||||||
Store (2, \FLVL)
|
\FLVL = 2
|
||||||
Notify (\_TZ.THRM, 0x81)
|
Notify (\_TZ.THRM, 0x81)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -133,15 +133,15 @@ Device (EC0)
|
||||||
}
|
}
|
||||||
Method (_ON) {
|
Method (_ON) {
|
||||||
If (FCOS) {
|
If (FCOS) {
|
||||||
Store (One, FSL2)
|
FSL2 = One
|
||||||
Store (2, \FLVL)
|
\FLVL = 2
|
||||||
Notify (\_TZ.THRM, 0x81)
|
Notify (\_TZ.THRM, 0x81)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Method (_OFF) {
|
Method (_OFF) {
|
||||||
If (FCOS) {
|
If (FCOS) {
|
||||||
Store (Zero, FSL2)
|
FSL2 = Zero
|
||||||
Store (3, \FLVL)
|
\FLVL = 3
|
||||||
Notify (\_TZ.THRM, 0x81)
|
Notify (\_TZ.THRM, 0x81)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -158,15 +158,15 @@ Device (EC0)
|
||||||
}
|
}
|
||||||
Method (_ON) {
|
Method (_ON) {
|
||||||
If (FCOS) {
|
If (FCOS) {
|
||||||
Store (One, FSL3)
|
FSL3 = One
|
||||||
Store (3, \FLVL)
|
\FLVL = 3
|
||||||
Notify (\_TZ.THRM, 0x81)
|
Notify (\_TZ.THRM, 0x81)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Method (_OFF) {
|
Method (_OFF) {
|
||||||
If (FCOS) {
|
If (FCOS) {
|
||||||
Store (Zero, FSL3)
|
FSL3 = Zero
|
||||||
Store (4, \FLVL)
|
\FLVL = 4
|
||||||
Notify (\_TZ.THRM, 0x81)
|
Notify (\_TZ.THRM, 0x81)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -183,15 +183,15 @@ Device (EC0)
|
||||||
}
|
}
|
||||||
Method (_ON) {
|
Method (_ON) {
|
||||||
If (FCOS) {
|
If (FCOS) {
|
||||||
Store (One, FSL4)
|
FSL4 = One
|
||||||
Store (4, \FLVL)
|
\FLVL = 4
|
||||||
Notify (\_TZ.THRM, 0x81)
|
Notify (\_TZ.THRM, 0x81)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Method (_OFF) {
|
Method (_OFF) {
|
||||||
If (FCOS) {
|
If (FCOS) {
|
||||||
Store (Zero, FSL4)
|
FSL4 = Zero
|
||||||
Store (5, \FLVL)
|
\FLVL = 5
|
||||||
Notify (\_TZ.THRM, 0x81)
|
Notify (\_TZ.THRM, 0x81)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@ Device (EC0)
|
||||||
// AC Power Connected
|
// AC Power Connected
|
||||||
Method (_Q51, 0, NotSerialized)
|
Method (_Q51, 0, NotSerialized)
|
||||||
{
|
{
|
||||||
Store (One, \PWRS)
|
\PWRS = One
|
||||||
Notify (AC, 0x80)
|
Notify (AC, 0x80)
|
||||||
\PNOT ()
|
\PNOT ()
|
||||||
}
|
}
|
||||||
|
@ -243,7 +243,7 @@ Device (EC0)
|
||||||
// AC Power Removed
|
// AC Power Removed
|
||||||
Method (_Q52, 0, NotSerialized)
|
Method (_Q52, 0, NotSerialized)
|
||||||
{
|
{
|
||||||
Store (Zero, \PWRS)
|
\PWRS = Zero
|
||||||
Notify (AC, 0x80)
|
Notify (AC, 0x80)
|
||||||
\PNOT ()
|
\PNOT ()
|
||||||
}
|
}
|
||||||
|
@ -271,14 +271,14 @@ Device (EC0)
|
||||||
// Lid Switch Event
|
// Lid Switch Event
|
||||||
Method (_Q5E, 0, NotSerialized)
|
Method (_Q5E, 0, NotSerialized)
|
||||||
{
|
{
|
||||||
Store (LIDS, \LIDS)
|
\LIDS = LIDS
|
||||||
Notify (\_SB.LID0, 0x80)
|
Notify (\_SB.LID0, 0x80)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lid Switch Event
|
// Lid Switch Event
|
||||||
Method (_Q5F, 0, NotSerialized)
|
Method (_Q5F, 0, NotSerialized)
|
||||||
{
|
{
|
||||||
Store (LIDS, \LIDS)
|
\LIDS = LIDS
|
||||||
Notify (\_SB.LID0, 0x80)
|
Notify (\_SB.LID0, 0x80)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue