From patchwork Tue Apr 11 16:10:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 13207849 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B4A6C76196 for ; Tue, 11 Apr 2023 16:14:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230352AbjDKQOT (ORCPT ); Tue, 11 Apr 2023 12:14:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231254AbjDKQOD (ORCPT ); Tue, 11 Apr 2023 12:14:03 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2087.outbound.protection.outlook.com [40.107.212.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24373527A for ; Tue, 11 Apr 2023 09:11:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lfz1OXN0GgvCSxcRB9dJqnrha1mYdS3JiFryWZz6Z2IQxgEwFcjcI0X23y6WLHWy/NmkObofxV/sTOGJ5AGhcHMbxGmxpBtWiDLdFsDQosuiPxhKyXMrG2yWBg4NByrcjaDHq2PdIpLSE4YSkCCcFo6OlLQyMRTUBEd7L8RUXCWOQXcYVTOfS0qcuqZfzmvgZjZbLn3+UGZr7TsGmYhLRXgtyChNTR63eBHN1rdlg1EdnvMWDhkEINgWpjxAe/dGnJPzo/xwrjm1p7TFGspynp4SvXlY5zQHmixO3ywO6fONtEtxrH9QZ5Mez8QWXqZ4EZBePiXfz/3c6IBPwD+Rew== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=s6XQQq0SqGB+kg7CavL2oqoJa8uZaKecevfhRovLhlc=; b=MvHitiDFMmHYaK7ei1YDXRh/6Tn3A630a/PVe6GW0LEw7TXE4tHcjyOnRMh5UN4APdVqSro+p4NxaUHCC5WH/3/xQMNb0QwgGhPhZcixXqgdTUhzn7BPqLFBtyCoTGS26Z/oTH6FkukbUjKvBFW2X47xhfibAMI0FJCBcADq4V+0h11XsnUmm/m87yleNn+BBr6VpglKjtj06voc2dBExsXCcyjKPtjhsqg4T3n82ron/vN/TCIAiPfFwYQpUhAAPPAChBRZiJZtCNQCph3UItqK4i3nwBDOA+UaxNiW/EGE4UumPi9rT7Yp+0BitCOFMWMre6VAz72AQ6kpcLpLfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=s6XQQq0SqGB+kg7CavL2oqoJa8uZaKecevfhRovLhlc=; b=hGV1f1GlMbyxiQa17m2T4Mk2m84DS3Kmbxu1t1zirPQ/8/Y8PBNEnDR11H8EqAoM6zpOyZSjAnzRGNJ6io8M3JJqIhlxKFRnKNdP7x3YfeiRrR9beknnQSOPZcebP/KBEllqBgtWwOH6CxWSqZ8tBTA7TYg8+6S1V92fzDnfFe4= Received: from DS7PR03CA0115.namprd03.prod.outlook.com (2603:10b6:5:3b7::30) by MW4PR12MB6852.namprd12.prod.outlook.com (2603:10b6:303:20b::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.33; Tue, 11 Apr 2023 16:11:22 +0000 Received: from DM6NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b7:cafe::58) by DS7PR03CA0115.outlook.office365.com (2603:10b6:5:3b7::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.39 via Frontend Transport; Tue, 11 Apr 2023 16:11:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT028.mail.protection.outlook.com (10.13.173.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.29 via Frontend Transport; Tue, 11 Apr 2023 16:11:21 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 11 Apr 2023 11:11:19 -0500 From: Basavaraj Natikar To: , , CC: Basavaraj Natikar Subject: [PATCH 1/7] HID: amd_sfh: Correct the structure fields Date: Tue, 11 Apr 2023 21:40:24 +0530 Message-ID: <20230411161030.909350-2-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230411161030.909350-1-Basavaraj.Natikar@amd.com> References: <20230411161030.909350-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT028:EE_|MW4PR12MB6852:EE_ X-MS-Office365-Filtering-Correlation-Id: 774a7620-8613-4270-a621-08db3aa76457 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nW60jo3CCx0h+edhf2YcaBiGS5YUB/aOFPgTRcsIYVGY9nJPNRhA7qmcbsPXDACL34FsxPxzDAFamaUo/FDa0VuNSvgslmZ0VwRzyUP7Mk0wUneNFz70AM7WoetVrWhbM9CZfe1dUGNU0U3/0I2sj58Yz5Vo1O8RC9sa22MblhpG9gEOOizCykJqNVEUXN8TEqNZfHRSdGKIx5ah3G+JQo0qFFzY6q2uTuYkeFScc/s0+22McVrpEaOo3YhNLfrSoJThjUmgNk5HUflg4lSvadZJS1JYEK3N+rDml8Sp4hRjEoz4wx6V2NUnO/UqD37TJl0S9fjHPgiPYE/e97xxyOLsvuxi+2tBw+0imk1UieEWp1hVpjgrqrIHqvF01cGt1RRG3yI5+p4sFay2XCP03fZ8tvH2Y28GGgjVtCXGNuWd12KMJk0zwqtvme61tS4HA0+wN73bY3lvclp/HRblr0qngz3cHUnyVAazxSxpj+ZG3PUlqpgm+gHcpIlb6SHFiZneKU0hHAclQGrMR/isDO98/WwD8tB7APrG9e3pg5q26kirxy+zQVzbdEnn/2ZLTQ+6lpzUYY6RFHFZ0A6+jO9yaB4XkN49C7VcAGeSiitgYdE5lmxnseZjD9fR9guLvt3YN9OCRtjWvhoFtTZ3pNZn7DydF1NH4wE9+ri7m6r1pbg98Rgqle7EGJr7//nsx8NCTDV5lyV0w2CdoLZmCvUZiSSz9TaUDcsg29S1IzU= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(39860400002)(346002)(136003)(451199021)(46966006)(36840700001)(40470700004)(426003)(336012)(186003)(2616005)(86362001)(16526019)(70586007)(478600001)(70206006)(4326008)(83380400001)(8676002)(356005)(2906002)(5660300002)(1076003)(82740400003)(26005)(36860700001)(81166007)(6666004)(41300700001)(40480700001)(316002)(4744005)(110136005)(36756003)(7696005)(40460700003)(82310400005)(8936002)(47076005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2023 16:11:21.9691 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 774a7620-8613-4270-a621-08db3aa76457 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6852 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Misinterpreted sfh_cmd_base structure member fields. Therefore, adjust the structure member fields accordingly to reflect functionality. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h index ae47a369dc05..a3e0ec289e3f 100644 --- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h +++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h @@ -33,9 +33,9 @@ struct sfh_cmd_base { struct { u32 sensor_id : 4; u32 cmd_id : 4; - u32 sub_cmd_id : 6; - u32 length : 12; - u32 rsvd : 5; + u32 sub_cmd_id : 8; + u32 sub_cmd_value : 12; + u32 rsvd : 3; u32 intr_disable : 1; } cmd; }; From patchwork Tue Apr 11 16:10:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 13207850 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45321C77B6F for ; Tue, 11 Apr 2023 16:14:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230379AbjDKQOV (ORCPT ); Tue, 11 Apr 2023 12:14:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230374AbjDKQOG (ORCPT ); Tue, 11 Apr 2023 12:14:06 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2046.outbound.protection.outlook.com [40.107.220.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10BB87D93 for ; Tue, 11 Apr 2023 09:11:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WmMLDJx89qZOIdDPXgSl7DCIcYvxfBzO0RraLiVg3re0IwH21QpaVL65NGDacA4F++ST5mlF1JKaABFUA37CmcRFKCBAkW8aVS+/76lrQbUghDZkuu11zVLSjcrNJNzaBHsd6fSjzJsvRTM4iJ38S3ZkZVefIroGRp3Ocf6mxHmvwIlYa5HBIE/c+zTGH9hxSp22RkJ7XbJx+w+uVo0S/vc09pRwU4BiVNE/VaAqVii787za1Wgwoqn66JZjWKOMhvybSsgv2/cn6uwyKMKeAy+l9Xst80E99cc21g6y4lMB9lFfXJF7+aidSpcaFN3oUEqczAn8aUZRxV00ID8m+w== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8yMHiZbLxXnvNrpBPmxXHwYs8LLZzT9oz2UnuCbyJwg=; b=odosmRkxnX1iyrMUa9G7+AlHJN/nB6cHeGa2bz0sbqTjWpAHWJcINaCm+mIkYkJ3lr5veQ4zPeYs3OR0rN8jnN+hAwXDSjploHastGPWNP4HHsFzFohB7Ey0O1z+KvrlCbY68/SlOCnhyoBDjVU6meAbSRKky48nHdkjO/ft7P4HtyJx5+z7vqNUwHUeo8Cwsq10VA0kRYIw+xF0cJiaUmye/HI1XrMGbVvp/CHSb3y2f+2aBXfG5hPSQYqzV8SJOKwNIUpga55m0XulvrVULaak3dGYom0BkF+A2ml6dfVxSfBjubD+b/cK31gnSHHv+QLTh6omD2HaIj1uPmUoSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=8yMHiZbLxXnvNrpBPmxXHwYs8LLZzT9oz2UnuCbyJwg=; b=37bWxZLCsxb5dwPhyi1jsKt6w/gjNZogRABOzuiW/gi4qKIw+xmh41J0dHp9kVJC3G1odO1DtU+Ch74FVZDneXceRjWVNFdY03t2p8MdkgBYXn0Zl0BgjVC3gLcfm/R7n3SOsLNd7HjWbVc0i4w+T2ZoEj21W58hSPwqNAu2vAk= Received: from DS7PR03CA0094.namprd03.prod.outlook.com (2603:10b6:5:3b7::9) by MN6PR12MB8471.namprd12.prod.outlook.com (2603:10b6:208:473::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.33; Tue, 11 Apr 2023 16:11:24 +0000 Received: from DM6NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b7:cafe::10) by DS7PR03CA0094.outlook.office365.com (2603:10b6:5:3b7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.28 via Frontend Transport; Tue, 11 Apr 2023 16:11:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT028.mail.protection.outlook.com (10.13.173.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.29 via Frontend Transport; Tue, 11 Apr 2023 16:11:23 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 11 Apr 2023 11:11:21 -0500 From: Basavaraj Natikar To: , , CC: Basavaraj Natikar Subject: [PATCH 2/7] HID: amd_sfh: Correct the sensor enable and disable command Date: Tue, 11 Apr 2023 21:40:25 +0530 Message-ID: <20230411161030.909350-3-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230411161030.909350-1-Basavaraj.Natikar@amd.com> References: <20230411161030.909350-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT028:EE_|MN6PR12MB8471:EE_ X-MS-Office365-Filtering-Correlation-Id: 13aee8bc-e539-4f40-5c0c-08db3aa76554 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Jwj2RUhVwJ471JxHVXoanHISY/h6kEDNJrUp9Bme5HxG8I98zoKVY6HnAAd6mAkuzzWbojbHxV2D7e1xmqQLl0fxNjzSWF+4logy+O2/EvxQqPHVjGGwNwyXg+M3D0L3SaerTCIb4MJ1zi/WmBWx6sktXxxY5t+px1I2x83K6moqTlruZ3q6XCb+1QFlzLSYxAjhZ8bc+MR41Cyak5jO5fo+zhsxyQJpimMgfyobDuA4ypcTJu7msZhgNy2oBf8FpTA158hophO6VPUL4Vp+w3JUiOJ/ZO3vdFnVCz2/BvqyoprRhT4NLBiVPHJKu3zkT99xa4ppsp2VIXzrvCtuPLc0H7O/ABdMWGu+ybpSUs0Id7D1MD5+SJLI8L6V/gV6TjxVGahFVPyj0YMYWq1o6AoOXOU43gNrLevB9+dYlaDleIeGuiOpcH1j8VCd+/vDh03We6z/56eeGq1zvpz2i0d3dDFfYn8lZ1YN21VLZh9eAvyt0gJrbCTIejUqofvHamxvbyybdP6BaLemvzpEB/wgm+I+0uD2zgqgv652VqKZcmWJaPy1Gr83BwySZE8dxFrDLEO/IW450YX9ijFqybw2MZiA8JLTf4Z8gYiZoEhkjSOOdtRr9LEwcCtSf5EHUDTLOrL7u3sGESOYHmhs+jCWEbJ6loz7clevrr2Mu5zeEizkOua5DcpqpHgsg0/vnK66c62nRV/R46Q/JQVmp/+TB+ZBkWCRZmkZoJhO3Lg= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(376002)(346002)(39860400002)(451199021)(40470700004)(46966006)(36840700001)(82310400005)(2906002)(86362001)(36756003)(40480700001)(2616005)(7696005)(186003)(47076005)(336012)(426003)(16526019)(83380400001)(1076003)(36860700001)(26005)(70586007)(4326008)(478600001)(40460700003)(81166007)(70206006)(356005)(8936002)(82740400003)(8676002)(41300700001)(110136005)(5660300002)(316002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2023 16:11:23.6252 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 13aee8bc-e539-4f40-5c0c-08db3aa76554 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR12MB8471 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org In order to start or stop sensors, the firmware command needs to be changed to add an additional default subcommand value. For this reason, add a subcommand value to enable or disable sensors accordingly. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c index c6df959ec725..6e19ccc12450 100644 --- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c +++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c @@ -33,6 +33,7 @@ static void amd_start_sensor(struct amd_mp2_dev *privdata, struct amd_mp2_sensor cmd_base.ul = 0; cmd_base.cmd.cmd_id = ENABLE_SENSOR; cmd_base.cmd.intr_disable = 0; + cmd_base.cmd.sub_cmd_value = 1; cmd_base.cmd.sensor_id = info.sensor_idx; writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG(0)); @@ -45,6 +46,7 @@ static void amd_stop_sensor(struct amd_mp2_dev *privdata, u16 sensor_idx) cmd_base.ul = 0; cmd_base.cmd.cmd_id = DISABLE_SENSOR; cmd_base.cmd.intr_disable = 0; + cmd_base.cmd.sub_cmd_value = 1; cmd_base.cmd.sensor_id = sensor_idx; writeq(0x0, privdata->mmio + AMD_C2P_MSG(1)); From patchwork Tue Apr 11 16:10:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 13207851 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 044C2C76196 for ; Tue, 11 Apr 2023 16:14:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230386AbjDKQOW (ORCPT ); Tue, 11 Apr 2023 12:14:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229870AbjDKQOH (ORCPT ); Tue, 11 Apr 2023 12:14:07 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2073.outbound.protection.outlook.com [40.107.94.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 436CC7AB4 for ; Tue, 11 Apr 2023 09:11:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lONImwlpe2z7r8FEOsg+adRn9Bp/LWdSZEz9/1Yq9DX7a0A+5JVlVNHlRLZxWbV2ov5V4ma2QtVLQiL7ZaNsyLECqTnUhQZXXwcwBHDZF3Cj4XTNvSTG+LBIi5uu5gzWZ9JzY929W1xAR8oFBEv8Yp4ByH6ywTHes0r6AGmeb3WAqUEAqTxJOrTYaVQyW3c0wvT4a5JEtoohgu6dpwSIUqpnMJuEXLMlcBVTBpAnaCQ5DTxzX7SfdmURMLHWzq1hx+SZUraZZVjVtd2o06HkzfwY4Tgz27zVi4lJm57mofcPWSe1+h5LCRpKZBqoOXpYOH8Xep2ff+xXiN/dnH8gzg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bL+ndif0kN67B0HrjoztR6H68GGhwCO6AZ3WC9QudM4=; b=LqeVyHcu/grRBw7TWaHGHHsuRqlpSM93HcR+k0s29xixqIHZ0b3ki31KzRCFGDhUsa3JEPEgUqXt9E++GeFEl/cNFxPMjTtwmq716ouaCPmHvwdQ0LpFQhgdxKWlR0Pwobs8mbP7rKJ73LHo4gj6m1yQvIGsAA+7EpSNNB/aQb8qvrrTBpJXXCJ8e18PW48H+uZgDvTn3/KyEYUZok2Yq+oZxaGGx/0sdXj1lh8mMlULqEnB5AKTxFpDrKLF3Unv1F6/4GpQD0eE5y3RkwSNsxkGhsT/U2lOLgUB4xpEob5iW8RcefwTBVLtfqnY5B9gdaneQAsTSruL6yVuwmNDQw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=bL+ndif0kN67B0HrjoztR6H68GGhwCO6AZ3WC9QudM4=; b=lL0vGe4I1ics67wBDJwJRe2YeLiCYrqiAq0CbFVKHfD0XkSSxkX0xq94p4BVJUFGanCqQqIyhzkVNPJF4zqY/8qoOGl4st245M/OHNd/ucyWsCEhm3LYEb6Kv5Z3Z8zKL5aJhESA/AQvgtSVRvLFrYkg+g5qNPUbTxsOcRwL4JM= Received: from DS7PR05CA0062.namprd05.prod.outlook.com (2603:10b6:8:57::8) by SJ0PR12MB5633.namprd12.prod.outlook.com (2603:10b6:a03:428::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Tue, 11 Apr 2023 16:11:25 +0000 Received: from DM6NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:8:57:cafe::d3) by DS7PR05CA0062.outlook.office365.com (2603:10b6:8:57::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.28 via Frontend Transport; Tue, 11 Apr 2023 16:11:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT024.mail.protection.outlook.com (10.13.172.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.29 via Frontend Transport; Tue, 11 Apr 2023 16:11:25 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 11 Apr 2023 11:11:23 -0500 From: Basavaraj Natikar To: , , CC: Basavaraj Natikar Subject: [PATCH 3/7] HID: amd_sfh: Fix illuminance value Date: Tue, 11 Apr 2023 21:40:26 +0530 Message-ID: <20230411161030.909350-4-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230411161030.909350-1-Basavaraj.Natikar@amd.com> References: <20230411161030.909350-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT024:EE_|SJ0PR12MB5633:EE_ X-MS-Office365-Filtering-Correlation-Id: 71fa3b6e-7943-4f43-f9c0-08db3aa7662b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QfBvdMGslrGGmmwHeZLAVGXN+XtrBEDv6KtgMQ3BBH3gMr5ukL7XvcR2aVC1M1BdvHSjRq5LPB36LHYcyEEACrNfwa1WKD78iWfvWPIIrgn2YCKXXt2TBlg5nxcpJX8CyqYnkCnT9i7vcbxYvo3gBMr6ekuj7QS53rIAJqBz6RLyTGb7imqWPvvsTll5Zoof+pdn6BGKC0jBqvQVks1YWiq5VA0goW/U4XXQCJbqDaJW0Ulv4Qb5F1JU0Gn7RpMSWC7VoB+HQx6kjuSlSKi90Y15exeelECLNhOqlDnPX1FzXSlXA1bUp9abM9DIeylgfYycYhZmFLTlPMZim3hj65aLTFuR+xnT4kivGMyMNQcfZpzkQ+7SHw2KrOCMDtUwi0yngMN4P17Fa1UAfNmFwPLLn96ykEotMOrXmsmaZJ12JhesPZKOfOnC7pKfRodi4i54QE9pQz3zCLS/DKgyMD0c4A3uC/jrpXRkvD7jOY2leBKnqSolY/pRvs542MhnuuJEwah5rtfl7zhPuswFfRjH8MQtI20En7dLooxX3amy4E/GsUKVnkh8QmIyqHS69w966Ec4s7xmVRHlsJzxja217Jmd073obA1yG03C7zpkBjnVC+13tSIaHnye1ED9d/fHfVdxqUfKhHSNi+XHqiblRnEDkZFsqRI7IV09ot7nvp9T3pFMeI/7In7DmHi9R+aJwzVd0YT+PPK0E0iLfNtkE2G5P1R4h7C08Pl7nLU= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(376002)(136003)(346002)(451199021)(46966006)(36840700001)(40470700004)(82310400005)(110136005)(82740400003)(81166007)(356005)(36860700001)(70206006)(8676002)(70586007)(86362001)(478600001)(4326008)(336012)(47076005)(426003)(2616005)(186003)(26005)(16526019)(316002)(41300700001)(36756003)(2906002)(1076003)(83380400001)(7696005)(40460700003)(40480700001)(8936002)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2023 16:11:25.0383 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 71fa3b6e-7943-4f43-f9c0-08db3aa7662b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5633 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Illuminance value is actually 32 bits, but is incorrectly trancated to 16 bits. Hence convert to integer illuminace accordingly to reflect correct values. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c | 2 +- drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c index 0609fea581c9..6f0d332ccf51 100644 --- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c +++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c @@ -218,7 +218,7 @@ static u8 get_input_rep(u8 current_index, int sensor_idx, int report_id, OFFSET_SENSOR_DATA_DEFAULT; memcpy_fromio(&als_data, sensoraddr, sizeof(struct sfh_als_data)); get_common_inputs(&als_input.common_property, report_id); - als_input.illuminance_value = als_data.lux; + als_input.illuminance_value = float_to_int(als_data.lux); report_size = sizeof(als_input); memcpy(input_report, &als_input, sizeof(als_input)); break; diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h index a3e0ec289e3f..9d31d5b510eb 100644 --- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h +++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h @@ -133,7 +133,7 @@ struct sfh_mag_data { struct sfh_als_data { struct sfh_common_data commondata; - u16 lux; + u32 lux; }; struct hpd_status { From patchwork Tue Apr 11 16:10:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 13207854 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80C75C77B6F for ; Tue, 11 Apr 2023 16:14:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231159AbjDKQO3 (ORCPT ); Tue, 11 Apr 2023 12:14:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231143AbjDKQOO (ORCPT ); Tue, 11 Apr 2023 12:14:14 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2042.outbound.protection.outlook.com [40.107.220.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29A6D5B93 for ; Tue, 11 Apr 2023 09:12:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aYR74A3/XckXvXz7ETDiBn8G0bnTCo32tGoXUj3Ns45uQDWPgeFyL3HZ3iDQlexSrwxiGPklN8DV/gLflZmMFfDOU3BLfkoguCZQCcRwLgXOoGweqMNLagL2+rDGSO6UUUiu8421GZ4RD7KQOod0Bt8ipEaHQb6UfDj4DrMXIhgq3q/8N0iO0NC+8IEdyCoqV16+eIIRSzbAzEtLTUVqVWFgcTf6afDINrOQHwBaQuUc+blX9vBx3vpJbRtkulcJujPrKL8/u7kqiH5OUhQ8cNwMLCMIL33quU2LPsQVmeojmCVptLxjSVipIjzFAEXzvJeM1se1YDRAPmKfmjfgMg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RCPdzWiwaIKoQ5dedv+uRdZ+7uqz50edcjeWTAtQACY=; b=W1ezz/bS6JcmQ/3TzfxvG3p/f1Qs5eI5aqvY8WSFPIIlmMYVQg/xPX4Vdcqpwx9pl2Mta2c61ZMYgSqTy4TvQZtN0TvIMyLHwItdsPNTfflChRW936aD4Y7LLBmQkC/x2DGG1hZS0KmgJTaKGJFxeN6bUw38zuhur4ZeuAGiB4z+rbqpEn3AAS3jgGLXYItIVikmOQ5eB7P0MUPLo7Ng3HH1xbIfOXJwPgAbfHrecaXsyXoDUWGi8s+oSw+8s6W4ddF9aNfQqgg6jR1H1eTkbmHSVjoWgrPGi8xLaLqmHisxF0FvrG3eNdP2QLCZ13uICzsWPLQ+HrwLsdLdMwv8/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=RCPdzWiwaIKoQ5dedv+uRdZ+7uqz50edcjeWTAtQACY=; b=xa+FzxvgtPONJGVTfXTvYGas6tKCZboL36ywIV7H+MPwYeZfnZsAl2YwY1hqSxc91r6GVV45twErxG1s93m3n0I7pNWDLYs4xobT1Iucb2UiSqfG4vYppRgYjcMJF0z6qAOJvreyCBmzy0q7KX3XplWg65gUhRNqIHK02YyS0K0= Received: from DM6PR17CA0019.namprd17.prod.outlook.com (2603:10b6:5:1b3::32) by LV2PR12MB5966.namprd12.prod.outlook.com (2603:10b6:408:171::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36; Tue, 11 Apr 2023 16:11:27 +0000 Received: from DM6NAM11FT065.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1b3:cafe::68) by DM6PR17CA0019.outlook.office365.com (2603:10b6:5:1b3::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.34 via Frontend Transport; Tue, 11 Apr 2023 16:11:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT065.mail.protection.outlook.com (10.13.172.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.29 via Frontend Transport; Tue, 11 Apr 2023 16:11:26 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 11 Apr 2023 11:11:24 -0500 From: Basavaraj Natikar To: , , CC: Basavaraj Natikar Subject: [PATCH 4/7] HID: amd_sfh: Add support for shutdown operation Date: Tue, 11 Apr 2023 21:40:27 +0530 Message-ID: <20230411161030.909350-5-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230411161030.909350-1-Basavaraj.Natikar@amd.com> References: <20230411161030.909350-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT065:EE_|LV2PR12MB5966:EE_ X-MS-Office365-Filtering-Correlation-Id: 58765dae-d64c-4dc2-8db0-08db3aa7672f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bGATMyS0a4Ji6GjgT1Q8hFYaldvlnPfQtLHZBaeLAB5QfpaiLluzCSIk3uo7dy6oYxMGaoFK/aPa5wwleZEgSWGGdxRhYGIL2ungcUiXFab75TWGiK2X1DIpUw/6j0pTZK/NRtF0yK4eqvWGcC1Cf6yyfhUUegRG7MMF6glh7hW4zb2ItrdqmQMcbEwE84BxxbZRKuRzYLoA1p8FlY/W1q/kLw0DopUwMHadj3Ns+GcC6hrtAklzdA99nDDtwdYVvxgW8icvKSpctrhh4gSLJUj0Wa1fJaXBGOqKJ8/sh5eVFqfHT4uZoAICP6rFpiAzg/BNl2N0wFo0g9J+jN+LgJaZiRJjPtS0vE2H3Eywiz7johK7ZQiJKnKNexukk8mP3+QNH5yimzJiLeXCjNcDhmQ4bhMGLHMriHH+8wZ+N0dAOZgHvwp9uogkpG5PNN372PFlu97UamS4dVF8MhinqUM/gtO8dtRa+KU8R8V+5ySEh9YlUFxLpU57uByWg5OveQriR1YnY9cGi7MmO+EUpQyaG4gPEZaWHfiXSHHHS0jB3PSd48JulwRZJMz2NMQpqS4BRDJyoKExGIeMBMt1qPE1qjj+cwdBYWGwLJw0/NxAjNjeDc6RoiSPH4SjDBrgJ4uN7v4wDtSsvv8TLaMiomHWGvwxfszgSgi4EakJ8DuePGn4IbO/P7AyAVha1Ub+g7aOrtpMVpyjdd/+UNCqZe5vlpvssllSsN4E7Bw7qqQ= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(346002)(136003)(376002)(451199021)(40470700004)(46966006)(36840700001)(40460700003)(7696005)(8676002)(70206006)(70586007)(478600001)(4326008)(41300700001)(110136005)(316002)(36756003)(86362001)(83380400001)(426003)(336012)(2616005)(26005)(1076003)(47076005)(2906002)(8936002)(82310400005)(40480700001)(5660300002)(36860700001)(81166007)(16526019)(186003)(82740400003)(356005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2023 16:11:26.7395 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 58765dae-d64c-4dc2-8db0-08db3aa7672f X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT065.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5966 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org As soon as the system is booted after shutdown, the sensors may remain in a weird state and fail to initialize. Therefore, all sensors should be turned off during shutdown. Fixes: 4f567b9f8141 ("SFH: PCIe driver to add support of AMD sensor fusion hub") Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c index 47774b9ab3de..c936d6a51c0c 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c @@ -367,6 +367,14 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i return devm_add_action_or_reset(&pdev->dev, privdata->mp2_ops->remove, privdata); } +static void amd_sfh_shutdown(struct pci_dev *pdev) +{ + struct amd_mp2_dev *mp2 = pci_get_drvdata(pdev); + + if (mp2 && mp2->mp2_ops) + mp2->mp2_ops->stop_all(mp2); +} + static int __maybe_unused amd_mp2_pci_resume(struct device *dev) { struct amd_mp2_dev *mp2 = dev_get_drvdata(dev); @@ -401,6 +409,7 @@ static struct pci_driver amd_mp2_pci_driver = { .id_table = amd_mp2_pci_tbl, .probe = amd_mp2_pci_probe, .driver.pm = &amd_mp2_pm_ops, + .shutdown = amd_sfh_shutdown, }; module_pci_driver(amd_mp2_pci_driver); From patchwork Tue Apr 11 16:10:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 13207853 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 098CAC77B73 for ; Tue, 11 Apr 2023 16:14:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231154AbjDKQO1 (ORCPT ); Tue, 11 Apr 2023 12:14:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231307AbjDKQOM (ORCPT ); Tue, 11 Apr 2023 12:14:12 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2047.outbound.protection.outlook.com [40.107.101.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1261F7D99 for ; Tue, 11 Apr 2023 09:11:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DRy9ZW0VJM+AC0J7O5yvuiALlf0wvqV8DYJcvLmDLMYkySw/+TXD0YvB+Uo5PIPqgkwafqR7YZQ5AcrdA6wiRM8QNyQyPSpIDxlk8OwIu2NQiM8k0laXInosCLGxDtcxd5lGy5nMeJ+DFSrB8f+WCTgzWzx3H7yUdn+4lcVkeW3/gp1P0M4omj8N+DGfOHPizKWU3GPBhA/UTAzDKR2OLGnUdLQdKES2/aN0Fud6SSEMnevlSAbGS4Aljm0aL2IwrApJjP0qeF+Pq4QXpxGtLnq8gluqCFrX2m7Ibk0drZGceLF1NZaFzZq6O3pXx4nkRgCLtYDSR96z6I2QBrHjOg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=liE4yvPQ9sg2cjzdBiA7mTr1UHcTayWGmVX1GYuBClw=; b=caC0pHLsLqzxsxG6t4rK/lveY6MEdqjd+ezUpjsbvmj8rmUlWb071IlvRcoB+WY9tWQkqtU0Mj/v6Pig+e8vZNt3bakURNCSEPEN5BDOh2pqKPN2KB6kavop7tVMXx51I5S+MSYVt7ud4kqFKvi93lXkCS/Infd4RQn1ZK6y7A3Ok5lHaCq9xmlzVAQMqw/wgTqEnMuixXmk4QWi/iLQxQRhGrB8X+6J/WAWeZAGSgvNybRDS1QqaNiv0IN/gAGSNWvM2NHHc5pMOQvrgfM7hItYhKOUAHD51KLspnJV1LSeTUKmzHWUgI/sIW7XLpizPVMMK/OyGpf8Sh7t5+tLuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=liE4yvPQ9sg2cjzdBiA7mTr1UHcTayWGmVX1GYuBClw=; b=k+7BhUSlAVNM+/FnJxx2RVn5ydcqO2etgScZ7LbaXeJuHyN5cS6Se7Y558QOQCv33xSl9MRQBEObO97zWajUVSdcbjBgmWje/PaQnX0mB3Pl2XaBp06iPQgU3rqUfBFRGgrcAT+HPlYS75iEMcA9L3wjyVzHXc6tOl5uHam0RSs= Received: from DM6PR04CA0017.namprd04.prod.outlook.com (2603:10b6:5:334::22) by DM6PR12MB4467.namprd12.prod.outlook.com (2603:10b6:5:2a8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Tue, 11 Apr 2023 16:11:29 +0000 Received: from DM6NAM11FT054.eop-nam11.prod.protection.outlook.com (2603:10b6:5:334:cafe::e6) by DM6PR04CA0017.outlook.office365.com (2603:10b6:5:334::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38 via Frontend Transport; Tue, 11 Apr 2023 16:11:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT054.mail.protection.outlook.com (10.13.173.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.28 via Frontend Transport; Tue, 11 Apr 2023 16:11:28 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 11 Apr 2023 11:11:26 -0500 From: Basavaraj Natikar To: , , CC: Basavaraj Natikar Subject: [PATCH 5/7] HID: amd_sfh: Correct the stop all command Date: Tue, 11 Apr 2023 21:40:28 +0530 Message-ID: <20230411161030.909350-6-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230411161030.909350-1-Basavaraj.Natikar@amd.com> References: <20230411161030.909350-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT054:EE_|DM6PR12MB4467:EE_ X-MS-Office365-Filtering-Correlation-Id: c053be66-6e45-4cd9-433b-08db3aa76836 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vj+gcEuI2lTQlEdzjuhtD0PtkPCYrZbGXvUqRVO2aAf5KwIR6FNHPdUfQgiuSDZz7qjgGmpJe9L40lwb2JVqSGGQIiU38FSEnUOq65FSZw1320+LtPLb049iH9yHBzmeRTtq5HzqAB6EP8sLJOs2oK2J8tsxpgMxhUbitfNHoR4Mwa+ZrjH7AP2UVmuv+lepi7tQ8bJHNvVbYGhBwU8Rli2QFJQovRydBszHP9MJv8g/uyfKrWkTj7EEgl/GEwjqcV1UaroO8mxpJPfEYkl0h+3GozDHsFZVcFq9Y+bybz+nMbypEWn7VR95ayKXwu96ZIfr5fb+n6vNk+/0cNNFwGoiNB/pM14+qsH8KP8MnoUUDgNGUhwAw3SK28z2ZL3uvoJTedeMkUbH4Y36dTx7ZkDIMguNvjpuhIS407m9gsIlzEBs6NUJpgeyzkt3caOA2yRVazueVe7027o5AYyUG3SQHiZmH98L/T+cZLZpxK8NsmtZsAhjVaWIUJTavUZtOV1B1qKbOLMhpVKCIOYGkcCwcL/+hGoc5IMtL3ZeE2L8j3/1IfxfDFGDBZh9+mFRCJyvTlYirU4e9iIYYZ0nCxGErxi4Ml27rYdEfYQTwq+5Xa3HXFjnFifB9fPGri6lLIXeIUGoq8cDBZyZV/L/WE5cBEsWyf7MMTShaGu83KFb38Kf5YAFHTsK9A9ATu7K8gs0cZe0lgp5Ovn2CtP0eGAef1mJW6WyMCPSOcuEYxw= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(136003)(396003)(346002)(451199021)(40470700004)(46966006)(36840700001)(83380400001)(36756003)(36860700001)(5660300002)(110136005)(41300700001)(47076005)(316002)(82740400003)(478600001)(8936002)(356005)(81166007)(2616005)(186003)(16526019)(70206006)(70586007)(86362001)(4326008)(2906002)(8676002)(7696005)(40460700003)(26005)(82310400005)(336012)(426003)(1076003)(40480700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2023 16:11:28.4612 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c053be66-6e45-4cd9-433b-08db3aa76836 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT054.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4467 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Misinterpreted the stop all command in SHF1.1 firmware. Therefore, it is necessary to update the stop all command accordingly to disable all sensors. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c index 6e19ccc12450..6f6047f7f12e 100644 --- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c +++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c @@ -58,8 +58,10 @@ static void amd_stop_all_sensor(struct amd_mp2_dev *privdata) struct sfh_cmd_base cmd_base; cmd_base.ul = 0; - cmd_base.cmd.cmd_id = STOP_ALL_SENSORS; + cmd_base.cmd.cmd_id = DISABLE_SENSOR; cmd_base.cmd.intr_disable = 0; + /* 0xf indicates all sensors */ + cmd_base.cmd.sensor_id = 0xf; writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG(0)); } From patchwork Tue Apr 11 16:10:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 13207852 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18367C76196 for ; Tue, 11 Apr 2023 16:14:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230017AbjDKQO1 (ORCPT ); Tue, 11 Apr 2023 12:14:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231326AbjDKQOM (ORCPT ); Tue, 11 Apr 2023 12:14:12 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2077.outbound.protection.outlook.com [40.107.244.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50E637DB9 for ; Tue, 11 Apr 2023 09:11:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oR+V9sp5tLStdMF3IlLe0yeBFYQ/IGye32dq5pzpl1BkG4dRHL3SiNcySD4R1ppaGsXk90yi4Fx5iWcHchUQzvv16JuN/S3CEi+cf//PTC7SUDxzPuMvfAltPEAUV8z12FiTP/PTaAIfy6Ej8Uog+PAsq4mdu2TztmuJ0ZhOyjukNFlABpadKP+3FC09cUg7m2a0lqliuia1dc954HdQntBkwM6bft1zMVhToWTs2lhOx9gLi0vyAQ9HquLbdI4ItL4X+rSIi1ePhs1YiCRg14okhP62za276/I+ARaye2MkJTU5DkFp60iAHWPgOGyAcyHwM4n2EtScHIzbMrVXOQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1/ZR0rzUOGijyjY/5dCl25yg6J1YZcZ76HnP+s/fN9g=; b=I59VvkhmMW9drzp5vwriVMYSn1VtqvotmRGp8ifDT59ANuEnnoEljQAqlAaiDIwkZF7iqpqIFmmB7sKRJt+0oXrUOjkdCckdA5H0AJcBl9FL+uQl0y2hjBCFhhHuU7YCCcb0M/vFz9sS0sJLZv/ydRnu3hZuQakkWhRqbDvdFMOIdI0yxYInCYKrZAPhtx7QnH+qFE6dSPH/ZrG2JVOUFGf9GiW2byGwiuF8PdVNUOZM1/gdrmXbMmmFW2CJ7ExVQD+sWzyv/gS0XEbZo0CEYiYlTJj2vuG8apo/AZ6aoZiw5JA4ypBPmWYZ7tlgMOmnXGo1TLV67jfIu4ywMGodcg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=1/ZR0rzUOGijyjY/5dCl25yg6J1YZcZ76HnP+s/fN9g=; b=TUtyZDAMMdffrR9yW9YzzdBuCca0GdS8kyybTLaqrYtgvbR0lyKrhNJXfc7z9L6eGGFmCK1y0qf6oChVlUKzF4e9q2RfwLoYlvsLU8+H2wsTyXFq5bk3ygqcijXfykC/o9mi+mHw+pv9CznYaSFKo+u06NXLeeoQFYo1PTw0DPg= Received: from DM6PR04CA0028.namprd04.prod.outlook.com (2603:10b6:5:334::33) by CY5PR12MB6549.namprd12.prod.outlook.com (2603:10b6:930:43::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Tue, 11 Apr 2023 16:11:30 +0000 Received: from DM6NAM11FT054.eop-nam11.prod.protection.outlook.com (2603:10b6:5:334:cafe::4a) by DM6PR04CA0028.outlook.office365.com (2603:10b6:5:334::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38 via Frontend Transport; Tue, 11 Apr 2023 16:11:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT054.mail.protection.outlook.com (10.13.173.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.28 via Frontend Transport; Tue, 11 Apr 2023 16:11:30 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 11 Apr 2023 11:11:28 -0500 From: Basavaraj Natikar To: , , CC: Basavaraj Natikar Subject: [PATCH 6/7] HID: amd_sfh: Increase sensor command timeout for SFH1.1 Date: Tue, 11 Apr 2023 21:40:29 +0530 Message-ID: <20230411161030.909350-7-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230411161030.909350-1-Basavaraj.Natikar@amd.com> References: <20230411161030.909350-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT054:EE_|CY5PR12MB6549:EE_ X-MS-Office365-Filtering-Correlation-Id: 74876982-31b3-4d8c-bbb7-08db3aa76937 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UpghNTIJBZ3hITJubOFNplZozLs5jj4/izUWdtl2xV4ueN9kQYXBAimLwdn2exraM2RSZr9zFUJeROKsf32DFCZ6A0rgqlC8xpg2ZiSRK0n9/xE8+SVOkpgKS9iSmbmuiDxkPhar9lNP754ZNi8p2lWQsoPWNBhSe85VK+1MIyWFDGtNfrA9NEKiWP2E+rc5cOZewPZT99jZ9ufdFMKB/6cKLeku1A1lOh1NewmfNhywruFdmAAlaYj7Db7uSllLbDTVTmPY16kf4XsBZ613fStqAMNjFMsPgdP6ZN3aE1htwuOATe+u+BbT/iVhFRBlmLSSwjoxJNpRbPmn5FNmdbYcR+eaGt/YVillxB/xsJhwj4RfLe9QZ7nSkTgsL/Hlqz009ktfV+hzhFLV1b9hW7qy3Dbh+vZ2Hf3YxYT+UpnBdA749zDPrbkp9W1WQity2djPRXKOOvVKYq7ZrBfi22YdvYrMf1sZmOsdb+HZaDPN/I550BXF5AZCsx4M9M+1wjQ9wUL0h0D44Dzf0TK4uHtrzQcSG7Id5rfil7GGUf0R5ffmrvfzw6y2p5aVrpiJOuYn0dJ5MGHleedQywGE15RDmdkV+rZECJWFh8j1a2SfzRyTfGlJMZjt/IYCKGlPMxNge9z/nmQyhZ6WiVeUQg+siMjl88eWIKzWo5yoaOA0lpspMQo+7HVvhvoG0RPx1hEcfgJSYb1CgXRfamnyf65dgGQF/R15x+Wrh9jSnkE= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(396003)(346002)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(336012)(426003)(1076003)(26005)(82310400005)(2616005)(83380400001)(47076005)(186003)(40460700003)(81166007)(16526019)(2906002)(36756003)(36860700001)(86362001)(5660300002)(7696005)(8676002)(8936002)(110136005)(356005)(41300700001)(316002)(82740400003)(70206006)(478600001)(40480700001)(70586007)(4326008)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2023 16:11:30.1485 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 74876982-31b3-4d8c-bbb7-08db3aa76937 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT054.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6549 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The initialization of SFH1.1 sensors may take some time. Hence, increase sensor command timeouts in order to obtain status responses within a maximum timeout. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c index 6f6047f7f12e..4f81ef2d4f56 100644 --- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c +++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c @@ -16,11 +16,11 @@ static int amd_sfh_wait_response(struct amd_mp2_dev *mp2, u8 sid, u32 cmd_id) { struct sfh_cmd_response cmd_resp; - /* Get response with status within a max of 1600 ms timeout */ + /* Get response with status within a max of 10000 ms timeout */ if (!readl_poll_timeout(mp2->mmio + AMD_P2C_MSG(0), cmd_resp.resp, (cmd_resp.response.response == 0 && cmd_resp.response.cmd_id == cmd_id && (sid == 0xff || - cmd_resp.response.sensor_id == sid)), 500, 1600000)) + cmd_resp.response.sensor_id == sid)), 500, 10000000)) return cmd_resp.response.response; return -1; From patchwork Tue Apr 11 16:10:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 13207855 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D87DC76196 for ; Tue, 11 Apr 2023 16:14:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231214AbjDKQOi (ORCPT ); Tue, 11 Apr 2023 12:14:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230146AbjDKQOS (ORCPT ); Tue, 11 Apr 2023 12:14:18 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2065.outbound.protection.outlook.com [40.107.244.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED4E983D5 for ; Tue, 11 Apr 2023 09:12:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mnOOPlBnijmaRX4dB8jwB0JaiwIsDBIUiqpeHrkaijVZKM4+yOFZGk4QWOApPAW3Hv3HFYZ8bGPmhTfrF+UhaQTHlX0IUDIQxEerH+pNqaduk1v1JECWLuFGfjv5HjyEQyWDwq8XQjKuitMqxqqP73PNsaizK0xe5xouckhWH/EF6f5pLOSYBMvZ8iQWsI8IHZNc9fR55qZ6APqjrQzRCW6q1+TNKmJ8erE5kxuLTNBMZ5FeH/oL4KKkeXIRMMsKItzpMGQ3hEHdTHuUAr6vnOoftFhJFyiRQw+QDIMDZApmGMC00UWBr42BZXZ18S0CGY3wLPhuVl20cDTHGrLqpQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YXb9oo1wk5j10gj0Pfl1rAlJ1gQvZjEP2dCWcQ4s2LI=; b=iY+fFIyAN97shCg2L66Wdf0S9uaOv8FANsa65oTBhNLwRPjAlhEpd0i+dGL3+E30+MEbpyB7m1+kuThgFQSMex3oS2MsxnHXG1nZRO+ebKHx4CqB9mKXjgJ67x0+mnzDV2Mh86Fi7hYeT2ZTMiQc8XujIVOgIv39qfdErVcpL5ZMBozoEoTupyNa6LLvNWAxxjmI+Xy1o+6BoXg4hlRnBRSoadFeTUgjupS5YIb6Jzm/B6J9J/NMSRwlNsMe8QWJS2QnxOKnbtARGec6svk2UW5juSVcmoyFpkNl7SXj3hK2nQbN11wAnzB/0XdEQEK/aiB9+hcBdhcUDJEIMJb0ww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=YXb9oo1wk5j10gj0Pfl1rAlJ1gQvZjEP2dCWcQ4s2LI=; b=UlgHHGtIeSpp2ANGAwwrqsKapAin8WFCTMmqKejWGZpM7mFvFqq3buNPnRjrQIxM2AvJpDqtc2jrDhtoYP3XPm0wVhXvH1hoksNIGNpJEn5it48mvbJ1skNnJmo6OLNoDZC6LImLTY6DTDiEFNJDhbEiJsRjJMsfzKYGMWH+RGk= Received: from DM6PR04CA0013.namprd04.prod.outlook.com (2603:10b6:5:334::18) by CO6PR12MB5425.namprd12.prod.outlook.com (2603:10b6:303:13e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.33; Tue, 11 Apr 2023 16:11:32 +0000 Received: from DM6NAM11FT054.eop-nam11.prod.protection.outlook.com (2603:10b6:5:334:cafe::d1) by DM6PR04CA0013.outlook.office365.com (2603:10b6:5:334::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38 via Frontend Transport; Tue, 11 Apr 2023 16:11:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT054.mail.protection.outlook.com (10.13.173.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.28 via Frontend Transport; Tue, 11 Apr 2023 16:11:31 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 11 Apr 2023 11:11:29 -0500 From: Basavaraj Natikar To: , , CC: Basavaraj Natikar Subject: [PATCH 7/7] HID: amd_sfh: Handle "no sensors" enabled for SFH1.1 Date: Tue, 11 Apr 2023 21:40:30 +0530 Message-ID: <20230411161030.909350-8-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230411161030.909350-1-Basavaraj.Natikar@amd.com> References: <20230411161030.909350-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT054:EE_|CO6PR12MB5425:EE_ X-MS-Office365-Filtering-Correlation-Id: cbd6f484-f985-4887-967d-08db3aa76a3b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r8tpSbB4Smmlf3gjYlZkTzyhOdyiH6YlmmWiv3fDNT1jN59kIPeOreVCnM68ATX+vLNIknJfU49IN67hj7WbTs1Vv2l9Svvi6RUBXJJy8P/H3B3/Cp4jF9BPvlYAzZnj8uqe169CgQb/VIgHNE/kuMKvfAa3XDoSBNGDy0csYlMpcEnWPxZTAn9DNeo4viOu5soVAGGSqc6mNUESw+KibUFJOMHA2XN4BSvUuCkzrYEcsLdaFEcoQvYnHfhnlR/h7xOplm97KY/qQGFhlCQ42tTO9ZwL4nx+f9e2nvl3reRcanAL4+Rp0jfveuxeLHo8sOV5XY7veFqRcm7c5JEt9PgC5Z6xoGhV4uraoHEhHWcI/fyVB1Z7e5pcXHZC3QeKFJGOkKH4QglIvwP9iOMGBvrVt5C2BGoFIyB9oJ5fRrHjY6efYk+0rdLQCAGQIy+LQ+LQpW4qqpzlRTnQ7SZrZW+HbjkoqHtWEqnAp24gj9pGDXZgRkDJdeTZnxt5LO0qgag0tjm2hZ9vFlcXke1mYnqJB5FGCRbmNOAh6V5YJPA5dF0RD5SAP4qZaLX8n0COGhfvtzwrqwVjUKVdhxVOhr9S6tLEE4j1OGGOAYoHMPcl2idCWXXPeFJB/vgxZkS/rca64mvO/6G/EaCKePKgftW8ywdKy0Rsika1BRDIEy8/DdrX1zYbld7+uv8VpM2MA/zXzN4I/vJM1AHMyDPmUuE4Uq+mwiMppEZu+lz+aew= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(396003)(376002)(136003)(451199021)(40470700004)(36840700001)(46966006)(316002)(40480700001)(81166007)(6666004)(36756003)(41300700001)(82310400005)(8936002)(47076005)(40460700003)(110136005)(7696005)(83380400001)(86362001)(36860700001)(2616005)(16526019)(186003)(336012)(426003)(26005)(82740400003)(356005)(5660300002)(1076003)(70206006)(70586007)(478600001)(4326008)(8676002)(2906002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2023 16:11:31.8515 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cbd6f484-f985-4887-967d-08db3aa76a3b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT054.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5425 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Based on num_hid_devices, each sensor device is initialized. If "no sensors" is initialized, amd_sfh work initialization and scheduling doesn’t make sense and returns EOPNOTSUPP to stop driver probe. Hence, add a check for "no sensors" enabled to handle the special case. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c index a1d6e08fab7d..bb8bd7892b67 100644 --- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c +++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c @@ -112,6 +112,7 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata) cl_data->num_hid_devices = amd_sfh_get_sensor_num(privdata, &cl_data->sensor_idx[0]); if (cl_data->num_hid_devices == 0) return -ENODEV; + cl_data->is_any_sensor_enabled = false; INIT_DELAYED_WORK(&cl_data->work, amd_sfh_work); INIT_DELAYED_WORK(&cl_data->work_buffer, amd_sfh_work_buffer); @@ -170,6 +171,7 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata) status = (status == 0) ? SENSOR_ENABLED : SENSOR_DISABLED; if (status == SENSOR_ENABLED) { + cl_data->is_any_sensor_enabled = true; cl_data->sensor_sts[i] = SENSOR_ENABLED; rc = amdtp_hid_probe(i, cl_data); if (rc) { @@ -186,12 +188,21 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata) cl_data->sensor_sts[i]); goto cleanup; } + } else { + cl_data->sensor_sts[i] = SENSOR_DISABLED; } dev_dbg(dev, "sid 0x%x (%s) status 0x%x\n", cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), cl_data->sensor_sts[i]); } + if (!cl_data->is_any_sensor_enabled) { + dev_warn(dev, "Failed to discover, sensors not enabled is %d\n", + cl_data->is_any_sensor_enabled); + rc = -EOPNOTSUPP; + goto cleanup; + } + schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP)); return 0;