From 9c97cbd6413ea40807af66e0f576ed883ae9bf55 Mon Sep 17 00:00:00 2001 From: sunflower2333 Date: Sat, 2 Jul 2022 23:07:21 +0800 Subject: [PATCH] Add touch support for mix3 --- legacy/perseus/DSDT.aml | Bin 248356 -> 248418 bytes legacy/perseus/DSDT.dsl | 171 ++----------- legacy/perseus/cust_touch.asl | 86 +++++++ legacy/perseus/cust_touch_resources.asl | 325 +++++++++++++++--------- 4 files changed, 316 insertions(+), 266 deletions(-) create mode 100644 legacy/perseus/cust_touch.asl diff --git a/legacy/perseus/DSDT.aml b/legacy/perseus/DSDT.aml index aa0c0db5277bde425fd485eb2b97a5df3c7e35cb..a4af4c0ff8375ce6011231b71432fec833f8a556 100644 GIT binary patch delta 582 zcmZWm&ubGw6n<~E`L$uPbhJN1X)sVI0oeqjJrqr{Gl_${-A#5AD+&uD_&4+>dMJt) zX<@D+xd?)IT9372TM8cZ;9YN0!Gr&Rvn@z%4>QagzVCbQd*685`mt?QdB~&thXxSZ zcYM#Qgxp(c+7&PWK(0k@Av5=`T1N8h#gi6pwh)sRl4NJ4w-AWHzF2evZym;Nu+y!jk&-3a75k5E{9j z*9)W%%*>iT0-6Rei)bykeFs22Xr9% zLpcx}*nd+#xcj)9>9oDNia(Ks9R-pt20B|lEXZZvGj2H~(1>ywX%lAD(L zvqx(5(QAMfz|$-sZYH&Ta`d~=olf_BLJy;EWH%f2({wHZRx*0hx6?Lhe5#)qm##`U o4k`VF=N0V`fu#EYm;soBs(vhqw6#N5J^yIBKdvzvKP;iEs`R0A^&5wCMwlck~Ou-7Q z@c0J;c=n=M_dGSQyqR;F3IqV0TIgy+Q?CmX2yZ-lTtQDN2qhJSlec#+Y zj}l;Gf5#6KzgkEJC3K8jCH>VtPUF#R83e5Q}b;$k05$)`TvBT4Z+{<3@Cn-af}qeaJ3LOTe{ z<+29++E_wzWLOQZn~ue`W&7+P5#3pE>Y8Kf<#=v~95WCMdLaU^p#tJF#}^;t0EeN# z#lt@-q7EKFuTgEz=RF!(ftTvqG`{U*O246VPiMY% zU5WFpiM=(Dr^+@_dJU%>D**{f_Mb diff --git a/legacy/perseus/DSDT.dsl b/legacy/perseus/DSDT.dsl index 08fe1d9..2478685 100644 --- a/legacy/perseus/DSDT.dsl +++ b/legacy/perseus/DSDT.dsl @@ -41652,6 +41652,7 @@ DefinitionBlock ("", "DSDT", 2, "QCOMM ", "SDM850 ", 0x00000003) }) } + Include ("cust_touch_resources.asl") Device (BAM1) @@ -41914,6 +41915,30 @@ DefinitionBlock ("", "DSDT", 2, "QCOMM ", "SDM850 ", 0x00000003) } } + + +// +// I2C15 - "Core I2C Bus" +// +Device (IC15) +{ + Name (_HID, "QCOM0220") + Alias(\_SB.PSUB, _SUB) + Name (_UID, 15) + Name (_DEP, Package(){\_SB_.PEP0,\_SB_.QGP0}) + Name (_CCA, 0) + + Method (_CRS, 0x0, NotSerialized) + { + Name (RBUF, ResourceTemplate () + { + Memory32Fixed (ReadWrite, 0x00A98000, 0x00004000) + Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive, , , ) {391} + }) + Return (RBUF) + } +} + Device (SPI9) { Name (_HID, "QCOM021E") // _HID: Hardware ID @@ -59492,151 +59517,7 @@ DefinitionBlock ("", "DSDT", 2, "QCOMM ", "SDM850 ", 0x00000003) Name (_SUB, "RENEGA0E") // _SUB: Subsystem ID } - Device (TSC1) - { - 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, - IC13 - }) - Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings - { - Name (RBUF, ResourceTemplate () - { - //I2cSerialBusV2 (0x0020, ControllerInitiated, 0x00061A80, - I2cSerialBusV2 (0x0001, ControllerInitiated, 0x00061A80, - AddressingMode7Bit, "\\_SB.IC13", - 0x00, ResourceConsumer, , Exclusive, - ) - GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullUp, 0x0000, - "\\_SB.GIO0", 0x00, ResourceConsumer, , - ) - { // Pin list - 0x007D - } - //GpioIo (Exclusive, PullNone, 0x0000, 0x0000, IoRestrictionNone, - // "\\_SB.GIO0", 0x00, ResourceConsumer, , - // ) - // { // Pin list - // 0x0063 - // } - }) - Return (RBUF) /* \_SB_.TSC1._CRS.RBUF */ - } - - Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method - { - While (One) - { - Name (_T_0, Buffer (0x01) // _T_x: Emitted by ASL Compiler - { - 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, 0x00) // _T_x: Emitted by ASL Compiler - _T_1 = ToInteger (Arg2) - If ((_T_1 == Zero)) - { - While (One) - { - Name (_T_2, 0x00) // _T_x: Emitted by ASL Compiler - _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 */ - } - } - } + Include ("cust_touch.asl") Device (BTNS) { diff --git a/legacy/perseus/cust_touch.asl b/legacy/perseus/cust_touch.asl new file mode 100644 index 0000000..4839abc --- /dev/null +++ b/legacy/perseus/cust_touch.asl @@ -0,0 +1,86 @@ +// +// Copyright (c) 2015 - 2017 Qualcomm Technologies Inc. All rights reserved. +// +// This file contains the touch ACPI device definitions. +// +// +// =================================================================== +// EDIT HISTORY +// +// when who what, where, why +// -------- --- ----------------------------------------------- +// 11/15/16 ms Initial Version for 8998 QRD +// =================================================================== + + +Device (TSC1) +{ + Name (_HID, "STFT0521") // _HID: Hardware ID + Alias (\_SB.PSUB, _SUB) + Name (_DEP, Package (0x03) // _DEP: Dependencies + { + \_SB.GIO0, + \_SB.IC15, + \_SB.PEP0 + }) + Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings + { + Name (RBUF, ResourceTemplate () + { + I2cSerialBusV2 (0x0049, ControllerInitiated, 0x00061A80, + AddressingMode7Bit, "\\_SB.IC15", + 0x00, ResourceConsumer, , Exclusive, + ) + GpioInt (Level, ActiveLow, Exclusive, PullUp, 0x0000, + "\\_SB.GIO0", 0x00, ResourceConsumer, , + ) + { // Pin list + 0x001F + } + }) + Return (RBUF) /* \_SB_.TSC1._CRS.RBUF */ + } + 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 (\_SB.ABD.AVBL) + { + \_SB.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 (\_SB.ABD.AVBL) + { + \_SB.PEP0.FLD0 = DBUF /* \_SB_.TSC1.DBUF */ + } + } +} + diff --git a/legacy/perseus/cust_touch_resources.asl b/legacy/perseus/cust_touch_resources.asl index 58c47bf..31c1897 100644 --- a/legacy/perseus/cust_touch_resources.asl +++ b/legacy/perseus/cust_touch_resources.asl @@ -4,10 +4,13 @@ // This file contains the resources needed by touch driver. // // +// Copyright (c) 2014-19 by QUALCOMM Technologies, Inc. All Rights Reserved. +// QUALCOMM Confidential and Proprietary +// //=========================================================================== Scope(\_SB_.PEP0) { - + Method(LPMX) { Return(LPXC) @@ -15,143 +18,202 @@ Scope(\_SB_.PEP0) Name(LPXC, Package(){ - // Touch LVS1 + // Touch FTS521 Package() { "DEVICE", "\\_SB.TSC1", Package() { - "DSTATE", - 0x0, // D0 state - - // TS_INT configuration + "DSTATE", + 0x0, // D0 state + + // TLMMGPIO resource RESET Package() - { - "TLMMGPIO", // TLMMGPIO resource TS_INT - Package() - { - 31, // PIN number = 31 - 0, // State: NOT active = 0x0 - 0, // Function select = 0 - 0, // direction = Input. - 3, // Pull Up - 0, // Drive Strength: 0x0 = 2mA - }, - }, + { + "TLMMGPIO", + Package() + { + 32, // PIN number = 32 + 0, // State: NOT active = 0x0 + 0, // Function select = 0 + 1, // direction = Output. + 0, // NO Pull + 0, // Drive Strength: 0x0 = 2mA + }, + }, + + // Power source - VCC33 Power Supply Package() + { + "PMICVREGVOTE", // PMICVREGVOTE resource + Package() + { + "PPP_RESOURCE_ID_LDO28_A", // PM8998 ldoa 28 + 1, // Voltage Regulator type = LDO + 3300000, // 3.3V + 1, // force (1/0) enable/disable from software + 7, // power mode - Normal Power Mode + 0, // head room voltage + "HLOS_DRV", // DRV ID + "REQUIRED", // Set type + }, + }, + + // Power source - VCCIO Power Supply + Package () { - "TLMMGPIO", // TLMMGPIO resource RESET - Package() - { - 32, // PIN number = 32 - 0, // State: NOT active = 0x0 + "TLMMGPIO", + Package () + { + 79, // PIN number = 79 + 1, // State: active = 0x1 0, // Function select = 0 1, // direction = Output. - 0, // NO Pull + 3, // Pull Up 0, // Drive Strength: 0x0 = 2mA - }, - }, + } + }, - // Synaptics Power source - VDD - Package() - { - "PMICVREGVOTE", // PMICVREGVOTE resource - Package() - { - "PPP_RESOURCE_ID_LDO14_A", // VREG ID - 1, // Voltage Regulator type = LDO - 1800000, // 3.3V - 1, // force enable from software - 7, // power mode - Normal Power Mode - 0, // head room voltage - }, - }, + // eKTH6318 T1 > 0 sec. [T1]: the time difference between 0.9VCC33 and 0.9VCCIO. + Package() + { + "DELAY", + Package() + { + 4000, // Delay in milliseconds + } + }, + + // Power source - TOUCH 1.8VIO POWER ENABLE to VDD_TS_1P8_LDO +// Package() +// { +// "PMICGPIO", +// Package() +// { +// "IOCTL_PM_GPIO_CONFIG_DIGITAL_OUTPUT", // GPIO or GPIO IOCTL +// 1, // PMIC_C PM8150b +// 4,// GPIO 5 +// 0, // PM_GPIO_OUT_BUFFER_CONFIG_CMOS +// 1, // PM_GPIO_VIN1 +// 10,// PM_GPIO_SOURCE_HIGH +// 3, // PM_GPIO_OUT_BUFFER_HIGH +// 4, // PM_GPIO_I_SOURCE_PULL_DOWN_10uA +// }, +// }, - // I2C Pull Up source - // Package() - // { - // "TLMMGPIO", - // Package() - // { - // 23, // PIN number = 23 - // 1, // State: active = 0x1 - // 0, // Function select = 0 - // 1, // direction = Output. - // 3, // Pull Up - // 0, // Drive Strength: 0x0 = 2mA - // }, - // }, - - Package() - { - "DELAY", // Hold the RESET line LOW after power up for 2ms - Package() - { - 1000, // 2 Milsec delay - } - }, - + // [T2]: The time difference between 0.9VCCIO & TS_RESET + Package() + { + "DELAY", + Package() + { + 4000, // Delay in milliseconds + } + }, + // Drive RESET Line High + Package() + { + "TLMMGPIO", // TLMMGPIO resource TS_RESET + Package() + { + 32, // PIN number = 32 + 1, // State: active = 0x1 + 0, // Function select = 0 + 1, // direction = O/P + 0, // Pull none + 0, // Drive Strength: 0x0 = 2mA + }, + }, + + //may need needs ~200 ms to be ready for comm + Package() + { + "DELAY", + Package() + { + 200, // 200 Milsec delay + } + }, + + // TS_INT configuration + Package() + { + "TLMMGPIO", // TLMMGPIO resource TS_INT + Package() + { + 31, // PIN number = 31 + 0, // State: NOT active = 0x0 + 0, // Function select = 0 + 0, // direction = Input. + 3, // Pull Up + 0, // Drive Strength: 0x0 = 2mA + }, + }, + }, + + Package() + { + "DSTATE", + 0x3, // D3 state + + // TS_INT Disable Interrupt First Package() { - "TLMMGPIO", // TLMMGPIO resource TS_RESET + "TLMMGPIO", // TLMMGPIO resource TS_INT Package() { - 32, // PIN number = 32 - 1, // State: active = 0x1 - 0, // Function select = 0 - 1, // direction = O/P - 0, // Pull Up - 0, // Drive Strength: 0x0 = 2mA + 31, // PIN number = 31 + 0, // State: IN active = 0x0 + 0, // Function select = 0 + 0, // direction = Input. + 1, // Pull Down + 0, // Drive Strength: 0x0 = 2mA }, }, - // Synaptics may need needs ~200 ms to be ready for comm - Package() + // Power source - TOUCH 1.8VIO POWER DISABLE to VDD_TS_1P8_LDO + Package () { - "DELAY", - Package() + "TLMMGPIO", + Package () { - 20000, // 200 Milsec delay + 79, // PIN number = 79 + 0, // State: active = 0x0 + 0, // Function select = 0 + 1, // direction = Output. + 0, // Pull Down + 0, // Drive Strength: 0x0 = 2mA } - }, - }, - Package() - { - "DSTATE", - 0x3, // D3 state - - // Synaptics Power source - VDD - Package() + }, + + Package() { - "PMICVREGVOTE", // PMICVREGVOTE resource + "DELAY", Package() { - "PPP_RESOURCE_ID_LDO14_A", // VREG ID - 1, // Voltage Regulator type = LDO - 0, // Voltage is in micro volts - 0, // Force disable from s/w - 5, // power mode - Low Power Mode - 0, // head room voltage - }, + 4000, // 4s delay + } }, - - // I2C Pull Up source - // Package() - // { - // "TLMMGPIO", - // Package() - // { - // 23, // PIN number = 23 - // 0, // State: IN active = 0x0 - // 0, // Function select = 0 - // 1, // direction = Output. - // 1, // Pull Down - // 0, // Drive Strength: 0x0 = 2mA - // }, - // }, - + + // eKTH6318 Power source - VCCIO Power Supply Off +// Package() +// { +// "PMICGPIO", +// Package() +// { +// "IOCTL_PM_GPIO_CONFIG_DIGITAL_OUTPUT", // GPIO or GPIO IOCTL +// 1, // PM8150b +// 4,// GPIO 5 +// 0, // PM_GPIO_OUT_BUFFER_CONFIG_CMOS +// 1, // PM_GPIO_VIN1 +// 0,// PM_GPIO_SOURCE_HIGH +// 3, // PM_GPIO_OUT_BUFFER_HIGH +// 4, // PM_GPIO_I_SOURCE_PULL_DOWN_10uA +// }, +// }, + // RESET pin - power save mode Package() { @@ -167,21 +229,42 @@ Scope(\_SB_.PEP0) }, }, - // TS_INT configuration - power save mode Package() { - "TLMMGPIO", // TLMMGPIO resource TS_INT + "DELAY", Package() - { - 31, // PIN number = 31 - 0, // State: IN active = 0x0 - 0, // Function select = 0 - 0, // direction = Input. - 1, // Pull Down - 0, // Drive Strength: 0x0 = 2mA - }, + { + 4000, // 2ms delay + } + }, + + // Power source - VCC33- Power Supply OFF + Package() + { + "PMICVREGVOTE", // PMICVREGVOTE resource + Package() + { + "PPP_RESOURCE_ID_LDO28_A", // ldoa 28 + 1, // Voltage Regulator type = LDO + 0, // 0V + 1, // force (1/0) enable/disable from software + 7, // power mode - Low Power Mode + 0, // head room voltage + // "HLOS_DRV", // DRV ID + "REQUIRED", // Set type + }, }, - }, - }, + + //100ms delay before the backlight is off + Package() + { + "DELAY", + Package() + { + 100, // 100ms delay + } + }, + }, + }, }) } -- 2.45.2