linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: rockchip: Add Bluetooth HFP support for Radxa Rock 3A
       [not found] <20221023152440.2546-1-wiagn233@outlook.com>
@ 2022-10-23 15:24 ` Shengyu Qu
  2022-10-23 15:24 ` [PATCH 1/3] arm64: dts: rockchip: RK356x: Add I2S2 device node Shengyu Qu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: Shengyu Qu @ 2022-10-23 15:24 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, heiko, michael.riesch, s.hauer,
	pgwipeout, frattaroli.nicolas, frank-w, devicetree,
	linux-arm-kernel, linux-rockchip
  Cc: Shengyu Qu

Initial test.
---
 .../boot/dts/rockchip/rk3568-rock-3a.dts      | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts
index 37676e8a258c..423558fbc200 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts
@@ -60,6 +60,31 @@ simple-audio-card,codec {
 		};
 	};
 
+	bt-sco-audio {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "rock-3a-bt-sco";
+		simple-audio-card,format = "dsp_b";
+		simple-audio-card,bitclock-inversion;
+		simple-audio-card,frame-master = <&bt_cpu>;
+		simple-audio-card,bitclock-master = <&bt_cpu>;
+		simple-audio-card,mclk-fs = <64>;
+
+		bt_cpu: simple-audio-card,cpu {
+			sound-dai = <&i2s2_2ch>;
+			dai-tdm-slot-num = <2>;
+			dai-tdm-slot-width = <16>;
+		};
+
+		bt_codec: simple-audio-card,codec {
+			sound-dai = <&bt_sco_codec>;
+		};
+	};
+
+	bt_sco_codec: bt-sco-codec {
+		compatible = "linux,bt-sco";
+		#sound-dai-cells = <0>;
+	};
+
 	sdio_pwrseq: sdio-pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		clocks = <&rk809 1>;
@@ -611,6 +636,15 @@ bluetooth {
 		compatible = "brcm,bcm43438-bt";
 		clocks = <&rk809 1>;
 		clock-names = "lpo";
+		brcm,bt-pcm-int-params = [00 02 00 00 00];
+		/*
+		 * Parameters:
+		 * SCO routing: PCM
+		 * PCM interface rate: 512KBps
+		 * PCM frame type (0-1): short
+		 * PCM sync mode (0-1): slave
+		 * PCM clock mode (0-1): slave
+		 */
 		device-wakeup-gpios = <&gpio4 RK_PB5 GPIO_ACTIVE_HIGH>;
 		host-wakeup-gpios = <&gpio4 RK_PB4 GPIO_ACTIVE_HIGH>;
 		shutdown-gpios = <&gpio4 RK_PB2 GPIO_ACTIVE_HIGH>;
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/3] arm64: dts: rockchip: RK356x: Add I2S2 device node
       [not found] <20221023152440.2546-1-wiagn233@outlook.com>
  2022-10-23 15:24 ` [PATCH] arm64: dts: rockchip: Add Bluetooth HFP support for Radxa Rock 3A Shengyu Qu
@ 2022-10-23 15:24 ` Shengyu Qu
  2022-10-23 15:24 ` [PATCH 2/3] arm64: dts: rockchip: Add I2S2 node for RADXA Rock 3A Shengyu Qu
  2022-10-23 15:24 ` [PATCH 3/3] arm64: dts: rockchip: Add nodes for SDIO/UART Wi-Fi/Bluetooth modules to Radxa " Shengyu Qu
  3 siblings, 0 replies; 4+ messages in thread
From: Shengyu Qu @ 2022-10-23 15:24 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, heiko, michael.riesch, s.hauer,
	pgwipeout, frattaroli.nicolas, frank-w, devicetree,
	linux-arm-kernel, linux-rockchip
  Cc: Shengyu Qu

This patch adds I2S2 device tree node for RK3566/RK3568.

Signed-off-by: Shengyu Qu <wiagn233@outlook.com>
---
 arch/arm64/boot/dts/rockchip/rk356x.dtsi | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi
