Hans de Goede changed bug 1019337
What Removed Added
CC   jwrdegoede@fedoraproject.org
Flags needinfo?(adrien.plazas@suse.com)  

Comment # 14 on bug 1019337 from
Hi Adrian and Takashi,

So the story with backlight / pwm on the GPDwin consists of 2 problems really.

1) There is a generic problem with pwm handling on cht causing backlight
control to not work on any cht devices. I've a couple of patches queued up for
4.11 fixing this:

https://git.kernel.org/cgit/linux/kernel/git/thierry.reding/linux-pwm.git/commit/?h=for-4.11/acpi&id=69efb3439ccf2ce72e01edde05d2c63d624e251e
https://git.kernel.org/cgit/linux/kernel/git/thierry.reding/linux-pwm.git/commit/?h=for-4.11/acpi&id=bf71f4e8fb95632b92476c54c5fb44eb88b19deb
https://git.kernel.org/cgit/linux/kernel/git/thierry.reding/linux-pwm.git/commit/?h=for-4.11/acpi&id=60b24b82b1416c94de71fd03cf98bf149a0fe9d3

Note something went wrong with merging these, so they don't build so you also
need:

https://github.com/jwrdegoede/linux-sunxi/commit/9bf1b82154cdfb5a419aa67d7613c22f68824890

When you've a kernel with these patches you need to make sure that the pwm-lpss
and pwm-lpss-platform modules are built into the initrd (assuming i915.ko is in
the initrd) and then things will work on normal
cht hardware. To fix the initrd use dracut -f --add-drivers "pwm-lpss
pwm-lpss-platform" .

2) The dstd on the GPDwin is broken the _STA (status) ACPI method for the pwm
device returns 0, meaning the hardware is not there / not used. So the kernel
ignores it.

To fix this I've had to resort to creating a modified dstd:

https://fedorapeople.org/~jwrdegoede/GPD-win/dsdt.dsl

This has 3 differences compared to the original:

@@ -9703,12 +9703,7 @@

             Method (_STA, 0, NotSerialized)  // _STA: Status
             {
-                If ((SI0A == Zero) || (SD2D == One))
-                {
-                    Return (Zero)
-                }
-
-                Return (0x0F)
+                Return (Zero)
             }

             Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device

This is the _STA method of the mmc controller for a sdio wifi chip, which the
GPDwin does not use,
it uses pcie wifi, so it should return 0. This not returning of 0  breaks wifi
with newer kernels, as newer kernels recognize this controller and call its
_PS3 method which then turns of the pcie-wifi as it uses the same gpio.

@@ -10908,16 +10749,6 @@

             Method (_STA, 0, NotSerialized)  // _STA: Status
             {
-                If ((P10A == Zero) || (L11D == One))
-                {
-                    Return (Zero)
-                }
-
-                If (OSID == One)
-                {
-                    Return (Zero)
-                }
-
                 Return (0x0F)
             }


This is the _STA method for the pwm1 device, which now properly returns 0x0f
making the pwm-lpss driver actually load / bind to it.

And then I rip out all code from the  _PS0 and _PS3 methods of the acpi-node
describing the mmc controlled for the micro-sd slot, this is an attempt to fix
the suspend/resume issue as there is something in there which the kernel does
not  like. This is a hack, but since I was touching the dstd anyways ...
This makes the device suspend, but since we don't have a driver for the
power-button it never wakes up, oops.

To use the modified dstd make sure you've CONFIG_ACPI_TABLE_UPGRADE=y in your
kernel .config and then pre- note PRE pre-pend this initrd:

https://fedorapeople.org/~jwrdegoede/GPD-win/initrd-dstd

To your initrd, also see: Documentation/acpi/initrd_table_override.txt in the
kernel source tree.

With a kernel with the linked patches + the initrd pre-pended the backlight
control works for me. Next on my list to work on is the volume and power
buttons.

Regards,

Hans


You are receiving this mail because: