[PATCH v4] ARM: dts: ux500: Fix BT+WLAN on Janice

Stephan Gerhold stephan at gerhold.net
Sat Mar 20 15:28:44 GMT 2021


On Sat, Mar 20, 2021 at 02:10:35AM +0100, Linus Walleij wrote:
> GPIO215 has a rail named WLAN_RST_N but it is actually connected
> to the pin WLAN_REG_ON on the BCM4330 chip, so this should be
> the WLAN regulator GPIO rather than GPIO222. The misunderstanding
> comes from the erroneous naming of the rail on the schematic.
> 
> GPIO222 is indeed connected to the rail BT_VREG_EN and the pin
> BT_REG_ON, and can be handled by the driver as usual.
> 
> This corrects misunderstandings and makes Janice's WLAN and BT
> setup look like that of Golden and Skomer.
> 
> Add explicit BCM4330 compatible to the WLAN chip.
> 
> Cc: Stephan Gerhold <stephan at gerhold.net>
> Signed-off-by: Linus Walleij <linus.walleij at linaro.org>

This looks great, thanks for your patience to resolve the confusion! :)

Reviewed-by: Stephan Gerhold <stephan at gerhold.net>

Consider fixing the typo below when you apply this.

Thanks!
Stephan

> ---
> ChangeLog v3->v4:
> - Resolve the confusion around WLAN_RST_N
> 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 | 48 +++++++------------
>  1 file changed, 18 insertions(+), 30 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..f24369873ce2 100644
> --- a/arch/arm/boot/dts/ste-ux500-samsung-janice.dts
> +++ b/arch/arm/boot/dts/ste-ux500-samsung-janice.dts
> @@ -135,21 +135,22 @@ 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.
> +	 * line WL_REG_ON high and enables the internal regulators
> +	 * inside the chip. Unfortunatley it is erroneously named

Typo: Unfortunatley -> Unfortunately.

> +	 * WLAN_RST_N on the schematic but it is not a reset line.
>  	 *
>  	 * 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_reg: regulator-gpio-wlan {
>  		compatible = "regulator-fixed";
> -		regulator-name = "BT_VREG_EN";
> +		regulator-name = "WL_REG_ON";
>  		regulator-min-microvolt = <3000000>;
>  		regulator-max-microvolt = <3000000>;
>  		startup-delay-us = <100000>;
> -		/* GPIO222 (BT_VREG_EN) */
> -		gpio = <&gpio6 30 GPIO_ACTIVE_HIGH>;
> +		/* GPIO215 (WLAN_RST_N to WL_REG_ON) */
> +		gpio = <&gpio6 23 GPIO_ACTIVE_HIGH>;
>  		enable-active-high;
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&wlan_ldo_en_default>;
> @@ -390,11 +391,10 @@ mmc at 80118000 {
>  			pinctrl-1 = <&mc1_a_2_sleep>;
>  			/*
>  			 * GPIO-controlled voltage enablement: this drives
> -			 * the BT_VREG_EN line high when we use this device.
> -			 * Represented as regulator to fill OCR mask and to
> -			 * be usable in parallel with the Bluetooth chip.
> +			 * the WL_REG_ON line high when we use this device.
> +			 * Represented as regulator to fill OCR mask.
>  			 */
> -			vmmc-supply = <&wl_bt_reg>;
> +			vmmc-supply = <&wl_reg>;
>  
>  			#address-cells = <1>;
>  			#size-cells = <0>;
> @@ -408,9 +408,6 @@ wifi at 1 {
>  				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>;
>  			};
> @@ -440,15 +437,8 @@ uart at 80120000 {
>  
>  			bluetooth {
>  				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.
> -				 */
> -				// shutdown-gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>;
> -				vbat-supply = <&wl_bt_reg>;
> +				/* GPIO222 rail BT_VREG_EN to BT_REG_ON */
> +				shutdown-gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>;
>  				/* BT_WAKE on GPIO199 */
>  				device-wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
>  				/* BT_HOST_WAKE on GPIO97 */
> @@ -759,9 +749,9 @@ janice_cfg1 {
>  	/* GPIO that enables the WLAN internal LDO regulators */
>  	wlan-ldo {
>  		wlan_ldo_en_default: wlan_ldo_default {
> -			/* GPIO222 BT_VREG_ON */
> +			/* GPIO215 named WLAN_RST_N */
>  			janice_cfg1 {
> -				pins = "GPIO222_AJ9";
> +				pins = "GPIO215_AH13";
>  				ste,config = <&gpio_out_lo>;
>  			};
>  		};
> @@ -875,11 +865,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";
> @@ -889,14 +874,17 @@ janice_cfg2 {
>  	};
>  	bluetooth {
>  		bluetooth_default_mode: bluetooth_default {
> +			/* GPIO199 BT_WAKE and GPIO222 BT_VREG_ON */
>  			janice_cfg1 {
> -				pins = "GPIO199_AH23";
> +				pins = "GPIO199_AH23", "GPIO222_AJ9";
>  				ste,config = <&gpio_out_lo>;
>  			};
> +			/* GPIO97 BT_HOST_WAKE */
>  			janice_cfg2 {
>  				pins = "GPIO97_D9";
>  				ste,config = <&gpio_in_nopull>;
>  			};
> +			/* GPIO209 BT_RST_N */
>  			janice_cfg3 {
>  				pins = "GPIO209_AG15";
>  				ste,config = <&gpio_out_hi>;
> -- 
> 2.29.2
> 



More information about the linux-arm-kernel mailing list