From d99baf22582140cbb2aa49028828bdc063ad1142 Mon Sep 17 00:00:00 2001 From: Dudley Du Date: Tue, 18 Nov 2014 09:57:08 +0800 Subject: [PATCH] coreboot: add Cypress new trackpad device supported in auron platform This patch adds Cypress gen5 trackpad device supported in auron platform. The new Cypress gen5 trackpad's I2C address is 0x24 which is different from the old trackpad device's I2C address 0x67. BRANCH=None BUG=None TEST=None Signed-off-by: Dudley Du Change-Id: I4a80d6a5b63b4ec3a0d38258886b1979a12377ea Reviewed-on: https://chromium-review.googlesource.com/230254 Reviewed-by: Shawn Nematbakhsh Reviewed-by: Dudley Du Tested-by: Dudley Du Commit-Queue: Shawn Nematbakhsh --- src/mainboard/google/auron/acpi/mainboard.asl | 48 ++++++++++++++++++- src/mainboard/google/auron/mainboard.c | 9 ++++ src/mainboard/google/auron/onboard.h | 1 + 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/src/mainboard/google/auron/acpi/mainboard.asl b/src/mainboard/google/auron/acpi/mainboard.asl index 547cdb03f2..4556e2d603 100644 --- a/src/mainboard/google/auron/acpi/mainboard.asl +++ b/src/mainboard/google/auron/acpi/mainboard.asl @@ -114,7 +114,53 @@ Scope (\_SB.PCI0.I2C0) ControllerInitiated, // SlaveMode 400000, // ConnectionSpeed AddressingMode7Bit, // AddressingMode - "\\_SB.PCI0.I2C0", // ResourceSource + "\\_SB.PCI0.I2C0", // ResourceSource + ) + Interrupt (ResourceConsumer, Edge, ActiveLow) + { + BOARD_TRACKPAD_IRQ + } + }) + + Method (_STA) + { + If (LEqual (\S1EN, 1)) { + Return (0xF) + } Else { + Return (0x0) + } + } + + Name (_PRW, Package() { BOARD_TRACKPAD_WAKE_GPIO, 0x3 }) + + Method (_DSW, 3, NotSerialized) + { + Store (BOARD_TRACKPAD_WAKE_GPIO, Local0) + If (LEqual (Arg0, 1)) { + // Enable GPIO as wake source + \_SB.PCI0.LPCB.GPIO.GWAK (Local0) + } + } + + /* Allow device to power off in S0 */ + Name (_S0W, 4) + } + + Device (CTPB) + { + Name (_HID, "CYAP0001") + Name (_DDN, "Cypress Touchpad") + Name (_UID, 3) + Name (ISTP, 1) /* Touchpad */ + + Name (_CRS, ResourceTemplate() + { + I2cSerialBus ( + 0x24, // SlaveAddress + ControllerInitiated, // SlaveMode + 400000, // ConnectionSpeed + AddressingMode7Bit, // AddressingMode + "\\_SB.PCI0.I2C0", // ResourceSource ) Interrupt (ResourceConsumer, Edge, ActiveLow) { diff --git a/src/mainboard/google/auron/mainboard.c b/src/mainboard/google/auron/mainboard.c index 2028beee8b..1e39eebb07 100644 --- a/src/mainboard/google/auron/mainboard.c +++ b/src/mainboard/google/auron/mainboard.c @@ -156,6 +156,15 @@ static int mainboard_smbios_data(device_t dev, int *handle, 0, /* device */ 0); /* function */ + len += smbios_write_type41( + current, handle, + BOARD_TRACKPAD_NAME, /* name */ + BOARD_TRACKPAD_IRQ, /* instance */ + BOARD_TRACKPAD_I2C_BUS, /* segment */ + BOARD_TRACKPAD_GEN5_I2C_ADDR, /* bus */ + 0, /* device */ + 0); /* function */ + len += smbios_write_type41( current, handle, BOARD_TOUCHSCREEN_NAME, /* name */ diff --git a/src/mainboard/google/auron/onboard.h b/src/mainboard/google/auron/onboard.h index 4703980579..23726d164f 100644 --- a/src/mainboard/google/auron/onboard.h +++ b/src/mainboard/google/auron/onboard.h @@ -30,6 +30,7 @@ #define BOARD_TRACKPAD_WAKE_GPIO 12 /* GPIO12 */ #define BOARD_TRACKPAD_I2C_BUS 1 /* I2C0 */ #define BOARD_TRACKPAD_I2C_ADDR 0x67 +#define BOARD_TRACKPAD_GEN5_I2C_ADDR 0x24 #define BOARD_TOUCHSCREEN_NAME "touchscreen" #define BOARD_TOUCHSCREEN_IRQ 38 /* PIRQW */