beryllium: Fix Focaltech touchscreen
authorMarijan Limov <marijan.limov@gmail.com>
星期四, 3 Feb 2022 19:27:33 +0000 (20:27 +0100)
committerMarijan Limov <marijan.limov@gmail.com>
星期四, 3 Feb 2022 19:27:33 +0000 (20:27 +0100)
beryllium/DSDT.AML
beryllium/Dsdt.asl
beryllium/audio_bus.asl
beryllium/dsdt_common.asl
beryllium/focaltech.asl [new file with mode: 0644]
beryllium/focaltech_resources.asl [new file with mode: 0644]
beryllium/pep.asl

index 2c3b9939c04052e078cc4e371a2bced4ca3244ce..ec21eea86ad9502a7d98f52a9bbad7630c71644f 100644 (file)
Binary files a/beryllium/DSDT.AML and b/beryllium/DSDT.AML differ
index c3024f30c4c5d4c6d5d76cad9a2cbb26ee383d2c..41f01408a380ca699b47eb35eabb4eae730f768f 100644 (file)
@@ -22,7 +22,7 @@ DefinitionBlock("DSDT.AML", "DSDT", 0x02, "QCOMM ", "SDM850 ", 3)
         //
         // Touch
         //
-        Include("cust_touch.asl")
+        Include("focaltech.asl")
 
                //
         // Buttons
index d0c74f97b4b3715438e32d3738d90ac7806d5879..7dbff2e5a3bda2c5cabd895e4744e44d05d3d2a6 100644 (file)
@@ -44,6 +44,7 @@ Device (ADCM)
             Name (_DEP, Package()
             {
                 \_SB_.SPI9,
+                \_SB_.I2C6
             })
 
             Method (_CRS, 0x0, NotSerialized) 
index 7cb6338eb84fd6d878878fa940c3e1ffa0f3e683..ba08adbdc09f1fd15de206313ab2d20703aafccd 100644 (file)
@@ -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 (file)
index 0000000..8390051
--- /dev/null
@@ -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 (file)
index 0000000..335daf3
--- /dev/null
@@ -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
index de49c9deb48bdfbd4cf5431e602fe75aa008b074..42beb3859ad04d0c9ecdc8233c493dc7e15367fe 100644 (file)
@@ -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")