ATH10K Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: ath10k: fix qcom,coexist-support documentation
@ 2022-12-31  4:47 Vincent Tremblay
  2022-12-31  4:58 ` [PATCH v2] " Vincent Tremblay
  2022-12-31 14:15 ` [PATCH] " Vincent Tremblay
  0 siblings, 2 replies; 3+ messages in thread
From: Vincent Tremblay @ 2022-12-31  4:47 UTC (permalink / raw)
  Cc: ath10k, vincent

The driver is reading the value using the function
"of_property_read_u8", which is expecting the data to be
represented on 8 bits.

By default, the value specified in the DT is saved using a 32 bits
format, which cause the driver to read "0" instead of "1".

To make the driver work properly, the DT should specify the right
data representation to use.

Signed-off-by: Vincent Tremblay <vincent@vtremblay.dev>
---
 .../devicetree/bindings/net/wireless/qcom,ath10k.txt        | 6 +++---
 drivers/net/wireless/ath/ath10k/core.c                      | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
index b61c2d5a0ff7..b71e97cb6c24 100644
--- a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
+++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
@@ -92,8 +92,8 @@ Optional properties:
 - qcom,msa-fixed-perm: Boolean context flag to disable SCM call for statically
 		       mapped msa region.
 
-- qcom,coexist-support : should contain eithr "0" or "1" to indicate coex
-			 support by the hardware.
+- qcom,coexist-support : should contain a 8 bits value representing either 
+			 "0" or "1" to indicate coex support by the hardware.
 - qcom,coexist-gpio-pin : gpio pin number  information to support coex
 			  which will be used by wifi firmware.
 
