From patchwork Wed Mar 17 14:38:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 12146079 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A93ACC433E0 for ; Wed, 17 Mar 2021 14:39:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E18F64F26 for ; Wed, 17 Mar 2021 14:39:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232069AbhCQOjV (ORCPT ); Wed, 17 Mar 2021 10:39:21 -0400 Received: from mail-bn8nam11on2079.outbound.protection.outlook.com ([40.107.236.79]:59457 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232151AbhCQOjC (ORCPT ); Wed, 17 Mar 2021 10:39:02 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fVDxt5F88QSzSmK5lG3Fycl4n549do1fBDQ2874sWu+suROSy+etncU1nLJUIzKXKx+BXbS16QTugibzXBBfUhdBzz7ZumrxTVLHHh2omdA13GPyt9QJFvDkyC74rCcYEfiLHl/Yw4SwM+WctNVrjTXKf1aA9ngdpPyKILTKlICTxHQkN70iA7V1fTGPuXeAJJualEzm02a5TSW+G7FHBzhsi5uo6L1R+t+AoiaeGVost6TS3TV7+VYN8sp9m5HDXJdPnqoR03DJ/DegyBC9YzLeLlxJtQMm+FZay/60FFN74Jy5zO3TenWwjTUI2JG7lLW7iJwPYcZFxPgzJwKl6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NGtzko4HOIwk5a4eO6NuXL071uckrB7N6Q8tKBWOqKM=; b=NqUhWDsh2LMQFt5AJogqjXrMoyMwe774ZfGXYZL4Q5zPZli3z/YHVgBc9XYSbtnr6Pvk8qJgIwcghCtplNpoMIGAU091tCDMmetRNlaF15flqu9C974oKDZscIMVnDCjn06dpGLGa5Ho7gNdn6P7qdPZVgnymaJSkChdYZ5vpxKnfgwb6RgbovEgD2ejcan65Wq8+aYeZApSOv5HiDXkgDAFVUGNKF2djrwl2KRvgE0Td7MGuC9H8CRX3RpJqnD4mU1EkYNmCzUnafkJPM0J7yaORM9tT+BM7plI/YXijKItY6HhsfBTLLY4u+PVKJDiJT+xOlgsgMmWM+OK9k93Yg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NGtzko4HOIwk5a4eO6NuXL071uckrB7N6Q8tKBWOqKM=; b=MsWM+vi+r3Y6np+udkaYH5ZR+ooL7C3V27RUA/Hab/E4lPp6urk8fhcHJKr7YYkduHsIHKjALq8aNFQoZIiMCX/dM0NKIQxmVB3WcA2G2zx5Qri8zSuv++PDoHQ7obAXnxkW7EMEQd0E67us/h87Ohddj18awHNKkJ9rPvhzq4Q= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=none action=none header.from=amd.com; Received: from MN2PR12MB4488.namprd12.prod.outlook.com (2603:10b6:208:24e::19) by MN2PR12MB4423.namprd12.prod.outlook.com (2603:10b6:208:24f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32; Wed, 17 Mar 2021 14:39:00 +0000 Received: from MN2PR12MB4488.namprd12.prod.outlook.com ([fe80::5deb:dba7:1bd4:f39c]) by MN2PR12MB4488.namprd12.prod.outlook.com ([fe80::5deb:dba7:1bd4:f39c%5]) with mapi id 15.20.3933.032; Wed, 17 Mar 2021 14:39:00 +0000 From: Alex Deucher To: amd-gfx@lists.freedesktop.org, linux-acpi@vger.kernel.org, rjw@rjwysocki.net, lenb@kernel.org Cc: hdegoede@redhat.com, Prike.Liang@amd.com, Shyam-sundar.S-k@amd.com, Alex Deucher , Marcin Bachry Subject: [PATCH 1/2] platform/x86: Add missing LPS0 functions for AMD Date: Wed, 17 Mar 2021 10:38:41 -0400 Message-Id: <20210317143842.786380-1-alexander.deucher@amd.com> X-Mailer: git-send-email 2.30.2 X-Originating-IP: [192.161.79.247] X-ClientProxiedBy: MN2PR13CA0023.namprd13.prod.outlook.com (2603:10b6:208:160::36) To MN2PR12MB4488.namprd12.prod.outlook.com (2603:10b6:208:24e::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (192.161.79.247) by MN2PR13CA0023.namprd13.prod.outlook.com (2603:10b6:208:160::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.11 via Frontend Transport; Wed, 17 Mar 2021 14:38:59 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 64c4e4cb-ff92-49df-fb1b-08d8e9526750 X-MS-TrafficTypeDiagnostic: MN2PR12MB4423: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fs6orAmSjN/zT0I6qjYGnDYDTXgtlRtZqcSXvuuuOWI/QFrpcfiPwLqtKCErZ391u8YnS1ajDYq88tXkDlngZeH01mxIY7CEJGtmYlXs4Lql/xRuHqCn4Pu0zhRPgFiF4UpSNf+Gz3IA0UTuiZ9735euKgTsTPPolDEFZOxk+Good4OLgWY1VsVpZG1NPMbEQgWD3k+bGCfFfIjbZu1ZOqaBQz7uReH6bXq9/2H+XFDDr4RiN4ZEgORaXqrXtnKW7SeMysWa5wNdhNJPqokxQ+GtsHZPIILj7eMRKL0YYyGv3daGgsIUYlpfBq0Y/d6lXUxKKQnDUQzAelFCRHCzzrf14VA76OlFZcPCo2h2AkwqWOfsioj31RBFeGh2kNt/Z6M0f5vIaEF5xT3F0GXm1KcKPBs9AXdvjZBSqVgrHT8+/O4oGXlgYYff27GYo4Qazp+JyuQaJrkVJst9eGI8XipUNgqi2V7glxQPWuFZSX2z4Or0Jch5P1EHZk5ru55HBwcb+ERqCeN9fLfewn1DJP0Ko9NgjbE25TdXMvrO7F+pEUeUZNuuo/T/pBQMteNBS35kdrCx7gCyWw2UUhwAwiSWPyJ1IVd+aB6Q1LS9TCVajbCznkjGtXTXJM/xf4rNf3UDWJZlHuB93SWVgG4HlQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB4488.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(346002)(39860400002)(366004)(376002)(396003)(16526019)(6666004)(6512007)(86362001)(8936002)(478600001)(966005)(186003)(956004)(83380400001)(2906002)(69590400012)(6506007)(66946007)(5660300002)(6486002)(36756003)(66476007)(4326008)(66556008)(8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eBSwpGPPo3svGxZsFJlJ6Hmh4y+iOpEu4/jtFd9LpYLbamt8CVq4eHQuNyMb/RNzKoarsQwnIJZCwpfH4THPTlVsI0YqbLrAco+klEnRAx+heWO/vgX55Rr6oL2+Mj7mHTQRpYoTShlQYX6aeWF2dvWoV9RcnLcMDC7pxv32iObRVIiAGXTlwqqW4SgicNKGqWudCt9L+ZMoRumf5o+iEbQWvdgXEfn1O3F3IrfbRhnBBQkgv6AlAVox9v5lGnm1/qr+CDvLqa7FedQAulADrkhVeX8QgwsmeifQGCApALexPv41xmR+ieNKbwjBsTvLHFRyHazYI1X5sfSpXHYEiIaboYx X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 64c4e4cb-ff92-49df-fb1b-08d8e9526750 X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4488.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2021 14:39:00.5305 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: H06n+PbxRQYcUh/qVRO7QnmxL7rWadG+jduCXWaYZVkmUbu1tIbWQQi8tUrHo7iEFVligYsPeokUHnqIWYN3TQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4423 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org These are supposedly not required for AMD platforms, but at least some HP laptops seem to require it to properly turn off the keyboard backlight. Based on a patch from Marcin Bachry . Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1230 Reviewed-by: Hans de Goede Signed-off-by: Alex Deucher Cc: Marcin Bachry --- drivers/acpi/x86/s2idle.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c index 2b69536cdccb..2d7ddb8a8cb6 100644 --- a/drivers/acpi/x86/s2idle.c +++ b/drivers/acpi/x86/s2idle.c @@ -42,6 +42,8 @@ static const struct acpi_device_id lps0_device_ids[] = { /* AMD */ #define ACPI_LPS0_DSM_UUID_AMD "e3f32452-febc-43ce-9039-932122d37721" +#define ACPI_LPS0_ENTRY_AMD 2 +#define ACPI_LPS0_EXIT_AMD 3 #define ACPI_LPS0_SCREEN_OFF_AMD 4 #define ACPI_LPS0_SCREEN_ON_AMD 5 @@ -408,6 +410,7 @@ int acpi_s2idle_prepare_late(void) if (acpi_s2idle_vendor_amd()) { acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF_AMD); + acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY_AMD); } else { acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF); acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY); @@ -422,6 +425,7 @@ void acpi_s2idle_restore_early(void) return; if (acpi_s2idle_vendor_amd()) { + acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT_AMD); acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_ON_AMD); } else { acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT);