]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
AMD_SFH: Fix for incorrect Sensor index
authorSandeep Singh <sandeep.singh@amd.com>
Wed, 28 Oct 2020 09:00:10 +0000 (14:30 +0530)
committerJiri Kosina <jkosina@suse.cz>
Thu, 29 Oct 2020 15:02:29 +0000 (16:02 +0100)
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.

Fixes: 4f567b9f8141 ("SFH: PCIe driver to add support of AMD sensor fusion hub 4f567b9f8141")
Reported-by: Mandoli <lipheng@hanmail.net>
Reported-by: Richard Neumann <mail@richard-neumann.de>
Signed-off-by: Sandeep Singh <sandeep.singh@amd.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h

index 9c5eb442e1a633e7c58f6cc0df90e2c118dfd518..a51c7b76283bb46b156fe405cf487a986d1cdd3e 100644 (file)
@@ -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)
index ac9a01cc1454cfbadcaec700005f313def3ffcd7..095c471d8fd6fba28b0191fccb74101a37885b16 100644 (file)
@@ -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 */