chromeec: Move keyboard backlight code into Chrome EC directory
Since more boards are starting to use the EC provided keyboard backlight interface move the code to a common place and allow it to get included in mainboards. Change-Id: I3f307bbce1a96cdd1c8224b1e89a63d6fedef738 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: http://review.coreboot.org/11478 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
ab5754da66
commit
ef549a04c5
|
@ -420,6 +420,10 @@ Device (EC0)
|
||||||
#include "als.asl"
|
#include "als.asl"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef EC_ENABLE_KEYBOARD_BACKLIGHT
|
||||||
|
#include "keyboard_backlight.asl"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef EC_ENABLE_PD_MCU_DEVICE
|
#ifdef EC_ENABLE_PD_MCU_DEVICE
|
||||||
#include "pd.asl"
|
#include "pd.asl"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the coreboot project.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2015 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.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
Scope (\_SB)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Chrome EC Keyboard Backlight interface
|
||||||
|
*/
|
||||||
|
Device (KBLT)
|
||||||
|
{
|
||||||
|
Name (_HID, "GOOG0002")
|
||||||
|
Name (_UID, 1)
|
||||||
|
|
||||||
|
/* Read current backlight value */
|
||||||
|
Method (KBQC, 0, NotSerialized)
|
||||||
|
{
|
||||||
|
Return (\_SB.PCI0.LPCB.EC0.KBLV)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Write new backlight value */
|
||||||
|
Method (KBCM, 1, NotSerialized)
|
||||||
|
{
|
||||||
|
Store (Arg0, \_SB.PCI0.LPCB.EC0.KBLV)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -21,6 +21,9 @@
|
||||||
#include <mainboard/google/glados/ec.h>
|
#include <mainboard/google/glados/ec.h>
|
||||||
#include <mainboard/google/glados/gpio.h>
|
#include <mainboard/google/glados/gpio.h>
|
||||||
|
|
||||||
|
/* Enable EC backed Keyboard Backlight in ACPI */
|
||||||
|
#define EC_ENABLE_KEYBOARD_BACKLIGHT
|
||||||
|
|
||||||
/* Enable EC backed PD MCU device in ACPI */
|
/* Enable EC backed PD MCU device in ACPI */
|
||||||
#define EC_ENABLE_PD_MCU_DEVICE
|
#define EC_ENABLE_PD_MCU_DEVICE
|
||||||
|
|
||||||
|
|
|
@ -47,24 +47,6 @@ Scope (\_SB)
|
||||||
{
|
{
|
||||||
Name (_HID, EisaId ("PNP0C0C"))
|
Name (_HID, EisaId ("PNP0C0C"))
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Keyboard Backlight interface via EC */
|
|
||||||
Device (KBLT) {
|
|
||||||
Name (_HID, "GOOG0002")
|
|
||||||
Name (_UID, 1)
|
|
||||||
|
|
||||||
/* Read current backlight value */
|
|
||||||
Method (KBQC, 0)
|
|
||||||
{
|
|
||||||
Return (\_SB.PCI0.LPCB.EC0.KBLV)
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Write new backlight value */
|
|
||||||
Method (KBCM, 1)
|
|
||||||
{
|
|
||||||
Store (Arg0, \_SB.PCI0.LPCB.EC0.KBLV)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -20,5 +20,8 @@
|
||||||
/* mainboard configuration */
|
/* mainboard configuration */
|
||||||
#include "../ec.h"
|
#include "../ec.h"
|
||||||
|
|
||||||
|
/* Enable EC backed Keyboard Backlight in ACPI */
|
||||||
|
#define EC_ENABLE_KEYBOARD_BACKLIGHT
|
||||||
|
|
||||||
/* ACPI code for EC functions */
|
/* ACPI code for EC functions */
|
||||||
#include "../../../../ec/google/chromeec/acpi/ec.asl"
|
#include <ec/google/chromeec/acpi/ec.asl>
|
||||||
|
|
|
@ -85,23 +85,4 @@ Scope (\_SB) {
|
||||||
VendorShort (ADDR) {0x4a}
|
VendorShort (ADDR) {0x4a}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keyboard Backlight interface via EC
|
|
||||||
Device (KBLT) {
|
|
||||||
Name (_HID, EisaId("GGL0002"))
|
|
||||||
Name (_UID, 1)
|
|
||||||
Name (_ADR, 0)
|
|
||||||
|
|
||||||
// Read current backlight value
|
|
||||||
Method (KBQC, 0)
|
|
||||||
{
|
|
||||||
Return (\_SB.PCI0.LPCB.EC0.KBLV)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write new backlight value
|
|
||||||
Method (KBCM, 1)
|
|
||||||
{
|
|
||||||
Store (Arg0, \_SB.PCI0.LPCB.EC0.KBLV)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,9 @@
|
||||||
/* Enable EC backed ALS device in ACPI */
|
/* Enable EC backed ALS device in ACPI */
|
||||||
#define EC_ENABLE_ALS_DEVICE
|
#define EC_ENABLE_ALS_DEVICE
|
||||||
|
|
||||||
|
/* Enable EC backed Keyboard Backlight in ACPI */
|
||||||
|
#define EC_ENABLE_KEYBOARD_BACKLIGHT
|
||||||
|
|
||||||
/* Enable EC backed PD MCU device in ACPI */
|
/* Enable EC backed PD MCU device in ACPI */
|
||||||
#define EC_ENABLE_PD_MCU_DEVICE
|
#define EC_ENABLE_PD_MCU_DEVICE
|
||||||
|
|
||||||
|
|
|
@ -37,24 +37,6 @@ Scope (\_SB)
|
||||||
{
|
{
|
||||||
Name(_HID, EisaId("PNP0C0C"))
|
Name(_HID, EisaId("PNP0C0C"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keyboard Backlight interface via EC
|
|
||||||
Device (KBLT) {
|
|
||||||
Name (_HID, "GOOG0002")
|
|
||||||
Name (_UID, 1)
|
|
||||||
|
|
||||||
// Read current backlight value
|
|
||||||
Method (KBQC, 0)
|
|
||||||
{
|
|
||||||
Return (\_SB.PCI0.LPCB.EC0.KBLV)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write new backlight value
|
|
||||||
Method (KBCM, 1)
|
|
||||||
{
|
|
||||||
Store (Arg0, \_SB.PCI0.LPCB.EC0.KBLV)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue