<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/acpi/button.c, branch v5.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-04-20T08:37:15Z</updated>
<entry>
<title>ACPI: button: Drop no longer necessary Asus T200TA lid_init_state quirk</title>
<updated>2020-04-20T08:37:15Z</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2020-04-19T15:16:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2b6022a32e1c6e740a5929951d9d8cbed3b162b1'/>
<id>urn:sha1:2b6022a32e1c6e740a5929951d9d8cbed3b162b1</id>
<content type='text'>
Commit 17e5888e4e18 ("x86: Select HARDIRQS_SW_RESEND on x86") fixes
the edge-triggered embedded-controller (WC) IRQ not being replayed after
resume when woken by opening the lid, which gets signaled by the EC.

This means that the lid_init_state=ACPI_BUTTON_LID_INIT_OPEN quirk for
the Asus T200TA is no longer necessary, the lid now works properly
without it, so drop the quirk.

Fixes: 17e5888e4e18 ("x86: Select HARDIRQS_SW_RESEND on x86")
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: button: move HIDs to acpi/button.h</title>
<updated>2020-02-13T22:36:23Z</updated>
<author>
<name>Josh Triplett</name>
<email>josh@joshtriplett.org</email>
</author>
<published>2020-02-11T23:37:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ac1cc6b4856ffa7ecb818b3ceb82bfc43597d613'/>
<id>urn:sha1:ac1cc6b4856ffa7ecb818b3ceb82bfc43597d613</id>
<content type='text'>
This makes it possible to use ACPI_BUTTON_HID_POWER in another driver.

Signed-off-by: Josh Triplett &lt;josh@joshtriplett.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: button: Add DMI quirk for Razer Blade Stealth 13 late 2019 lid switch</title>
<updated>2020-01-07T10:51:41Z</updated>
<author>
<name>Jason Ekstrand</name>
<email>jason@jlekstrand.net</email>
</author>
<published>2020-01-02T20:27:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0528904926aab19bffb2068879aa44db166c6d5f'/>
<id>urn:sha1:0528904926aab19bffb2068879aa44db166c6d5f</id>
<content type='text'>
Running evemu-record on the lid switch event shows that the lid reports
the first "close" but then never reports an "open".  This causes systemd
to continuously re-suspend the laptop every 30s.  Resetting the _LID to
"open" fixes the issue.

Signed-off-by: Jason Ekstrand &lt;jason@jlekstrand.net&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: button: Add DMI quirk for Acer Switch 10 SW5-032 lid-switch</title>
<updated>2019-11-29T09:21:52Z</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2019-11-18T15:35:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=90ed9c639c1b53556f87b1c5031c7e4c57285a92'/>
<id>urn:sha1:90ed9c639c1b53556f87b1c5031c7e4c57285a92</id>
<content type='text'>
The Acer Switch 10 SW5-032 _LID method is quite broken, it looks like this:

            Method (_LID, 0, NotSerialized)  // _LID: Lid Status
            {
                If ((STAS &amp; One))
                {
                    Local0 = One
                    PBCG |= 0x05000000
                    HMCG |= 0x05000000
                }
                Else
                {
                    Local0 = Zero
                    PBCG &amp;= 0xF0FFFFFF
                    HMCG &amp;= 0xF0FFFFFF
                }

                ^^PCI0.GFX0.CLID = Local0
                Return (Local0)
            }

The problem here is the accesses to the PBCG and HMCG, these are the
pinconf0 registers for the power, resp. the home button GPIO,
e.g. PBCG is declared as:

            OperationRegion (PWBT, SystemMemory, 0xFED0E080, 0x10)
            Field (PWBT, DWordAcc, NoLock, Preserve)
            {
                PBCG,   32,
                PBV1,   32,
                PBSA,   32,
                PBV2,   32
            }

Where 0xFED0E000 is the base address of the GPO2 device and 0x80 is
the offset for the pin used for the powerbutton.

The problem here is this line in _LID:
                    PBCG |= 0x05000000

This changes the trigger flags of the GPIO, changing when it generates
interrupts. Note it does not clear the original flags. Linux uses an
edge triggered interrupt on both positive and negative edges. This |=
adds the BYT_TRIG_LVL flag to this, so now it is turned into a level
interrupt which fires both when low and high, iow it simply always
fires leading to an interrupt storm, the tablet immediately waking up
from suspend again, etc.

There is nothing we can do to fix this, except for a DSDT override,
which the user needs to do manually. The only thing we can do is
never call _LID, which requires disabling the lid-switch functionality
altogether.

