From patchwork Sat Jan 7 22:43:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 9503295 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CF35F606E1 for ; Sat, 7 Jan 2017 22:43:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4A2728419 for ; Sat, 7 Jan 2017 22:43:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9690B28421; Sat, 7 Jan 2017 22:43:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 133EE28419 for ; Sat, 7 Jan 2017 22:43:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755661AbdAGWn5 (ORCPT ); Sat, 7 Jan 2017 17:43:57 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:33794 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750945AbdAGWn4 (ORCPT ); Sat, 7 Jan 2017 17:43:56 -0500 Received: by mail-lf0-f66.google.com with SMTP id q89so2676977lfi.1 for ; Sat, 07 Jan 2017 14:43:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nCGZhbLNTlXQ5C69EB/2iDiPnM+YBWR7PSHlU6sdsPE=; b=Zn0IbyerNmKOvuwOEDYvGxTPXgOFRWAVK8XxJ5NCO6BiWx0njqKdsqg5+LxXZ3DA8i 4kpBVNdI3YFBJ335JErDZNfllqcTGu/er5PDvdTsX7TrXzYC0xrCeMTa6RCvxffpUGrW V5Kbq6zGhMRbZYfuONWa+UJsUuf0uS2jDtcv5WlNIJQqmITbPDAkpC766WKyka3c9RiZ UMG051nlKN7sZZQo2xwDY0kr74r+GWjUPOtcant9faHQdqEYeTZwNX/QeDYQ21dexjzh 272gRGYqlzJew42qyBOoHRWuNcLxwXs+B+FmnrGfCaUKwnL/Ti3lmN/G6n/C8/HNDNDk jL2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nCGZhbLNTlXQ5C69EB/2iDiPnM+YBWR7PSHlU6sdsPE=; b=CI47xKBb8y39tQQkJQBBGD/494sviVR31nj+ZGIYLwR+91WTMV2iuxRW/2q4PGUsuj SA+RSnZgM5RCNdumAJI63UQ4B1Y6yL5JqDeGDSOtYk54xqXRl5zt5e1VUZpKSK38c37I zWXpSLx9QR1FF+jfuRfI0ufsZMN6q5CEvAinSDSF+jQGDjGGkziro7GnTeJsIWEgecEP HkjAGnoOlKZzaTyEPWKKB2Okuv+8m3bjBrII33GkFiPXgNi/KbaRMMlnbnQVOQOT9sxt obsmC/MESqhOjjPw5UU5i6ivMzVhoZ66Xu9GMtzx+Kvn4qGR4VPowwMQsdGk16CMLwfO JRGw== X-Gm-Message-State: AIkVDXIP+mAQ9tjVh+87NemRClgp7Gm13FUFN4+M3kbSGrPqwqNEp3evLaxlZAaT2en4qQ== X-Received: by 10.25.75.80 with SMTP id y77mr27994885lfa.173.1483829034085; Sat, 07 Jan 2017 14:43:54 -0800 (PST) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id j9sm8378922lfe.23.2017.01.07.14.43.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Jan 2017 14:43:53 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Pieter-Paul Giesberts , Franky Lin , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH] brcmfmac: make brcmf_of_probe more generic Date: Sat, 7 Jan 2017 23:43:45 +0100 Message-Id: <20170107224345.3079-1-zajec5@gmail.com> X-Mailer: git-send-email 2.10.1 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafał Miłecki We may want to use Open Firmware for other devices than just SDIO ones. In future we may want to support more Broadcom properties so there is really no reason for such limitation. Call brcmf_of_probe for all kind of devices & move extra conditions to the body of that funcion. Signed-off-by: Rafał Miłecki --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 8 +++----- drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | 7 +++++-- drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.h | 6 ++++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c index 3e15d64..b1f574f 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c @@ -299,11 +299,9 @@ struct brcmf_mp_device *brcmf_get_module_param(struct device *dev, } } } - if ((bus_type == BRCMF_BUSTYPE_SDIO) && (!found)) { - /* No platform data for this device. In case of SDIO try OF - * (Open Firwmare) Device Tree. - */ - brcmf_of_probe(dev, &settings->bus.sdio); + if (!found) { + /* No platform data for this device, try OF (Open Firwmare) */ + brcmf_of_probe(dev, bus_type, settings); } return settings; } diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c index 425c41d..aee6e59 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c @@ -23,14 +23,17 @@ #include "common.h" #include "of.h" -void brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd *sdio) +void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, + struct brcmf_mp_device *settings) { + struct brcmfmac_sdio_pd *sdio = &settings->bus.sdio; struct device_node *np = dev->of_node; int irq; u32 irqf; u32 val; - if (!np || !of_device_is_compatible(np, "brcm,bcm4329-fmac")) + 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) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.h index a9d94c1..95b7032 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.h @@ -14,9 +14,11 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifdef CONFIG_OF -void brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd *sdio); +void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, + struct brcmf_mp_device *settings); #else -static void brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd *sdio) +static void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, + struct brcmf_mp_device *settings) { } #endif /* CONFIG_OF */