index 164708f1eb67..4af1e28b3a0b 100644
--- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi
@@ -1105,6 +1105,28 @@ &i2s1m0_sdo0   &i2s1m0_sdo1
 		status = "disabled";
 	};
 
+	i2s2_2ch: i2s@fe420000 {
+		compatible = "rockchip,rk3568-i2s-tdm";
+		reg = <0x0 0xfe420000 0x0 0x1000>;
+		interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
+		assigned-clocks = <&cru CLK_I2S2_2CH_SRC>;
+		assigned-clock-rates = <1188000000>;
+		clocks = <&cru MCLK_I2S2_2CH>, <&cru MCLK_I2S2_2CH>, <&cru HCLK_I2S2_2CH>;
+		clock-names = "mclk_tx", "mclk_rx", "hclk";
+		dmas = <&dmac1 4>, <&dmac1 5>;
+		dma-names = "tx", "rx";
+		resets = <&cru SRST_M_I2S2_2CH>;
+		reset-names = "m";
+		rockchip,grf = <&grf>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&i2s2m0_sclktx
+				&i2s2m0_lrcktx
+				&i2s2m0_sdi
+				&i2s2m0_sdo>;
+		#sound-dai-cells = <0>;
+		status = "disabled";
+	};
+
 	i2s3_2ch: i2s@fe430000 {
 		compatible = "rockchip,rk3568-i2s-tdm";
 		reg = <0x0 0xfe430000 0x0 0x1000>;
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/3] arm64: dts: rockchip: Add I2S2 node for RADXA Rock 3A
       [not found] <20221023152440.2546-1-wiagn233@outlook.com>
  2022-10-23 15:24 ` [PATCH] arm64: dts: rockchip: Add Bluetooth HFP support for Radxa Rock 3A Shengyu Qu
  2022-10-23 15:24 ` [PATCH 1/3] arm64: dts: rockchip: RK356x: Add I2S2 device node Shengyu Qu
@ 2022-10-23 15:24 ` Shengyu Qu
  2022-10-23 15:24 ` [PATCH 3/3] arm64: dts: rockchip: Add nodes for SDIO/UART Wi-Fi/Bluetooth modules to Radxa " Shengyu Qu
  3 siblings, 0 replies; 4+ messages in thread
From: Shengyu Qu @ 2022-10-23 15:24 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, heiko, michael.riesch, s.hauer,
	pgwipeout, frattaroli.nicolas, frank-w, devicetree,
	linux-arm-kernel, linux-rockchip
  Cc: Shengyu Qu

This patch adds I2S2 node for Radxa Rock 3A's M.2 E key slot for
Bluetooth PCM input. I2S2 is not used now, but could be configured
for Bluetooth HFP over PCM in future patches.

Signed-off-by: Shengyu Qu <wiagn233@outlook.com>
---
 arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts
index fb87a168fe96..9577a34bb367 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts
@@ -526,6 +526,11 @@ &i2s1_8ch {
 	status = "okay";
 };
 
