Beryllium - Brightness adjustment works for tianma, still no ebbg
authorMarijan Limov <marijan.limov@gmail.com>
星期天, 22 Aug 2021 23:49:13 +0000 (01:49 +0200)
committerMarijan Limov <marijan.limov@gmail.com>
星期天, 22 Aug 2021 23:49:13 +0000 (01:49 +0200)
I2C should be working too

beryllium/DSDT.aml
beryllium/DSDT.dsl
beryllium/cust_touch_resources.asl [new file with mode: 0644]
beryllium/displayXML.asl

index 24db902e40ec957f27eb0a0d9e3c8d2259336e91..fa6a4ca3231df32c4f38e6f3bcbe37d6ea9e9dea 100644 (file)
Binary files a/beryllium/DSDT.aml and b/beryllium/DSDT.aml differ
index 3941ecc5a8b2e471dbbfd2604bdc176d8e5f867c..49d3df14c5b7d0575cde95f767481c14ef64b81c 100644 (file)
@@ -30970,7 +30970,7 @@ DefinitionBlock ("", "DSDT", 2, "QCOMM ", "SDM850 ", 0x00000003)
                                 One, 
                                 0x001B7740, 
                                 One, 
-                                0x07
+                                0x05
                                 Zero
                             }
                         }, 
@@ -30984,7 +30984,7 @@ DefinitionBlock ("", "DSDT", 2, "QCOMM ", "SDM850 ", 0x00000003)
                                 One, 
                                 0x0013E5C0, 
                                 One, 
-                                0x07
+                                0x05
                                 Zero
                             }
                         }, 
@@ -30998,7 +30998,7 @@ DefinitionBlock ("", "DSDT", 2, "QCOMM ", "SDM850 ", 0x00000003)
                                 One, 
                                 0x002F5D00, 
                                 One, 
-                                0x07
+                                0x05
                                 Zero
                             }
                         }
@@ -42227,175 +42227,8 @@ DefinitionBlock ("", "DSDT", 2, "QCOMM ", "SDM850 ", 0x00000003)
             })
         }
 
-        Scope (PEP0)
-        {
-            Method (LPMX, 0, NotSerialized)
-            {
-                Return (LPXC) /* \_SB_.PEP0.LPXC */
-            }
-
-            Name (LPXC, Package (0x01)
-            {
-                Package (0x04)
-                {
-                    "DEVICE", 
-                    "\\_SB.TSC1", 
-                    Package (0x09)
-                    {
-                        "DSTATE", 
-                        Zero, 
-                        Package (0x02)
-                        {
-                            "TLMMGPIO", 
-                            Package (0x06)
-                            {
-                                0x7D, 
-                                Zero, 
-                                Zero, 
-                                Zero, 
-                                0x03, 
-                                Zero
-                            }
-                        }, 
-
-                        Package (0x02)
-                        {
-                            "TLMMGPIO", 
-                            Package (0x06)
-                            {
-                                0x63, 
-                                Zero, 
-                                Zero, 
-                                One, 
-                                Zero, 
-                                Zero
-                            }
-                        }, 
-
-                        Package (0x02)
-                        {
-                            "PMICVREGVOTE", 
-                            Package (0x06)
-                            {
-                                "PPP_RESOURCE_ID_LDO28_A", 
-                                One, 
-                                0x00325AA0, 
-                                One, 
-                                0x07, 
-                                Zero
-                            }
-                        }, 
-
-                        Package (0x02)
-                        {
-                            "TLMMGPIO", 
-                            Package (0x06)
-                            {
-                                0x17, 
-                                One, 
-                                Zero, 
-                                One, 
-                                0x03, 
-                                Zero
-                            }
-                        }, 
-
-                        Package (0x02)
-                        {
-                            "DELAY", 
-                            Package (0x01)
-                            {
-                                0x02
-                            }
-                        }, 
-
-                        Package (0x02)
-                        {
-                            "TLMMGPIO", 
-                            Package (0x06)
-                            {
-                                0x63, 
-                                One, 
-                                Zero, 
-                                One, 
-                                Zero, 
-                                Zero
-                            }
-                        }, 
-
-                        Package (0x02)
-                        {
-                            "DELAY", 
-                            Package (0x01)
-                            {
-                                0xC8
-                            }
-                        }
-                    }, 
-
-                    Package (0x06)
-                    {
-                        "DSTATE", 
-                        0x03, 
-                        Package (0x02)
-                        {
-                            "PMICVREGVOTE", 
-                            Package (0x06)
-                            {
-                                "PPP_RESOURCE_ID_LDO28_A", 
-                                One, 
-                                Zero, 
-                                Zero, 
-                                Zero, 
-                                Zero
-                            }
-                        }, 
-
-                        Package (0x02)
-                        {
-                            "TLMMGPIO", 
-                            Package (0x06)
-                            {
-                                0x17, 
-                                Zero, 
-                                Zero, 
-                                One, 
-                                One, 
-                                Zero
-                            }
-                        }, 
-
-                        Package (0x02)
-                        {
-                            "TLMMGPIO", 
-                            Package (0x06)
-                            {
-                                0x63, 
-                                Zero, 
-                                Zero, 
-                                Zero, 
-                                One, 
-                                Zero
-                            }
-                        }, 
-
-                        Package (0x02)
-                        {
-                            "TLMMGPIO", 
-                            Package (0x06)
-                            {
-                                0x7D, 
-                                Zero, 
-                                Zero, 
-                                Zero, 
-                                One, 
-                                Zero
-                            }
-                        }
-                    }
-                }
-            })
-        }
+        
+        Include ("cust_touch_resources.asl")
 
         Device (BAM1)
         {
@@ -53384,42 +53217,10 @@ DefinitionBlock ("", "DSDT", 2, "QCOMM ", "SDM850 ", 0x00000003)
                 Return (RBUF) /* \_SB_.GPU0.DITH.RBUF */
             }
 