@@ -176,7 +176,7 @@ wifi0: wifi@a000000 {
 	qcom,msi_addr = <0x0b006040>;
 	qcom,msi_base = <0x40>;
 	qcom,ath10k-pre-calibration-data = [ 01 02 03 ... ];
-	qcom,coexist-support = <1>;
+	qcom,coexist-support = /bits/ 8 <1>;
 	qcom,coexist-gpio-pin = <0x33>;
 };
 
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 5eb131ab916f..802d6a12dc1e 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -2355,14 +2355,14 @@ static int ath10k_download_cal_data(struct ath10k *ar)
 static void ath10k_core_fetch_btcoex_dt(struct ath10k *ar)
 {
 	struct device_node *node;
-	u8 coex_support = 0;
+	u32 coex_support = 0;
 	int ret;
 
 	node = ar->dev->of_node;
 	if (!node)
 		goto out;
 
-	ret = of_property_read_u8(node, "qcom,coexist-support", &coex_support);
+	ret = of_property_read_u32(node, "qcom,coexist-support", &coex_support);
 	if (ret) {
 		ar->coex_support = true;
 		goto out;
-- 
2.37.2


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* [PATCH v2] dt-bindings: ath10k: fix qcom,coexist-support documentation
  2022-12-31  4:47 [PATCH] dt-bindings: ath10k: fix qcom,coexist-support documentation Vincent Tremblay
@ 2022-12-31  4:58 ` Vincent Tremblay
  2022-12-31 14:15 ` [PATCH] " Vincent Tremblay
  1 sibling, 0 replies; 3+ messages in thread
From: Vincent Tremblay @ 2022-12-31  4:58 UTC (permalink / raw)
  Cc: ath10k, vincent

The driver is reading the value using the function
"of_property_read_u8", which is expecting the data to be
represented on 8 bits.

By default, the value specified in the DT is saved using a 32 bits
format, which cause the driver to read "0" instead of "1".

To make the driver work properly, the DT should specify the right
data representation to use.

Signed-off-by: Vincent Tremblay <vincent@vtremblay.dev>
---
v2 changes:
 - Remove unrelated changes

 .../devicetree/bindings/net/wireless/qcom,ath10k.txt        | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
index b61c2d5a0ff7..4a66ceeb1e76 100644
--- a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
+++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
@@ -92,8 +92,8 @@ Optional properties:
 - qcom,msa-fixed-perm: Boolean context flag to disable SCM call for statically
 		       mapped msa region.
 
-- qcom,coexist-support : should contain eithr "0" or "1" to indicate coex
-			 support by the hardware.
+- qcom,coexist-support : should contain a 8 bits value representing either
+			 "0" or "1" to indicate coex support by the hardware.
 - qcom,coexist-gpio-pin : gpio pin number  information to support coex
 			  which will be used by wifi firmware.
 
@@ -176,7 +176,7 @@ wifi0: wifi@a000000 {
 	qcom,msi_addr = <0x0b006040>;
 	qcom,msi_base = <0x40>;
 	qcom,ath10k-pre-calibration-data = [ 01 02 03 ... ];
-	qcom,coexist-support = <1>;
+	qcom,coexist-support = /bits/ 8 <1>;
 	qcom,coexist-gpio-pin = <0x33>;
 };
 
-- 
2.37.2


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [PATCH] dt-bindings: ath10k: fix qcom,coexist-support documentation
  2022-12-31  4:47 [PATCH] dt-bindings: ath10k: fix qcom,coexist-support documentation Vincent Tremblay
  2022-12-31  4:58 ` [PATCH v2] " Vincent Tremblay
@ 2022-12-31 14:15 ` Vincent Tremblay
  1 sibling, 0 replies; 3+ messages in thread
From: Vincent Tremblay @ 2022-12-31 14:15 UTC (permalink / raw)
  To: ath10k; +Cc: vincent

On Fri, Dec 30, 2022 at 11:47:52PM -0500, Vincent Tremblay wrote:
> The driver is reading the value using the function
> "of_property_read_u8", which is expecting the data to be
> represented on 8 bits.
> 
> By default, the value specified in the DT is saved using a 32 bits
> format, which cause the driver to read "0" instead of "1".
> 
> To make the driver work properly, the DT should specify the right
> data representation to use.
> 
> Signed-off-by: Vincent Tremblay <vincent@vtremblay.dev>
> ---
>  .../devicetree/bindings/net/wireless/qcom,ath10k.txt        | 6 +++---
>  drivers/net/wireless/ath/ath10k/core.c                      | 4 ++--
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
> index b61c2d5a0ff7..b71e97cb6c24 100644
> --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
> +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
> @@ -92,8 +92,8 @@ Optional properties:
>  - qcom,msa-fixed-perm: Boolean context flag to disable SCM call for statically
>  		       mapped msa region.
>  
> -- qcom,coexist-support : should contain eithr "0" or "1" to indicate coex
> -			 support by the hardware.
> +- qcom,coexist-support : should contain a 8 bits value representing either 
> +			 "0" or "1" to indicate coex support by the hardware.
>  - qcom,coexist-gpio-pin : gpio pin number  information to support coex
>  			  which will be used by wifi firmware.
>  
> @@ -176,7 +176,7 @@ wifi0: wifi@a000000 {
>  	qcom,msi_addr = <0x0b006040>;
>  	qcom,msi_base = <0x40>;
>  	qcom,ath10k-pre-calibration-data = [ 01 02 03 ... ];
> -	qcom,coexist-support = <1>;
> +	qcom,coexist-support = /bits/ 8 <1>;
>  	qcom,coexist-gpio-pin = <0x33>;
>  };
> -- 
> 2.37.2
>
The more I think about this, the more I think it is probably better to
change the code to read the "qcom,coexist-support" property as a u32
instead of a u8. This would simplify the DT syntax and make it easier to
write.

Please ignore this patch, I will create a new one to modify the driver.

Regards,
Vincent Tremblay

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

end of thread, other threads:[~2022-12-31 14:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-31  4:47 [PATCH] dt-bindings: ath10k: fix qcom,coexist-support documentation Vincent Tremblay
2022-12-31  4:58 ` [PATCH v2] " Vincent Tremblay
2022-12-31 14:15 ` [PATCH] " Vincent Tremblay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox