Eran Mitrani has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/74885 )
Change subject: src/drivers/spi: add HID over SPI ACPI driver ......................................................................
src/drivers/spi: add HID over SPI ACPI driver
Add driver to support ELAN touchscreen using SPI
* See "HID Over SPI Protocol Specification" section 5.2 - ACPI enum * https://www.microsoft.com/en-us/download/details.aspx?id=103325
BUG=b:278783755 TEST=waiting for HW to be available
Signed-off-by: Eran Mitrani mitrani@google.com Change-Id: Id51d385ce350cef23da4184b044c74569f4dd3f0 --- A src/drivers/spi/hid/elan/elan7b18uh.asl 1 file changed, 136 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/85/74885/1
diff --git a/src/drivers/spi/hid/elan/elan7b18uh.asl b/src/drivers/spi/hid/elan/elan7b18uh.asl new file mode 100644 index 0000000..e3aae01 --- /dev/null +++ b/src/drivers/spi/hid/elan/elan7b18uh.asl @@ -0,0 +1,118 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +/* +* ELAN7B18UH - HID over SPI +* See "HID Over SPI Protocol Specification" section 5.2 - ACPI enum +* https://www.microsoft.com/en-us/download/details.aspx?id=103325 + +* NOTES: +* 1. Make sure BOARD_TOUCH_GPIO_INDEX is defined according to the borad's schematics +* 2. Include this file under the scope for the correct SPI, e.g.: +* Scope (_SB.PCI0.SPI0) +* { +* #include <drivers/spi/hid/elan/elan7b18uh.asl> +* } +*/ + +Device(TCSC) { + Name (_HID, "ELAN9006") /* VendorID + DeviceID - <VVVVdddd> */ + Name (_CID, "PNP0C51") /* Compatible ID - PNP0C51 */ + Name (_SUB, "ELAN0732") /* SubVendorID + SubSystemID - <VVVVssss> */ + Name (_HRV, 0x0001) /* Hardware Revision Number - 2 bytes */ + + Method (_STA, 0) + { + Return (0xf) + } + + Name (_CRS, ResourceTemplate () { + SpiSerialBusV2 ( + 0, /* DeviceSelection */ + PolarityLow, /* DeviceSelectionPolarity */ + FourWireMode, /* WireMode */ + 8, /* DataBitLength */ + ControllerInitiated, /* SlaveMode */ + 0x016E3600, /* ConnectionSpeed (24MHz) */ + ClockPolarityLow, /* ClockPolarity */ + ClockPhaseFirst, /* ClockPhase */ + "\_SB.PCI0.SPI0", /* ResourceSource */ + 0, /* ResourceSourceIndex */ + ResourceConsumer, /* ResourceUsage */ + ) + GpioInt ( + Level, /* InterruptType */ + ActiveLow, /* InterruptLevel */ + Exclusive, /* ShareType */ + PullUp, /* PinConfig */ + 0x0000, /* DeBounceTime */ + "\_SB.GPO0", /* ResourceSource */ + 0x00, /* ResourceSourceIndex */ + ResourceConsumer, /* ResourceUsage */ + ) + { + BOARD_TOUCH_GPIO_INDEX + } + }) + + /* _DSM - Device-Specific Method */ + /* Arg0: UUID Unique function identifier */ + /* Arg1: Integer Revision ID - Will be 3 for HidSpi V1 */ + /* Arg2: Integer Function Index (0 = Return Supported Functions) */ + /* Arg3: Package Parameters */ + + Method (_DSM, 4) { + /* HIDSPI UUID */ + If(LEqual(Arg0,ToUUID("6E2AC436-0FCF-41AF-A265-B32A220DCFAB"))) { + + /* Switch on the function index */ + switch(ToInteger(Arg2)) { + case(0) { + /* Switch on the revision level */ + switch(ToInteger(Arg1)) { + case (3) { + /* HidSpi v1: Functions 0-6 */ + Return(Buffer(One) { 0x7F }) + } + default { + /* Unsupported revision */ + Return(Buffer(One) { 0x00 }) + } + } + } + case(1) { + /* Elan Input Report Header address - 0x1000*/ + Return (0x1000) + } + case(2) { + /* Elan Input Report Body address - 0x1100*/ + Return (0x1100) + } + case(3) { + /* Elan Output Report Header address - 0x2000 */ + Return (0x2000) + } + case(4) { + /* Read opcode */ + Return (Buffer(1) {0x0B}) + } + case(5) { + /* Write opcode */ + Return (Buffer(1) {0x02}) + } + case(6) { + /* Flags */ + Return (0x0000) + } + default { + /* Unsupported function index */ + Return (Buffer() {0}) + } + } + } + else { + /* No functions are supported for this UUID. */ + return (Buffer() {0}) + } + } + Function(_RST) {} /* Placeholder for function-level device reset */ +}