-            Method (BLCP, 1, Serialized)
+            Method (BLCP, 1, NotSerialized)
             {
                 Name (RBUF, Buffer (0x0100){})
-                Local0 = Zero
-                CreateField (RBUF, (Local0 * 0x08), 0x20, PKHR)
-                Local0 += 0x04
-                CreateField (RBUF, (Local0 * 0x08), 0x08, PKCM)
-                Local0 += One
-                CreateField (RBUF, (Local0 * 0x08), 0x08, PKDS)
-                Local0 += One
-                CreateField (RBUF, (Local0 * 0x08), 0x08, PKUB)
-                Local0 += One
-                CreateField (RBUF, (Local0 * 0x08), 0x08, PKLB)
-                Local0 += One
-                Name (BON, Buffer (0x03)
-                {
-                     0x39, 0x53, 0x24                                 // 9S$
-                })
-                CreateField (RBUF, (Local0 * 0x08), 0x20, PKH2)
-                Local0 += 0x04
-                CreateField (RBUF, (Local0 * 0x08), 0x20, PKP2)
-                PKH2 = SizeOf (BON)
-                PKP2 = BON /* \_SB_.GPU0.BLCP.BON_ */
-                Local0 += SizeOf (BON)
-                CreateDWordField (RBUF, (Local0 * 0x08), EOF)
-                Local1 = (Arg0 * 0x03FF)
-                Local1 /= 0xFF
-                Local2 = (Arg0 * 0x03FF)
-                Local2 /= 0xFF00
-                Local2 &= 0x03
-                PKHR = 0x04
-                PKCM = 0x39
-                PKDS = 0x51
-                PKUB = Local2
-                PKLB = Local1
-                EOF = Zero
+                
                 Return (RBUF) /* \_SB_.GPU0.BLCP.RBUF */
             }
 
@@ -54031,7 +53832,7 @@ DefinitionBlock ("", "DSDT", 2, "QCOMM ", "SDM850 ", 0x00000003)
                         Package (0x02)
                         {
                             "DisableMiracast", 
-                            One
+                            Zero
                         }, 
 
                         Package (0x02)
