From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31549C433DB for ; Fri, 19 Mar 2021 12:51:54 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C6C3B64E60 for ; Fri, 19 Mar 2021 12:51:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C6C3B64E60 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=k2VoqM6LD9rZ2V87LSyB+vJ5pEnDHOeIsfvfjuc1yks=; b=qBusJlNxtEQN+w2jPxlrEFaI9H +i/V18iBQkliynBjvcphf0/FdKuFVkhoQHVeToqaEmIBnVVXfsFtz7f56CDiUuVAz1b8AIzPfJ/i8 XNfmuocXPtSPNoZBxbB7obV/L7nwHY10t4lI2Q2S6HpjMXps5YT1YXrclVi3Ko/CpEhDsM2lYB97P WktJ/jw6J2KNgzId6roCmbsfhl8Xlce5CKDA08ddPH9oQiEFn/Nj/0skuJdfFeDPIYf99HiAryJeq MRd1J01RePJQpEd/EOtp7hfL2PCsu0HUM/va8THTIzPsZnSg2r/jNv8Mqqda9ehfpcdYr3L4+bZtG v1gmKnVg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNEZv-007QJG-RE; Fri, 19 Mar 2021 12:50:11 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNEXv-007QCZ-Kt for linux-arm-kernel@lists.infradead.org; Fri, 19 Mar 2021 12:50:09 +0000 Received: by mail-lf1-x12d.google.com with SMTP id w37so9786794lfu.13 for ; Fri, 19 Mar 2021 05:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tJ0DUph+vyz3epf64uj+7Wf03DBx5o9De5e6QoFkuEg=; b=G3WgFQ+oAYx4RGT+eC1NFGKg1wcQT44nL6HAJ2fWrmo96QWZQAImXkWoclmhZ6Zl0M J/3gim4cq/zeTLBcj7Art8zPGHczwCl94wrUyGheV1BznlN9hvuWHLPUow1gSQbeaWUu 1zFFtICMXEnHriOfc2ZU8KSsni1goeP2wFdwalCM3cofB5SdjY3K6EleSMyv8zziqhmb aJf7JVvHfhdvsmwy0jC1k32gtAtdJN6m8t3L0eEleXFetKIV/A6aNn2BaKQVpy1ZtAeA bvTQDig6pcBY+Z4r/ZIgHI0+5bxiTQhR3eVwg3HkRiT2Ksm6h1xAnP9za2TEFDYbFV47 M7JA== 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=tJ0DUph+vyz3epf64uj+7Wf03DBx5o9De5e6QoFkuEg=; b=tKx/pGOp1/DQdzYwAfiplI2fS98mQt1fWW48Vs8d+1UwqqBhldtCer4f4FZMtVkfzp TdEylNfFxjpTaOCH1rBQEGFeuMiLumHVDxQQRV2dhBRGbpVXEal8U1leXtMeB9ho6gcS 2rSghgwvEolxVv8rvp09tWsYluYUHAfmYN2x1iNxprZ/nkg0LTRg5pO1OUYM9MBdXNHs aFwD6QgMU7i4Ag7TlJMY3mC42VAxDWMgyT8Sf5MgHm00Pxg+lvo9fqZIpB8o22ewMZXx 3VL7Z3izSfi7ju84vZVBYhME6FYPzMspZeoQrNAugOiMu2eFRuwhm3UJd3kbfQzGRgpc q4QA== X-Gm-Message-State: AOAM533ceYzR9n0wM/Q8qzoekgSp4oMzqhjya2+3EE575BpAZPvVCEyn SfYrvlZnNMSGieNFrnioh1Ja3pfAkX20RoduCLE= X-Google-Smtp-Source: ABdhPJxPvQyDu0N1LFLcPU2/UCnNo8dJL5h8bCbVuDchP0tFscqj6tQ7L+IWnADk+5ojy6p6bYShgA== X-Received: by 2002:a05:6512:96e:: with SMTP id v14mr702603lft.490.1616158084790; Fri, 19 Mar 2021 05:48:04 -0700 (PDT) Received: from localhost.localdomain (c-d7cb225c.014-348-6c756e10.bbcust.telenor.se. [92.34.203.215]) by smtp.gmail.com with ESMTPSA id x7sm747214ljc.118.2021.03.19.05.48.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 05:48:04 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Cc: Linus Walleij , Stephan Gerhold Subject: [PATCH v3] ARM: dts: ux500: Fix BT+WLAN on Janice Date: Fri, 19 Mar 2021 13:48:02 +0100 Message-Id: <20210319124802.485087-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210319_125007_931863_A267ED62 X-CRM114-Status: GOOD ( 25.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Rename the regulator and handle to indicate that it handles both WLAN and BT. The BCM4330 WL_RESET is connected to GPIO215 and needs to be driven high so that the WLAN chip goes out of reset and enumerates on the SDIO bus. Since the device will not probe until the SDIO card enumerates, we need to hack the pin config for GPIO215 into the regulator so that when VMMC is enabled, we also de-assert WL_RESET and the WLAN comes up. We cannot have the pin config as part of the WLAN device since pin configs are applied when probing, and probing doesn't happen unless WL_RESET is deasserted (catch 22). Add explicit BCM4330 compatible to the WLAN chip. Cc: Stephan Gerhold Signed-off-by: Linus Walleij --- ChangeLog v2->v3: - Break out patch, Janice has BCM4330 and is different from Golden and Skomer. ChangeLog v1->v2: - Change compatible strings on the WLAN chips to be specific-to-generic indicating the exact model. --- .../arm/boot/dts/ste-ux500-samsung-janice.dts | 43 ++++++++++++------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/arch/arm/boot/dts/ste-ux500-samsung-janice.dts b/arch/arm/boot/dts/ste-ux500-samsung-janice.dts index 7411bfeda285..3da0a8b97df2 100644 --- a/arch/arm/boot/dts/ste-ux500-samsung-janice.dts +++ b/arch/arm/boot/dts/ste-ux500-samsung-janice.dts @@ -135,14 +135,20 @@ lcd_1v8_reg: regulator-gpio-lcd-1v8 { /* * This regulator is a GPIO line that drives the Broadcom WLAN - * line BT_VREG_EN high and enables the internal regulators - * inside the chip. + * and Bluetooth line BT_VREG_EN high and enables the internal + * regulators inside the chip. + * + * The chip actually has two signals for powering on WLAN and + * BT: BT_REG_ON and WL_REG_ON, but since these are OR:ed inside + * the chip the system designers have decided to connect just one + * of them, however both WLAN and BT need to enable this supply + * to power each part on, so it is a shared regulator. * * The voltage specified here is only used to determine the OCR mask, * the for the SDIO connector, the chip is actually connected * directly to VBAT. */ - wl_bt_reg: regulator-gpio-wlan { + wl_bt_reg: regulator-gpio-wlan-bt { compatible = "regulator-fixed"; regulator-name = "BT_VREG_EN"; regulator-min-microvolt = <3000000>; @@ -152,7 +158,7 @@ wl_bt_reg: regulator-gpio-wlan { gpio = <&gpio6 30 GPIO_ACTIVE_HIGH>; enable-active-high; pinctrl-names = "default"; - pinctrl-0 = <&wlan_ldo_en_default>; + pinctrl-0 = <&wlan_bt_ldo_en_default>; }; @@ -401,15 +407,13 @@ mmc@80118000 { status = "okay"; wifi@1 { - /* Actually BRCM4330 */ - compatible = "brcm,bcm4329-fmac"; + compatible = "brcm,bcm4330-fmac", "brcm,bcm4329-fmac"; reg = <1>; /* GPIO216 WL_HOST_WAKE */ interrupt-parent = <&gpio6>; interrupts = <24 IRQ_TYPE_EDGE_FALLING>; interrupt-names = "host-wake"; /* GPIO215 WLAN_RST_N */ - /* FIXME: kernel does not use this assert/deassert */ reset-gpios = <&gpio6 23 GPIO_ACTIVE_LOW>; pinctrl-names = "default"; pinctrl-0 = <&wlan_default_mode>; @@ -439,13 +443,15 @@ uart@80120000 { status = "okay"; bluetooth { + /* BRCM4330B1 actually */ compatible = "brcm,bcm4330-bt"; /* * We actually have shutdown-gpios, BT_VREG_EN on GPIO222, * but since this GPIO is shared with the WLAN chip, we need * to reference the regulator instead. The regulator * framework will reference count the GPIO usage and - * make sure we can use the same GPIO for several supplies. + * make sure we can use the same GPIO regulator for several + * supplies. */ // shutdown-gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>; vbat-supply = <&wl_bt_reg>; @@ -756,14 +762,24 @@ janice_cfg1 { }; }; }; - /* GPIO that enables the WLAN internal LDO regulators */ - wlan-ldo { - wlan_ldo_en_default: wlan_ldo_default { + /* GPIO that enables the WLAN and Bluetooth internal LDO regulators */ + wlan-bt-ldo { + wlan_bt_ldo_en_default: wlan_bt_ldo_default { /* GPIO222 BT_VREG_ON */ janice_cfg1 { pins = "GPIO222_AJ9"; ste,config = <&gpio_out_lo>; }; + /* + * HACK: this is the WL_RESET line that technically has nothing + * to do with the regulator, but in order for the SDIO card + * to enumerate, this must be driven high, so we need to do + * that here. + */ + janice_cfg2 { + pins = "GPIO215_AH13"; /* RESET_N */ + ste,config = <&gpio_out_hi>; + }; }; }; /* Flash and torch */ @@ -875,11 +891,6 @@ janice_cfg2 { }; wlan { wlan_default_mode: wlan_default { - /* GPIO215 used for RESET_N */ - janice_cfg1 { - pins = "GPIO215_AH13"; - ste,config = <&gpio_out_lo>; - }; /* GPIO216 for WL_HOST_WAKE */ janice_cfg2 { pins = "GPIO216_AG12"; -- 2.29.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel