lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 1 Sep 2016 00:55:15 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Wei-Ning Huang <wnhuang@...gle.com>
Cc:     Zhang Rui <rui.zhang@...el.com>,
        "Rafael J . Wysocki" <rjw@...ysocki.net>,
        Len Brown <lenb@...nel.org>,
        ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ACPI / button: add support for tablet mode switch

On Wed, Aug 31, 2016 at 10:52 AM, Wei-Ning Huang <wnhuang@...gle.com> wrote:
> On Wed, Aug 31, 2016 at 4:01 PM, Zhang Rui <rui.zhang@...el.com> wrote:
>> On δΈ‰, 2016-08-31 at 15:33 +0800, Wei-Ning Huang wrote:
>>> From: Wei-Ning Huang <wnhuang@...omium.org>
>>>
>>> ACPI PNP device HID 'PNP0C60' is a device that indicates tablet mode
>>> status. Add support for mapping this device to the SW_TABLET_MODE
>>> input
>>> event.
>>>
>>> Signed-off-by: Wei-Ning Huang <wnhuang@...omium.org>
>>> ---
>>>  drivers/acpi/button.c | 36 ++++++++++++++++++++++++++++++++++++
>>>  1 file changed, 36 insertions(+)
>>>
>>> diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
>>> index 148f4e5..50e9de6 100644
>>> --- a/drivers/acpi/button.c
>>> +++ b/drivers/acpi/button.c
>>> @@ -53,6 +53,11 @@
>>>  #define ACPI_BUTTON_DEVICE_NAME_LID  "Lid Switch"
>>>  #define ACPI_BUTTON_TYPE_LID         0x05
>>>
>>> +#define ACPI_BUTTON_SUBCLASS_TABLET  "tablet"
>>> +#define ACPI_BUTTON_HID_TABLET               "PNP0C60"
>>> +#define ACPI_BUTTON_DEVICE_NAME_TABLET       "Tablet Mode Switch"
>>> +#define ACPI_BUTTON_TYPE_TABLET              0x07
>>> +
>>>  #define ACPI_BUTTON_LID_INIT_IGNORE  0x00
>>>  #define ACPI_BUTTON_LID_INIT_OPEN    0x01
>>>  #define ACPI_BUTTON_LID_INIT_METHOD  0x02
>>> @@ -70,6 +75,7 @@ static const struct acpi_device_id
>>> button_device_ids[] = {
>>>       {ACPI_BUTTON_HID_SLEEPF, 0},
>>>       {ACPI_BUTTON_HID_POWER,  0},
>>>       {ACPI_BUTTON_HID_POWERF, 0},
>>> +     {ACPI_BUTTON_HID_TABLET, 0},
>>>       {"", 0},
>>>  };
>>>  MODULE_DEVICE_TABLE(acpi, button_device_ids);
>>> @@ -305,6 +311,23 @@ static void acpi_lid_initialize_state(struct
>>> acpi_device *device)
>>>       }
>>>  }
>>>
>>> +static int acpi_tablet_send_state(struct acpi_device *device)
>>> +{
>>> +     struct acpi_button *button = acpi_driver_data(device);
>>> +     unsigned long long state;
>>> +     acpi_status status;
>>> +
>>> +     status = acpi_evaluate_integer(device->handle, "_TBL", NULL,
>>> &state);
>>
>> Control methods with prefix "_" suggests this is an ACPI predefined
>> control method, but I can not find it in ACPI spec 6.1.
>> Can you illustrate me where I can find the definition of _TBL?
>
> Sorry, I'm not very familiar with ACPI's control method.

So apparently you don't really know what the patch you've posted is doing.

> '_TBL' is not a predefined ACPI control method according to the ACPI 6.1 spec.
> Maybe I should change it to '_LID'? As a tablet switch is sort of a
> 'inverted' lid switch.

Is that _TBL thing documented anywhere?

Thanks,
Rafael

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