Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932382AbbGUAWs (ORCPT ); Mon, 20 Jul 2015 20:22:48 -0400 Received: from mga01.intel.com ([192.55.52.88]:57992 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932178AbbGUAWr (ORCPT ); Mon, 20 Jul 2015 20:22:47 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,511,1432623600"; d="scan'208";a="527424165" From: "Zheng, Lv" To: Bastien Nocera , "Rafael J. Wysocki" , Len Brown , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: "dev@mgautier.fr" Subject: RE: Ghost Lid switch on Baytrail tablet Thread-Topic: Ghost Lid switch on Baytrail tablet Thread-Index: AQHQwyuUUfqsmSb8xk+HVyILkB4FUJ3lD4uQ Date: Tue, 21 Jul 2015 00:22:42 +0000 Message-ID: <1AE640813FDE7649BE1B193DEA596E8802738629@SHSMSX101.ccr.corp.intel.com> References: <1437266568.3512.10.camel@hadess.net> In-Reply-To: <1437266568.3512.10.camel@hadess.net> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id t6L0MqOd001295 Content-Length: 2397 Lines: 67 Hi, The _LID returns LIDS: Device (LID) { Name (_HID, EisaId ("PNP0C0D") /* Lid Device */) // _HID: Hardware ID Name (LIDS, Zero) Method (_LID, 0, NotSerialized) // _LID: Lid Status { Return (LIDS) /* \_SB_.LID_.LIDS */ } } All LIDS related code can be found: Line 132: LIDS, 8, Line 5400: PARM |= (LIDS << 0x10) Line 5566: PARM = (LIDS << 0x08) Line 11792: ^^LID.LIDS = Zero * Line 11802: ^^LID.LIDS = One Line 11906: Name (LIDS, Zero) Line 11909: Return (LIDS) /* \_SB_.LID_.LIDS */ The value is only set by Q14 (marked by * above): Method (Q14, 0, NotSerialized) { P8XH (One, 0xBB) P8XH (Zero, 0x14) ^^LID.LIDS = One Notify (LID, 0x80) // Status Change P8XH (One, 0xBB) P8XH (Zero, 0xA4) } If QR_EC(0x14) cannot arrive to the OSPMs as early as possible, then the default LIDS=0 value may cause problem. We need EC debug log to track if QR_EC(0x14) can arrive earlier. You can uncomment the following line from drivers/acpi/ec.c and rebuild the kernel: /* #define DEBUG */ Send the dmesg output (before suspending) to us. Thanks and best regards -Lv > -----Original Message----- > From: Bastien Nocera [mailto:hadess@hadess.net] > Sent: Sunday, July 19, 2015 8:43 AM > To: Rafael J. Wysocki; Len Brown; linux-acpi@vger.kernel.org; linux-kernel@vger.kernel.org > Cc: dev@mgautier.fr > Subject: Ghost Lid switch on Baytrail tablet > > Hey, > > This tablet: > http://www.amazon.com/WinBook-10-1-Inch-Windows-full-size-Display/dp/B00N9ZG5U2/ > doesn't have a physical lid switch unless you plug the keyboard accessory to it. > > But it thinks that there is a lid, and that it's closed, making logind > suspend the machine after about 30 seconds. > > I'm currently testing this on a 4.0 kernel, as there have been > regressions on Baytrail with 4.1 and 4.2rcs. > > The DSDT for that tablet: > https://people.gnome.org/~hadess/Winbook%20TW100%20DSDT.dsl > > Any ideas how to handle this sort of device? > > Cheers ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?