From: Marijan Limov Date: 星期四, 3 Feb 2022 19:27:33 +0000 (+0100) Subject: beryllium: Fix Focaltech touchscreen X-Git-Url: https://git.renegade-project.org/?a=commitdiff_plain;h=f989009df7e18e990ef3dc356b798faf6d5b6546;p=edk2-sdm845-acpi.git beryllium: Fix Focaltech touchscreen --- diff --git a/beryllium/DSDT.AML b/beryllium/DSDT.AML index 2c3b993..ec21eea 100644 Binary files a/beryllium/DSDT.AML and b/beryllium/DSDT.AML differ diff --git a/beryllium/Dsdt.asl b/beryllium/Dsdt.asl index c3024f3..41f0140 100644 --- a/beryllium/Dsdt.asl +++ b/beryllium/Dsdt.asl @@ -22,7 +22,7 @@ DefinitionBlock("DSDT.AML", "DSDT", 0x02, "QCOMM ", "SDM850 ", 3) // // Touch // - Include("cust_touch.asl") + Include("focaltech.asl") // // Buttons diff --git a/beryllium/audio_bus.asl b/beryllium/audio_bus.asl index d0c74f9..7dbff2e 100644 --- a/beryllium/audio_bus.asl +++ b/beryllium/audio_bus.asl @@ -44,6 +44,7 @@ Device (ADCM) Name (_DEP, Package() { \_SB_.SPI9, + \_SB_.I2C6 }) Method (_CRS, 0x0, NotSerialized) diff --git a/beryllium/dsdt_common.asl b/beryllium/dsdt_common.asl index 7cb6338..ba08adb 100644 --- a/beryllium/dsdt_common.asl +++ b/beryllium/dsdt_common.asl @@ -27,12 +27,13 @@ Name (TCML, 0x01400000) // Holds TrEE Carveout Memory Length //Audio Drivers Include("audio.asl") +Include("audio_bus.asl") // // Storage - UFS/SD // Include("../Common/ufs.asl") - // Include("../Common/sdc.asl") // No SD support on polaris + Include("../Common/sdc.asl") // // ASL Bridge Device @@ -143,6 +144,6 @@ Include("pmic_batt.asl") // Include("../Common/qgpi.asl") -Include("nfc.asl") +//Include("nfc.asl") Include("../Common/sar_manager.asl") diff --git a/beryllium/focaltech.asl b/beryllium/focaltech.asl new file mode 100644 index 0000000..8390051 --- /dev/null +++ b/beryllium/focaltech.asl @@ -0,0 +1,141 @@ +Include ("focaltech_resources.asl") + +Device (TSC1) +{ + Name (_HID, "FTTS8719") // _HID: Hardware ID + //Name (_HID, "TEST3330") // _HID: Hardware ID + Name (_HRV, One) // _HRV: Hardware Revision + Name (_ADR, Zero) // _ADR: Address + Name (_UID, One) // _UID: Unique ID + Name (_DEP, Package (0x03) // _DEP: Dependencies + { + PEP0, + GIO0, + IC15 + }) + Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings + { + Name (RBUF, ResourceTemplate () + { + I2cSerialBusV2 (0x0038, ControllerInitiated, 0x00061A80, + AddressingMode7Bit, "\\_SB.IC15", + 0x00, ResourceConsumer, , Exclusive, + ) + GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullUp, 0x0000, + "\\_SB.GIO0", 0x00, ResourceConsumer, , + ) + { // Pin list + 0x001F + } + }) + Return (RBUF) /* \_SB_.TSC1._CRS.RBUF */ + } + + Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method + { + While (One) + { + Name (_T_0, Buffer (One) // _T_x: Emitted by ASL Compiler, x=0-9, A-Z + { + 0x00 // . + }) + CopyObject (ToBuffer (Arg0), _T_0) /* \_SB_.TSC1._DSM._T_0 */ + If ((_T_0 == ToUUID ("3cdff6f7-4267-4555-ad05-b30a3d8938de") /* HID I2C Device */)) + { + While (One) + { + Name (_T_1, Zero) // _T_x: Emitted by ASL Compiler, x=0-9, A-Z + _T_1 = ToInteger (Arg2) + If ((_T_1 == Zero)) + { + While (One) + { + Name (_T_2, Zero) // _T_x: Emitted by ASL Compiler, x=0-9, A-Z + _T_2 = ToInteger (Arg1) + If ((_T_2 == One)) + { + Return (Buffer (One) + { + 0x03 // . + }) + } + Else + { + Return (Buffer (One) + { + 0x00 // . + }) + } + + Break + } + } + ElseIf ((_T_1 == One)) + { + Debug = "Method _DSM Function HID" + Return (0x20) + } + Else + { + } + + Break + } + } + Else + { + Return (Buffer (One) + { + 0x00 // . + }) + } + + Break + } + } + + Name (PGID, Buffer (0x0A) + { + "\\_SB.TSC1" + }) + Name (DBUF, Buffer (DBFL){}) + CreateByteField (DBUF, Zero, STAT) + CreateByteField (DBUF, 0x02, DVAL) + CreateField (DBUF, 0x18, 0xA0, DEID) + Method (_S1D, 0, NotSerialized) // _S1D: S1 Device State + { + Return (0x03) + } + + Method (_S2D, 0, NotSerialized) // _S2D: S2 Device State + { + Return (0x03) + } + + Method (_S3D, 0, NotSerialized) // _S3D: S3 Device State + { + Return (0x03) + } + + Method (_PS0, 0, NotSerialized) // _PS0: Power State 0 + { + DEID = Buffer (ESNL){} + DVAL = Zero + DEID = PGID /* \_SB_.TSC1.PGID */ + If (^^ABD.AVBL) + { + ^^PEP0.FLD0 = DBUF /* \_SB_.TSC1.DBUF */ + } + } + + Method (_PS3, 0, NotSerialized) // _PS3: Power State 3 + { + DEID = Buffer (ESNL){} + DVAL = 0x03 + DEID = PGID /* \_SB_.TSC1.PGID */ + If (^^ABD.AVBL) + { + ^^PEP0.FLD0 = DBUF /* \_SB_.TSC1.DBUF */ + } + } +} \ No newline at end of file diff --git a/beryllium/focaltech_resources.asl b/beryllium/focaltech_resources.asl new file mode 100644 index 0000000..335daf3 --- /dev/null +++ b/beryllium/focaltech_resources.asl @@ -0,0 +1,141 @@ +Scope (PEP0) + { + Method (LPMX, 0, NotSerialized) + { + Return (LPXC) /* \_SB_.PEP0.LPXC */ + } + + Name (LPXC, Package (0x01) + { + Package (0x04) + { + "DEVICE", + "\\_SB.TSC1", + Package (0x08) + { + "DSTATE", + Zero, + Package (0x02) + { + "TLMMGPIO", + Package (0x06) + { + 0x1F, + Zero, + Zero, + Zero, + 0x03, + Zero + } + }, + + Package (0x02) + { + "TLMMGPIO", + Package (0x06) + { + 0x20, + Zero, + Zero, + One, + Zero, + Zero + } + }, + + Package (0x02) + { + "PMICVREGVOTE", + Package (0x06) + { + "PPP_RESOURCE_ID_LDO14_A", + One, + 0x001B7740, + One, + 0x07, + Zero + } + }, + + Package (0x02) + { + "DELAY", + Package (0x01) + { + 0x03E8 + } + }, + + Package (0x02) + { + "TLMMGPIO", + Package (0x06) + { + 0x20, + One, + Zero, + One, + Zero, + Zero + } + }, + + Package (0x02) + { + "DELAY", + Package (0x01) + { + 0x4E20 + } + } + }, + + Package (0x05) + { + "DSTATE", + 0x03, + Package (0x02) + { + "PMICVREGVOTE", + Package (0x06) + { + "PPP_RESOURCE_ID_LDO14_A", + One, + Zero, + Zero, + 0x05, + Zero + } + }, + + Package (0x02) + { + "TLMMGPIO", + Package (0x06) + { + 0x20, + Zero, + Zero, + Zero, + One, + Zero + } + }, + + Package (0x02) + { + "TLMMGPIO", + Package (0x06) + { + 0x1F, + Zero, + Zero, + Zero, + One, + Zero + } + } + } + } + }) + } \ No newline at end of file diff --git a/beryllium/pep.asl b/beryllium/pep.asl index de49c9d..42beb38 100644 --- a/beryllium/pep.asl +++ b/beryllium/pep.asl @@ -9,4 +9,4 @@ Include("../Common/pep_common.asl") Include("cust_camera_resources.asl") //Include("nfc_resources.asl") //NFC -Include("cust_touch_resources.asl") +//Include("cust_touch_resources.asl")