Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp73804pxx; Wed, 28 Oct 2020 18:39:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzw93l8+8VP2EQJOkyTAGmLvrEGWWvomrLlsKTc+zra9R/ULzu/cwLEaJ/aKLczEgKrU8cM X-Received: by 2002:a05:6402:142a:: with SMTP id c10mr1730671edx.261.1603935551082; Wed, 28 Oct 2020 18:39:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1603935551; cv=pass; d=google.com; s=arc-20160816; b=l05Dt78HUPdl4NXFoNZyX7gurD9pxNqpCNIIkjSMzJguBNLaLnFhG0AKbAr4QvRDaN GheOqC3rXXbQse11WB5stEEdgBWZ55HDW68DCqcBYybr7VS7HfVwMKDU6VC+X6U+h+f+ cjT5jiwapbMdNn74QitH1MJJrKkE3geK0VLCVCdr371J1kf9L40jpc1LqVWY27adykCK LNJodDQ6MWcmCyJZbi31Zhz4W7fapXAfInsTxPto+Z+P451APkHt+N8bG7IAKSxDLF52 oJ0jWOvB7qhSGLW3gVJ+BI+wPNozr1mtxm4ZWCHfN47nbp+atNCwQRcdiY52HuleNO4m GyKQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=LNHZ6QE2kz0rzJDxJ8agwRI+miR67gp6zQFzF2f2+Cc=; b=P8B6dhkx4ZYbA1Q7pgfQmtG2pL9SPdiU4MAkL5N76arV0stL26YUC3AwRpRQqE7MVS QP8C6ibeff/c5mdOPeVplP0ON2648c4ghcKcnoyrqBm0pcfkGog05Mvrp1EUizMW9XQg cOCzy99OuHtzWZUFXimhRkUdrpOSyaye7IZAklsyJkErPp8HDYr29PRT18RKOlHEqBER 2hsdTP25OrRK9xr2BP/EmooUcnuE8OX48kQolXUDs/cX4oweoZyYBN33FlcuW/YEc78r XSGk9F+98gdbeic+gJZ2okUH4fWzP2J/Y6J16LTVNZySF/iY6EJQHnQ6jXvpRAW64Mvj +UHg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=WY4ytmOx; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w17si739795ejk.629.2020.10.28.18.38.48; Wed, 28 Oct 2020 18:39:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=WY4ytmOx; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388042AbgJ1Wep (ORCPT + 99 others); Wed, 28 Oct 2020 18:34:45 -0400 Received: from mail-dm6nam10on2040.outbound.protection.outlook.com ([40.107.93.40]:41825 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387529AbgJ1WcG (ORCPT ); Wed, 28 Oct 2020 18:32:06 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SyF+fjToWT52pGgbOmP3kv6a0TQscugvPXZrt5eUTdxFRQhKxCLVxIm72YPts5jjLhVedJLoOn0+qrJGvcwbpA95vpV7ODCnJ31Uwsem10oGHJcNNAdWModirr2QHZzxATHzJMqfiNE3NXGPABNLB1Vtm771GGNPC/0wxbO60zjbF9xy0GAhjvupeFUBZ3tlUTf7mWSXKT2ouo19PryoRT2Kycp4RtKSAmxjmn91VPi37roz2Eh2HD+WtdYkvmHC6hCrJyMWCRJw+beVg38XB+tlY/G+zbmagTYe8Ww/D5YalnPuexehwf0xJwpR26nhbnMb8JhncmuhBYUb3MzUDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LNHZ6QE2kz0rzJDxJ8agwRI+miR67gp6zQFzF2f2+Cc=; b=HpJcCqrp7ZbkMwbJ9wDYjbDeGIUBhB/y1i4icwcHbfYNR58VjCZHcBmZ0h/neKu0szYXY8XQFDOm30tDQ8G0eo5IdSsLsVAB+M6yCprlMOQysQBbY6c5EYHNpUHjdZC5mN+cPa/AilJc7nvcoK24CiG77XlfM55qF5X80u8vtEru3Pkgx+ccY0zkiA5FMYd++sxkhJsf7Bcuz9xodWFLgJMz0Fv/Vu5jUa/tjy/BNtTFcjymz1d2aZyieskSyre+9p/c+hNDp/94mY2H32ewAv6Lbh3x4mYc2dYEt8F+zILqEfw4CTLQNMrTwim3fcU+uiDtp4oml26S5jv8yuHa9w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LNHZ6QE2kz0rzJDxJ8agwRI+miR67gp6zQFzF2f2+Cc=; b=WY4ytmOxhekLYodxRZYqmMBlWYQYGIBwFwPHvpqH4pVXsNzGknP82Wp7fdpPouCf9P+uQUxpcaon4CY13GR4vI6D2z3SOnHMXAhuy2IoErLe96wPyRm6Z3UL4kFmzDOlQM8jQQ2o+Vlkf6tGwieSt6xFUBkM7mGMtkG7K7lTet8= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=amd.com; Received: from BY5PR12MB4098.namprd12.prod.outlook.com (2603:10b6:a03:205::8) by BY5PR12MB4919.namprd12.prod.outlook.com (2603:10b6:a03:1d6::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21; Wed, 28 Oct 2020 09:00:37 +0000 Received: from BY5PR12MB4098.namprd12.prod.outlook.com ([fe80::e1a3:69b7:a02d:a74d]) by BY5PR12MB4098.namprd12.prod.outlook.com ([fe80::e1a3:69b7:a02d:a74d%7]) with mapi id 15.20.3499.019; Wed, 28 Oct 2020 09:00:37 +0000 From: Sandeep Singh To: jikos@kernel.org, benjamin.tissoires@redhat.com, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, jic23@kernel.org, Nehal-bakulchandra.Shah@amd.com Cc: mail@richard-neumann.de, Shyam-sundar.S-k@amd.com, lipheng@hanmail.net, Sandeep Singh Subject: [PATCH v3] AMD_SFH: Fix for incorrect Sensor index Date: Wed, 28 Oct 2020 14:30:10 +0530 Message-Id: <20201028090010.2689060-1-Sandeep.Singh@amd.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [165.204.156.251] X-ClientProxiedBy: MA1PR01CA0123.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:35::17) To BY5PR12MB4098.namprd12.prod.outlook.com (2603:10b6:a03:205::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from jatayu.amd.com (165.204.156.251) by MA1PR01CA0123.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:35::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Wed, 28 Oct 2020 09:00:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d6baa59d-58d0-4d6e-b256-08d87b1fefe2 X-MS-TrafficTypeDiagnostic: BY5PR12MB4919: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1360; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kEixEBbk0IyXzwPEuIyvMPf0AS+W+qbOsp21bR6Lmk5Gymp+687WrSnKwLsZU/Xy8RWNpF8YyKuCvBcDbxWWYw5c2SvATv2CPRvy3q/Gkk5UojIS1zXLvFV1xsKhSwYGDHCI0LK1EWKQ5aI+kGtxY1Tio2m4IBpsmsIhLcSiZEP3u9lutyGLRAq4XQCGUYNMHv/W+iI+CTpsbPhOHjH6tcatzAcCrSPSrNHM/10dyCgzTlBUxlamu7h+8vN7yBNcUItoDokwSnhqnKlLibEFRmF7dV30sxi6Xrwug7h7n0D9r/qOaxuyWCjOLkKoWYZMYzvuN2lHD5WD4M4GjYLXChl88itnuzC5xczHubPcdxaDR6WulUR66U5KJCVkG3kOAgtajvl8PXLG2Qh4L390sA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB4098.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(396003)(39860400002)(136003)(346002)(366004)(8676002)(36756003)(6666004)(66946007)(2906002)(66556008)(66476007)(8936002)(316002)(6636002)(478600001)(2616005)(83380400001)(86362001)(186003)(16526019)(6486002)(5660300002)(4326008)(26005)(52116002)(7696005)(956004)(1076003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: hUBr5nyyy+c1jmJJBjlnYgAX1gAnFa5Y5whrfzBfGn+h2tfDWrEVw98l3sfSCvhrGiKnR9XxYEFLu2BQ8/hfnIhHu1IipCGCV3AmzMaAJw6oVy65d27aJgEx/N1WcvXIZ1MK8ukJEXo5SmbwoscbM2G36hnAZg6Wq2Ydqz73pcZ4VoKUXxwBpIqiXt1ZxUXcpwRcqmPbVxShydmOwwsDH2xwWFIfKR2+Fb3DVJazWznW6N8+44uxkGldqyOIHgAFVvm3BryOZRyWShxW6KbzHyYUwogGwtfcOS9yBOsoG6Jis1o1I4bUJR0xbrF+Xc3SiZtQFSlNpROu04REhg+1POlGJCaGsdm3b9irfxvH3/5EGiQkb7/KDXlD1ffDC0TCx1RRBEPOqL4N/mSUaCFYDdT7QLKrZLGRGC8ngh/DgI/wMemwOf2miLE7XRBmvMekXfMvc23hUIBKEDWZFFw85ds4nrRgaBhV2njbmjWCMkb3YC4ngDRmZMyv1aEdUEWN+4+xQ/bs5W1FKXUHzWy9+T2XyRa7AWA34Z/EKGGUfmj77OZ0oWEj8e8uJqTEWnCcPkR9n5I8VXtaARh1wliHfe3owaP80X0eDuah7SamqrdZ3sNaLG5TuzBRqdNA+LD6+cZyV22RMaXXtnwThSXX7g== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6baa59d-58d0-4d6e-b256-08d87b1fefe2 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4098.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2020 09:00:37.3212 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HcYbUFP80AS/pZPZOHG/5NqisiYB3JwvttocIp/ZKhHiiKq7XdnrqGafWdliVjYL X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4919 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sandeep Singh It appears like the accelerometer/magnetometer and gyroscope indices were interchanged in the patch series which got into for-5.11/amd-sfh-hid until Mandoli/Richard reported to us. Ideally sensor indices should be 0,1,2 for the accelerometer, Gyroscope, Magnetometer respectively, but this interchanged possibly could be because i was using a test MP2 firmware on my machine. This patch fixes the earlier commit with the right sensor indices and also removing unused structures _hid_report_descriptor, _hid_device_descriptor as reported by Richard. Reported-by: Mandoli Reported-by: Richard Neumann Signed-off-by: Sandeep Singh Fixes: SFH: PCIe driver to add support of AMD sensor fusion hub (4f567b9f8141) --- Changes since v1:(https://lkml.org/lkml/2020/10/23/172) -> Add Reported by : Richard Neumann Changes since v2:(https://lkml.org/lkml/2020/10/24/22) -> Modified commit message drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 6 +++--- .../amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h | 14 -------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c index 9c5eb442e1a6..a51c7b76283b 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c @@ -20,9 +20,9 @@ #define DRIVER_NAME "pcie_mp2_amd" #define DRIVER_DESC "AMD(R) PCIe MP2 Communication Driver" -#define ACEL_EN BIT(1) -#define GYRO_EN BIT(2) -#define MAGNO_EN BIT(3) +#define ACEL_EN BIT(0) +#define GYRO_EN BIT(1) +#define MAGNO_EN BIT(2) #define ALS_EN BIT(19) void amd_start_sensor(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info info) diff --git a/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h b/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h index ac9a01cc1454..095c471d8fd6 100644 --- a/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h +++ b/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h @@ -16,11 +16,6 @@ enum desc_type { feature_size, }; -struct _hid_report_descriptor { - u8 bDescriptorType; - u8 wDescriptorLength; -}; - struct common_feature_property { /* common properties */ u8 report_id; @@ -38,15 +33,6 @@ struct common_input_property { u8 event_type; } __packed; -struct _hid_device_descriptor { - u8 bLength; - u8 bDescriptorType; - u8 bcdHID[2]; - u8 bCountryCode; - u8 bNumDescriptors; - struct _hid_report_descriptor *reports; -}; - struct accel3_feature_report { struct common_feature_property common_property; /* properties specific to this sensor */ -- 2.25.1