src/ec: Improve code formatting
Change-Id: I93b71ca577c973046d1651d92665168b329eda1b Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/16503 Tested-by: build bot (Jenkins) Reviewed-by: Alexander Couzens <lynxis@fe80.eu> Reviewed-by: Omar Pakker
This commit is contained in:
parent
112ab91837
commit
b933109594
|
@ -32,7 +32,7 @@ Device (EC0)
|
|||
Offset(0x00),
|
||||
, 1, // Reserved ; 00h.0
|
||||
LCDS, 1, // 1= BACKLIGHT ON , 0= BACKLIGHT OFF ; 00h.1
|
||||
, 6, // Reserved ; 00h.2 ~ 00h.6
|
||||
, 6, // Reserved ; 00h.2 ~ 00h.6
|
||||
HTBN, 8, // HOTKEY_BUTTON_NUMBER ; 01h For ABO Hot Key Function
|
||||
HTBT, 8, // HOTKEY_BUTTON_TYPE ; 02h For ABO Hot Key Function
|
||||
LMEN, 1, // Launch Manager enable .(1=Enable ) ; 03h.0, Lauanch manage
|
||||
|
@ -212,9 +212,9 @@ Device (EC0)
|
|||
// 101 : CPT
|
||||
, 1, // Reserved ; C0h.7
|
||||
BST0, 8, // Battery Status ; C1h
|
||||
// Bit0 : Discharging
|
||||
// Bit1 : Charging
|
||||
// Bit2 : Discharg and Critical Low
|
||||
// Bit0 : Discharging
|
||||
// Bit1 : Charging
|
||||
// Bit2 : Discharg and Critical Low
|
||||
// Bit3-7 : Reserved
|
||||
BRC0, 16, // Batt Remaining Capacity ; C2h, C3h
|
||||
BSN0, 16, // Batt Serial Number ; C4h, C5h
|
||||
|
|
|
@ -144,7 +144,7 @@ static struct device_operations ops = {
|
|||
};
|
||||
|
||||
static struct pnp_info pnp_dev_info[] = {
|
||||
{ &ops, 0, 0, { 0, 0 }, }
|
||||
{ &ops, 0, 0, { 0, 0 }, }
|
||||
};
|
||||
|
||||
static void enable_dev(struct device *dev)
|
||||
|
|
|
@ -448,7 +448,7 @@ Device (EC0)
|
|||
#endif
|
||||
|
||||
#ifdef EC_ENABLE_KEYBOARD_BACKLIGHT
|
||||
#include "keyboard_backlight.asl"
|
||||
#include "keyboard_backlight.asl"
|
||||
#endif
|
||||
|
||||
#ifdef EC_ENABLE_PD_MCU_DEVICE
|
||||
|
|
|
@ -27,13 +27,13 @@ Device(EC)
|
|||
Field (ERAM, ByteAcc, NoLock, Preserve)
|
||||
{
|
||||
Offset (0x02),
|
||||
DKR1, 1, /* Dock register 1 */
|
||||
DKR1, 1, /* Dock register 1 */
|
||||
Offset (0x05),
|
||||
HSPA, 1,
|
||||
Offset (0x0C),
|
||||
LEDS, 8, /* LED state */
|
||||
Offset (0x1a),
|
||||
DKR2, 1, /* Dock register 2 */
|
||||
DKR2, 1, /* Dock register 2 */
|
||||
Offset (0x2a),
|
||||
EVNT, 8, /* write will trigger EC event */
|
||||
Offset (0x3a),
|
||||
|
@ -56,7 +56,7 @@ Device(EC)
|
|||
PAGE, 8, /* Information Page Selector */
|
||||
Offset (0xfe),
|
||||
, 4,
|
||||
DKR3, 1 /* Dock register 3 */
|
||||
DKR3, 1 /* Dock register 3 */
|
||||
}
|
||||
|
||||
Method (_CRS, 0)
|
||||
|
@ -140,226 +140,226 @@ Device(EC)
|
|||
Store(0x50, EVNT)
|
||||
}
|
||||
|
||||
Method(_Q2A, 0, NotSerialized)
|
||||
{
|
||||
Notify(^LID, 0x80)
|
||||
}
|
||||
Method(_Q2A, 0, NotSerialized)
|
||||
{
|
||||
Notify(^LID, 0x80)
|
||||
}
|
||||
|
||||
Method(_Q2B, 0, NotSerialized)
|
||||
{
|
||||
Notify(^LID, 0x80)
|
||||
}
|
||||
Method(_Q2B, 0, NotSerialized)
|
||||
{
|
||||
Notify(^LID, 0x80)
|
||||
}
|
||||
|
||||
|
||||
/* IBM proprietary buttons. */
|
||||
/* IBM proprietary buttons. */
|
||||
|
||||
Method (_Q10, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x01)
|
||||
}
|
||||
Method (_Q10, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x01)
|
||||
}
|
||||
|
||||
Method (_Q11, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x02)
|
||||
}
|
||||
Method (_Q11, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x02)
|
||||
}
|
||||
|
||||
Method (_Q12, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x03)
|
||||
}
|
||||
Method (_Q12, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x03)
|
||||
}
|
||||
|
||||
Method (_Q64, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x05)
|
||||
}
|
||||
Method (_Q64, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x05)
|
||||
}
|
||||
|
||||
Method (_Q65, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x06)
|
||||
}
|
||||
Method (_Q65, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x06)
|
||||
}
|
||||
|
||||
Method (_Q17, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x08)
|
||||
}
|
||||
Method (_Q17, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x08)
|
||||
}
|
||||
|
||||
Method (_Q66, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x0A)
|
||||
}
|
||||
Method (_Q66, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x0A)
|
||||
}
|
||||
|
||||
Method (_Q6A, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x1B)
|
||||
}
|
||||
Method (_Q6A, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x1B)
|
||||
}
|
||||
|
||||
Method (_Q1A, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x0B)
|
||||
}
|
||||
Method (_Q1A, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x0B)
|
||||
}
|
||||
|
||||
Method (_Q1B, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x0C)
|
||||
}
|
||||
Method (_Q1B, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x0C)
|
||||
}
|
||||
|
||||
Method (_Q62, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x0D)
|
||||
}
|
||||
Method (_Q62, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x0D)
|
||||
}
|
||||
|
||||
Method (_Q60, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x0E)
|
||||
}
|
||||
Method (_Q60, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x0E)
|
||||
}
|
||||
|
||||
Method (_Q61, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x0F)
|
||||
}
|
||||
Method (_Q61, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x0F)
|
||||
}
|
||||
|
||||
Method (_Q1F, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x12)
|
||||
}
|
||||
Method (_Q1F, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x12)
|
||||
}
|
||||
|
||||
Method (_Q67, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x13)
|
||||
}
|
||||
Method (_Q67, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x13)
|
||||
}
|
||||
|
||||
Method (_Q63, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x14)
|
||||
}
|
||||
Method (_Q63, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x14)
|
||||
}
|
||||
|
||||
Method (_Q19, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x18)
|
||||
}
|
||||
Method (_Q19, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x18)
|
||||
}
|
||||
|
||||
Method (_Q1C, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x19)
|
||||
}
|
||||
Method (_Q1C, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x19)
|
||||
}
|
||||
|
||||
Method (_Q1D, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x1A)
|
||||
}
|
||||
Method (_Q1D, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RHK (0x1A)
|
||||
}
|
||||
|
||||
Method (_Q5C, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RTAB (0xB)
|
||||
}
|
||||
Method (_Q5C, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RTAB (0xB)
|
||||
}
|
||||
|
||||
Method (_Q5D, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RTAB (0xC)
|
||||
}
|
||||
Method (_Q5D, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RTAB (0xC)
|
||||
}
|
||||
|
||||
Method (_Q5E, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RTAB (0x9)
|
||||
}
|
||||
Method (_Q5E, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RTAB (0x9)
|
||||
}
|
||||
|
||||
Method (_Q5F, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RTAB (0xA)
|
||||
}
|
||||
Method (_Q5F, 0, NotSerialized)
|
||||
{
|
||||
^HKEY.RTAB (0xA)
|
||||
}
|
||||
|
||||
Device (HKEY)
|
||||
{
|
||||
Name (_HID, EisaId ("IBM0068"))
|
||||
Name (BTN, 0)
|
||||
Name (BTAB, 0)
|
||||
/* MASK */
|
||||
Name (DHKN, 0x080C)
|
||||
/* Effective Mask */
|
||||
Name (EMSK, 0)
|
||||
/* Effective Mask for tablet */
|
||||
Name (ETAB, 0)
|
||||
/* Device enabled. */
|
||||
Name (EN, 0)
|
||||
Method (_STA, 0, NotSerialized)
|
||||
{
|
||||
Return (0x0F)
|
||||
}
|
||||
/* Retrieve event. */
|
||||
Method (MHKP, 0, NotSerialized)
|
||||
{
|
||||
Store (BTN, Local0)
|
||||
If (LNotEqual (Local0, Zero)) {
|
||||
Store (Zero, BTN)
|
||||
Add (Local0, 0x1000, Local0)
|
||||
Return (Local0)
|
||||
}
|
||||
Store (BTAB, Local0)
|
||||
If (LNotEqual (Local0, Zero)) {
|
||||
Store (Zero, BTAB)
|
||||
Add (Local0, 0x5000, Local0)
|
||||
Return (Local0)
|
||||
}
|
||||
Return (Zero)
|
||||
}
|
||||
/* Report event */
|
||||
Method (RHK, 1, NotSerialized) {
|
||||
ShiftLeft (One, Subtract (Arg0, 1), Local0)
|
||||
If (And (EMSK, Local0)) {
|
||||
Store (Arg0, BTN)
|
||||
Notify (HKEY, 0x80)
|
||||
}
|
||||
}
|
||||
/* Report tablet */
|
||||
Method (RTAB, 1, NotSerialized) {
|
||||
ShiftLeft (One, Subtract (Arg0, 1), Local0)
|
||||
If (And (ETAB, Local0)) {
|
||||
Store (Arg0, BTAB)
|
||||
Notify (HKEY, 0x80)
|
||||
}
|
||||
}
|
||||
/* Enable/disable all events. */
|
||||
Method (MHKC, 1, NotSerialized) {
|
||||
If (Arg0) {
|
||||
Device (HKEY)
|
||||
{
|
||||
Name (_HID, EisaId ("IBM0068"))
|
||||
Name (BTN, 0)
|
||||
Name (BTAB, 0)
|
||||
/* MASK */
|
||||
Name (DHKN, 0x080C)
|
||||
/* Effective Mask */
|
||||
Name (EMSK, 0)
|
||||
/* Effective Mask for tablet */
|
||||
Name (ETAB, 0)
|
||||
/* Device enabled. */
|
||||
Name (EN, 0)
|
||||
Method (_STA, 0, NotSerialized)
|
||||
{
|
||||
Return (0x0F)
|
||||
}
|
||||
/* Retrieve event. */
|
||||
Method (MHKP, 0, NotSerialized)
|
||||
{
|
||||
Store (BTN, Local0)
|
||||
If (LNotEqual (Local0, Zero)) {
|
||||
Store (Zero, BTN)
|
||||
Add (Local0, 0x1000, Local0)
|
||||
Return (Local0)
|
||||
}
|
||||
Store (BTAB, Local0)
|
||||
If (LNotEqual (Local0, Zero)) {
|
||||
Store (Zero, BTAB)
|
||||
Add (Local0, 0x5000, Local0)
|
||||
Return (Local0)
|
||||
}
|
||||
Return (Zero)
|
||||
}
|
||||
/* Report event */
|
||||
Method (RHK, 1, NotSerialized) {
|
||||
ShiftLeft (One, Subtract (Arg0, 1), Local0)
|
||||
If (And (EMSK, Local0)) {
|
||||
Store (Arg0, BTN)
|
||||
Notify (HKEY, 0x80)
|
||||
}
|
||||
}
|
||||
/* Report tablet */
|
||||
Method (RTAB, 1, NotSerialized) {
|
||||
ShiftLeft (One, Subtract (Arg0, 1), Local0)
|
||||
If (And (ETAB, Local0)) {
|
||||
Store (Arg0, BTAB)
|
||||
Notify (HKEY, 0x80)
|
||||
}
|
||||
}
|
||||
/* Enable/disable all events. */
|
||||
Method (MHKC, 1, NotSerialized) {
|
||||
If (Arg0) {
|
||||
Store (DHKN, EMSK)
|
||||
Store (Ones, ETAB)
|
||||
}
|
||||
Else
|
||||
{
|
||||
}
|
||||
Else
|
||||
{
|
||||
Store (Zero, EMSK)
|
||||
Store (Zero, ETAB)
|
||||
}
|
||||
Store (Arg0, EN)
|
||||
}
|
||||
/* Enable/disable event. */
|
||||
Method (MHKM, 2, NotSerialized) {
|
||||
If (LLessEqual (Arg0, 0x20)) {
|
||||
}
|
||||
Store (Arg0, EN)
|
||||
}
|
||||
/* Enable/disable event. */
|
||||
Method (MHKM, 2, NotSerialized) {
|
||||
If (LLessEqual (Arg0, 0x20)) {
|
||||
ShiftLeft (One, Subtract (Arg0, 1), Local0)
|
||||
If (Arg1)
|
||||
{
|
||||
Or (DHKN, Local0, DHKN)
|
||||
Or (DHKN, Local0, DHKN)
|
||||
}
|
||||
Else
|
||||
{
|
||||
And (DHKN, Not (Local0), DHKN)
|
||||
And (DHKN, Not (Local0), DHKN)
|
||||
}
|
||||
If (EN)
|
||||
{
|
||||
Store (DHKN, EMSK)
|
||||
Store (DHKN, EMSK)
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Mask hotkey all. */
|
||||
Method (MHKA, 0, NotSerialized)
|
||||
{
|
||||
Return (0x07FFFFFF)
|
||||
}
|
||||
/* Version */
|
||||
Method (MHKV, 0, NotSerialized)
|
||||
{
|
||||
Return (0x0100)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Mask hotkey all. */
|
||||
Method (MHKA, 0, NotSerialized)
|
||||
{
|
||||
Return (0x07FFFFFF)
|
||||
}
|
||||
/* Version */
|
||||
Method (MHKV, 0, NotSerialized)
|
||||
{
|
||||
Return (0x0100)
|
||||
}
|
||||
}
|
||||
|
||||
#include "ac.asl"
|
||||
#include "battery.asl"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
Field(ERAM, ByteAcc, NoLock, Preserve)
|
||||
{
|
||||
Offset (0x32),
|
||||
Offset (0x32),
|
||||
, 2,
|
||||
WKLD, 1,
|
||||
Offset (0x46),
|
||||
|
|
|
@ -25,7 +25,7 @@ Field(ERAM, ByteAcc, NoLock, Preserve)
|
|||
|
||||
Device(SLPB)
|
||||
{
|
||||
Name (_HID, EisaId ("PNP0C0E"))
|
||||
Name (_HID, EisaId ("PNP0C0E"))
|
||||
Method(_PRW, 0, NotSerialized)
|
||||
{
|
||||
Return (Package() { 0x18, 0x03 })
|
||||
|
|
|
@ -23,11 +23,11 @@ Scope(\_TZ)
|
|||
Multiply(Arg0, 10, Local0)
|
||||
Add (Local0, 2732, Local0)
|
||||
if (LLessEqual(Local0, 2732)) {
|
||||
Return (3000)
|
||||
Return (3000)
|
||||
}
|
||||
|
||||
if (LGreater(Local0, 4012)) {
|
||||
Return (3000)
|
||||
Return (3000)
|
||||
}
|
||||
Return (Local0)
|
||||
}
|
||||
|
@ -39,10 +39,10 @@ Scope(\_TZ)
|
|||
}
|
||||
Method(_TMP) {
|
||||
#if defined (EC_LENOVO_H8_ME_WORKAROUND)
|
||||
/* Avoid tripping alarm if ME isn't booted at all yet */
|
||||
If (LAnd (LNot (MEB1), LEqual (\_SB.PCI0.LPCB.EC.TMP0, 128))) {
|
||||
Return (C2K(40))
|
||||
}
|
||||
/* Avoid tripping alarm if ME isn't booted at all yet */
|
||||
If (LAnd (LNot (MEB1), LEqual (\_SB.PCI0.LPCB.EC.TMP0, 128))) {
|
||||
Return (C2K(40))
|
||||
}
|
||||
Store (1, MEB1)
|
||||
#endif
|
||||
Return (C2K(\_SB.PCI0.LPCB.EC.TMP0))
|
||||
|
@ -61,10 +61,10 @@ Scope(\_TZ)
|
|||
|
||||
Method(_TMP) {
|
||||
#if defined (EC_LENOVO_H8_ME_WORKAROUND)
|
||||
/* Avoid tripping alarm if ME isn't booted at all yet */
|
||||
If (LAnd (LNot (MEB2), LEqual (\_SB.PCI0.LPCB.EC.TMP1, 128))) {
|
||||
Return (C2K(40))
|
||||
}
|
||||
/* Avoid tripping alarm if ME isn't booted at all yet */
|
||||
If (LAnd (LNot (MEB2), LEqual (\_SB.PCI0.LPCB.EC.TMP1, 128))) {
|
||||
Return (C2K(40))
|
||||
}
|
||||
Store (1, MEB2)
|
||||
#endif
|
||||
Return (C2K(\_SB.PCI0.LPCB.EC.TMP1))
|
||||
|
|
|
@ -154,7 +154,7 @@ static struct device_operations ops = {
|
|||
};
|
||||
|
||||
static struct pnp_info pnp_dev_info[] = {
|
||||
{ &ops, 0, 0, { 0, 0 }, }
|
||||
{ &ops, 0, 0, { 0, 0 }, }
|
||||
};
|
||||
|
||||
static void enable_dev(struct device *dev)
|
||||
|
|
|
@ -131,10 +131,10 @@ u8 ec_it8518_get_event(void)
|
|||
{
|
||||
u8 cmd = 0;
|
||||
u8 status = inb(EC_SC);
|
||||
if (status & SCI_EVT) {
|
||||
if (status & SCI_EVT) {
|
||||
ec_write_cmd(QR_EC);
|
||||
cmd = ec_read_ob();
|
||||
} else if ( status & SMI_EVT) {
|
||||
} else if (status & SMI_EVT) {
|
||||
ec_kbc_write_cmd(EC_KBD_SMI_EVENT);
|
||||
cmd = ec_kbc_read_ob();
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ static struct device_operations ops = {
|
|||
};
|
||||
|
||||
static struct pnp_info pnp_dev_info[] = {
|
||||
{ &ops, 0, 0, { 0, 0 }, }
|
||||
{ &ops, 0, 0, { 0, 0 }, }
|
||||
};
|
||||
|
||||
static void enable_dev(struct device *dev)
|
||||
|
|
Loading…
Reference in New Issue