+&i2s2_2ch {
+	rockchip,trcm-sync-tx-only;
+	status = "okay";
+};
+
 &mdio1 {
 	rgmii_phy1: ethernet-phy@0 {
 		compatible = "ethernet-phy-ieee802.3-c22";
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 3/3] arm64: dts: rockchip: Add nodes for SDIO/UART Wi-Fi/Bluetooth modules to Radxa Rock 3A
       [not found] <20221023152440.2546-1-wiagn233@outlook.com>
                   ` (2 preceding siblings ...)
  2022-10-23 15:24 ` [PATCH 2/3] arm64: dts: rockchip: Add I2S2 node for RADXA Rock 3A Shengyu Qu
@ 2022-10-23 15:24 ` Shengyu Qu
  3 siblings, 0 replies; 4+ messages in thread
From: Shengyu Qu @ 2022-10-23 15:24 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, heiko, michael.riesch, s.hauer,
	pgwipeout, frattaroli.nicolas, frank-w, devicetree,
	linux-arm-kernel, linux-rockchip
  Cc: Shengyu Qu

This patch adds related bus/pinctrl/power nodes to enable support for
Radxa's Wi-Fi Bluetooth combo module.
Tested with RADXA A6 module, which uses AP6275S (BCM43752A2)

Signed-off-by: Shengyu Qu <wiagn233@outlook.com>
---
 .../boot/dts/rockchip/rk3568-rock-3a.dts      | 69 +++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts
index 9577a34bb367..9cf20f3b4d16 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts
@@ -60,6 +60,17 @@ simple-audio-card,codec {
 		};
 	};
 
+	sdio_pwrseq: sdio-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		clocks = <&rk809 1>;
+		clock-names = "ext_clock";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wifi_enable>;
+		post-power-on-delay-ms = <100>;
+		power-off-delay-us = <5000000>;
+		reset-gpios = <&gpio3 RK_PD4 GPIO_ACTIVE_LOW>;
+	};
+
 	vcc12v_dcin: vcc12v-dcin {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc12v_dcin";
@@ -610,6 +621,26 @@ vcc5v0_usb_otg_en: vcc5v0_usb_otg_en {
 			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 	};
+
+	bt {
+		bt_enable: bt-enable {
+			rockchip,pins = <4 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+		bt_host_wake: bt-host-wake {
+			rockchip,pins = <4 RK_PB4 RK_FUNC_GPIO &pcfg_pull_down>;
+		};
+
+		bt_wake: bt-wake {
+			rockchip,pins = <4 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	sdio-pwrseq {
+		wifi_enable: wifi-enable {
+			rockchip,pins = <3 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
 };
 
 &pmu_io_domains {
@@ -654,12 +685,50 @@ &sdmmc0 {
 	status = "okay";
 };
 
+&sdmmc2 {
+	supports-sdio;
+	bus-width = <4>;
+	disable-wp;
+	cap-sd-highspeed;
+	cap-sdio-irq;
+	keep-power-in-suspend;
+	mmc-pwrseq = <&sdio_pwrseq>;
+	non-removable;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdmmc2m0_bus4 &sdmmc2m0_cmd &sdmmc2m0_clk>;
+	sd-uhs-sdr104;
+	vmmc-supply = <&vcc3v3_sys>;
+	vqmmc-supply = <&vcc_1v8>;
+	status = "okay";
+};
+
 &tsadc {
 	rockchip,hw-tshut-mode = <1>;
 	rockchip,hw-tshut-polarity = <0>;
 	status = "okay";
 };
 
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1m0_xfer &uart1m0_ctsn &uart1m0_rtsn>;
+	uart-has-rtscts;
+	status = "okay";
+
+	bluetooth {
+		compatible = "brcm,bcm43438-bt";
+		clocks = <&rk809 1>;
+		clock-names = "lpo";
+		device-wakeup-gpios = <&gpio4 RK_PB5 GPIO_ACTIVE_HIGH>;
+		host-wakeup-gpios = <&gpio4 RK_PB4 GPIO_ACTIVE_HIGH>;
+		shutdown-gpios = <&gpio4 RK_PB2 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&bt_host_wake &bt_wake &bt_enable>;
+		vbat-supply = <&vcc3v3_sys>;
+		vddio-supply = <&vcc_1v8>;
+		/* vddio comes from regulator on module, use IO bank voltage instead */
+	};
+};
+
 &uart2 {
 	status = "okay";
 };
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-10-23 15:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20221023152440.2546-1-wiagn233@outlook.com>
2022-10-23 15:24 ` [PATCH] arm64: dts: rockchip: Add Bluetooth HFP support for Radxa Rock 3A Shengyu Qu
2022-10-23 15:24 ` [PATCH 1/3] arm64: dts: rockchip: RK356x: Add I2S2 device node Shengyu Qu
2022-10-23 15:24 ` [PATCH 2/3] arm64: dts: rockchip: Add I2S2 node for RADXA Rock 3A Shengyu Qu
2022-10-23 15:24 ` [PATCH 3/3] arm64: dts: rockchip: Add nodes for SDIO/UART Wi-Fi/Bluetooth modules to Radxa " Shengyu Qu

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