linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] brcmfmac: Add sg parameters dts parsing
@ 2017-12-01  7:55 Chi-Hsien Lin
  2017-12-01  8:38 ` Arend van Spriel
  0 siblings, 1 reply; 3+ messages in thread
From: Chi-Hsien Lin @ 2017-12-01  7:55 UTC (permalink / raw)
  To: linux-wireless
  Cc: Kalle Valo, brcm80211-dev-list, brcm80211-dev-list.pdl,
	arend.vanspriel, franky.lin, hante.meuleman, Wright Feng,
	Stanley Hsu

broken_sg_support, sd_head_align, and sd_sgentry_align are used in
brcmfmac code but not configurable in dts file. Add the parsing logic.
Now they can be configured like below in dts:
	brcm,broken_sg_support;
	brcm,sd_head_align = /bits/ 16 <4>;
	brcm,sd_sgentry_align = /bits/ 16 <4>;

Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
index aee6e59..023f8ea 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
@@ -30,14 +30,22 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
 	struct device_node *np = dev->of_node;
 	int irq;
 	u32 irqf;
-	u32 val;
+	u32 val32;
+	u16 val16;
 
 	if (!np || bus_type != BRCMF_BUSTYPE_SDIO ||
 	    !of_device_is_compatible(np, "brcm,bcm4329-fmac"))
 		return;
 
-	if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0)
-		sdio->drive_strength = val;
+	if (of_property_read_u32(np, "brcm,drive-strength", &val32) == 0)
+		sdio->drive_strength = val32;
+
+	sdio->broken_sg_support = of_property_read_bool(np,
+							"brcm,broken_sg_support");
+	if (of_property_read_u16(np, "brcm,sd_head_align", &val16) == 0)
+		sdio->sd_head_align = val16;
+	if (of_property_read_u16(np, "brcm,sd_sgentry_align", &val16) == 0)
+		sdio->sd_sgentry_align = val16;
 
 	/* make sure there are interrupts defined in the node */
 	if (!of_find_property(np, "interrupts", NULL))
-- 
2.1.0

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

* Re: [PATCH] brcmfmac: Add sg parameters dts parsing
  2017-12-01  7:55 [PATCH] brcmfmac: Add sg parameters dts parsing Chi-Hsien Lin
@ 2017-12-01  8:38 ` Arend van Spriel
  2017-12-02 14:45   ` Kalle Valo
  0 siblings, 1 reply; 3+ messages in thread
From: Arend van Spriel @ 2017-12-01  8:38 UTC (permalink / raw)
  To: Chi-Hsien Lin, linux-wireless
  Cc: Kalle Valo, brcm80211-dev-list, brcm80211-dev-list.pdl,
	franky.lin, hante.meuleman, Wright Feng, Stanley Hsu

On 12/1/2017 8:55 AM, Chi-Hsien Lin wrote:
> broken_sg_support, sd_head_align, and sd_sgentry_align are used in
> brcmfmac code but not configurable in dts file. Add the parsing logic.
> Now they can be configured like below in dts:
> 	brcm,broken_sg_support;
> 	brcm,sd_head_align =/bits/  16 <4>;
> 	brcm,sd_sgentry_align =/bits/  16 <4>;

Hi Chi-Hsien,

For device tree support you should submit a separate commit on the dt 
binding specification. For broadcom fullmac chipsets binding spec can be 
found in 
Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt.

The alignment properties are to be specified in bytes, not bits.

Regards,
Arend

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

* Re: [PATCH] brcmfmac: Add sg parameters dts parsing
  2017-12-01  8:38 ` Arend van Spriel
@ 2017-12-02 14:45   ` Kalle Valo
  0 siblings, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2017-12-02 14:45 UTC (permalink / raw)
  To: Arend van Spriel
  Cc: Chi-Hsien Lin, linux-wireless, brcm80211-dev-list,
	brcm80211-dev-list.pdl, franky.lin, hante.meuleman, Wright Feng,
	Stanley Hsu

Arend van Spriel <arend.vanspriel@broadcom.com> writes:

> On 12/1/2017 8:55 AM, Chi-Hsien Lin wrote:
>> broken_sg_support, sd_head_align, and sd_sgentry_align are used in
>> brcmfmac code but not configurable in dts file. Add the parsing logic.
>> Now they can be configured like below in dts:
>> 	brcm,broken_sg_support;
>> 	brcm,sd_head_align =/bits/  16 <4>;
>> 	brcm,sd_sgentry_align =/bits/  16 <4>;
>
> Hi Chi-Hsien,
>
> For device tree support you should submit a separate commit on the dt
> binding specification. For broadcom fullmac chipsets binding spec can
> be found in
> Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt.

And remember to CC the device tree mailing list. I need an ack from the
DT maintainers before I can apply the patch.

-- 
Kalle Valo

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

end of thread, other threads:[~2017-12-02 14:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-01  7:55 [PATCH] brcmfmac: Add sg parameters dts parsing Chi-Hsien Lin
2017-12-01  8:38 ` Arend van Spriel
2017-12-02 14:45   ` Kalle Valo

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