This commit adds a quirk for this, as no lid-switch function is better
then the interrupt storm. A user manually applying a DSDT override can
also override the quirk on the kernel cmdline.

Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Reviewed-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: button: Remove unused acpi_lid_notifier_[un]register() functions</title>
<updated>2019-10-28T14:40:26Z</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2019-10-26T20:24:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e346d0cf2c0a2dc9e63d5b90824bbe5ac0cc43e2'/>
<id>urn:sha1:e346d0cf2c0a2dc9e63d5b90824bbe5ac0cc43e2</id>
<content type='text'>
There are no users of the acpi_lid_notifier_[un]register functions,
so lets remove them.

Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: button: Add DMI quirk for Asus T200TA</title>
<updated>2019-10-28T14:40:26Z</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2019-10-26T20:24:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=00e250367cc6c4ab80fea6ec605d464e624bd520'/>
<id>urn:sha1:00e250367cc6c4ab80fea6ec605d464e624bd520</id>
<content type='text'>
The Asus T200TA lid has some weird behavior where _LID keeps reporting
closed after every second openening of the lid. Causing immediate
re-suspend after opening every other open.

I've looked at the AML code but it involves talking to the EC and we
have no idea what the EC is doing. Setting lid_init_state to
ACPI_BUTTON_LID_INIT_OPEN fixes the unwanted behavior, so this commit
adds a DMI based quirk to use ACPI_BUTTON_LID_INIT_OPEN on the T200TA.

Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: button: Add DMI quirk for Medion Akoya E2215T</title>
<updated>2019-10-28T14:40:26Z</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2019-10-26T20:24:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=932e1ba486117de2fcea3df27ad8218ad6c11470'/>
<id>urn:sha1:932e1ba486117de2fcea3df27ad8218ad6c11470</id>
<content type='text'>
The Medion Akoya E2215T's ACPI _LID implementation is quite broken:

 1. For notifications it uses an ActiveLow Edge GpioInt, rather then
    an ActiveBoth one, meaning that the device is only notified when the
    lid is closed, not when it is opened.

2. Matching with this its _LID method simply always returns 0 (closed)

  In order for the Linux LID code to work properly with this implementation,
  the lid_init_state selection needs to be set to ACPI_BUTTON_LID_INIT_OPEN.

This commit adds a DMI quirk for this.

Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: button: Turn lid_blacklst DMI table into a generic quirk table</title>
<updated>2019-10-28T14:40:26Z</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2019-10-26T20:24:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d7cd08231a7fafb0d81786515527651d3242a7f4'/>
<id>urn:sha1:d7cd08231a7fafb0d81786515527651d3242a7f4</id>
<content type='text'>
Commit 3540c32a9ae4 ("ACPI / button: Add quirks for initial lid state
notification") added 3 different modes to the LID handling code to deal
with various buggy implementations.

Until now users which need one of the 2 non-default modes to get their
HW to work have to pass a kernel commandline option for this.

E.g. https://bugzilla.kernel.org/show_bug.cgi?id=106151 was closed with a
note that the user has to add "button.lid_init_state=open" to the kernel
commandline to get the LID code to not cause undesirable suspends on his
Samsung N210 Plus.

This commit modifies the existing lid_blacklst DMI table so that it can
be used not only to completely disable the LID code on devices where
the ACPI tables are broken beyond repair, but also to select one of the 2
non default LID handling modes on devices where this is necessary.

This will allow us to add quirks to make the LID work OOTB on broken
devices. Getting this working OOTB is esp. important because the typical
breakage is false LID closed reporting, causing undesirable suspends which
basically make the system unusable.

Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: button: Allow disabling LID support with the lid_init_state module option</title>
<updated>2019-10-28T14:40:26Z</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2019-10-26T20:24:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=593681e2c75f59f23cf6f6cefc4f00cae2a4522b'/>
<id>urn:sha1:593681e2c75f59f23cf6f6cefc4f00cae2a4522b</id>
<content type='text'>
Add a new "disabled" value for the lid_init_state module option, which can
be used to disable LID support on devices where it is completely broken.

Sometimes devices seem to spontaneously suspend and the cause for this is
not clear. The LID switch is known to be one possible cause for this,
this commit allows easily disabling the LID switch for testing if it
is the cause.

For example some devices which do not even have a lid, still have a LID
device in their ACPI tables, pointing to a floating GPIO.

This is not really related to the initial LID state, but re-using the
existing option keeps things simple and it will make it much easier to
add DMI quirks which can either disable the LID completely or set another
non-default lid_init_state value, both of which are necessary on some
devices.

Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: button: Refactor lid_init_state module parsing code</title>
<updated>2019-10-28T14:40:26Z</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2019-10-26T20:24:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=065bd4d35b3fb4484c61fc40a51eeffd5abe52e8'/>
<id>urn:sha1:065bd4d35b3fb4484c61fc40a51eeffd5abe52e8</id>
<content type='text'>
Replace the weird strncmp() calls in param_set_lid_init_state(),
which look to me like they will also accept things like "opennnn"
to use sysfs_match_string instead.

Also rewrite param_get_lid_init_state() using the new lid_init_state_str
array. Instead of doing a straightforward one line replacement, e.g. :
  return sprintf(buffer, lid_init_state_str[lid_init_state]);
print all possible values, putting [] around the selected value, so
that users can easily find out what the possible values are.

Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