@@ -58466,7 +58267,7 @@ Include("cust_thermal_zones.asl")
 
         Device (TSC1)
         {
-            Name (_HID, "MSHW1003")  // _HID: Hardware ID
+            Name (_HID, "TEST3330")  // _HID: Hardware ID
             Name (_UID, One)  // _UID: Unique ID
             Name (_DEP, Package (0x03)  // _DEP: Dependencies
             {
@@ -58478,7 +58279,7 @@ Include("cust_thermal_zones.asl")
             {
                 Name (RBUF, ResourceTemplate ()
                 {
-                    I2cSerialBusV2 (0x0020, ControllerInitiated, 0x00061A80,
+                    I2cSerialBusV2 (0x0062, ControllerInitiated, 0x00061A80,
                         AddressingMode7Bit, "\\_SB.IC15",
                         0x00, ResourceConsumer, , Exclusive,
                         )
@@ -58486,13 +58287,13 @@ Include("cust_thermal_zones.asl")
                         "\\_SB.GIO0", 0x00, ResourceConsumer, ,
                         )
                         {   // Pin list
-                            0x007D
+                            31
                         }
                     GpioIo (Exclusive, PullNone, 0x0000, 0x0000, IoRestrictionNone,
                         "\\_SB.GIO0", 0x00, ResourceConsumer, ,
                         )
                         {   // Pin list
-                            0x0063
+                            32
                         }
                 })
                 Return (RBUF) /* \_SB_.TSC1._CRS.RBUF */
diff --git a/beryllium/cust_touch_resources.asl b/beryllium/cust_touch_resources.asl
new file mode 100644 (file)
index 0000000..58c47bf
--- /dev/null
@@ -0,0 +1,187 @@
+//===========================================================================
+//                           <cust_touch_resources.asl>
+// DESCRIPTION
+//   This file contains the resources needed by touch driver.
+//
+//
+//===========================================================================
+Scope(\_SB_.PEP0)
+{
+    
+  Method(LPMX)
+  {
+     Return(LPXC)
+  }
+  
+  Name(LPXC,
+    Package(){
+        // Touch LVS1
+        Package()
+        {
+             "DEVICE",
+             "\\_SB.TSC1",
+             Package()
+             { 
+                "DSTATE",
+                0x0, // D0 state
+                
+                // 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()
+                {
+                    "TLMMGPIO", // TLMMGPIO resource RESET
+                    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
+                    },
+                },
+
+                // 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
+                    },
+                },
+
+                // 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
+                    }
+                },
+                
+                // 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 Up
+                        0,   // Drive Strength: 0x0 = 2mA
+                    },
+                },
+                
+                // Synaptics may need needs ~200 ms to be ready for comm
+                Package()
+                {
+                    "DELAY", 
+                    Package()
+                    {
+                        20000,  // 200 Milsec delay
+                    }
+                },
+             },
+             Package()
+             {
+                "DSTATE",
+                0x3, // D3 state    
+                
+                // Synaptics Power source - VDD
+                Package()
+                {
+                    "PMICVREGVOTE",                 // PMICVREGVOTE resource
+                    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
+                    },
+                },
+                
+                // 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
+                //     },
+                // },               
+                 
+                // RESET pin - power save mode 
+                Package()
+                {
+                    "TLMMGPIO", // TLMMGPIO resource RESET
+                    Package()
+                    {                                    
+                        32,  // PIN number = 32
+                        0,   // State: IN active = 0x0
+                        0,   // Function select = 0
+                        0,   // direction = Output.
+                        1,   // Pull Down
+                        0,   // Drive Strength: 0x0 = 2mA
+                    },
+                },
+
+                // TS_INT configuration - power save mode
+                Package()
+                {
+                    "TLMMGPIO", // TLMMGPIO resource TS_INT
+                    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
+                    },
+                },
+             },
+         },       
+    })
+}
index 127c7653c0a05e38a015b9ed38853dfab8df9c5d..a0fce022eaf14f387605b14a01e8f4cd9ae31827 100644 (file)
@@ -338,5 +338,17 @@ Name (PCFG, Buffer(){"
 <Group id='Backlight Configuration'>
        <BacklightType>1</BacklightType>
        <BacklightPmicControlType>2</BacklightPmicControlType>
+       <BacklightSteps>100</BacklightSteps>
+       <BacklightPMICBankSelect>15</BacklightPMICBankSelect>
+       <BacklightPMICPWMFrequency>600000</BacklightPMICPWMFrequency>
+       <BacklightDefault>80</BacklightDefault>
+       <BacklightLowPower>40</BacklightLowPower>
+       <PMIPowerPmicNumber>1</PMIPowerPmicNumber>
+       <PMIPowerPmicModel>21</PMIPowerPmicModel>
+       <PMIPowerconfig>1</PMIPowerConfig>
+       <AdaptiveBrightnessFeature>1</AdaptiveBrightnessFeature>
+       <CABLEnable>True</CABLEnable>
+       <BrignessMinLuminance>200</BrignessMinLuminance>
+       <BrignessMaxLuminance>319970</BrignessMaxLuminance>
 </Group>
 "})
\ No newline at end of file