All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: dts: sun7i: Add wifi dt node on Banana Pro
@ 2017-01-04 14:22 Jörg Krause
  2017-01-04 14:22 ` [PATCH 2/2] ARM: dts: sun7i: Enable audio codec " Jörg Krause
  2017-01-05 17:19 ` [PATCH 1/2] ARM: dts: sun7i: Add wifi dt node " Maxime Ripard
  0 siblings, 2 replies; 4+ messages in thread
From: Jörg Krause @ 2017-01-04 14:22 UTC (permalink / raw)
  To: linux-arm-kernel

The Banana Pro has an AMPAK AP6181 WiFi+Bluetooth module. The WiFi part
is a BCM43362 IC connected to MMC3 of the A20 SoC via SDIO. The IC also
takes a power enable signal via GPIO.

This commit adds a device-tree node to power it up, so the mmc subsys
can scan it, and enables the mmc controller which is connected to it.

As the wifi enable pin of the AP6181 module is not really a regulator,
switch the mmc3 node to the mmc-pwrseq framework for controlling it.
This more accurately reflectes how the hardware actually works.

Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
---
 arch/arm/boot/dts/sun7i-a20-bananapro.dts | 35 ++++++++++++++++++++-----------
 1 file changed, 23 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boot/dts/sun7i-a20-bananapro.dts b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
index 19d63d4049de..439ad50dcd4a 100644
--- a/arch/arm/boot/dts/sun7i-a20-bananapro.dts
+++ b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
@@ -76,6 +76,13 @@
 		};
 	};
 
+	mmc3_pwrseq: mmc3_pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		pinctrl-names = "default";
+		pinctrl-0 = <&vmmc3_pin_bananapro>;
+		reset-gpios = <&pio 7 22 GPIO_ACTIVE_LOW>;
+	};
+
 	reg_gmac_3v3: gmac-3v3 {
 		compatible = "regulator-fixed";
 		pinctrl-names = "default";
@@ -87,17 +94,6 @@
 		enable-active-high;
 		gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>;
 	};
