linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] AMD_SFH: Fix for incorrect Sensor index
@ 2020-10-23  8:59 Sandeep Singh
  2020-10-23  9:05 ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Sandeep Singh @ 2020-10-23  8:59 UTC (permalink / raw)
  To: jikos, benjamin.tissoires, linux-kernel, linux-input, jic23,
	Nehal-bakulchandra.Shah
  Cc: Shyam-sundar.S-k, lipheng, Sandeep Singh

From: Sandeep Singh <sandeep.singh@amd.com>

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

Reported-by: Mandoli <lipheng@hanmail.net>
Signed-off-by: Sandeep Singh <sandeep.singh@amd.com>
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(-)

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] AMD_SFH: Fix for incorrect Sensor index
  2020-10-23  8:59 [PATCH] AMD_SFH: Fix for incorrect Sensor index Sandeep Singh
@ 2020-10-23  9:05 ` Jiri Kosina
  2020-10-23  9:22   ` Singh, Sandeep
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Kosina @ 2020-10-23  9:05 UTC (permalink / raw)
  To: Sandeep Singh
  Cc: benjamin.tissoires, linux-kernel, linux-input, jic23,
	Nehal-bakulchandra.Shah, Shyam-sundar.S-k, lipheng,
	Richard Neumann

On Fri, 23 Oct 2020, Sandeep Singh wrote:

> From: Sandeep Singh <sandeep.singh@amd.com>
> 
> Add fix for incorrect sensor index and minor code clean-up.
> 
> Reported-by: Mandoli <lipheng@hanmail.net>

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

Thanks.

> Signed-off-by: Sandeep Singh <sandeep.singh@amd.com>
> 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(-)
> 
> 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
> 

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] AMD_SFH: Fix for incorrect Sensor index
  2020-10-23  9:05 ` Jiri Kosina
@ 2020-10-23  9:22   ` Singh, Sandeep
  0 siblings, 0 replies; 3+ messages in thread
From: Singh, Sandeep @ 2020-10-23  9:22 UTC (permalink / raw)
  To: Jiri Kosina, Sandeep Singh
  Cc: benjamin.tissoires, linux-kernel, linux-input, jic23,
	Nehal-bakulchandra.Shah, Shyam-sundar.S-k, lipheng,
	Richard Neumann

Hi Jiri,

On 10/23/2020 2:35 PM, Jiri Kosina wrote:
> [CAUTION: External Email]
>
> On Fri, 23 Oct 2020, Sandeep Singh wrote:
>
>> From: Sandeep Singh <sandeep.singh@amd.com>
>>
>> Add fix for incorrect sensor index and minor code clean-up.
>>
>> Reported-by: Mandoli <lipheng@hanmail.net>
> 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

>
> Thanks.
>
>> Signed-off-by: Sandeep Singh <sandeep.singh@amd.com>
>> 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(-)
>>
>> 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
>>
> --
> Jiri Kosina
> SUSE Labs
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-23  9:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-23  8:59 [PATCH] AMD_SFH: Fix for incorrect Sensor index Sandeep Singh
2020-10-23  9:05 ` Jiri Kosina
2020-10-23  9:22   ` Singh, Sandeep

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).