devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dt: bindings: net: ath11k: add qcom,board_id definition
@ 2019-12-17 16:43 John Crispin
  2019-12-17 16:43 ` [PATCH 2/2] ath11k: load appropriate board data based on board id John Crispin
  2019-12-19 13:49 ` [PATCH 1/2] dt: bindings: net: ath11k: add qcom,board_id definition Kalle Valo
  0 siblings, 2 replies; 4+ messages in thread
From: John Crispin @ 2019-12-17 16:43 UTC (permalink / raw)
  To: Kalle Valo, Rob Herring; +Cc: linux-wireless, ath11k, devicetree, John Crispin

We need to be able to define what id the board has allowing us to load the
correct definition data. This patch adds the description of the required
property.

Signed-off-by: John Crispin <john@phrozen.org>
---
 .../devicetree/bindings/net/wireless/qcom,ath11k.yaml        | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
index a1717db36dba..c68daf6ad424 100644
--- a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
+++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
@@ -142,6 +142,11 @@ properties:
         * reg
         * reg-names
 
+  qcom,board_id:
+      $ref: /schemas/types.yaml#/definitions/uint32
+      description:
+        The board id defining what board definition should be loaded
+
 required:
   - compatible
   - reg
-- 
2.20.1


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

* [PATCH 2/2] ath11k: load appropriate board data based on board id
  2019-12-17 16:43 [PATCH 1/2] dt: bindings: net: ath11k: add qcom,board_id definition John Crispin
@ 2019-12-17 16:43 ` John Crispin
  2019-12-19 13:49 ` [PATCH 1/2] dt: bindings: net: ath11k: add qcom,board_id definition Kalle Valo
  1 sibling, 0 replies; 4+ messages in thread
From: John Crispin @ 2019-12-17 16:43 UTC (permalink / raw)
  To: Kalle Valo, Rob Herring
  Cc: linux-wireless, ath11k, devicetree, Venkateswara Naralasetty,
	John Crispin

From: Venkateswara Naralasetty <vnaralas@codeaurora.org>

This patch add support to read board id from dts and load
appropriate board data from userland.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/qmi.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
index 2377895a58ec..e80290c7c9dd 100644
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -1712,9 +1712,11 @@ static int ath11k_qmi_alloc_target_mem_chunk(struct ath11k_base *ab)
 
 static int ath11k_qmi_request_target_cap(struct ath11k_base *ab)
 {
+	struct device *dev = ab->dev;
 	struct qmi_wlanfw_cap_req_msg_v01 req;
 	struct qmi_wlanfw_cap_resp_msg_v01 resp;
 	struct qmi_txn txn = {};
+	unsigned int board_id;
 	int ret = 0;
 
 	memset(&req, 0, sizeof(req));
@@ -1753,10 +1755,14 @@ static int ath11k_qmi_request_target_cap(struct ath11k_base *ab)
 		ab->qmi.target.chip_family = resp.chip_info.chip_family;
 	}
 
-	if (resp.board_info_valid)
+	if (!of_property_read_u32(dev->of_node, "qcom,board_id", &board_id)) {
+		if (board_id != 0xFF)
+			ab->qmi.target.board_id = board_id;
+	} else if (resp.board_info_valid) {
 		ab->qmi.target.board_id = resp.board_info.board_id;
-	else
+	} else {
 		ab->qmi.target.board_id = 0xFF;
+	}
 
 	if (resp.soc_info_valid)
 		ab->qmi.target.soc_id = resp.soc_info.soc_id;
-- 
2.20.1


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

* Re: [PATCH 1/2] dt: bindings: net: ath11k: add qcom,board_id definition
  2019-12-17 16:43 [PATCH 1/2] dt: bindings: net: ath11k: add qcom,board_id definition John Crispin
  2019-12-17 16:43 ` [PATCH 2/2] ath11k: load appropriate board data based on board id John Crispin
@ 2019-12-19 13:49 ` Kalle Valo
  2019-12-19 13:57   ` John Crispin
  1 sibling, 1 reply; 4+ messages in thread
From: Kalle Valo @ 2019-12-19 13:49 UTC (permalink / raw)
  To: John Crispin; +Cc: Rob Herring, devicetree, linux-wireless, ath11k

John Crispin <john@phrozen.org> writes:

> We need to be able to define what id the board has allowing us to load the
> correct definition data. This patch adds the description of the required
> property.
>
> Signed-off-by: John Crispin <john@phrozen.org>
> ---
>  .../devicetree/bindings/net/wireless/qcom,ath11k.yaml        | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
> index a1717db36dba..c68daf6ad424 100644
> --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
> +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
> @@ -142,6 +142,11 @@ properties:
>          * reg
>          * reg-names
>  
> +  qcom,board_id:
> +      $ref: /schemas/types.yaml#/definitions/uint32
> +      description:
> +        The board id defining what board definition should be loaded

I think this needs more discussion. This is very tricky to get right, as
it needs to be extensible and what not. With ath10k we have learned that
a simple integer is not enough.

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

* Re: [PATCH 1/2] dt: bindings: net: ath11k: add qcom,board_id definition
  2019-12-19 13:49 ` [PATCH 1/2] dt: bindings: net: ath11k: add qcom,board_id definition Kalle Valo
@ 2019-12-19 13:57   ` John Crispin
  0 siblings, 0 replies; 4+ messages in thread
From: John Crispin @ 2019-12-19 13:57 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Rob Herring, devicetree, linux-wireless, ath11k

On 19/12/2019 14:49, Kalle Valo wrote:
> John Crispin <john@phrozen.org> writes:
> 
>> We need to be able to define what id the board has allowing us to load the
>> correct definition data. This patch adds the description of the required
>> property.
>>
>> Signed-off-by: John Crispin <john@phrozen.org>
>> ---
>>   .../devicetree/bindings/net/wireless/qcom,ath11k.yaml        | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
>> index a1717db36dba..c68daf6ad424 100644
>> --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
>> +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
>> @@ -142,6 +142,11 @@ properties:
>>           * reg
>>           * reg-names
>>   
>> +  qcom,board_id:
>> +      $ref: /schemas/types.yaml#/definitions/uint32
>> +      description:
>> +        The board id defining what board definition should be loaded
> 
> I think this needs more discussion. This is very tricky to get right, as
> it needs to be extensible and what not. With ath10k we have learned that
> a simple integer is not enough.
> 

I was expecting this, there seems to be an option to add ranges and/or 
enums. I did however fail to find any docs on the schemeas.
	John

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

end of thread, other threads:[~2019-12-19 13:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-17 16:43 [PATCH 1/2] dt: bindings: net: ath11k: add qcom,board_id definition John Crispin
2019-12-17 16:43 ` [PATCH 2/2] ath11k: load appropriate board data based on board id John Crispin
2019-12-19 13:49 ` [PATCH 1/2] dt: bindings: net: ath11k: add qcom,board_id definition Kalle Valo
2019-12-19 13:57   ` John Crispin

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).