Skip to contentSkip to conversation

AMD_SFH: Fix for incorrect Sensor index

PATCH Superseded Sandeep Singh 3 participants 3 messages Oct 23, 2020

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 AMD_SFH: Fix for incorrect Sensor index

From: Sandeep Singh <[email protected]>

Add fix for incorrect sensor index and minor code clean-up.

Fixes SFH: PCIe driver to add support of AMD sensor fusion hub (4f567b9f8141)

---
This patch can be applied on = for-5.11/amd-sfh-hid

 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(-)
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +3 -3
index 9c5eb442e1a6..a51c7b76283b 100644
@@ -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)
drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h +0 -14
index ac9a01cc1454..095c471d8fd6 100644
@@ -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 */
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 5 lines · Sandeep Singh

From: Sandeep Singh <[email protected]>

Add fix for incorrect sensor index and minor code clean-up.

CCing Richard Neumann, I believe he reported exactly the same issue too, and thus should be added as Reported-by: too. Agreed?

Thanks.

Quoted 61 lines
Fixes SFH: PCIe driver to add support of AMD sensor fusion hub (4f567b9f8141)

---
This patch can be applied on = for-5.11/amd-sfh-hid

 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(-)
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +3 -3
index 9c5eb442e1a6..a51c7b76283b 100644
@@ -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)
drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h +0 -14
index ac9a01cc1454..095c471d8fd6 100644
@@ -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 */
Signature · 1 line
2.25.1
Signature · 2 lines
Jiri Kosina
SUSE Labs
#2 lore raw

Hi Jiri,

Quoted 11 lines · Jiri Kosina

[CAUTION: External Email]

Quoted 5 lines · Sandeep Singh

From: Sandeep Singh <[email protected]>

Add fix for incorrect sensor index and minor code clean-up.

CCing Richard Neumann, I believe he reported exactly the same issue too, and thus should be added as Reported-by: too. Agreed?

Mandoli is the user who reported this issue, since he replied in another mail thread.

I believe Richard also pointing to same user (Mandoli) in his last conversion.

Thanks

Quoted 68 lines

Thanks.

Quoted 59 lines
Fixes SFH: PCIe driver to add support of AMD sensor fusion hub (4f567b9f8141)

---
This patch can be applied on = for-5.11/amd-sfh-hid

  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(-)
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +3 -3
index 9c5eb442e1a6..a51c7b76283b 100644
@@ -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)
drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h +0 -15
index ac9a01cc1454..095c471d8fd6 100644
@@ -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 */
--
Quoted 2 lines

2.25.1

--
Jiri Kosina
SUSE Labs