From patchwork Tue May 9 06:58:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 680407 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 26A2BC7EE2D for ; Tue, 9 May 2023 07:00:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235142AbjEIHAC (ORCPT ); Tue, 9 May 2023 03:00:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235140AbjEIG7m (ORCPT ); Tue, 9 May 2023 02:59:42 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20604.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaa::604]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B896187 for ; Mon, 8 May 2023 23:59:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QhW5pHUht5roX6hMuazUR/r3KmECBcUzNR1K2azEf/dgnWBzn1hNM1uY5wochNh1ZCKKbLjfaEaIJY/MxKHXfFl2Ouko2iswhw/YN+ZEoLVEJmE6VBd3xG42GJjS81fx9mNhwxbyFWBzzZn/nYlbUJjzeBzV8dgU1zw/JG7JT//lEZW5d7zYNg1UbzsRqUa5zTX6y+r1KHsvP/pNT3m54WxMcMQV99qo/T/fIIFzaoLbGdV9eCj2IHN129AlRJSV7Qkfx6HXqepnkfeaHHXcW2cIgxQd0YSbc+YZkAZGEMJylKjaJyIlzj8jMbk8Zb95YjW+Eq3XNAwEUGAWnYLbWA== 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=wxfaxF6tIBXhpeLPJkS6zlj3HKNnd1hkcf2hhIfGHZo=; b=M4zZAEn4J8PuJfS7RWCpuDNDYzHbAjxiMDQNd30rUF9X5lpBCiTTPJYhZV6J6ghLsBydta/j9Z6cTnTbSNx4tIOmOZI08eVAPQYJoM2jTCMouc4yDwCO3CBrkOUxHgkBf8+CSftN9mFEE8gIHQ4imeojAvP3kGssUq1xNBeTFXopIbpPykFtzvIfs8ay3W6oBnxIK7Gb1qtkICykH9O+/j8Wg7hDgVt+zkREjTTV4qIzPR50w9JSIeGYsCBHaF4tvSOuBqiOqH8odSMpl7z1JHU55ZhIK38pkJYVMk/J1ZbWO0PBraC9avoj0MsGTgcG1dKNI6aWP+09uUWo9HPhOw== 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=wxfaxF6tIBXhpeLPJkS6zlj3HKNnd1hkcf2hhIfGHZo=; b=U8AxAtqc21tIPHdTb28vCvgqS4a1QzPkd3HeyDWzvA8XNzSmXHaR0qQ9OCdSgGBnfke7olS4E6RfC+jkekW4HACkGjl85msl0G6RubTcmKuOHcIGzFQym44Gn5nJ3JAr6dKP2ZQLaTWi2a5MDy+WDzveneT7pKLgJz9Rf2yRsLM= Received: from MW4PR03CA0115.namprd03.prod.outlook.com (2603:10b6:303:b7::30) by DM6PR12MB4944.namprd12.prod.outlook.com (2603:10b6:5:1ba::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.32; Tue, 9 May 2023 06:59:34 +0000 Received: from CO1NAM11FT116.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b7:cafe::7f) by MW4PR03CA0115.outlook.office365.com (2603:10b6:303:b7::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.32 via Frontend Transport; Tue, 9 May 2023 06:59:33 +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 CO1NAM11FT116.mail.protection.outlook.com (10.13.174.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6363.33 via Frontend Transport; Tue, 9 May 2023 06:59:33 +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, 9 May 2023 01:59:30 -0500 From: Basavaraj Natikar To: , , CC: Basavaraj Natikar Subject: [PATCH 1/5] HID: amd_sfh: Remove unnecessary log Date: Tue, 9 May 2023 12:28:53 +0530 Message-ID: <20230509065857.4170013-2-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230509065857.4170013-1-Basavaraj.Natikar@amd.com> References: <20230509065857.4170013-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: CO1NAM11FT116:EE_|DM6PR12MB4944:EE_ X-MS-Office365-Filtering-Correlation-Id: 1643886f-4ad7-46ee-13e9-08db505af1e4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c4VyNeb7eQXXMgpeb7ScvD27EUJ9mfZ20KiQ9XR4vv7u7xZubJ00de35+jyenGUfVCAek5RYoBHQYi4dkXFzruC7pATVdxEPkkMckhsv6s74Spo0AcGAQRxYjKZ3L3eiW83md6KHylnVz73NzvREByKr4IqFFS6hpeNumTNmjS0oHcrqcbjg9k4Qx/9kRnRYIt/Nwxhh0FttGy3uDXrwZbcSZoEhK0f2SdmZb6Qd/cXa6w7ahnfkb8ByHiU9ezqzKyxsUkfAuREsy4L+Ox3+GbwKG3pme9Cj5JnDKGWhiStfvaDIPn3CNS/fFqAtp/vXquZKhvKJ0tJjmVzhaQLxIEneGWKG1WwN0Hdv53//yNeO7xABwZVfnJZVOwVNZhGmPnHobFSZ5YJFURMWV4VC6OG8+qAkIiDbEounzHuKpmw0TXm5tHKOCqxlifQpu/UaA6HbzLeXowg+Wm2jq1QhpRZ+iSnO1cbHO2cuXiTwke8ysmi57vhiqk7pKOQyCX18oC3K2Z9+WSF4IIUpvLH6ToB9JIQ5TIgeKrAV0PekBLJYlFqeaD611EpY2CDr2zY8NvgtEFdTTCgzt44zuOQFzFk58KUEueOKXeU5www1hF75LoS+WKL16iL4YggDg62soBWJgZF5ZCsT8dM6hOb8gfW6+eYLjrHEIBBdI2666J0l58ci7VBIoexFZzFwtLHVnb/XJDFtSgano7pHU/mq9LnD2+aL4rMHzrHwH1ANDEE= 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)(136003)(376002)(396003)(39860400002)(346002)(451199021)(46966006)(40470700004)(36840700001)(4744005)(4326008)(2906002)(8936002)(478600001)(316002)(5660300002)(8676002)(41300700001)(16526019)(110136005)(6666004)(70586007)(70206006)(7696005)(1076003)(26005)(186003)(82740400003)(47076005)(40460700003)(2616005)(36756003)(36860700001)(426003)(336012)(83380400001)(40480700001)(82310400005)(86362001)(356005)(81166007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2023 06:59:33.7186 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1643886f-4ad7-46ee-13e9-08db505af1e4 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: CO1NAM11FT116.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4944 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org There is a duplicate log message that is not necessary. Hence remove unnecessary log message. Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/amd_sfh_client.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_client.c b/drivers/hid/amd-sfh-hid/amd_sfh_client.c index d9b7b01900b5..7e4a3b6c0ac7 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_client.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_client.c @@ -306,10 +306,6 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata) } } 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]); } dev_dbg(dev, "sid 0x%x (%s) status 0x%x\n", cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), From patchwork Tue May 9 06:58:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 680772 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 166C3C7EE22 for ; Tue, 9 May 2023 07:00:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235137AbjEIHAB (ORCPT ); Tue, 9 May 2023 03:00:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235142AbjEIG7m (ORCPT ); Tue, 9 May 2023 02:59:42 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2086.outbound.protection.outlook.com [40.107.95.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC1BE46BD for ; Mon, 8 May 2023 23:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FRIS+eVlCCt3O/eIzDyjpOyabps/AHQe/DVbwkKUS/7Y9puwgw7b0MvbRvrsTXOMZbRmtjYjjM5NWDEUMqHyvVZyIAz6Pz5ju6RTpMINWPTNO4w1C1ldDuegkKNXmqlARxEqGbyhAQv2cale+fzbnoQrsNcqv5vPZVvf182L9psPmU3Li0tSgZjZftbng7En8ZcVL8krPe3QRSLwoVSDeV9jKQqhh5cUOUZd4Ad1VDKUFL/G3Byu2sfF0OiRqg6G+J9en86Szs9AM+07tYzHtdT+4kXtXhc1qOnhWC1cn7peqSan3/LgW+p7hHhwnad+6CmI/jWLDINAgBHWPWFOKg== 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=2Lmi5JARoAQL7a/JrrgY/E0dWjzJqtY06aEmPlI7ejg=; b=AkBQHI9iif5/ZSYb1E1g68lVzdFMjV6ySz2mtOO2Oib56+IRQGIX1iRJaPEOO6/WTqvyt1beMfZCYdB8NcpeGB4jhqqlJ10vR71LxdU8TwZPKzPIA4IEKhcwJcimgF51kQ0sMb6gtfO9qoRYdET5LRSV7/TBPgskojubaDH8E7I/ZZTYtAxOoyfD+izDrxY1PY6/RxbC7vl9c7FYhtMqRkvt59+DV6onkVuR4bRKP8GWN23pamSDIJxBEv0J0cNKWsmq994QKSQAQ3BxcUJjm8Pl1Sxf8iNoE8PPQOpCdTM5JKLnZ5bgqQO2NQ4D3X59N6NsWK1umHI5NPh2CVYtFA== 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=2Lmi5JARoAQL7a/JrrgY/E0dWjzJqtY06aEmPlI7ejg=; b=ToptLyImEF9L33hPuEl3FCBXYte53zcOU0i+U+zCRviPfp7htSfs7oVEEYGRGJ6QPERkaCXVTB7WTHncsFE7agDfdAYn07W0aEllXOAJYNsZjJzijtZx1MapvJvTZGaqjMbjWkM9mub2kd2JftTQa/k75tap1N1g+UIfM1JIwNg= Received: from MW4PR03CA0116.namprd03.prod.outlook.com (2603:10b6:303:b7::31) by SJ2PR12MB8650.namprd12.prod.outlook.com (2603:10b6:a03:544::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.32; Tue, 9 May 2023 06:59:36 +0000 Received: from CO1NAM11FT116.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b7:cafe::51) by MW4PR03CA0116.outlook.office365.com (2603:10b6:303:b7::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33 via Frontend Transport; Tue, 9 May 2023 06:59:36 +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 CO1NAM11FT116.mail.protection.outlook.com (10.13.174.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6363.33 via Frontend Transport; Tue, 9 May 2023 06:59:36 +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, 9 May 2023 01:59:32 -0500 From: Basavaraj Natikar To: , , CC: Basavaraj Natikar Subject: [PATCH 2/5] HID: amd_sfh: Remove duplicate cleanup Date: Tue, 9 May 2023 12:28:54 +0530 Message-ID: <20230509065857.4170013-3-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230509065857.4170013-1-Basavaraj.Natikar@amd.com> References: <20230509065857.4170013-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: CO1NAM11FT116:EE_|SJ2PR12MB8650:EE_ X-MS-Office365-Filtering-Correlation-Id: 12dcff17-6aaf-4476-e614-08db505af382 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rfT34Pi2GSkYlpusEeGmeZ9rnLz7cOy2CEo7bkWRNt7eHTiudQR4/5fh/sQQpGeg/GsGtPoBhOVnmX0hHw1vrR8ZxGCge8x8ft1D5CubUwMnK9z1Dfoo+IcKAkH+Z3y9o99DUrwAMFdkFpH3AzJ5DgNAo1ISOXjrmZCiPjZODUBd+YQyq//Om9VuPYWQbySnZK0vrO7IP8ePB4m/bOxvNEBMb6Tig1eYjvR//5tQAVpAhbvTyJMLaHVY1ar1219Xw2i2pL/AgVUGyy3zx9ZZzQquDfHhtNlJ3nJDYM4JR+aj6GH59Q3/dt6Z0wqNRzvUWjvn1viVOHiHxecnBKSiK08VhhQa9gLaHTky46hiZQ6OojHA+nh9/Zjdkd2ydMhFz4FX+y732w0lnOVict5xV2TRDfU/jL/OKXJTSYhBYNlV1hTaZnriJmvE3pJa08UGiPcZMmoDu0fIaPRhqUKfw/h+Ik8E6w7q0d9P9urHSzVcv3Tu3edjqHm1GH9SW6VvSOK6Dt+QVvgH/CTSOluMICOWNOyyWLyWOlKKxRqTG5onHRxDtSAPQ7T5FBoNcpXnJ24Bi73NSY4nRwuNcN3V0HmSN9x4zNZWM/TOTWoC6E8dmv61GPj9+t3P+j1Iqz8pBRUOpKpR0cpQkGto28cXIUNvdtFEcFkTlQTXnTo6ucgP7WiUW+X4tMUbci4EzLMubWSqQDJ/4MEMDp5DNIaUT/XXzavmGum89r+HTUWehVE= 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)(39860400002)(346002)(451199021)(46966006)(36840700001)(40470700004)(40460700003)(4326008)(70206006)(316002)(478600001)(70586007)(7696005)(110136005)(86362001)(36756003)(426003)(83380400001)(336012)(47076005)(36860700001)(26005)(1076003)(2616005)(6666004)(2906002)(5660300002)(41300700001)(8936002)(8676002)(82310400005)(40480700001)(81166007)(82740400003)(16526019)(186003)(356005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2023 06:59:36.4371 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 12dcff17-6aaf-4476-e614-08db505af382 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: CO1NAM11FT116.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8650 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org A number of duplicate cleanups are performed that are not necessary. As a result, remove duplicate cleanups and use common cleanup. Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/amd_sfh_client.c | 27 ++++-------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_client.c b/drivers/hid/amd-sfh-hid/amd_sfh_client.c index 7e4a3b6c0ac7..3d62527f87d3 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_client.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_client.c @@ -292,18 +292,8 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata) cl_data->is_any_sensor_enabled = true; cl_data->sensor_sts[i] = SENSOR_ENABLED; rc = amdtp_hid_probe(cl_data->cur_hid_dev, cl_data); - if (rc) { - mp2_ops->stop(privdata, cl_data->sensor_idx[i]); - status = amd_sfh_wait_for_response - (privdata, cl_data->sensor_idx[i], SENSOR_DISABLED); - if (status != SENSOR_ENABLED) - 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 (rc) goto cleanup; - } } else { cl_data->sensor_sts[i] = SENSOR_DISABLED; } @@ -313,25 +303,16 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata) } if (!cl_data->is_any_sensor_enabled || (mp2_ops->discovery_status && mp2_ops->discovery_status(privdata) == 0)) { - amd_sfh_hid_client_deinit(privdata); - for (i = 0; i < cl_data->num_hid_devices; i++) { - devm_kfree(dev, cl_data->feature_report[i]); - devm_kfree(dev, in_data->input_report[i]); - devm_kfree(dev, cl_data->report_descr[i]); - } dev_warn(dev, "Failed to discover, sensors not enabled is %d\n", cl_data->is_any_sensor_enabled); - return -EOPNOTSUPP; + rc = -EOPNOTSUPP; + goto cleanup; } schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP)); return 0; cleanup: + amd_sfh_hid_client_deinit(privdata); for (i = 0; i < cl_data->num_hid_devices; i++) { - if (in_data->sensor_virt_addr[i]) { - dma_free_coherent(&privdata->pdev->dev, 8 * sizeof(int), - in_data->sensor_virt_addr[i], - cl_data->sensor_dma_addr[i]); - } devm_kfree(dev, cl_data->feature_report[i]); devm_kfree(dev, in_data->input_report[i]); devm_kfree(dev, cl_data->report_descr[i]); From patchwork Tue May 9 06:58:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 680406 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 3E793C7EE2C for ; Tue, 9 May 2023 07:00:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235140AbjEIHAE (ORCPT ); Tue, 9 May 2023 03:00:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235148AbjEIG7p (ORCPT ); Tue, 9 May 2023 02:59:45 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2061e.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e83::61e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E4075590 for ; Mon, 8 May 2023 23:59:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T4QPp3pNuBSb5zqHuOqnsKoBe82j+xAps5tafj526okXTLTBptuuZZ/CxJg5SdXjnjoFPJT2Tom5dI3THgobqh12A2kIxL6WZzhEFuzj+IF046aEZO4ZTfrrPCQ8Lsyl5jEarc4B5ht82kidAgU3tP1Js5lvRsgPDCalD18hl2lWE4i8rf3FPA84C2qOlUj8nfpzmG8mUYL58a0HjF9MaP3uOCo8f/PYZwrLmxz0jJSOV+PFUAokerWSxHW/HWyv9KLC85miZLdPG9MTNq+cF7L8f0MXWbJktCZhC50Nwg1JwpIJHMZ2WQFdx9NXYnLxh5QMuAyf/ZuV7bi8V4ne+g== 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=Se7ewAzSsrDpeQrBQGWeA9BKLjeLmieHFZMOT7P2LMQ=; b=jM9KzWWF11TzAhUCDmYgp75ssG1cNWsAG/XqyPCVtibJMO57iXmWbSeKcGBLNG88/jkNi0d1uVpDj0MxUOpIvYtYYSKIk0JbD9+EDdFTmBoGf5LvaTIk56ulqk4fM/CUrROWeKOHJfGVpOq1vj2nqIwWjgwumj5NcOPOtT/lCW3B6GR2AVhlqOYmbGmCT88o+EutI8k5ty5WVD0JyOCdQbUxb1WdyvrSuIxg3h/4P9GLJttQK228oCQnYoVYegrd3SOKctUT/V2M6/LzfiUqVzGUkYRh4nqZaaM3dyqCIQg7SC8jwYYbTqxtBMK9Buh3oFzbCcz27XDDmFOzbCG7Hw== 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=Se7ewAzSsrDpeQrBQGWeA9BKLjeLmieHFZMOT7P2LMQ=; b=v6jz2UWlNu6HVQecD7uI+Y15UvwXpTsPT8YLxsZc+ruOvPm9M8EOwn44FokRkUc54JqHmxAkW1GNnFP7v3Cc/7TSwS7apf6AKex50bBQTNm7sgpcVLbNYtQ4HAvq0/mT1U146dYYsYAMiL90Ctvjz7/ErA3qplHPLpPIEizgmFo= Received: from MW4PR03CA0104.namprd03.prod.outlook.com (2603:10b6:303:b7::19) by DS0PR12MB7536.namprd12.prod.outlook.com (2603:10b6:8:11c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.32; Tue, 9 May 2023 06:59:40 +0000 Received: from CO1NAM11FT116.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b7:cafe::64) by MW4PR03CA0104.outlook.office365.com (2603:10b6:303:b7::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.32 via Frontend Transport; Tue, 9 May 2023 06:59:39 +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 CO1NAM11FT116.mail.protection.outlook.com (10.13.174.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6363.33 via Frontend Transport; Tue, 9 May 2023 06:59:39 +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, 9 May 2023 01:59:33 -0500 From: Basavaraj Natikar To: , , CC: Basavaraj Natikar Subject: [PATCH 3/5] HID: amd_sfh: Split sensor and HID initialization Date: Tue, 9 May 2023 12:28:55 +0530 Message-ID: <20230509065857.4170013-4-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230509065857.4170013-1-Basavaraj.Natikar@amd.com> References: <20230509065857.4170013-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: CO1NAM11FT116:EE_|DS0PR12MB7536:EE_ X-MS-Office365-Filtering-Correlation-Id: 6acca31d-ca11-4cf5-d963-08db505af585 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: I/3Fnukszrj7HjQaZCx5QFgLD6snAj/GmHI3GfUrP6rQUINxxOAXAnVSIWLLGo3spwUzWgcMg3BQfJSLMbl2LsPJEHlG0MpohlNyRdxDFx92e3SdY1ZRD5ot0hlPGJosDMW5as1njRmR/+FDUsGHYzJYHZpKoaWNDPGO0vm1Cb1SoLKVIbK+ou1mjrTMF3H11iYVf8sBM5MDdlE6CMgnMQzB7F4mB1dFPywLlIFVMB3k56ZF/5+HDWdRs6qeKGjFr2zbZs8LBf0ZBZIabCfxNM9xC343OrY3fwFqp/umOnTS0ARhVdsKw/BZKQfqPY+1Si8vfVJzoE2C9d1X0lIVweGo8Q8Yh+d9O/r4wPlrh8xGzzz2VXe/Yt8qQFl+8ayNPJztNKEtafyCRVfP0Zh2ZWXFG6lTs2fpUwInnXX+eN3wCzMJUuGNCD6RssL48OowRvTUURw171gZVLDD98ptJfuPM7ymSoS/Rk9KIHhzI416sIe/h7QUvVNA3+UP0pzd7tUokVLNDW1wXxqXA6sVFCjbVXr92sxN4wekxGn+9uPTxcyVjxh4Yn3bv2O9rrbMX+wHFLzEyy5bNo8Qmuttbg5ziZiLaf2O4xwWsNg80QnmggFE2QLJYeI9Jb/JRFrwHL6+M9UQTsTZD9eaBY6EXacCEfJxUnsu5n+LnUpzNMrZejlbgLtaZk1/T01S33lkbZHgKl5mIyODt7eE3T1zmuZTrKx3xA8BqG2hNQbTK40= 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)(136003)(396003)(376002)(346002)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(2906002)(41300700001)(316002)(478600001)(110136005)(6666004)(70586007)(70206006)(5660300002)(8936002)(4326008)(8676002)(7696005)(40480700001)(1076003)(26005)(336012)(356005)(82740400003)(40460700003)(186003)(16526019)(36860700001)(426003)(83380400001)(2616005)(47076005)(86362001)(82310400005)(36756003)(81166007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2023 06:59:39.8119 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6acca31d-ca11-4cf5-d963-08db505af585 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: CO1NAM11FT116.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7536 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Sensors are enabled independently of HID device initialization. Sensor initialization should be kept separate in this case, while HID devices should be initialized according to the sensor state. Hence split sensor initialization and HID initialization into separate blocks. Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/amd_sfh_client.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_client.c b/drivers/hid/amd-sfh-hid/amd_sfh_client.c index 3d62527f87d3..bdb578e0899f 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_client.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_client.c @@ -215,7 +215,7 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata) struct device *dev; u32 feature_report_size; u32 input_report_size; - int rc, i, status; + int rc, i; u8 cl_idx; req_list = &cl_data->req_list; @@ -286,12 +286,15 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata) if (rc) goto cleanup; mp2_ops->start(privdata, info); - status = amd_sfh_wait_for_response - (privdata, cl_data->sensor_idx[i], SENSOR_ENABLED); - if (status == SENSOR_ENABLED) { + cl_data->sensor_sts[i] = amd_sfh_wait_for_response + (privdata, cl_data->sensor_idx[i], SENSOR_ENABLED); + } + + for (i = 0; i < cl_data->num_hid_devices; i++) { + cl_data->cur_hid_dev = i; + if (cl_data->sensor_sts[i] == SENSOR_ENABLED) { cl_data->is_any_sensor_enabled = true; - cl_data->sensor_sts[i] = SENSOR_ENABLED; - rc = amdtp_hid_probe(cl_data->cur_hid_dev, cl_data); + rc = amdtp_hid_probe(i, cl_data); if (rc) goto cleanup; } else { @@ -301,6 +304,7 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata) 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 || (mp2_ops->discovery_status && mp2_ops->discovery_status(privdata) == 0)) { dev_warn(dev, "Failed to discover, sensors not enabled is %d\n", cl_data->is_any_sensor_enabled); From patchwork Tue May 9 06:58:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 680408 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 A2BE4C77B75 for ; Tue, 9 May 2023 07:00:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235136AbjEIHAA (ORCPT ); Tue, 9 May 2023 03:00:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235144AbjEIG7n (ORCPT ); Tue, 9 May 2023 02:59:43 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2046.outbound.protection.outlook.com [40.107.93.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0F932114 for ; Mon, 8 May 2023 23:59:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l2weda5QCa8xsX1M7LAxzUAKaIjsKKxAVGdaQ5vIwFVDUPl31hvmXhbEj44lk5GxebWN+nlw2gu/Me56hJDWjcS47lQQ84gNEdptdnu2SLLLkZhnFHPkN1zhM5GxsJW0kbl0rMaYD/ES91VmtoVInFvby7bGYmyoebjVCgNGOEB8JdFMQJNAxZwwC2f55P5DOxR7HVuA+4xhmvkHASGLR6f0UBZu9NYLca266SeraD+tpm+DAthVL3RnFoOx0uyYgXssLerongzxhkWYKUWfOv1uZY6jYYqhG52COaJY+c2Pc9lKpxT+E/bBwtAmbUrIy0qxYnpbhlYx4HiB8TOqlQ== 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=xFiWmXP1vZKqkjM3sGLaf3fJTnFrl3kJHULoi246cvA=; b=oD0dc3hhYjp0xKK9QTviEB8Dwnew4rENcejH0A+2c+NHGBcP7DW52nENeZqGJoqT26krsF1dg9+sJ81RRR8XpDu7L2QUlie7/Q2KJulT5BcmPxAIFflea59vJnjlLQjRJNDDkulTsICt/0PpgDQYU/YaHvxq/UCs2jlV1lc7Z5MgLZr9E8fo+pDUAKBVJsUN5F77z5k3u6kB3Qsd+rPHAL3GL84dSI71Pg36FLGAGp/Jpza8VVUHe1CrP/kfuLY/mUUZIkHBNMlqlC9iGcMnPoq1S4oNuOYL4+luVGVh9I+qpElTE8hbOmgJ+zPRwDvoqRocskgF8Z+vF3ShDqceZQ== 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=xFiWmXP1vZKqkjM3sGLaf3fJTnFrl3kJHULoi246cvA=; b=uundcn9f39qj3Xz0hOTO1AACncIo0bU8QMLOsyT+eHC4RJEiG4qEsfnhFh649SQ+oJdfdoJekZdIAXHp0Wrq46Nbum/XiI2/v+jjuv29LDwCOGH3xewRuv+MVI5o8u/K/JUhYytfaLEPLoNxN4g1dOK/dUoH55XbGKRdNJ7HLG4= Received: from MW4PR03CA0031.namprd03.prod.outlook.com (2603:10b6:303:8e::6) by DS0PR12MB7971.namprd12.prod.outlook.com (2603:10b6:8:14e::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Tue, 9 May 2023 06:59:40 +0000 Received: from CO1NAM11FT008.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8e:cafe::c9) by MW4PR03CA0031.outlook.office365.com (2603:10b6:303:8e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.29 via Frontend Transport; Tue, 9 May 2023 06:59:40 +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 CO1NAM11FT008.mail.protection.outlook.com (10.13.175.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6387.18 via Frontend Transport; Tue, 9 May 2023 06:59:39 +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, 9 May 2023 01:59:35 -0500 From: Basavaraj Natikar To: , , CC: Basavaraj Natikar Subject: [PATCH 4/5] HID: amd_sfh: Remove duplicate cleanup for SFH1.1 Date: Tue, 9 May 2023 12:28:56 +0530 Message-ID: <20230509065857.4170013-5-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230509065857.4170013-1-Basavaraj.Natikar@amd.com> References: <20230509065857.4170013-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: CO1NAM11FT008:EE_|DS0PR12MB7971:EE_ X-MS-Office365-Filtering-Correlation-Id: 6baf5221-de4a-4cda-a241-08db505af58d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6ZD72HtQR8A0vGjpfJC9emSepA4whyWQRGeqSzpHzTs4hzkfA+1y2uCrH5WXryEZvBqHtwW2jIcJDX9VEqaP8+CZ7AE6jBbLL4xhyjJl97mgGU84//gcE7R2YVx1JjXmYgShz+llzrA+0XHemRqd5E+fTNpWepCvox8aKbMnaeRKtw3BWdCtM/JtQjHlzO6skcRIA57X2sNfwNl6VgoDbWRD82wKQ8mpioZy8Fun5gb0d5Ita62RncK2bloVaciFHVAFp4qEqEt9L1aTPQPk50AnU6WsxvnRKKWMqy+ilITqtjv9rQmTDp2MNQuxZSCIpOYCFSuMyEcUQ2dhPnZbtSyh4toD2eQQ1ZjzifH3AyQhKp8xMMnFZ6LbfY6/L4K9FGtRbzLtfGBbwSOmKBqdV/7uXbJeP9IYyoTujQGAnda1Cm3MF3gxsw8sD2yFCtwZxJSMYkjRC29U0TDzq7gZ+RbPUbNbIMVWuNWGXB7LpKMnpFjHBrGLzt02VzwnUxJgD5gqcOD0xMFDkK6E5lo03TS8GGt+DgRpgN+9BQZiEbIUmmFbLP8GqtXpYJd/E0cLJ+zEdjeo6bmnjcB9ktkN9I8phV2J9WzCt31H+0X9/uMko/nvTGVVIXLIp1K1SHjpl5alkbFuW7t5KK5XpRDpKmS3ZAaV5ficAOy4mQyJoGLOhEfQP8Velx3OEjJ3pYSoIKZ+ZSGN7DTPVP8Gt0pY41XeXHHvMhWE0oCc23nCul8= 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)(136003)(346002)(376002)(396003)(451199021)(40470700004)(36840700001)(46966006)(81166007)(110136005)(47076005)(316002)(356005)(83380400001)(82740400003)(1076003)(41300700001)(26005)(40480700001)(36860700001)(5660300002)(86362001)(8936002)(82310400005)(8676002)(4326008)(70586007)(70206006)(336012)(426003)(186003)(16526019)(478600001)(36756003)(2616005)(40460700003)(2906002)(6666004)(7696005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2023 06:59:39.8629 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6baf5221-de4a-4cda-a241-08db505af58d 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: CO1NAM11FT008.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7971 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org A duplicate cleanup is performed that is not necessary. As a result, remove duplicate cleanup and use common cleanup. Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) 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 bb8bd7892b67..2102d53bd51f 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 @@ -174,20 +174,8 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata) cl_data->is_any_sensor_enabled = true; cl_data->sensor_sts[i] = SENSOR_ENABLED; rc = amdtp_hid_probe(i, cl_data); - if (rc) { - mp2_ops->stop(privdata, cl_data->sensor_idx[i]); - status = amd_sfh_wait_for_response - (privdata, cl_data->sensor_idx[i], DISABLE_SENSOR); - if (status == 0) - status = SENSOR_DISABLED; - if (status != SENSOR_ENABLED) - 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 (rc) goto cleanup; - } } else { cl_data->sensor_sts[i] = SENSOR_DISABLED; } From patchwork Tue May 9 06:58:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 680771 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 05498C7EE2A for ; Tue, 9 May 2023 07:00:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235138AbjEIHAC (ORCPT ); Tue, 9 May 2023 03:00:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235145AbjEIG7n (ORCPT ); Tue, 9 May 2023 02:59:43 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2077.outbound.protection.outlook.com [40.107.93.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E457F4C31 for ; Mon, 8 May 2023 23:59:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AwyDOox494Mm96Ndp2GZQIV2nYDnTmX/X+IRkoq9iqm3SGQO0Uu5CuUfYKkKuorzp4ktc3ybO3h60Z1IEp9j1STPWEf2CYFggF0Z11iz8tiN/sceWvkhrRQXGUKl+br5fG69UYrDcvK+wqWzMruBacge/4ko0r1iEnecrT4hd+TOzpAQtA0GFBdXuKvouDSUOZl8ywlt2zCBtNwNGhBnXJd2jtB7AsjsugTZSlLYJ5RMqqeXDyMth6uAPf6K8cfWknA7ViFn7cTXZKa6+4HCKVxFm74M52FOhej74kheX1YzS+89mXT1WIegfPQ6WZSFTB+4yfvqG3RsaOS79udMMQ== 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=lVk/N+I4e+gPmh58OSlB1nZZobtv+1Ib22lKzChWlFU=; b=n6ZdwxOlVN8/N0YYLKyiSFVPJnqmsp6JTMHbfaYvbeMAEycwUB+Kj2rmvxtcUCO5F0z0RHbk1f3DKgiQKtQ0FmOb8n1Rwxe/TOjbgIGvHaYfaKryikc16TQVGBFeCTLR2lHzBiYNhAjA9PecihMqQEp17Js76JDS3g44+OYoTUlFmVLr211R+WKD4sYkkDp3sjKK9KXQd2Z1tIc3l943RVHiiqWmsquJSoqsMEMKMeCq+1J5RSexkNMnkWOHNc+AWdLcaQ9QvA/e94iWmiC/NuJyhMUWeUUR1XwfO6sANuAzANNvPuGZXuPbdwfKTR7Y+omJODibYMLKTYztcjAc8g== 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=lVk/N+I4e+gPmh58OSlB1nZZobtv+1Ib22lKzChWlFU=; b=nSlf4nEYIPlCAAXCbQLLTCR7MIckq+YR0Z/OZoRvx4Fk+8MA9/6OtSrK2OCx5UZN6oMSj/uN5FO0TUJaNICCzXLpeydv385RkGoEcw5qs/CKDZ+rrc+lWmogrftpq/lL9z3niBcH49CC8j48dRU2uB5Sn5mYYO73kD8lzY9N/ok= Received: from MW4PR03CA0106.namprd03.prod.outlook.com (2603:10b6:303:b7::21) by DM4PR12MB5866.namprd12.prod.outlook.com (2603:10b6:8:65::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Tue, 9 May 2023 06:59:40 +0000 Received: from CO1NAM11FT116.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b7:cafe::84) by MW4PR03CA0106.outlook.office365.com (2603:10b6:303:b7::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33 via Frontend Transport; Tue, 9 May 2023 06:59:40 +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 CO1NAM11FT116.mail.protection.outlook.com (10.13.174.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6363.33 via Frontend Transport; Tue, 9 May 2023 06:59:40 +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, 9 May 2023 01:59:37 -0500 From: Basavaraj Natikar To: , , CC: Basavaraj Natikar Subject: [PATCH 5/5] HID: amd_sfh: Split sensor and HID initialization for SFH1.1 Date: Tue, 9 May 2023 12:28:57 +0530 Message-ID: <20230509065857.4170013-6-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230509065857.4170013-1-Basavaraj.Natikar@amd.com> References: <20230509065857.4170013-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: CO1NAM11FT116:EE_|DM4PR12MB5866:EE_ X-MS-Office365-Filtering-Correlation-Id: f35a5277-5ede-4785-4a45-08db505af5d9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Hin4UPpzofAlAw6eOJq8+rR1M1uYVxDoP+74nE9f2MmXVhZtZyZMFidESGm1IQkJmgDv52a9rD4H4G5/3aWQhGH1Io1Xv5S67ogBOQaPgU01jxjOu/8+KPvXg2h2nwcrC7/vTxKpkZg4tbtypPFO3b7v4SZyCy9Myv6pFJph0zSAoCGpGSPfEkul3wNS0JE8a8Pn+RYVfv75JTkIZFvq1UhHsNBZJPFMMZkE33QOYpaZ+SxTJoAF8ThOP2lAVMVLpZQ/US4TMhGDJOJKPCd9unC4IcRFWeE3btpbmqAlte+xmPYxPaqsywH9Jcfzjo+jbqxsTLA/UCUXPN2gMLHUxwkvfAVcENWZCkEl22Xpm24Hcfv0OKS87rzhmdnibNaJY61Kj2yuz925wL+wwSZGpvRDUwNGzfPithP5AQqwEdxNyTCND5IWBBFmvymYWY8ZFdJeWDZIxtJ7iWg9Yr1p86CzXKfHooDwJAoHxVRap4KrRvx/jH5a5Xe3SRQlLrDgJ+sOPrfx9mCyXZxSh5oQ/aW+0qGlRHBNSbtDCCPG5HM6Y90wggHqyn7tWx626a8uDpf0i1qRe5GHlhXLsJJNRVaU4AJNj8d8TJDYZlZv97Fq9y0cD438JkJvlLybHTJW2okHe8sGgsKnpvPp15Ga5V4sj3q4kA3IAh53/MnO79PngQwnbNi5HnPGJ4kTaVVzIbR2lFxwf1BSSssGb2MLMsQzA364INfKu8vKccSRArkkeOY0Jaut2zP+fW7xdcv/XZGRyqmrBbGcWXbp7nR/4VjztYeeiJydzr/hH3/24Rk= 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)(346002)(39860400002)(396003)(136003)(451199021)(46966006)(36840700001)(40470700004)(70586007)(70206006)(478600001)(86362001)(110136005)(82310400005)(6666004)(41300700001)(316002)(40460700003)(83380400001)(5660300002)(36756003)(7696005)(4326008)(8676002)(8936002)(81166007)(356005)(82740400003)(26005)(2906002)(1076003)(186003)(16526019)(36860700001)(336012)(426003)(47076005)(2616005)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2023 06:59:40.3587 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f35a5277-5ede-4785-4a45-08db505af5d9 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: CO1NAM11FT116.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5866 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Sensors are enabled independently of HID device initialization. Sensor initialization should be kept separate in this case, while HID devices should be initialized according to the sensor state. Hence split sensor initialization and HID initialization for SFH1.1 into separate blocks. Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 2102d53bd51f..e9c6413af24a 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 @@ -168,16 +168,16 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata) status = amd_sfh_wait_for_response (privdata, cl_data->sensor_idx[i], ENABLE_SENSOR); - status = (status == 0) ? SENSOR_ENABLED : SENSOR_DISABLED; + cl_data->sensor_sts[i] = (status == 0) ? SENSOR_ENABLED : SENSOR_DISABLED; + } - if (status == SENSOR_ENABLED) { + for (i = 0; i < cl_data->num_hid_devices; i++) { + cl_data->cur_hid_dev = i; + if (cl_data->sensor_sts[i] == 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) 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]),