-
-	reg_vmmc3: vmmc3 {
-		compatible = "regulator-fixed";
-		pinctrl-names = "default";
-		pinctrl-0 = <&vmmc3_pin_bananapro>;
-		regulator-name = "vmmc3";
-		regulator-min-microvolt = <3300000>;
-		regulator-max-microvolt = <3300000>;
-		enable-active-high;
-		gpio = <&pio 7 22 GPIO_ACTIVE_HIGH>;
-	};
 };
 
 &ahci {
@@ -166,10 +162,25 @@
 &mmc3 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc3_pins_a>;
-	vmmc-supply = <&reg_vmmc3>;
+	vmmc-supply = <&reg_vcc3v3>;
+	mmc-pwrseq = <&mmc3_pwrseq>;
 	bus-width = <4>;
 	non-removable;
+	wakeup-source;
 	status = "okay";
+
+	brcmf: bcrmf at 1 {
+		reg = <1>;
+		compatible = "brcm,bcm4329-fmac";
+		interrupt-parent = <&pio>;
+		interrupts = <7 15 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-names = "host-wake";
+	};
+};
+
+&mmc3_pins_a {
+	/* AP6181 requires pull-up */
+	allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 };
 
 &ohci0 {
-- 
2.11.0

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

* [PATCH 2/2] ARM: dts: sun7i: Enable audio codec on Banana Pro
  2017-01-04 14:22 [PATCH 1/2] ARM: dts: sun7i: Add wifi dt node on Banana Pro Jörg Krause
@ 2017-01-04 14:22 ` Jörg Krause
  2017-01-05 17:19   ` Maxime Ripard
  2017-01-05 17:19 ` [PATCH 1/2] ARM: dts: sun7i: Add wifi dt node " Maxime Ripard
  1 sibling, 1 reply; 4+ messages in thread
From: Jörg Krause @ 2017-01-04 14:22 UTC (permalink / raw)
  To: linux-arm-kernel

This commit enables the on-chip audio codec present on the A20 SoC
on the Banana Pro board.

Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
---
 arch/arm/boot/dts/sun7i-a20-bananapro.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/sun7i-a20-bananapro.dts b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
index 439ad50dcd4a..797de4c352a5 100644
--- a/arch/arm/boot/dts/sun7i-a20-bananapro.dts
+++ b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
@@ -100,6 +100,10 @@
 	status = "okay";
 };
 
+&codec {
+	status = "okay";
+};
+
 &ehci0 {
 	status = "okay";
 };
-- 
2.11.0

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

* [PATCH 1/2] ARM: dts: sun7i: Add wifi dt node on Banana Pro
  2017-01-04 14:22 [PATCH 1/2] ARM: dts: sun7i: Add wifi dt node on Banana Pro Jörg Krause
  2017-01-04 14:22 ` [PATCH 2/2] ARM: dts: sun7i: Enable audio codec " Jörg Krause
@ 2017-01-05 17:19 ` Maxime Ripard
  1 sibling, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2017-01-05 17:19 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Wed, Jan 04, 2017 at 03:22:49PM +0100, J?rg Krause wrote:
> The Banana Pro has an AMPAK AP6181 WiFi+Bluetooth module. The WiFi part
> is a BCM43362 IC connected to MMC3 of the A20 SoC via SDIO. The IC also
> takes a power enable signal via GPIO.
> 
> This commit adds a device-tree node to power it up, so the mmc subsys
> can scan it, and enables the mmc controller which is connected to it.
> 
> As the wifi enable pin of the AP6181 module is not really a regulator,
> switch the mmc3 node to the mmc-pwrseq framework for controlling it.
> This more accurately reflectes how the hardware actually works.
> 
> Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
> ---
>  arch/arm/boot/dts/sun7i-a20-bananapro.dts | 35 ++++++++++++++++++++-----------
>  1 file changed, 23 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/sun7i-a20-bananapro.dts b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
> index 19d63d4049de..439ad50dcd4a 100644
> --- a/arch/arm/boot/dts/sun7i-a20-bananapro.dts
> +++ b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
> @@ -76,6 +76,13 @@
>  		};
>  	};
>  
> +	mmc3_pwrseq: mmc3_pwrseq {

I'd rather have it named by its function rather than what it's
connected to (ie called wifi_pwrseq, or something like that). The node
names should also use dashes and not underscores.

> +		compatible = "mmc-pwrseq-simple";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&vmmc3_pin_bananapro>;
> +		reset-gpios = <&pio 7 22 GPIO_ACTIVE_LOW>;
> +	};
> +
>  	reg_gmac_3v3: gmac-3v3 {
>  		compatible = "regulator-fixed";
>  		pinctrl-names = "default";
> @@ -87,17 +94,6 @@
>  		enable-active-high;
>  		gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>;
>  	};
> -
> -	reg_vmmc3: vmmc3 {
> -		compatible = "regulator-fixed";
> -		pinctrl-names = "default";
> -		pinctrl-0 = <&vmmc3_pin_bananapro>;
> -		regulator-name = "vmmc3";
> -		regulator-min-microvolt = <3300000>;
> -		regulator-max-microvolt = <3300000>;
> -		enable-active-high;
> -		gpio = <&pio 7 22 GPIO_ACTIVE_HIGH>;
> -	};
>  };
>  
>  &ahci {
> @@ -166,10 +162,25 @@
>  &mmc3 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&mmc3_pins_a>;
> -	vmmc-supply = <&reg_vmmc3>;
> +	vmmc-supply = <&reg_vcc3v3>;
> +	mmc-pwrseq = <&mmc3_pwrseq>;
>  	bus-width = <4>;
>  	non-removable;
> +	wakeup-source;
>  	status = "okay";
> +
> +	brcmf: bcrmf at 1 {
> +		reg = <1>;
> +		compatible = "brcm,bcm4329-fmac";
> +		interrupt-parent = <&pio>;
> +		interrupts = <7 15 IRQ_TYPE_LEVEL_LOW>;
> +		interrupt-names = "host-wake";
> +	};
> +};
> +
> +&mmc3_pins_a {
> +	/* AP6181 requires pull-up */
> +	allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
>  };

This is the default now.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170105/ba6de88c/attachment.sig>

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

* [PATCH 2/2] ARM: dts: sun7i: Enable audio codec on Banana Pro
  2017-01-04 14:22 ` [PATCH 2/2] ARM: dts: sun7i: Enable audio codec " Jörg Krause
@ 2017-01-05 17:19   ` Maxime Ripard
  0 siblings, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2017-01-05 17:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 04, 2017 at 03:22:50PM +0100, J?rg Krause wrote:
> This commit enables the on-chip audio codec present on the A20 SoC
> on the Banana Pro board.
> 
> Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>

Applied, thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170105/908d80a0/attachment.sig>

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

end of thread, other threads:[~2017-01-05 17:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-04 14:22 [PATCH 1/2] ARM: dts: sun7i: Add wifi dt node on Banana Pro Jörg Krause
2017-01-04 14:22 ` [PATCH 2/2] ARM: dts: sun7i: Enable audio codec " Jörg Krause
2017-01-05 17:19   ` Maxime Ripard
2017-01-05 17:19 ` [PATCH 1/2] ARM: dts: sun7i: Add wifi dt node " Maxime Ripard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.