From 47bf3a5c9e2aadaa6bfdff151e139196f1334c06 Mon Sep 17 00:00:00 2001 From: Caesar Wang Date: Thu, 7 Jan 2016 16:25:45 +0800 Subject: ARM: dts: rockchip: add the sound setup for rk3036-kylin board The rk3036-kylin board uses a rt5616 audio codec connected to the i2s and can use the simple card to tie everyting together. Signed-off-by: Caesar Wang Signed-off-by: Heiko Stuebner --- arch/arm/boot/dts/rk3036-kylin.dts | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'arch/arm/boot/dts/rk3036-kylin.dts') diff --git a/arch/arm/boot/dts/rk3036-kylin.dts b/arch/arm/boot/dts/rk3036-kylin.dts index 992f9cadbc04..b28762522da0 100644 --- a/arch/arm/boot/dts/rk3036-kylin.dts +++ b/arch/arm/boot/dts/rk3036-kylin.dts @@ -46,6 +46,30 @@ model = "Rockchip RK3036 KylinBoard"; compatible = "rockchip,rk3036-kylin", "rockchip,rk3036"; + sound { + compatible = "simple-audio-card"; + simple-audio-card,format = "i2s"; + simple-audio-card,name = "rockchip,rt5616-codec"; + simple-audio-card,mclk-fs = <256>; + simple-audio-card,widgets = + "Microphone", "Microphone Jack", + "Headphone", "Headphone Jack"; + simple-audio-card,routing = + "MIC1", "Microphone Jack", + "MIC2", "Microphone Jack", + "Microphone Jack", "micbias1", + "Headphone Jack", "HPOL", + "Headphone Jack", "HPOR"; + + simple-audio-card,cpu { + sound-dai = <&i2s>; + }; + + simple-audio-card,codec { + sound-dai = <&rt5616>; + }; + }; + vcc_sys: vsys-regulator { compatible = "regulator-fixed"; regulator-name = "vcc_sys"; @@ -257,6 +281,17 @@ &i2c2 { status = "okay"; + + rt5616: rt5616@1b { + compatible = "rt5616"; + reg = <0x1b>; + #sound-dai-cells = <0>; + }; +}; + +&i2s { + #sound-dai-cells = <0>; + status = "okay"; }; &sdio { -- cgit v1.2.3 From 5d69fa0f27f5bdff449858a20b7f50f08b9f33d8 Mon Sep 17 00:00:00 2001 From: Caesar Wang Date: Fri, 15 Jan 2016 21:49:51 +0800 Subject: ARM: dts: rockchip: enable the uart0 for kylin board This patch is enabling the uart0 for bluetooth module. Signed-off-by: Caesar Wang Signed-off-by: Heiko Stuebner --- arch/arm/boot/dts/rk3036-kylin.dts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/arm/boot/dts/rk3036-kylin.dts') diff --git a/arch/arm/boot/dts/rk3036-kylin.dts b/arch/arm/boot/dts/rk3036-kylin.dts index b28762522da0..c748d2cbeed6 100644 --- a/arch/arm/boot/dts/rk3036-kylin.dts +++ b/arch/arm/boot/dts/rk3036-kylin.dts @@ -308,6 +308,10 @@ pinctrl-0 = <&sdio_clk &sdio_cmd &sdio_bus4>; }; +&uart0 { + status = "okay"; +}; + &uart2 { status = "okay"; }; -- cgit v1.2.3 From 99dc9fdc3105116b46273577e9641d7304b3046e Mon Sep 17 00:00:00 2001 From: Caesar Wang Date: Fri, 15 Jan 2016 21:49:52 +0800 Subject: ARM: dts: rockchip: enable the high speed on sdio for kylin board We want to the higher speed for wifi module working. Bootup kernel log: ... mmc_host mmc0: Bus speed (slot 0) = 37125000Hz (slot req 37500000Hz, actual 37125000HZ div = 0) or run 'cat /sys/kernel/debug/clk/clk_summary |grep phase -C 1' to check Otherwise, the mmc0 will run 400khz defalult value to work. Signed-off-by: Caesar Wang Signed-off-by: Heiko Stuebner --- arch/arm/boot/dts/rk3036-kylin.dts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'arch/arm/boot/dts/rk3036-kylin.dts') diff --git a/arch/arm/boot/dts/rk3036-kylin.dts b/arch/arm/boot/dts/rk3036-kylin.dts index c748d2cbeed6..905e187da381 100644 --- a/arch/arm/boot/dts/rk3036-kylin.dts +++ b/arch/arm/boot/dts/rk3036-kylin.dts @@ -299,6 +299,7 @@ broken-cd; bus-width = <4>; + cap-sd-highspeed; cap-sdio-irq; default-sample-phase = <90>; keep-power-in-suspend; @@ -306,6 +307,10 @@ num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sdio_clk &sdio_cmd &sdio_bus4>; + sd-uhs-sdr12; + sd-uhs-sdr25; + sd-uhs-sdr50; + sd-uhs-sdr104; }; &uart0 { -- cgit v1.2.3 From 4a9d0b033702566cde2f33ed19ff9c8a90b7fe8f Mon Sep 17 00:00:00 2001 From: Caesar Wang Date: Fri, 15 Jan 2016 21:49:53 +0800 Subject: ARM: dts: rockchip: add the sdio power sequence for kylin board This patch adds the sdio power sequence for kylin board. The WLAN attached to a SDIO interface, wifi/bluetooth have reset and power been needed to enable. AFAIK, the simple power sequence provider sets a value for multiple GPIOs. So the reset and power of WlAN chip can be handled in mmc power sequence. On the module itself this is one of these, that should can be handled by reset GPIOs in simple mmc power sequence. The Bluetooth host wake is high active from bootup, this patch is also set pinctrl bias as the default to enable the pull up in soc internal. Signed-off-by: Caesar Wang Signed-off-by: Heiko Stuebner --- arch/arm/boot/dts/rk3036-kylin.dts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'arch/arm/boot/dts/rk3036-kylin.dts') diff --git a/arch/arm/boot/dts/rk3036-kylin.dts b/arch/arm/boot/dts/rk3036-kylin.dts index 905e187da381..6a32b234525a 100644 --- a/arch/arm/boot/dts/rk3036-kylin.dts +++ b/arch/arm/boot/dts/rk3036-kylin.dts @@ -46,6 +46,23 @@ model = "Rockchip RK3036 KylinBoard"; compatible = "rockchip,rk3036-kylin", "rockchip,rk3036"; + sdio_pwrseq: sdio-pwrseq { + compatible = "mmc-pwrseq-simple"; + pinctrl-names = "default"; + pinctrl-0 = <&bt_wake_h>; + + /* + * On the module itself this is one of these (depending + * on the actual card populated): + * - SDIO_RESET_L_WL_REG_ON + * - SDIO_RESET_L_WL_RST + * - SDIO_RESET_L_BT_EN + */ + reset-gpios = <&gpio0 26 GPIO_ACTIVE_LOW>, /* WL_REG_ON */ + <&gpio0 27 GPIO_ACTIVE_LOW>, /* WL_RST */ + <&gpio2 9 GPIO_ACTIVE_LOW>; /* BT_EN */ + }; + sound { compatible = "simple-audio-card"; simple-audio-card,format = "i2s"; @@ -303,6 +320,7 @@ cap-sdio-irq; default-sample-phase = <90>; keep-power-in-suspend; + mmc-pwrseq = <&sdio_pwrseq>; non-removable; num-slots = <1>; pinctrl-names = "default"; @@ -336,6 +354,12 @@ }; }; + sdio { + bt_wake_h: bt-wake-h { + rockchip,pins = <2 8 RK_FUNC_GPIO &pcfg_pull_default>; + }; + }; + sleep { global_pwroff: global-pwroff { rockchip,pins = <2 7 RK_FUNC_1 &pcfg_pull_none>; -- cgit v1.2.3 From 6cff705b2dd944a14768e6a63c0773831583488e Mon Sep 17 00:00:00 2001 From: Caesar Wang Date: Fri, 15 Jan 2016 21:49:54 +0800 Subject: ARM: dts: rockchip: add the sdmmc for kylin board Although We can add the sdmmc node, shouldn't enable it. Since the sdmmc is reusing the same pin with uart2. Unfortunately, the uart2 is used by the debug port, so that will cause the debug information can't display on console if enabling the sdmmc. As we have supported the sdmmc (sd card) on hardware for kylin board. So, maybe we can have the sdmmc node in kylin dts, not to enable it. Anyway, you only need add the okay status if someone want to enable the sdmmc. e.g. if you use the adb to debug with android os. You can add the status = "okay" to enable the sdmmc for sd card working. The default status is disabling it. Signed-off-by: Caesar Wang Signed-off-by: Heiko Stuebner --- arch/arm/boot/dts/rk3036-kylin.dts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'arch/arm/boot/dts/rk3036-kylin.dts') diff --git a/arch/arm/boot/dts/rk3036-kylin.dts b/arch/arm/boot/dts/rk3036-kylin.dts index 6a32b234525a..190f22cc95ef 100644 --- a/arch/arm/boot/dts/rk3036-kylin.dts +++ b/arch/arm/boot/dts/rk3036-kylin.dts @@ -331,6 +331,17 @@ sd-uhs-sdr104; }; +&sdmmc { + bus-width = <4>; + cap-mmc-highspeed; + cap-sd-highspeed; + card-detect-delay = <200>; + disable-wp; + num-slots = <1>; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_cd>, <&sdmmc_bus4>; +}; + &uart0 { status = "okay"; }; @@ -360,6 +371,12 @@ }; }; + sdmmc { + sdmmc_pwr: sdmmc-pwr { + rockchip,pins = <2 28 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + sleep { global_pwroff: global-pwroff { rockchip,pins = <2 7 RK_FUNC_1 &pcfg_pull_none>; -- cgit v1.2.3 From fe253133728cce8793c4390c943b5b46d073d5e4 Mon Sep 17 00:00:00 2001 From: Caesar Wang Date: Thu, 28 Jan 2016 16:43:30 +0800 Subject: ARM: dts: rockchip: add the leds control for rk3036-kylin board As the kylin schematic drawing, add the needed work led for kylin board. Run: echo 0 > /sys/class/leds/kylin:red:led/brightness echo 1 > /sys/class/leds/kylin:red:led/brightness The led can normal on/off on kylin board. Signed-off-by: Caesar Wang Signed-off-by: Heiko Stuebner --- arch/arm/boot/dts/rk3036-kylin.dts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'arch/arm/boot/dts/rk3036-kylin.dts') diff --git a/arch/arm/boot/dts/rk3036-kylin.dts b/arch/arm/boot/dts/rk3036-kylin.dts index 190f22cc95ef..3332a7f785c5 100644 --- a/arch/arm/boot/dts/rk3036-kylin.dts +++ b/arch/arm/boot/dts/rk3036-kylin.dts @@ -46,6 +46,17 @@ model = "Rockchip RK3036 KylinBoard"; compatible = "rockchip,rk3036-kylin", "rockchip,rk3036"; + leds: gpio-leds { + compatible = "gpio-leds"; + + work { + gpios = <&gpio2 30 GPIO_ACTIVE_HIGH>; + label = "kylin:red:led"; + pinctrl-names = "default"; + pinctrl-0 = <&led_ctl>; + }; + }; + sdio_pwrseq: sdio-pwrseq { compatible = "mmc-pwrseq-simple"; pinctrl-names = "default"; @@ -359,6 +370,12 @@ }; &pinctrl { + leds { + led_ctl: led-ctl { + rockchip,pins = <2 30 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + pmic { pmic_int: pmic-int { rockchip,pins = <2 2 RK_FUNC_GPIO &pcfg_pull_default>; -- cgit v1.2.3 From 8f338ecf0cd47d94303d9b4d9b2f9a99944ef0e2 Mon Sep 17 00:00:00 2001 From: Caesar Wang Date: Tue, 2 Feb 2016 11:40:52 +0800 Subject: ARM: dts: rockchip: add mclk for rt5616 on rk3036 kylin board The I2S block that provide the output clock as the mclk for rt5616, That will be the master clock input. Signed-off-by: Caesar Wang Signed-off-by: Heiko Stuebner --- arch/arm/boot/dts/rk3036-kylin.dts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/arm/boot/dts/rk3036-kylin.dts') diff --git a/arch/arm/boot/dts/rk3036-kylin.dts b/arch/arm/boot/dts/rk3036-kylin.dts index 3332a7f785c5..b754613b9a9a 100644 --- a/arch/arm/boot/dts/rk3036-kylin.dts +++ b/arch/arm/boot/dts/rk3036-kylin.dts @@ -313,6 +313,8 @@ rt5616: rt5616@1b { compatible = "rt5616"; reg = <0x1b>; + clocks = <&cru SCLK_I2S_OUT>; + clock-names = "mclk"; #sound-dai-cells = <0>; }; }; -- cgit v1.2.3 From f6bb9d5f30d6986c4fdce1ed5a36088a0c30c544 Mon Sep 17 00:00:00 2001 From: Xing Zheng Date: Fri, 29 Jan 2016 16:49:21 +0800 Subject: ARM: dts: rockchip: increase the mclk_fs to 512 for kylin board If we playback the 8KHz FS audio with the 256 mclk_fs, we need the mclk = 256 * 8000 = 2.048MHz, the frac div is 594 / 2.048 = 290, the frac div value 0x00809015 set to the CRU_CLKSEL7_CON will cause to hang. We increase the mclk_fs to 512, will get the mclk = 512 * 8000 = 4.096MHz, use 0x01009015 instead of 0x00809015 to work around this issue. We will keep tracking it. Signed-off-by: Xing Zheng Signed-off-by: Heiko Stuebner --- arch/arm/boot/dts/rk3036-kylin.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/boot/dts/rk3036-kylin.dts') diff --git a/arch/arm/boot/dts/rk3036-kylin.dts b/arch/arm/boot/dts/rk3036-kylin.dts index b754613b9a9a..d5913fe128ee 100644 --- a/arch/arm/boot/dts/rk3036-kylin.dts +++ b/arch/arm/boot/dts/rk3036-kylin.dts @@ -78,7 +78,7 @@ compatible = "simple-audio-card"; simple-audio-card,format = "i2s"; simple-audio-card,name = "rockchip,rt5616-codec"; - simple-audio-card,mclk-fs = <256>; + simple-audio-card,mclk-fs = <512>; simple-audio-card,widgets = "Microphone", "Microphone Jack", "Headphone", "Headphone Jack"; -- cgit v1.2.3