From patchwork Mon May 9 13:20:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 571402 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 855E1C433EF for ; Mon, 9 May 2022 13:21:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235600AbiEINZU (ORCPT ); Mon, 9 May 2022 09:25:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235803AbiEINZC (ORCPT ); Mon, 9 May 2022 09:25:02 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2073.outbound.protection.outlook.com [40.107.243.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A863248E1 for ; Mon, 9 May 2022 06:21:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vv8f24S2/um7ky0UfYWJDWqiozXrLP5vMD2ya1PwiVqPwNMk4M2DysCHVTGb7iB2SjoHNb0F9v2MNMuk812Ba++Z5H2VlNbtL7gBrYd+yKcSIV4c5AKAEHMOGw+Avw5vEPuVMVJAKG5pDgzgmTVdvzWuXDICyWVqbJc20c/bTPXn43Socmvu2cpGyc0LWUoMwcTEC3A8Zo59Ij/+Pay63LWEX3FT2SV3J8ulXz/6QGt4mO55t6PXoNzKVGryRIlLs3VBC0kIsQK5inbu8X1hz2UP+zWC8HquMiErgHkHJDdjtnf10dE0glLgLXiLa1V+/C4yZFNYgGdh4EFuLiNaCg== 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=aeIuqusMrfE7DaUDKeca9rSmdpQk1tZRhJFuE465sS4=; b=Cea2Bz3c9wMe57p8mt4MOpJ5Ve7x07mfrdSKVgXxssDWlgitFjU1wXYMarhHiTh14SiQlPCY/ZsoJO2EwTXxjYlpca6trd8IS8cikqslvvmyCxC/ySG+pdy0aTe8labzVONQUot+nPvxPtFWcTUIe7lOTnUEIlmeQReZAcPNiSwnAiuuUq8WPtWvgKi4R6bPas+3cFWSJ+58nYqw12HnHNwLi1/llNgZx1tYJxs1uDtsR7dtnOrdeEGHDBloiOr6LHvr3SyfElsJZngoYpWQJnxk/nNcWM/rMoQVAUDwH19dh2Wx70SbP2Vc0Zugh90xIvu4dhMvkZ6uarmUp47IwA== 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=aeIuqusMrfE7DaUDKeca9rSmdpQk1tZRhJFuE465sS4=; b=KWy8fq2sR0yW5FnmxUQrO+hhNMMmW7zMoGO54cTlRjG7gnpLuiyVpQaDipWoC0M73eE/zj2998GP2ETSDFxj7K+X/S+5qxnicGo097aVvO/BOhIBRFdnTVxceqygdkJqxtAb/0nG/j25ve80DYWn02JYZHDBSEnL7AvQBDQtKvw= Received: from MW4PR03CA0319.namprd03.prod.outlook.com (2603:10b6:303:dd::24) by DM6PR12MB4861.namprd12.prod.outlook.com (2603:10b6:5:1bd::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.20; Mon, 9 May 2022 13:21:04 +0000 Received: from CO1NAM11FT022.eop-nam11.prod.protection.outlook.com (2603:10b6:303:dd:cafe::64) by MW4PR03CA0319.outlook.office365.com (2603:10b6:303:dd::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.20 via Frontend Transport; Mon, 9 May 2022 13:21:04 +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; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT022.mail.protection.outlook.com (10.13.175.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5227.15 via Frontend Transport; Mon, 9 May 2022 13:21:04 +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.24; Mon, 9 May 2022 08:21:00 -0500 From: Basavaraj Natikar To: , , , CC: , Basavaraj Natikar Subject: [PATCH 1/7] HID: amd_sfh: Add support for sensor discovery Date: Mon, 9 May 2022 18:50:20 +0530 Message-ID: <20220509132026.3204678-2-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220509132026.3204678-1-Basavaraj.Natikar@amd.com> References: <20220509132026.3204678-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 45fcd826-c709-4ca8-6a25-08da31bec4d5 X-MS-TrafficTypeDiagnostic: DM6PR12MB4861:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qVJ7+luownZbWvNmpPkA2qFAR5uwOIhFzHlEBI7aAGxOWGxyjIF8UbzRrQI8GYSKKSAqVyj53GaSQ0+RAK8sF/Ne2ibX9p4dREe5VQSfOrjFTQ71ZIgv3QnTutRIb7zFWpN19Dv7aX7tgD3wKz49qzhkLTFPa1ylVHSd1F0MkhByayKRZVTTDUIPQJ0S1rkKfqAHGu5vxkmsDLGcK9xpSpBK/Xn1ARYQHdktreEa0tPBrrfwP9hj6LHAdER8mkKTxrNbE04l2G6rtpF46tGGYYlY/OSTfO3X1P8LE0e0d+EWm+ndAwYVmwmRyhX08bUM4L7c18v72ga+1uGyYqey5qaWsiwR46EqbDj+p3qRQlq1ECXz6SU6OlJ+G3mRUhju+TjmRpjY2Y7hjUn9IqjeNfLot89V7jzaRJtr8qNt0a7Shkgf51GdyXi1PiUse0dKxVVdRC5ta0d4OO+mrecJypBfloRXMLt4IoILU4d/7KiVUwbr9VmksozotNc6PrH39Qt1TFzlQskrDoCMEO4EIM5N0rF0HD2/w8n0stzRl/ZvQN3jJjhvuEQKUEIUy9H0bItKPwv/h2pl7PrLmhV5ZmWfKe92bHDiB4XhG8gqVtpTLKq3x6AENNzxsceteNuGF5/EG4FPIUdgx0aOY3K65sYHwZIEM2/7CtC0Fy72rwENeX+qiP1XpYdEe8VY8gJBSOTSMK+Sfs7XYoyZafZN6A== 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:(13230001)(4636009)(46966006)(40470700004)(36840700001)(36860700001)(2616005)(40460700003)(26005)(4326008)(8676002)(36756003)(82310400005)(16526019)(1076003)(47076005)(186003)(336012)(426003)(70206006)(70586007)(110136005)(316002)(54906003)(508600001)(5660300002)(86362001)(6666004)(2906002)(7696005)(8936002)(81166007)(83380400001)(356005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2022 13:21:04.0339 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 45fcd826-c709-4ca8-6a25-08da31bec4d5 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: CO1NAM11FT022.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4861 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Sensor discovery status fails in case of broken sensors or platform not supported. Hence disable driver on failure of sensor discovery. Signed-off-by: Mario Limonciello Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/amd_sfh_client.c | 11 +++++++++++ drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 7 +++++++ drivers/hid/amd-sfh-hid/amd_sfh_pcie.h | 4 ++++ 3 files changed, 22 insertions(+) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_client.c b/drivers/hid/amd-sfh-hid/amd_sfh_client.c index c5de0ec4f9d0..444acd9e2cd6 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_client.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_client.c @@ -227,6 +227,17 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata) dev_dbg(dev, "sid 0x%x status 0x%x\n", cl_data->sensor_idx[i], cl_data->sensor_sts[i]); } + if (privdata->mp2_ops->discovery_status && + privdata->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\n"); + return -EOPNOTSUPP; + } schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP)); return 0; diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c index 6b5fd90b0bd1..e18a4efd8839 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c @@ -130,6 +130,12 @@ static int amd_sfh_irq_init_v2(struct amd_mp2_dev *privdata) return 0; } +static int amd_sfh_dis_sts_v2(struct amd_mp2_dev *privdata) +{ + return (readl(privdata->mmio + AMD_P2C_MSG(1)) & + SENSOR_DISCOVERY_STATUS_MASK) >> SENSOR_DISCOVERY_STATUS_SHIFT; +} + void amd_start_sensor(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info info) { union sfh_cmd_param cmd_param; @@ -245,6 +251,7 @@ static const struct amd_mp2_ops amd_sfh_ops_v2 = { .response = amd_sfh_wait_response_v2, .clear_intr = amd_sfh_clear_intr_v2, .init_intr = amd_sfh_irq_init_v2, + .discovery_status = amd_sfh_dis_sts_v2, }; static const struct amd_mp2_ops amd_sfh_ops = { diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h index 97b99861fae2..9aa88a91ac8d 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h @@ -39,6 +39,9 @@ #define AMD_SFH_IDLE_LOOP 200 +#define SENSOR_DISCOVERY_STATUS_MASK GENMASK(5, 3) +#define SENSOR_DISCOVERY_STATUS_SHIFT 3 + /* SFH Command register */ union sfh_cmd_base { u32 ul; @@ -143,5 +146,6 @@ struct amd_mp2_ops { int (*response)(struct amd_mp2_dev *mp2, u8 sid, u32 sensor_sts); void (*clear_intr)(struct amd_mp2_dev *privdata); int (*init_intr)(struct amd_mp2_dev *privdata); + int (*discovery_status)(struct amd_mp2_dev *privdata); }; #endif From patchwork Mon May 9 13:20:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 571148 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 A8543C433FE for ; Mon, 9 May 2022 13:21:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235605AbiEINZN (ORCPT ); Mon, 9 May 2022 09:25:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235747AbiEINZI (ORCPT ); Mon, 9 May 2022 09:25:08 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2045.outbound.protection.outlook.com [40.107.94.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A18827FDB for ; Mon, 9 May 2022 06:21:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GzYpOf0LyCUVGLgJVbrP/cQ1PTlgB3I0nSpD49Xt1i5YqhcUmV/ZkOjEKg0iv+dGBJKs4t4c284bdT6SrICAr4Lyi/0JCepPyzdF6llx4enLufHEmVSgFz2qvkZdJgMn1u71J1fdd0P94L06CvJ7+vX9S7pZxLhMiK8bvCwxLxiiOE/OtywB0+fYD7mr0OI22f9XMshuIalux7o4WCiFQFevHRv7oYPp1RGCG8aXgK+A1bk3kEwsU/d32MChdxHZO1PaKFqD4DPzJfFD/5VrcA4K6OaNZUWP3sNcrXrE/EwSrA/6OxtEkGKoBR5pJuwHFJ2bnmCrioU1YEtK29MDdw== 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=ksmKEJUzTAFJ7VdSfZ9HU7s2dJFlv1OCdmfrRovvyK4=; b=ZazUMB2dfdIOoE0Twn/OywVWMmcZkM+AGXVyrECY4FO+53AApHMNIFNcFlcbtzFHJ2rEb7DhtTj9I5Eh7LVcDGc3vazBaiFP4oJ5Fb1GLqIigp1tgtCzTxqv9timAGQDcNzdDSKzE5bOFSxgLKAubKBdyk2I4LdBBC02e/3pJ6Qkt/+cajix57QhY/Uu8mev/lyER5BXYyX0ZY02N0Ae6vPQLbQoLJkoTCgCJmOYljwd2NqMy8muFEibfHx/L5cGu2PBODo2t+jDRZ3m37ghF1eesEesXa9HVqYHRHT6erVelXgI/YCLx4tVVbx83JyYifFnQbWFm8nBWnhato9ufA== 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=ksmKEJUzTAFJ7VdSfZ9HU7s2dJFlv1OCdmfrRovvyK4=; b=QOqrNlCUoCH+Z4KSS5LdRbvPLQJLU+Mts0QA4qJwYJbvtTQCUcaUIZKGrwA32KuXYC8ZiAlHf1+WFBjGDqPp7tut+nltHzR6R8TZWnQ4dNbW70b/x67k6tOHzjJ8QS89DEAVFn/gtEOOr6Lkt9Noc7i/ADpBJcaZsEg3FqMJZsM= Received: from MW4PR03CA0316.namprd03.prod.outlook.com (2603:10b6:303:dd::21) by DM6PR12MB3401.namprd12.prod.outlook.com (2603:10b6:5:39::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.18; Mon, 9 May 2022 13:21:05 +0000 Received: from CO1NAM11FT022.eop-nam11.prod.protection.outlook.com (2603:10b6:303:dd:cafe::aa) by MW4PR03CA0316.outlook.office365.com (2603:10b6:303:dd::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.20 via Frontend Transport; Mon, 9 May 2022 13:21:05 +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; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT022.mail.protection.outlook.com (10.13.175.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5227.15 via Frontend Transport; Mon, 9 May 2022 13:21:05 +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.24; Mon, 9 May 2022 08:21:02 -0500 From: Basavaraj Natikar To: , , , CC: , Basavaraj Natikar Subject: [PATCH 2/7] HID: amd_sfh: Add sensor name by index for debug info Date: Mon, 9 May 2022 18:50:21 +0530 Message-ID: <20220509132026.3204678-3-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220509132026.3204678-1-Basavaraj.Natikar@amd.com> References: <20220509132026.3204678-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8a385403-7538-4495-0e9a-08da31bec5a0 X-MS-TrafficTypeDiagnostic: DM6PR12MB3401:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Cc2AVj+ebTbDgcREx9Ly7W9/y/LWKNsaoqbRbxH6b4pVhocX7gFfkjfOxDrXFeYbw9KnWJKR2ldSPK+yub2Kg95FV492o8N2j92nnZzTBqo5+j/RvsjfO8TmfRjbVGaRShVaGByoH3C/t2rBkW3Z14mpeX419pSHyo1pOQdxzwNns4Dj4pPtjDtC1BInetAlBorSPX+sOqoAL4jG//q2nRckrDHRJUzFAS17uhdyuznK++3JIynQHbMD9/6nyz1w81Is042kkorwFsQzwlKRcEgJxlxn2/yJNZtptWFjRVtn4fef+TjMJTzHqm5Zgv640AycT0Cl0benDJotsHrDZJ7reo+Gh4mszwxUbOfeMXaLNXnPDh62xPLMSZMVcwxx8/V4+7gdLi2WwNy/oE+N1t/UUOYn8YBVfaO0fyL9V3wxCemw96ud0jlSG+rsnlqaeKZhkZv3k5ovAwrreq0t4iE90tc6RnwmoKjDqfj/CpJjrn+23m5MdVgAjRgBSDINJss/Ch9toPkpGBCPxnRVgrSTsZDQVY7UsOd8HYGjizFagTe7rYyzr3+021KvvYQiLs4gRrJAa7uy21mFP+uyFRHd6KFMHQPfa4orBeOuXIyd6XaIqscwM4kgjViDgdsYO6kVH6qjAuDxlUgMHmfx0SN+qLVK0jUWY9Mb/oJqQIDxmiMrZuzCHSaoixgZmZKMK00To0ElpxzR/Zi1Rvq06Q== 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:(13230001)(4636009)(40470700004)(46966006)(36840700001)(7696005)(47076005)(6666004)(40460700003)(70586007)(26005)(86362001)(426003)(186003)(508600001)(16526019)(336012)(5660300002)(2906002)(8936002)(83380400001)(81166007)(82310400005)(2616005)(36756003)(54906003)(110136005)(356005)(316002)(4326008)(8676002)(36860700001)(70206006)(1076003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2022 13:21:05.3619 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8a385403-7538-4495-0e9a-08da31bec5a0 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: CO1NAM11FT022.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3401 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Adding get sensor name for debug info. This will make debug messages clearer. Signed-off-by: Mario Limonciello Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/amd_sfh_client.c | 34 +++++++++++++++++++----- drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 10 ++++--- drivers/hid/amd-sfh-hid/amd_sfh_pcie.h | 1 + 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_client.c b/drivers/hid/amd-sfh-hid/amd_sfh_client.c index 444acd9e2cd6..0f770a2b47ff 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_client.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_client.c @@ -141,6 +141,24 @@ u32 amd_sfh_wait_for_response(struct amd_mp2_dev *mp2, u8 sid, u32 sensor_sts) return sensor_sts; } +const char *get_sensor_name(int idx) +{ + switch (idx) { + case accel_idx: + return "accelerometer"; + case gyro_idx: + return "gyroscope"; + case mag_idx: + return "magnetometer"; + case als_idx: + return "ALS"; + case HPD_IDX: + return "HPD"; + default: + return "unknown sensor type"; + } +} + int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata) { struct amd_input_data *in_data = &privdata->in_data; @@ -219,13 +237,16 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata) (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 status 0x%x\n", - 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]), + cl_data->sensor_sts[i]); goto cleanup; } } - dev_dbg(dev, "sid 0x%x status 0x%x\n", - 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]), + cl_data->sensor_sts[i]); } if (privdata->mp2_ops->discovery_status && privdata->mp2_ops->discovery_status(privdata) == 0) { @@ -268,8 +289,9 @@ int amd_sfh_hid_client_deinit(struct amd_mp2_dev *privdata) (privdata, cl_data->sensor_idx[i], SENSOR_DISABLED); if (status != SENSOR_ENABLED) cl_data->sensor_sts[i] = SENSOR_DISABLED; - dev_dbg(&privdata->pdev->dev, "stopping sid 0x%x status 0x%x\n", - cl_data->sensor_idx[i], cl_data->sensor_sts[i]); + dev_dbg(&privdata->pdev->dev, "stopping 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]); } } diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c index e18a4efd8839..dadc491bbf6b 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c @@ -353,8 +353,9 @@ static int __maybe_unused amd_mp2_pci_resume(struct device *dev) (mp2, cl_data->sensor_idx[i], SENSOR_ENABLED); if (status == SENSOR_ENABLED) cl_data->sensor_sts[i] = SENSOR_ENABLED; - dev_dbg(dev, "resume sid 0x%x status 0x%x\n", - cl_data->sensor_idx[i], cl_data->sensor_sts[i]); + dev_dbg(dev, "suspend 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]); } } @@ -378,8 +379,9 @@ static int __maybe_unused amd_mp2_pci_suspend(struct device *dev) (mp2, cl_data->sensor_idx[i], SENSOR_DISABLED); if (status != SENSOR_ENABLED) cl_data->sensor_sts[i] = SENSOR_DISABLED; - dev_dbg(dev, "suspend sid 0x%x status 0x%x\n", - cl_data->sensor_idx[i], cl_data->sensor_sts[i]); + dev_dbg(dev, "suspend 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]); } } diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h index 9aa88a91ac8d..8c760526132a 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h @@ -138,6 +138,7 @@ int amd_sfh_hid_client_deinit(struct amd_mp2_dev *privdata); u32 amd_sfh_wait_for_response(struct amd_mp2_dev *mp2, u8 sid, u32 sensor_sts); void amd_mp2_suspend(struct amd_mp2_dev *mp2); void amd_mp2_resume(struct amd_mp2_dev *mp2); +const char *get_sensor_name(int idx); struct amd_mp2_ops { void (*start)(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info info); From patchwork Mon May 9 13:20:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 571147 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 CC1B9C433F5 for ; Mon, 9 May 2022 13:21:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235763AbiEINZQ (ORCPT ); Mon, 9 May 2022 09:25:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235813AbiEINZE (ORCPT ); Mon, 9 May 2022 09:25:04 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2048.outbound.protection.outlook.com [40.107.93.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A3A224945 for ; Mon, 9 May 2022 06:21:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S8SW0qLDbObNESEeMfQQ7lWNwjsIdagwh81ou+aTS7LIUHAHxaUDO2XxZ6xvcGgsa++wJTbtoqVnXGwnm1E6nP54hg3kiD03SuetEscA6/3KAE1LHpce0QPvrjIk5T0a+zYJygUbrnu0Mqbgos+Fuq7sRsb1EM7pZ6NMg5D8xTqAByxwdz6OLqcPhS9J1xoYs/diftsS/1gEGQ0FpjRA1yIk1wUTGqw6Ap1nBnIytYQttOXYx9v3m/vpKNvsLaaB77KEUWUwiHH/Z50g2jV8HdjSmhPy94wKhrl919SoeeNQGna619yxBoLre0fNmQ3qcWkDxXszKhec3BIYtjS46w== 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=rKDmO2kn7YhLtnZH1nLj+hFEruvKiwdM+4E8Q3/iaX4=; b=NdY/tjWYcaJDFivYELDiKs8SSQeNe0o0iVjpNXPkS4Kap9VKncStMjDYjHwzIErHOCdEDoF36/bm5Q2ZC0wsvObGk9MROysQ6PBpXqN/RWkJlPKYV4AnR9XUctXdqfBvLkie4W9SsJpLIt/26NCjN6el0Cp1vXRoLU3X+Nnr9bucGesQu25gkoieNlXheEjPLUnvEPxOppLU05sWMsEOqDwF+yEuMd1T3ZbL2IML6jJoKPWOnf7ccSaYC3GPXo144TpgGNCOBVgan8yU/OxepmEDvWmdynSBpWbcvIxvFsp/ZPybtpYfJnkc541HGU5pQcscBMIzUIkTVuyk2icqtA== 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=rKDmO2kn7YhLtnZH1nLj+hFEruvKiwdM+4E8Q3/iaX4=; b=Ledv/pJTgSH0wZS/oV8PQM7lXknkFcb4U33dnxfWQGAesf7CqQAk6Vi9tZBjK1N5bRZyjQcdqv1cgEGIthAY0yqbHewjbuP2vfgLpd9pciKl544SP+uXUSVQJZcXlO0sNuR7jU31bOmaqvge8E7F+lCpTC/C2/d02bAXhZJKugA= Received: from MW4PR03CA0316.namprd03.prod.outlook.com (2603:10b6:303:dd::21) by DM4PR12MB5200.namprd12.prod.outlook.com (2603:10b6:5:397::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.21; Mon, 9 May 2022 13:21:08 +0000 Received: from CO1NAM11FT022.eop-nam11.prod.protection.outlook.com (2603:10b6:303:dd:cafe::a) by MW4PR03CA0316.outlook.office365.com (2603:10b6:303:dd::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.20 via Frontend Transport; Mon, 9 May 2022 13:21:08 +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; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT022.mail.protection.outlook.com (10.13.175.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5227.15 via Frontend Transport; Mon, 9 May 2022 13:21:07 +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.24; Mon, 9 May 2022 08:21:04 -0500 From: Basavaraj Natikar To: , , , CC: , Basavaraj Natikar Subject: [PATCH 3/7] HID: amd_sfh: Modify the bus name Date: Mon, 9 May 2022 18:50:22 +0530 Message-ID: <20220509132026.3204678-4-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220509132026.3204678-1-Basavaraj.Natikar@amd.com> References: <20220509132026.3204678-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7f92c4e2-d64e-45b5-6bf4-08da31bec729 X-MS-TrafficTypeDiagnostic: DM4PR12MB5200:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ie8+i4oHO31bpTg69NlVWTV2z1LB1g26phQ/g/oVliOKHfbIy1Ljctfz3XA2eOs+B1fpCEWg4XQR/5sgUcKCLFa5HQ/9Gn0yi9atTq62FWB5WL1GV2Oh4Wm29Fes6oPmsvi8Jh7uFSFU6q1Vv+q0Q0dqmYgX0q/8lVYNB9rekuZFBMAqGXYDa9uMrZNSHPs/03SorTeWFLJU6yU3UldNCNDDM40YHHbts1Lsd0m10XZ27H8ngVtLQmuyMdKauOSS9s/rM+UH3NKY4qfjjTE0g+liJ/noqay58zNN48dVU1vfYQSoULFUJ3SbBBccOIPLxk5vAlcBO4o5L/jdz6q96736tNF//Fhoeb+fFLQIsO9GVvib65bQ8eWdfkwzwqpxye1byyZnTjCEKH5YYqWlE8sSJ5zz9lV89xnZW1gEF7SR01SijwEhuKygKIP2hgHHiK9ZjjsOdEoUBDuGBBo8VQ7cLBSE4VoftqYFNsU+kau51n9VJIDhpKRu0U2wSuI94empSHwPMBXMbgZmbfKBDm22i+y1m685OwWMkEIM/17600kYZnpkYec6IpxXhF2YupmR0oRg3V5DomXVpT9zY6Ug7tushW9u6cVuLDRgpUBDmYLJheIb+QXJ+ZXZiPZo1+7Kuv3JXLj8n2LH3JXuWfcE688FwYHU+CaFKVmIOt06gGajhFW11shAjj96RNZ+okTKBoh6AqAUC7onxKGhrA== 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:(13230001)(4636009)(36840700001)(46966006)(40470700004)(316002)(70206006)(426003)(47076005)(508600001)(26005)(70586007)(110136005)(6666004)(16526019)(7696005)(186003)(2906002)(81166007)(36860700001)(40460700003)(8676002)(4326008)(54906003)(336012)(356005)(82310400005)(86362001)(2616005)(83380400001)(8936002)(1076003)(36756003)(5660300002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2022 13:21:07.9399 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7f92c4e2-d64e-45b5-6bf4-08da31bec729 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: CO1NAM11FT022.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5200 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Modifying the amd-sfh bus name to meaningful name. Fixes: 4b2c53d93a4b ("SFH:Transport Driver to add support of AMD Sensor Fusion Hub (SFH)") Signed-off-by: Mario Limonciello Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/amd_sfh_hid.c | 2 +- drivers/hid/amd-sfh-hid/amd_sfh_hid.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_hid.c b/drivers/hid/amd-sfh-hid/amd_sfh_hid.c index 2bf97b6ac973..6e487e41f4dd 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_hid.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_hid.c @@ -141,7 +141,7 @@ int amdtp_hid_probe(u32 cur_hid_dev, struct amdtp_cl_data *cli_data) hid->driver_data = hid_data; cli_data->hid_sensor_hubs[cur_hid_dev] = hid; - hid->bus = BUS_AMD_AMDTP; + hid->bus = BUS_AMD_SFH; hid->vendor = AMD_SFH_HID_VENDOR; hid->product = AMD_SFH_HID_PRODUCT; snprintf(hid->name, sizeof(hid->name), "%s %04X:%04X", "hid-amdtp", diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_hid.h b/drivers/hid/amd-sfh-hid/amd_sfh_hid.h index c60abd38054c..cb04f47c8648 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_hid.h +++ b/drivers/hid/amd-sfh-hid/amd_sfh_hid.h @@ -12,7 +12,7 @@ #define AMDSFH_HID_H #define MAX_HID_DEVICES 5 -#define BUS_AMD_AMDTP 0x20 +#define BUS_AMD_SFH 0x20 #define AMD_SFH_HID_VENDOR 0x1022 #define AMD_SFH_HID_PRODUCT 0x0001 From patchwork Mon May 9 13:20:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 571403 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 D2EBAC433F5 for ; Mon, 9 May 2022 13:21:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235767AbiEINZO (ORCPT ); Mon, 9 May 2022 09:25:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235748AbiEINZI (ORCPT ); Mon, 9 May 2022 09:25:08 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2061.outbound.protection.outlook.com [40.107.93.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C41A26110 for ; Mon, 9 May 2022 06:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZXkp9TMHwpOHiMvOleQw6fo8YedAkr2SJVw2PVz03tVIk86GJlwAJR9SWVCCBWezJEinLiwNoeCilrXw3Vtmexkhl0SQS7BcrQ7WTUkhpGe5/mQVxYtx4l0OLwS7Km89ohDuPfsUFGO88XAEQFTP2motO1bRH2jVs3eHXm75Y2OYA1pWdRBb8548Xyhlb5NEi0LSlbV0y5k1m+sPsjTtZCETrScoDblmKWHxzYBjeU4re1Us55uw0eg1nBgSW4xZU2MEBNipfbcZEqOtDqRTCN/8WZY0JdGqL5g/e4gLIWMrDB6/S1ZFoT3ctWoppqCm5VsquXgWd5gaqET+3mlMrA== 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=hYXeDs1tf7DgODclSAABK3oZYQXmru9sjfc57hZJSDM=; b=Kud6lQFxozvDVVkmoVoXx92Sjb/asZeL7s98KbWDHq+3zxF/rYMgTKyOt+tur4rDkErG9jb2escD9nyOmm3qAogw5wfibjfGEhX32Ljq8E24rzOVNEGMJPHqBwWTQPJacdZgHLAV5re2jyL0YzbsJk6+MIhkGIRY2I/is8kkYOPDJgjsowKuuh0INsFOBZ7kT96Xo9/C1O2DEnvJx5agYS2czCJZw9zxN5kJPXCB7G9aOMxHT3oRpzqd8EbqmVuiNunwKO0xZXIVbniI0eT1L/C8BI7gqYIZ9oM2uYnu7L9czw7sIRprvo5yB6bX1eA35rZ+HP/ulrTMut4iGD8nVQ== 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=hYXeDs1tf7DgODclSAABK3oZYQXmru9sjfc57hZJSDM=; b=NcLzx8XLHboOVZ5Qsv8aKkIRVXzuiQTRIfzvRtfmJUE0sFu3NWZCyMe8SfUvG2blK1mWQ8poghiUyHV3Kj6mpJnhKame4yIsP9yYylc+JGbGKjUMIVXJweuUlvOyCDaJPPijN1c4UM8T4mXCdv9R3Oesj1qh/UtGRHaJlut0rDE= Received: from MW3PR05CA0004.namprd05.prod.outlook.com (2603:10b6:303:2b::9) by DM6PR12MB2779.namprd12.prod.outlook.com (2603:10b6:5:4f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24; Mon, 9 May 2022 13:21:10 +0000 Received: from CO1NAM11FT007.eop-nam11.prod.protection.outlook.com (2603:10b6:303:2b:cafe::a) by MW3PR05CA0004.outlook.office365.com (2603:10b6:303:2b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.13 via Frontend Transport; Mon, 9 May 2022 13:21:10 +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; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT007.mail.protection.outlook.com (10.13.174.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5227.15 via Frontend Transport; Mon, 9 May 2022 13:21:09 +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.24; Mon, 9 May 2022 08:21:07 -0500 From: Basavaraj Natikar To: , , , CC: , Basavaraj Natikar Subject: [PATCH 4/7] HID: amd_sfh: Modify the hid name Date: Mon, 9 May 2022 18:50:23 +0530 Message-ID: <20220509132026.3204678-5-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220509132026.3204678-1-Basavaraj.Natikar@amd.com> References: <20220509132026.3204678-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 10e2b6d7-2da3-4b6d-74b8-08da31bec858 X-MS-TrafficTypeDiagnostic: DM6PR12MB2779:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h016DHWji4qu0i66OY/wWRh4WMjb+TlcO/28p1TvT/TBAUFPsPYXMh6lH3ZLTXqxBOwLVZfflX5EboeeVXRtiUTHYnN5IlejhnmjxydUG+JM2CyHbOttWvr+kjkgzgu0xeDrHgAZSxbdulnLiLAGyzge4/1i/mlGL7O0ZiKBIM/DHeClSMZkCsZNGejhyPHhJ5QmDWNJp0w7fNEjVPDoHa2Q1tsrfWj3YeqFV+FqRUcfJC7k7D6pgw3aKFM2I4x/3Y/AOYyQuX2f98X3wh/AYCE/KFJZuzWgffEXHLNEPFUR24c1/ll5IPCs2q4UKJcUEF2SpK8n96jfAbSmLMUJogrZXZK3vrtn6x4yj+47LU8Hk3/oeLEE0epune1rGfH+kj/iwNfKMdW1rRPPSzG7S1Hf/9j9WTGNBSvKOJOzBvlnUZ/10vSoaTiM1f7mYp2ZzXXqxxTV3p896aipVxhAZRAtomQfP6WdzVAc8Pppy77xspYY3iTSFMcgNfg886PNIGVT/yj66g9ZTOWzBu59kVYrYZiVreWRL+ZJBfJ9A4EwdQlJY9fd37k8f0s483LvLI+uHVSdGVxGPCl/e10yYsKIB+iGEbdcAWrOQwidcJ4p2LMDgMdQJdyMnnnhBgBSnUSyhNxhKk4vja2/LcOg54iUju3/LLSyvgMRrQWB3omb4Zf7mfAglZPI5dm8Q8Aa9XMlOmfIA+0je1rVjUFAew== 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:(13230001)(4636009)(40470700004)(36840700001)(46966006)(2616005)(81166007)(1076003)(26005)(83380400001)(36860700001)(5660300002)(4744005)(36756003)(2906002)(82310400005)(8936002)(70586007)(356005)(86362001)(8676002)(4326008)(70206006)(6666004)(7696005)(40460700003)(16526019)(336012)(186003)(426003)(47076005)(110136005)(54906003)(508600001)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2022 13:21:09.9259 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 10e2b6d7-2da3-4b6d-74b8-08da31bec858 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: CO1NAM11FT007.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2779 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Modifying the amd-sfh hid name to meaningful name. Fixes: 4b2c53d93a4b ("SFH:Transport Driver to add support of AMD Sensor Fusion Hub (SFH)") Signed-off-by: Mario Limonciello Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/amd_sfh_hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_hid.c b/drivers/hid/amd-sfh-hid/amd_sfh_hid.c index 6e487e41f4dd..e2a9679e32be 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_hid.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_hid.c @@ -144,7 +144,7 @@ int amdtp_hid_probe(u32 cur_hid_dev, struct amdtp_cl_data *cli_data) hid->bus = BUS_AMD_SFH; hid->vendor = AMD_SFH_HID_VENDOR; hid->product = AMD_SFH_HID_PRODUCT; - snprintf(hid->name, sizeof(hid->name), "%s %04X:%04X", "hid-amdtp", + snprintf(hid->name, sizeof(hid->name), "%s %04X:%04X", "hid-amdsfh", hid->vendor, hid->product); rc = hid_add_device(hid); From patchwork Mon May 9 13:20:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 571146 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 09180C4332F for ; Mon, 9 May 2022 13:21:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235823AbiEINZ1 (ORCPT ); Mon, 9 May 2022 09:25:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235766AbiEINZK (ORCPT ); Mon, 9 May 2022 09:25:10 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2088.outbound.protection.outlook.com [40.107.236.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34A102871B for ; Mon, 9 May 2022 06:21:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kHP9QTNvQtEi/f3HE5SjQaiDtwQUKOxofDUWImQ14RYtsmMZYFURvv09erUnlUwf0a2uJMgtllFltiZ4A4Chq4/EtODtdi2uBKntbtqUaov0PnK2oDV+LAnNpzerQo4CIfKrzzddLc/roeXGKMQ6tzo7Q2l76BzNWNQiRxyrxOy3Bica6FWeR3CwxDvq0GIrvcAXlppE5+jeaMNoiOGnC5yRwNMpegVOOEScOCxdyqetF+f6hye7Ren2OjfDmVSWy9LKcwr/i7lDAiyPvdRSnJYO3iQa6favj5ayiJ4YYKYJrzan8VStEwVX2LiTfHyBElO4UGarZqI/WVtDOddxhQ== 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=nQlGigHISK4c1W+UyhCzgh5Mez3CK0PW6jpej1VFN3Q=; b=RIaunWBED7kMJYenJjv6kH9+xxKNTFYhMUp1ShXVO83kk/iNsGUXznjX7GWh6uNtza/dkMzK+N/dPKpMQV50gJ8O/nZv0TIRcxEZED+S+NP06lcNZajvQAPjhYEouOT+nkE1vnUPoJd6O+eqTlFtmm/+KJiR8tV7uTsPVrjALl3iTEjPe0eZYe1HS5/8ZIHPI5tLhIxuEDNmOWwqJhaiK+R6rCygmox4aRtPNyyYtIkf0F+/VKGsMjta7xxpz5mukdf8zs91G9bXULRSQPwuDo67o0lKsFVpzghVLhGhgRvrM6Mp6hCH+9CYKcIrNe9MrjaDPOgns5kt+m5ts1aq7g== 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=nQlGigHISK4c1W+UyhCzgh5Mez3CK0PW6jpej1VFN3Q=; b=S4CDcRy31pE//w4DbePJENFJj2j2ncciSTrVN/vjpry4dZ3tkKqAhh+GVBhGV8O0v+njvARxgc6cFhTzwz+JcDK4Na/h6WgahVwUZS1NNON+Fz54GotHyS67aViNrP0y1xRUDHkiypcc41jbsXGq9AULhLmNov60RhiuLtaDFfQ= Received: from MW4PR04CA0330.namprd04.prod.outlook.com (2603:10b6:303:82::35) by BN9PR12MB5337.namprd12.prod.outlook.com (2603:10b6:408:102::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.21; Mon, 9 May 2022 13:21:12 +0000 Received: from CO1NAM11FT008.eop-nam11.prod.protection.outlook.com (2603:10b6:303:82:cafe::2) by MW4PR04CA0330.outlook.office365.com (2603:10b6:303:82::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.22 via Frontend Transport; Mon, 9 May 2022 13:21:12 +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; 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.5227.15 via Frontend Transport; Mon, 9 May 2022 13:21:12 +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.24; Mon, 9 May 2022 08:21:09 -0500 From: Basavaraj Natikar To: , , , CC: , Basavaraj Natikar Subject: [PATCH 5/7] HID: amd_sfh: Add physical location to HID device Date: Mon, 9 May 2022 18:50:24 +0530 Message-ID: <20220509132026.3204678-6-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220509132026.3204678-1-Basavaraj.Natikar@amd.com> References: <20220509132026.3204678-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9083dbca-5c78-4164-5b90-08da31bec9a7 X-MS-TrafficTypeDiagnostic: BN9PR12MB5337:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RDktvG7XSkuACEAMyqg5UG4ZxBFAlAp1cIOienkR6WLXbrtAvo9Ht/2cExR5EKlHIuQVk8s41INAgKDAj+5fggCB6qZR7qElp8T7mIlgxjd6/gpC9vjJT/ijAagS3ST1/jxH4jUKZ5IGXTx7gBgu3+tq8tiV9a3JrgNSa6ggUVQEdJcJOT7weu6hSLg+tAS+GPXHl3f2GJ/9Gpsd7a/0zN0+Ke9Br+5Fqy2bidL+0krh6iIw4Co3+ybvO7H2cNluXbEaFeGqZmX8lXw3dEtLEc6e2NPfLBKqnwjKAhWpUvg2KSP6wf6xpIS2fq58Wyu5qLrxkrXe8Bu3a4nLBBskCGsISiwdxbXKQnIAOWrpNH8QCuQ6QuqWQeTANPPJMnxxAudQZd9CJX+9pIGMTKdyNZ5Frztkjo1zxTG1CT6eNgqJBU4jiBK0eWkEZ8dog5M6EslRzrwHd41C7d1XvMvv4GRNsK2Uy0P3f7yzzacCblx0uWnMxmWZ1kMVnPUCx03EUdGR/3Am3cSdV+0J7fogEyQ4GShoefpCCOIvcQYvFAOPsxxG8N3ClTG4N/a0vRzpecKkdcGPH0SwMfsT6pQRHCYEGFFo5d4W+nmkrJmj9k17ABf9jZr8pnkp7d5Jzw/56naeC+lEISpg9hVJfH3T3DQm8JTeVDyg7JSfP5Tz4thb7eCqqv+9+Qp/Yyfo5PswWOe1PUR55yy/L9KJGfqxrg== 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:(13230001)(4636009)(36840700001)(46966006)(40470700004)(316002)(426003)(47076005)(70206006)(26005)(508600001)(6666004)(7696005)(186003)(2906002)(81166007)(16526019)(40460700003)(36860700001)(8676002)(4326008)(54906003)(336012)(86362001)(70586007)(82310400005)(356005)(2616005)(8936002)(1076003)(36756003)(5660300002)(110136005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2022 13:21:12.1207 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9083dbca-5c78-4164-5b90-08da31bec9a7 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: BN9PR12MB5337 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org when HID device is loaded a wrong string is shown as physical location is not declared. ``` hid-generic 0020:1022:0001.0009: hidraw4: HID v0.00 Device [hid-amdtp 1022:0001] on ``` Hence use amd sfh driver name or device name which is connected to the HID device. Signed-off-by: Mario Limonciello Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/amd_sfh_hid.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_hid.c b/drivers/hid/amd-sfh-hid/amd_sfh_hid.c index e2a9679e32be..1089134030b0 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_hid.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_hid.c @@ -12,6 +12,7 @@ #include #include "amd_sfh_hid.h" +#include "amd_sfh_pcie.h" #define AMD_SFH_RESPONSE_TIMEOUT 1500 @@ -120,6 +121,8 @@ static struct hid_ll_driver amdtp_hid_ll_driver = { int amdtp_hid_probe(u32 cur_hid_dev, struct amdtp_cl_data *cli_data) { + struct amd_mp2_dev *mp2 = container_of(cli_data->in_data, struct amd_mp2_dev, in_data); + struct device *dev = &mp2->pdev->dev; struct hid_device *hid; struct amdtp_hid_data *hid_data; int rc; @@ -141,6 +144,8 @@ int amdtp_hid_probe(u32 cur_hid_dev, struct amdtp_cl_data *cli_data) hid->driver_data = hid_data; cli_data->hid_sensor_hubs[cur_hid_dev] = hid; + strscpy(hid->phys, dev->driver ? dev->driver->name : dev_name(dev), + sizeof(hid->phys)); hid->bus = BUS_AMD_SFH; hid->vendor = AMD_SFH_HID_VENDOR; hid->product = AMD_SFH_HID_PRODUCT; From patchwork Mon May 9 13:20:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 571401 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 4E819C433EF for ; Mon, 9 May 2022 13:21:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235637AbiEINZ2 (ORCPT ); Mon, 9 May 2022 09:25:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235827AbiEINZL (ORCPT ); Mon, 9 May 2022 09:25:11 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2080.outbound.protection.outlook.com [40.107.220.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E4115A59B for ; Mon, 9 May 2022 06:21:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kEJ04vq68wwbqLoWU3ssxLJoLpLdTlc9CS87awxGS89oYRJyIhbf11lRIV+YCSUCAk51cHexwhRze4xk//y4PFDo5kSNyZoBV8na/1IjEV6X0amJbjtwgNrnFTWLqOooScd9jyWo3ZeWj7r2fLnWSKw/nmHIUMloHpPNIqsUgXqJqP+MjqxS5ufIrfAxHtgYTsW2tGK1ejOE3uzWucA2cvUU4yHBjHdxy7XjxUuHOme4UGTnJ1cz0pMGY6ims+5gRFhXkz3HgdzuKZzvAyqSZEsRaQHKrokhmOobmeAMBSph35lmwQvCxVY78KPk458E79G7pAdW1F+C/4lwjTH+uQ== 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=/pBTH/w5gQMggu/9HYnlzjY9Fe14PfNWmWD+Lri75IQ=; b=FhNV1ZKjmqb7Ne2Nuh5v6Nu1hUziLNo/eS+gtil5FVDsqiCfXYvAzOVGfZSf4aSCc3dMJyQul1MEGT6srm5tiCMHSu4pMd7jbqqw3vRrBJoiHdlUbjBXYVN/qZxmTjFxTLWJLrFLeGtWj5EEcz4ZI4IEnX1u81jgfAmjtcJeN3ETae+4D4umYhlaQuu9MFlUc2fGIEsJW3sXUTdtIXGibmswiZ8LluHs3kq69BZz71X4CvZ6R7QvlB+I4aTJzfUVap05VXMwsvm3T6cdm9wY5bxfybRLhHNM1DaglsAhCDPUN6JYiquOT8WVnOSsNB7Crm8cTh9DoBs4nyH71VZz5w== 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=/pBTH/w5gQMggu/9HYnlzjY9Fe14PfNWmWD+Lri75IQ=; b=QiA3y75jqWi8hjfmDIUbaJeoFLnwGKUyBUta/uTZmy7hhSn2IKIzEEWhlmIza82AQnWXehYH1Lmz/4UZGngIecqEHK43fIh6iWYiZV8qDRcIdhH7KymkTMRdVFJGxbH8u4i0483pZz8UGkwEizUE/6SQ+ASsRwbRH4IHOqozhDs= Received: from MW4PR03CA0342.namprd03.prod.outlook.com (2603:10b6:303:dc::17) by BN6PR12MB1572.namprd12.prod.outlook.com (2603:10b6:405:3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.21; Mon, 9 May 2022 13:21:14 +0000 Received: from CO1NAM11FT046.eop-nam11.prod.protection.outlook.com (2603:10b6:303:dc:cafe::d2) by MW4PR03CA0342.outlook.office365.com (2603:10b6:303:dc::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.23 via Frontend Transport; Mon, 9 May 2022 13:21:14 +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; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT046.mail.protection.outlook.com (10.13.174.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5227.15 via Frontend Transport; Mon, 9 May 2022 13:21:14 +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.24; Mon, 9 May 2022 08:21:11 -0500 From: Basavaraj Natikar To: , , , CC: , Basavaraj Natikar Subject: [PATCH 6/7] HID: amd_sfh: Move bus declaration outside of amd-sfh Date: Mon, 9 May 2022 18:50:25 +0530 Message-ID: <20220509132026.3204678-7-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220509132026.3204678-1-Basavaraj.Natikar@amd.com> References: <20220509132026.3204678-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8c0e9197-7d0d-4c3f-98af-08da31becaeb X-MS-TrafficTypeDiagnostic: BN6PR12MB1572:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: erV91OQKRl3lkV4+APfS9bJxbb2XqUhPjhubSLJUAB91wK3vASSMswQOElUmOL5jlUjKfQShn4QYiqTGDONph8n+MaWXjFYH8rHwA8bfHkBDUS5jZTWBrnkXqwL8gtz+4nEp13l+1nT//jzvtfir06F8tM7TlNtNX1635zHECJgvlkafZDPWItAdsJhvVst8QHCzBxjC5qUVPsnTzJHyG/GrXNIiENegewx8Nuf9qrEONYdhLOJF5+w/rupYIGLtowW4CcmJAqx+krDmkOVYGljVwkhYuUSa6hVca1C78306eh1gzURd4uIEpsMwi4TGDsDJurx2WD45k8z+sM4KCpCXQXEjBcGpHLRoROM8YCPvJtTbNR454W4HgHYP9K845er0wBla33+yhfqooANO5vas1sL0JFTr7sMcLAzaOo7Y0IpaRVVjn7Z8ZRIRMnaywA9RLqt3aSwlSkI0+RQfbuzjK7666ugtHUYsJB0sGo75RzPEF0dOs4IPiYCg/UNa9oOoUXxs1yvdJGpW0kQM0rwUYigN//1vSgFawvfolGgsxRgyc79JXUW7hQ362HX+K992o7o8BK+exX+0VDJLhYlP3HNfbR70DvuB2OnRgTV/Z5s38Bkshu8eDiW1MogsVz206CFkcXlSAMOZc3s2TmG4Hc0+Y05DqDRVISNy2Gx9qZN74se3//CoHgSC5fb2Zthkx77NyFZbdWpPOSIoIA== 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:(13230001)(4636009)(40470700004)(36840700001)(46966006)(4326008)(2616005)(54906003)(86362001)(1076003)(70586007)(70206006)(110136005)(316002)(8936002)(6666004)(356005)(8676002)(26005)(7696005)(81166007)(508600001)(2906002)(82310400005)(336012)(426003)(40460700003)(47076005)(16526019)(83380400001)(36756003)(36860700001)(5660300002)(186003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2022 13:21:14.2456 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8c0e9197-7d0d-4c3f-98af-08da31becaeb 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: CO1NAM11FT046.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1572 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org This should allow external drivers to reference this bus ID reservation and detect data coming from amd-sfh. Signed-off-by: Mario Limonciello Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/amd_sfh_hid.h | 1 - include/uapi/linux/input.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_hid.h b/drivers/hid/amd-sfh-hid/amd_sfh_hid.h index cb04f47c8648..ad264db63180 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_hid.h +++ b/drivers/hid/amd-sfh-hid/amd_sfh_hid.h @@ -12,7 +12,6 @@ #define AMDSFH_HID_H #define MAX_HID_DEVICES 5 -#define BUS_AMD_SFH 0x20 #define AMD_SFH_HID_VENDOR 0x1022 #define AMD_SFH_HID_PRODUCT 0x0001 diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h index ee3127461ee0..ef4257ab3026 100644 --- a/include/uapi/linux/input.h +++ b/include/uapi/linux/input.h @@ -271,6 +271,7 @@ struct input_mask { #define BUS_RMI 0x1D #define BUS_CEC 0x1E #define BUS_INTEL_ISHTP 0x1F +#define BUS_AMD_SFH 0x20 /* * MT_TOOL types From patchwork Mon May 9 13:20:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 571145 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 45FD6C433FE for ; Mon, 9 May 2022 13:21:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235738AbiEINZa (ORCPT ); Mon, 9 May 2022 09:25:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235747AbiEINZO (ORCPT ); Mon, 9 May 2022 09:25:14 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2044.outbound.protection.outlook.com [40.107.237.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA8032528E for ; Mon, 9 May 2022 06:21:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KNlJLu7+uKqvdb7IpvEMkAMmXqGzjK1FxDHyu4iJAlDI+41G8CJY6f2ncpn71demKac0rCer5BXX4QsYr6ub/PZWahXzF5n65rjSfv11PTd2eHm+GbMlGXgYs42DL+1u/eQYW0XvpTxWFh+erJODbSG/Ti8vkV22BWgWFoSYwVRq5VkyeY527ZV3Sl808ZwZDY1Mv+AyictEyUYZP4WIQPIEqcrnSIsT7RdwCdz6WqV9HGyoR7UaNI1JglLjxMU292TfRqFG3LVACSwHcWtw9jbcm95OZlyW57XgHxJ7j7owGbMwLwp7L2W0eqBlRuq7UFT+mAHT5BzLJrtp7eQ2Vw== 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=u/9AwMlTHlvZuHme8DWKXDtsU3EPDj5BcnpyR+K8ESw=; b=OXxtfCKE4mMnSWwyZrptGK+dLUZjBBXPh08s4vzz1FmTednUOtPf/cu8AiyNwg3WO9zwofK3PxqDwqPIE8yyQP+BVrqAXE1HT/HFAsJJBsT7LCZ0nnJASe/U40EFF+sbKxyDNhpjhTenXGMpZ3QjjOJzbqcRFI+wkgsFRHBJocPIQ7R9LbpkKsD2kimFLdDmWbhXMdZW46x550F8l3lP1ocAJNdGcpoYb3p9QQk1Iw/PrgPjTG4Psic8mFpibeBI6Hnw7pzFcrcX6Am0ClQMcjaCH7ARdKfazGpSihD3r+0ZBCnAloZ+OylHZiR+IpU7CswTH0nihCc09oRC99fFeQ== 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=u/9AwMlTHlvZuHme8DWKXDtsU3EPDj5BcnpyR+K8ESw=; b=JkH7YQh3l1A6i8Ike+hyDFAtPURwUbL9BHIIWcBbw7Z8vu/E8kgpTZ74Ap567xm4AMmXXe8woZdeshYXpjrIh7T6Mi/ToJxYSYmhuQbz6kEM13OD7xk3Vnm063nnpxdPICnetjSIBo0d8dr790DQ1cTam0q0TZs8uEdTGj3uOaY= Received: from MW4PR03CA0108.namprd03.prod.outlook.com (2603:10b6:303:b7::23) by DM5PR12MB2503.namprd12.prod.outlook.com (2603:10b6:4:b2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.20; Mon, 9 May 2022 13:21:17 +0000 Received: from CO1NAM11FT040.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b7:cafe::22) by MW4PR03CA0108.outlook.office365.com (2603:10b6:303:b7::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.23 via Frontend Transport; Mon, 9 May 2022 13:21:16 +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; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT040.mail.protection.outlook.com (10.13.174.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5227.15 via Frontend Transport; Mon, 9 May 2022 13:21:16 +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.24; Mon, 9 May 2022 08:21:13 -0500 From: Basavaraj Natikar To: , , , CC: , Basavaraj Natikar Subject: [PATCH 7/7] HID: core: Display "SENSOR HUB" for sensor hub bus string in hid_info Date: Mon, 9 May 2022 18:50:26 +0530 Message-ID: <20220509132026.3204678-8-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220509132026.3204678-1-Basavaraj.Natikar@amd.com> References: <20220509132026.3204678-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fefa674b-959a-4c32-ac22-08da31becc3b X-MS-TrafficTypeDiagnostic: DM5PR12MB2503:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KmlS+3cBucN425t2DiA1o88ALf85C6m7z7Wf8mkRHgxrPKD9eF3xovBLZvL5xRliB6SOxG1IpamN0Sv3Kk55mkGqA6z3jaucpumiJkdW9fhmd+a/RFqPIOzeR9gwy35URM0bFP8y5OdXIrZkQ6SAQRdHA6TvEEA+wn+Bce55xpfp+C0B5QVV9Yy7w3HvfQztVIij2ASIuiYquqBp9citUNM6+fbJ9o1H4a6aKoJyshw3Aqq52FPIm+7kEzvzAiuCsbCMGi24xNz9LCVeebXfmpSym0td/bR3b7Ff62y3z0GDXJx6aqWQ2fjWFi7IRxcYyx6jouI8Pv2SgtdqRY50Ha5+gKwQBA/leN6bdejcAvvU6SJHm7kCUaybxWClnSVoNYJv1bAXHGuW+SzvyMZcmVXXkXJEO1/4J+vmxtNnVpD6nZY2Q/vPjpN9t2QFt0WYstVrmK8tb4beqvnl5iZRn9p6fXm85sIvUZg3BI5Ewqw1ymr5x3PbGaBx0In42a1JHyjjkWlv38lJXU1q/u0fIYyxKHxNiYrVcCKLYFnio5mW+lRlrV6k6XsPZ03PoNEuR0FiAkFtskj/YlJ+pdT4BmW+TopDu+aAYq4RLNwn6EAGbMcY3nweTs3/Cd5uXt74bmJYra/qakPTZi9LuX5VxMGWmqdbPmW1We7QTwvWWouT+Wn88Mn6BtuP0du/FoAq7DT8fO4TyUNuRsWlr5ALqw== 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:(13230001)(4636009)(36840700001)(46966006)(40470700004)(40460700003)(6666004)(7696005)(26005)(4744005)(16526019)(81166007)(36756003)(5660300002)(1076003)(2616005)(186003)(82310400005)(47076005)(2906002)(336012)(426003)(508600001)(8936002)(316002)(356005)(8676002)(70586007)(70206006)(4326008)(86362001)(36860700001)(110136005)(54906003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2022 13:21:16.4481 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fefa674b-959a-4c32-ac22-08da31becc3b 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: CO1NAM11FT040.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2503 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Currently sensor hub shows "", but this is a pretty common type available in many notebooks. Hence using the string "SENSOR HUB". Signed-off-by: Mario Limonciello Signed-off-by: Basavaraj Natikar --- drivers/hid/hid-core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index db925794fbe6..00154a1cd2d8 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -2222,6 +2222,10 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask) case BUS_VIRTUAL: bus = "VIRTUAL"; break; + case BUS_INTEL_ISHTP: + case BUS_AMD_SFH: + bus = "SENSOR HUB"; + break; default: bus = ""; }