Skip to content
Permalink
Browse files

Add rfkill support

Change-Id: I3cb0d6295cd0acbab21bb9e02e0affa21c761393
  • Loading branch information
mjg59 committed Nov 18, 2019
1 parent ff1e453 commit 1ee8ab63cb290d4e83d4e06e5e04004082aa217a
@@ -37,9 +37,9 @@ Device (EC)
BKLG, 8,
TOUP, 1,
WIRE, 1,
BLTH, 1,
WWAN, 1,
LIDC, 1,
APFG, 1,
BKLT, 1,
WRST, 1,
BTST, 1,
ACEB, 1,
@@ -62,6 +62,10 @@ Device (EC)

/* Initialize LID switch state */
Store (LIDC, \LIDS)

/* Enable radios */
WIRE = One
WWAN = One
}

/* KEY_BRIGHTNESSUP */
@@ -97,10 +97,10 @@ Device (IGPU)

Method (_BCL, 0, NotSerialized)
{
Return (Package (0x12)
Return (Package (0x13)
{
0x0A,
0x0F,
0x10,
0x00,
0x01,
0x02,
@@ -116,16 +116,27 @@ Device (IGPU)
0x0C,
0x0D,
0x0E,
0x0F
0x0F,
0x10
})
}
Method (_BCM, 1, NotSerialized)
{
\_SB.PCI0.LPCB.EC.BKLG = Arg0
If (LEqual (Arg0, Zero))
{
\_SB.PCI0.LPCB.EC.BKLT = Zero
} Else {
\_SB.PCI0.LPCB.EC.BKLT = One
\_SB.PCI0.LPCB.EC.BKLG = Arg0 - 1
}
}
Method (_BQC, 0, NotSerialized)
{
Return (\_SB.PCI0.LPCB.EC.BKLG)
If (LEqual (\_SB.PCI0.LPCB.EC.BKLT, Zero))
{
Return (Zero)
}
Return (\_SB.PCI0.LPCB.EC.BKLG + 1)
}
}
}
@@ -51,4 +51,6 @@ Scope (\_SB)
Return (0xF)
}
}

#include "rfkill.asl"
}
@@ -0,0 +1,62 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2019 Google Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/

Device (RDIO)
{
Name (_HID, EisaId ("COR0001"))
Name (_STA, 0x0F)

// The set of devices managed by this rfkill interface.
// Hardcoded to wifi and wwan in this case.
Method (DEVS, 0, NotSerialized)
{
Return (0x11)
}

Method (SSTA)
{
Local0 = Zero
If (LEqual (\_SB.PCI0.LPCB.EC.WIRE, One))
{
Local0 |= One
}
If (LEqual (\_SB.PCI0.LPCB.EC.WWAN, One))
{
Local0 |= 0x10
}
Return (Local0)
}

Method (HSTA)
{
Return (0xffffffffffffffff)
}

Method (CNTL, 1, NotSerialized)
{
If (And (Arg0, 0x01))
{
\_SB.PCI0.LPCB.EC.WIRE = One
} Else {
\_SB.PCI0.LPCB.EC.WIRE = Zero
}
If (And (Arg0, 0x10))
{
\_SB.PCI0.LPCB.EC.WWAN = One
} Else {
\_SB.PCI0.LPCB.EC.WWAN = Zero
}
}
}

0 comments on commit 1ee8ab6

Please sign in to comment.
You can’t perform that action at this time.