Re: [alsa-devel] [PATCH RESEND] ARM: dts: Support audio on Exynos5422-odroidxu3 using simple-audio-card
Hi Sylwester, Thanks for your review. On Mon, 23 Mar 2015 11:54:55 +0100 Sylwester Nawrocki s.nawro...@samsung.com wrote: On 23/03/15 03:51, Inha Song wrote: Add MAX98090 audio codec, I2S interface and the sound nodes to support audio on Exynos5422 SoC Based Odroid-XU3 board. Now we can support audio in Odroid-XU3 board using simple-audio-card DT binding. Signed-off-by: Inha Song ideal.s...@samsung.com --- arch/arm/boot/dts/exynos5420.dtsi | 9 + arch/arm/boot/dts/exynos5422-odroidxu3.dts | 57 ++ 2 files changed, 66 insertions(+) diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi index 4eaeabe..e459c1d 100644 --- a/arch/arm/boot/dts/exynos5420.dtsi +++ b/arch/arm/boot/dts/exynos5420.dtsi @@ -415,6 +415,9 @@ clock_audss EXYNOS_I2S_BUS, clock_audss EXYNOS_SCLK_I2S; clock-names = iis, i2s_opclk0, i2s_opclk1; + #clock-cells = 1; + clock-output-names = i2s_cdclk0; + #sound-dai-cells = 1; samsung,idma-addr = 0x0300; pinctrl-names = default; pinctrl-0 = i2s0_bus; @@ -429,6 +432,9 @@ dma-names = tx, rx; clocks = clock CLK_I2S1, clock CLK_SCLK_I2S1; clock-names = iis, i2s_opclk0; + #clock-cells = 1; + clock-output-names = i2s_cdclk1; + #sound-dai-cells = 1; pinctrl-names = default; pinctrl-0 = i2s1_bus; status = disabled; @@ -442,6 +448,9 @@ dma-names = tx, rx; clocks = clock CLK_I2S2, clock CLK_SCLK_I2S2; clock-names = iis, i2s_opclk0; + #clock-cells = 1; + clock-output-names = i2s_cdclk2; + #sound-dai-cells = 1; pinctrl-names = default; pinctrl-0 = i2s2_bus; status = disabled; diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts index edc25cf..9275ad6 100644 --- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts +++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts @@ -11,6 +11,7 @@ */ /dts-v1/; +#include dt-bindings/sound/samsung-i2s.h #include exynos5800.dtsi / { @@ -285,6 +286,62 @@ rtc@101E { status = okay; }; + + sound: sound { + compatible = simple-audio-card; + assigned-clocks = clock_audss EXYNOS_MOUT_AUDSS, + clock_audss EXYNOS_MOUT_I2S, + clock_audss EXYNOS_DOUT_AUD_BUS; + assigned-clock-parents = clock CLK_FIN_PLL, + clock_audss EXYNOS_MOUT_AUDSS; + assigned-clock-rates = 0, + 0, + 1920; The patch looks good, except it would be more appropriate to move the above properties to clock_audss { }; node in this file. Ok. I will fix and send v2 with your sign. -- +++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts +clock_audss { + assigned-clocks = clock_audss EXYNOS_MOUT_AUDSS, + clock_audss EXYNOS_MOUT_I2S, + clock_audss EXYNOS_DOUT_AUD_BUS; + assigned-clock-parents = clock CLK_FIN_PLL, + clock_audss EXYNOS_MOUT_AUDSS; + assigned-clock-rates = 0, + 0, + 1920; +}; + With that change feel free to add: Reviewed-by: Sylwester Nawrocki s.nawro...@samsung.com As a side note, this is a dts patch and of course Kukjin maintains that. You would likely get it applied sooner if you would have addressed it directly to Kukjin, rather than Mark or me. Ok. Best Regrads, Inha Song. -- Thanks, Sylwester -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[alsa-devel] [PATCH v2] ARM: dts: Support audio on Exynos5422-odroidxu3 using simple-audio-card
Add MAX98090 audio codec, I2S interface and the sound nodes to support audio on Exynos5422 SoC Based Odroid-XU3 board. Now we can support audio in Odroid-XU3 board using simple-audio-card DT binding. Signed-off-by: Inha Song ideal.s...@samsung.com Reviewed-by: Sylwester Nawrocki s.nawro...@samsung.com --- arch/arm/boot/dts/exynos5420.dtsi | 9 + arch/arm/boot/dts/exynos5422-odroidxu3.dts | 59 ++ 2 files changed, 68 insertions(+) diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi index 4eaeabe..e459c1d 100644 --- a/arch/arm/boot/dts/exynos5420.dtsi +++ b/arch/arm/boot/dts/exynos5420.dtsi @@ -415,6 +415,9 @@ clock_audss EXYNOS_I2S_BUS, clock_audss EXYNOS_SCLK_I2S; clock-names = iis, i2s_opclk0, i2s_opclk1; + #clock-cells = 1; + clock-output-names = i2s_cdclk0; + #sound-dai-cells = 1; samsung,idma-addr = 0x0300; pinctrl-names = default; pinctrl-0 = i2s0_bus; @@ -429,6 +432,9 @@ dma-names = tx, rx; clocks = clock CLK_I2S1, clock CLK_SCLK_I2S1; clock-names = iis, i2s_opclk0; + #clock-cells = 1; + clock-output-names = i2s_cdclk1; + #sound-dai-cells = 1; pinctrl-names = default; pinctrl-0 = i2s1_bus; status = disabled; @@ -442,6 +448,9 @@ dma-names = tx, rx; clocks = clock CLK_I2S2, clock CLK_SCLK_I2S2; clock-names = iis, i2s_opclk0; + #clock-cells = 1; + clock-output-names = i2s_cdclk2; + #sound-dai-cells = 1; pinctrl-names = default; pinctrl-0 = i2s2_bus; status = disabled; diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts index edc25cf..c038f0d 100644 --- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts +++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts @@ -11,6 +11,7 @@ */ /dts-v1/; +#include dt-bindings/sound/samsung-i2s.h #include exynos5800.dtsi / { @@ -285,6 +286,64 @@ rtc@101E { status = okay; }; + + sound: sound { + compatible = simple-audio-card; + + simple-audio-card,name = Odroid-XU3; + simple-audio-card,widgets = + Headphone, Headphone Jack, + Speakers, Speakers; + simple-audio-card,routing = + Headphone Jack, HPL, + Headphone Jack, HPR, + Headphone Jack, MICBIAS, + IN1, Headphone Jack, + Speakers, SPKL, + Speakers, SPKR; + + simple-audio-card,format = i2s; + simple-audio-card,bitclock-master = link0_codec; + simple-audio-card,frame-master = link0_codec; + + simple-audio-card,cpu { + sound-dai = i2s0 0; + system-clock-frequency = 1920; + }; + + link0_codec: simple-audio-card,codec { + sound-dai = max98090; + clocks = i2s0 CLK_I2S_CDCLK; + }; + }; +}; + +clock_audss { + assigned-clocks = clock_audss EXYNOS_MOUT_AUDSS, + clock_audss EXYNOS_MOUT_I2S, + clock_audss EXYNOS_DOUT_AUD_BUS; + assigned-clock-parents = clock CLK_FIN_PLL, + clock_audss EXYNOS_MOUT_AUDSS; + assigned-clock-rates = 0, + 0, + 1920; +}; + +hsi2c_5 { + status = okay; + max98090: max98090@10 { + compatible = maxim,max98090; + reg = 0x10; + interrupt-parent = gpx3; + interrupts = 2 0; + clocks = i2s0 CLK_I2S_CDCLK; + clock-names = mclk; + #sound-dai-cells = 0; + }; +}; + +i2s0 { + status = okay; }; hdmi { -- 2.0.0.390.gcb682f8 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[alsa-devel] [PATCH] ARM: dts: Support audio on Exynos5422-odroidxu3 using simple-audio-card
Add MAX98090 audio codec, I2S interface and the sound nodes to support audio on Exynos5422 SoC Based Odroid-XU3 board. Now we can support audio in Odroid-XU3 board using simple-audio-card DT binding. Signed-off-by: Inha Song ideal.s...@samsung.com --- arch/arm/boot/dts/exynos5420.dtsi | 9 + arch/arm/boot/dts/exynos5422-odroidxu3.dts | 57 ++ 2 files changed, 66 insertions(+) diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi index c0e98cf..a70005e 100644 --- a/arch/arm/boot/dts/exynos5420.dtsi +++ b/arch/arm/boot/dts/exynos5420.dtsi @@ -411,6 +411,9 @@ clock_audss EXYNOS_I2S_BUS, clock_audss EXYNOS_SCLK_I2S; clock-names = iis, i2s_opclk0, i2s_opclk1; + #clock-cells = 1; + clock-output-names = i2s_cdclk0; + #sound-dai-cells = 1; samsung,idma-addr = 0x0300; pinctrl-names = default; pinctrl-0 = i2s0_bus; @@ -425,6 +428,9 @@ dma-names = tx, rx; clocks = clock CLK_I2S1, clock CLK_SCLK_I2S1; clock-names = iis, i2s_opclk0; + #clock-cells = 1; + clock-output-names = i2s_cdclk1; + #sound-dai-cells = 1; pinctrl-names = default; pinctrl-0 = i2s1_bus; status = disabled; @@ -438,6 +444,9 @@ dma-names = tx, rx; clocks = clock CLK_I2S2, clock CLK_SCLK_I2S2; clock-names = iis, i2s_opclk0; + #clock-cells = 1; + clock-output-names = i2s_cdclk2; + #sound-dai-cells = 1; pinctrl-names = default; pinctrl-0 = i2s2_bus; status = disabled; diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts index edc25cf..9275ad6 100644 --- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts +++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts @@ -11,6 +11,7 @@ */ /dts-v1/; +#include dt-bindings/sound/samsung-i2s.h #include exynos5800.dtsi / { @@ -285,6 +286,62 @@ rtc@101E { status = okay; }; + + sound: sound { + compatible = simple-audio-card; + assigned-clocks = clock_audss EXYNOS_MOUT_AUDSS, + clock_audss EXYNOS_MOUT_I2S, + clock_audss EXYNOS_DOUT_AUD_BUS; + assigned-clock-parents = clock CLK_FIN_PLL, + clock_audss EXYNOS_MOUT_AUDSS; + assigned-clock-rates = 0, + 0, + 1920; + + simple-audio-card,name = Odroid-XU3; + + simple-audio-card,widgets = + Headphone, Headphone Jack, + Speakers, Speakers; + simple-audio-card,routing = + Headphone Jack, HPL, + Headphone Jack, HPR, + Headphone Jack, MICBIAS, + IN1, Headphone Jack, + Speakers, SPKL, + Speakers, SPKR; + + simple-audio-card,format = i2s; + simple-audio-card,bitclock-master = link0_codec; + simple-audio-card,frame-master = link0_codec; + + simple-audio-card,cpu { + sound-dai = i2s0 0; + system-clock-frequency = 1920; + }; + + link0_codec: simple-audio-card,codec { + sound-dai = max98090; + clocks = i2s0 CLK_I2S_CDCLK; + }; + }; +}; + +hsi2c_5 { + status = okay; + max98090: max98090@10 { + compatible = maxim,max98090; + reg = 0x10; + interrupt-parent = gpx3; + interrupts = 2 0; + clocks = i2s0 CLK_I2S_CDCLK; + clock-names = mclk; + #sound-dai-cells = 0; + }; +}; + +i2s0 { + status = okay; }; hdmi { -- 2.0.0.390.gcb682f8 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2] clk: samsung: Add CLKOUT driver support for Exynos3250 SoC.
This patch add CLKOUT driver support for Exynos3250 SoC. Exynos3250 SoC PMU_DEBUG is the same with Exynos4's PMU_DEBUG including CLKOUT mux. So, We can use the exynos4's clkout init function for Exynos3250 without the need to add new function. Signed-off-by: Inha Song ideal.s...@samsung.com --- drivers/clk/samsung/clk-exynos-clkout.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/samsung/clk-exynos-clkout.c b/drivers/clk/samsung/clk-exynos-clkout.c index 3a7cb25..1c02e73 100644 --- a/drivers/clk/samsung/clk-exynos-clkout.c +++ b/drivers/clk/samsung/clk-exynos-clkout.c @@ -142,6 +142,8 @@ CLK_OF_DECLARE(exynos4212_clkout, samsung,exynos4212-pmu, exynos4_clkout_init); CLK_OF_DECLARE(exynos4412_clkout, samsung,exynos4412-pmu, exynos4_clkout_init); +CLK_OF_DECLARE(exynos3250_clkout, samsung,exynos3250-pmu, + exynos4_clkout_init); static void __init exynos5_clkout_init(struct device_node *node) { -- 2.0.0.390.gcb682f8 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] clk: samsung: Add CLKOUT driver support for Exynos3250 SoC.
Hi, Tomasz, Thanks for you comment :) On Wed, 25 Feb 2015 09:54:02 +0900 Tomasz Figa tomasz.f...@gmail.com wrote: Hi Inha, Thanks for the patch. Please see my comments inline. 2015-02-24 18:22 GMT+09:00 Inha Song ideal.s...@samsung.com: This patch add CLKOUT driver support for Exynos3250 SoC. Could you please add a little more information? I know that it might be pretty obvious to people familiar with this driver and/or hardware, but it might be a good idea to explicitly say that the CLKOUT controller is compatible with Exynos4, so only a new compatible string is added. On the other hand, do you really need to add a new compatible string if an existing one can be reused? The reason why the DT property is called compatible is to be able to use the same compatible strings on different devices, because they are compatible, even though the string might have its name after only one of them. If there is some additional reason to add a new compatible string, please write this in commit message. In in PMU document(Document/devicetree/bindgins/arm/samsung/pmu.txt), samsung,exynos3250-pmu compatible string had been added. So I add this compatible in driver. Signed-off-by: Inha Song ideal.s...@samsung.com --- drivers/clk/samsung/clk-exynos-clkout.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/samsung/clk-exynos-clkout.c b/drivers/clk/samsung/clk-exynos-clkout.c index 3a7cb25..1c02e73 100644 --- a/drivers/clk/samsung/clk-exynos-clkout.c +++ b/drivers/clk/samsung/clk-exynos-clkout.c @@ -142,6 +142,8 @@ CLK_OF_DECLARE(exynos4212_clkout, samsung,exynos4212-pmu, exynos4_clkout_init); CLK_OF_DECLARE(exynos4412_clkout, samsung,exynos4412-pmu, exynos4_clkout_init); +CLK_OF_DECLARE(exynos3250_clkout, samsung,exynos3250-pmu, + exynos4_clkout_init); Are you sure that the PMU DEBUG register on Exynos3250 is indeed compatible with Exynos4 and not with newer SoCs? AFAIR, the only difference was the number of bits (4 on Exynos4 and 5 on Exynos5?) of the main mux. Exynos3250 PMU_DEBUG register is same with Exynos4. So I just use exynos4_clkout_init function. But, on second thought, It looks good to add exynos3_clkout_init function for Exynos3 SoC even though it's the same with exynos4_clkout_init. what is your opinion? Best Regards, Inha Song. Best regards, Tomasz -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] clk: samsung: Add CLKOUT driver support for Exynos3250 SoC.
This patch add CLKOUT driver support for Exynos3250 SoC. Signed-off-by: Inha Song ideal.s...@samsung.com --- drivers/clk/samsung/clk-exynos-clkout.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/samsung/clk-exynos-clkout.c b/drivers/clk/samsung/clk-exynos-clkout.c index 3a7cb25..1c02e73 100644 --- a/drivers/clk/samsung/clk-exynos-clkout.c +++ b/drivers/clk/samsung/clk-exynos-clkout.c @@ -142,6 +142,8 @@ CLK_OF_DECLARE(exynos4212_clkout, samsung,exynos4212-pmu, exynos4_clkout_init); CLK_OF_DECLARE(exynos4412_clkout, samsung,exynos4412-pmu, exynos4_clkout_init); +CLK_OF_DECLARE(exynos3250_clkout, samsung,exynos3250-pmu, + exynos4_clkout_init); static void __init exynos5_clkout_init(struct device_node *node) { -- 2.0.0.390.gcb682f8 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] ARM: dts: Add the source clock for CLKOUT register as xusbxti
This patch add the CLKOUT register source clock as xusbxti in PMU (Power Management Unit) dt node on Exynos3250. Cc: Kukjin Kim kg...@kernel.org Signed-off-by: Inha Song ideal.s...@samsung.com --- arch/arm/boot/dts/exynos3250.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/boot/dts/exynos3250.dtsi b/arch/arm/boot/dts/exynos3250.dtsi index 277b48b..aa1eb8c 100644 --- a/arch/arm/boot/dts/exynos3250.dtsi +++ b/arch/arm/boot/dts/exynos3250.dtsi @@ -130,6 +130,9 @@ pmu_system_controller: system-controller@1002 { compatible = samsung,exynos3250-pmu, syscon; reg = 0x1002 0x4000; + #clock-cells = 1; + clock-names = clkout9; + clocks = xusbxti; }; mipi_phy: video-phy@10020710 { -- 2.0.0.390.gcb682f8 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[alsa-devel] [PATCH v3 2/4] ASoC: samsung: Document Trats2 audio subsystem bindings
This patch add Trats2 audio subsystem bindings document. Signed-off-by: Inha Song ideal.s...@samsung.com --- .../bindings/sound/samsung,trats2-wm1811.txt | 25 ++ 1 file changed, 25 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt diff --git a/Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt b/Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt new file mode 100644 index 000..319ff07 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt @@ -0,0 +1,25 @@ +Samsung Exynos Trats2 audio with WM1811 codec + +Required properties: + + - compatible : Must be samsung,trats2-audio + - samsung,i2s-controller : The phandle of the I2S controller + - samsung,model : The user visible name of this sound + - samsung,audio-codec : The phandle of the WM1811 audio codec + - samsung,audio-routing : A list of the connections between audio + components. each entry is a pair of strings, the first being the + connection's sink, the second being the connection's source + +Example: + +sound { + compatible = samsung,trats2-audio; + samsung,i2s-controller = i2s0; + samsung,model = Trats2; + samsung,audio-codec = wm1811; + samsung,audio-routing = + SPK, SPKOUTLN, + SPK, SPKOUTLP, + SPK, SPKOUTRN, + SPK, SPKOUTRP; +}; -- 2.0.0.390.gcb682f8 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[alsa-devel] [PATCH v3 4/4] ARM: dts: Add sound nodes for exynos4412-trats2
This patch add WM1811 audio codec, I2S interface and the sound machine nodes to enable audio on exynos4412-trats2 board. Signed-off-by: Inha Song ideal.s...@samsung.com --- arch/arm/boot/dts/exynos4412-trats2.dts | 37 + 1 file changed, 37 insertions(+) diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts index 29231b4..ec1acaf 100644 --- a/arch/arm/boot/dts/exynos4412-trats2.dts +++ b/arch/arm/boot/dts/exynos4412-trats2.dts @@ -203,6 +203,25 @@ }; }; + i2c@138A { + samsung,i2c-sda-delay = 100; + samsung,i2c-slave-addr = 0x10; + samsung,i2c-max-bus-freq = 10; + pinctrl-0 = i2c4_bus; + pinctrl-names = default; + status = okay; + + wm1811: wm1811@1a { + compatible = wlf,wm1811; + reg = 0x1a; + clocks = pmu_system_controller 0; + clock-names = MCLK1; + DCVDD-supply = ldo3_reg; + DBVDD1-supply = ldo3_reg; + wlf,ldo1ena = gpj0 4 0; + }; + }; + i2c@138D { samsung,i2c-sda-delay = 100; samsung,i2c-slave-addr = 0x10; @@ -838,6 +857,24 @@ }; }; + i2s0: i2s@0383 { + pinctrl-0 = i2s0_bus; + pinctrl-names = default; + status = okay; + }; + + sound { + compatible = samsung,trats2-audio; + samsung,i2s-controller = i2s0; + samsung,model = Trats2; + samsung,audio-codec = wm1811; + samsung,audio-routing = + SPK, SPKOUTLN, + SPK, SPKOUTLP, + SPK, SPKOUTRN, + SPK, SPKOUTRP; + }; + exynos-usbphy@125B { status = okay; }; -- 2.0.0.390.gcb682f8 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[alsa-devel] [PATCH v3 3/4] ARM: dts: set clock out parent to XUSBXTI
This patch set clock out parent to XUSBXTI. Signed-off-by: Inha Song ideal.s...@samsung.com --- arch/arm/boot/dts/exynos4.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi index b8168f1..020bbaf 100644 --- a/arch/arm/boot/dts/exynos4.dtsi +++ b/arch/arm/boot/dts/exynos4.dtsi @@ -141,6 +141,8 @@ pmu_system_controller: system-controller@1002 { compatible = samsung,exynos4210-pmu, syscon; reg = 0x1002 0x4000; + assigned-clocks = pmu_system_controller 0; + assigned-clock-parents = clock CLK_XUSBXTI; }; dsi_0: dsi@11C8 { -- 2.0.0.390.gcb682f8 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[alsa-devel] [PATCH v3 1/4] ASoC: samsung: Add machine driver for Trats2
This patch add the sound machine driver for Trats2 board. The codec operate in master mode. Signed-off-by: Inha Song ideal.s...@samsung.com --- sound/soc/samsung/Kconfig | 8 ++ sound/soc/samsung/Makefile| 2 + sound/soc/samsung/trats2_wm1811.c | 218 ++ 3 files changed, 228 insertions(+) create mode 100644 sound/soc/samsung/trats2_wm1811.c diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index fc67f97..8031423 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -245,3 +245,11 @@ config SND_SOC_ARNDALE_RT5631_ALC5631 depends on SND_SOC_SAMSUNG select SND_SAMSUNG_I2S select SND_SOC_RT5631 + +config SND_SOC_SAMSUNG_TRATS2_WM1811 + tristate SoC I2S Audio support for WM1811 on Tizen Trats2 board + depends on SND_SOC_SAMSUNG + select SND_SOC_WM8994 + select SND_SAMSUNG_I2S + help + Say Y if you want to add support for SoC audio on the Tizen Trats2 board. diff --git a/sound/soc/samsung/Makefile b/sound/soc/samsung/Makefile index 31e3dba..e2b7b1b 100644 --- a/sound/soc/samsung/Makefile +++ b/sound/soc/samsung/Makefile @@ -46,6 +46,7 @@ snd-soc-littlemill-objs := littlemill.o snd-soc-bells-objs := bells.o snd-soc-odroidx2-max98090-objs := odroidx2_max98090.o snd-soc-arndale-rt5631-objs := arndale_rt5631.o +snd-soc-trats2-wm1811-objs := trats2_wm1811.o obj-$(CONFIG_SND_SOC_SAMSUNG_JIVE_WM8750) += snd-soc-jive-wm8750.o obj-$(CONFIG_SND_SOC_SAMSUNG_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o @@ -73,3 +74,4 @@ obj-$(CONFIG_SND_SOC_LITTLEMILL) += snd-soc-littlemill.o obj-$(CONFIG_SND_SOC_BELLS) += snd-soc-bells.o obj-$(CONFIG_SND_SOC_ODROIDX2) += snd-soc-odroidx2-max98090.o obj-$(CONFIG_SND_SOC_ARNDALE_RT5631_ALC5631) += snd-soc-arndale-rt5631.o +obj-$(CONFIG_SND_SOC_SAMSUNG_TRATS2_WM1811) += snd-soc-trats2-wm1811.o diff --git a/sound/soc/samsung/trats2_wm1811.c b/sound/soc/samsung/trats2_wm1811.c new file mode 100644 index 000..b937612 --- /dev/null +++ b/sound/soc/samsung/trats2_wm1811.c @@ -0,0 +1,218 @@ +/* + * Copyright (C) 2015 Samsung Electronics Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include linux/of.h +#include linux/module.h +#include linux/clk.h +#include sound/soc.h +#include sound/pcm_params.h +#include i2s.h +#include ../codecs/wm8994.h + +struct trats2_machine_priv { + struct clk *clk_mclk; +}; + +static struct trats2_machine_priv trats2_wm1811_priv; + +static const struct snd_kcontrol_new trats2_controls[] = { + SOC_DAPM_PIN_SWITCH(SPK), +}; + +static const struct snd_soc_dapm_widget trats2_dapm_widgets[] = { + SND_SOC_DAPM_SPK(SPK, NULL), +}; + +static int trats2_aif1_hw_params(struct snd_pcm_substream *substream, +struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream-private_data; + struct snd_soc_dai *codec_dai = rtd-codec_dai; + struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd-card); + unsigned int sysclk_rate; + unsigned int mclk_rate = + (unsigned int)clk_get_rate(priv-clk_mclk); + int ret; + + /* SYSCLK must be greater than 4.096MHz */ + if (params_rate(params) == 8000 || params_rate(params) == 11025) + sysclk_rate = params_rate(params) * 512; + else + sysclk_rate = params_rate(params) * 256; + + /* Set the codec FLL1 */ + ret = snd_soc_dai_set_pll(codec_dai, WM8994_FLL1, WM8994_FLL_SRC_MCLK1, + mclk_rate, sysclk_rate); + if (ret 0) { + dev_err(codec_dai-dev, Failed to set FLL1: %d\n, ret); + return ret; + } + + /* Set the codec SYSCLK */ + ret = snd_soc_dai_set_sysclk(codec_dai, WM8994_SYSCLK_FLL1, +sysclk_rate, SND_SOC_CLOCK_IN); + if (ret 0) { + dev_err(codec_dai-dev, Failed to set SYSCLK: %d\n, ret); + return ret; + } + + return 0; +} + +static int trats2_aif1_startup(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream-private_data; + struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd-card); + int ret; + + ret = clk_prepare_enable(priv-clk_mclk); + if (ret) { + dev_err(rtd-card-dev, Failed to enable mclk: %d\n, ret); + return ret; + } + + return 0; +} + +static void trats2_aif1_shutdown(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream-private_data; + struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd-card
[alsa-devel] [PATCH v3 0/4] Sound support for Exynos4412 Trats2 board
This patch-set adds basic sound support for the Trats2 boards. It just support primary I2s and external speaker playback. Changes in v3: - Set clock out parent to XUSBXTI in pmu_system_controller DT node. Changes in v2: - Remove unnecessary lines in Trats2 machine driver - move clock enable/disable to .startup / .shutdown - Fix code style issues - Remove mclk DT property in Trats2 sound and add MCLK1 property in WM1811 node. (MCLK1 is optional property in WM8994 node - refer: Document/devicetree/bindings/sound/wm8994.txt) - Use mclk that defined in WM1811 DT node. - Add samsung,audio-codec property to required properties. Inha Song (4): ASoC: samsung: Add machine driver for Trats2 ASoC: samsung: Document Trats2 audio subsystem bindings ARM: dts: set clock out parent to XUSBXTI ARM: dts: Add sound nodes for exynos4412-trats2 .../bindings/sound/samsung,trats2-wm1811.txt | 25 +++ arch/arm/boot/dts/exynos4.dtsi | 2 + arch/arm/boot/dts/exynos4412-trats2.dts| 37 sound/soc/samsung/Kconfig | 8 + sound/soc/samsung/Makefile | 2 + sound/soc/samsung/trats2_wm1811.c | 218 + 6 files changed, 292 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt create mode 100644 sound/soc/samsung/trats2_wm1811.c -- 2.0.0.390.gcb682f8 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[alsa-devel] [PATCH v4 2/3] ASoC: samsung: Document Trats2 audio subsystem bindings
This patch add Trats2 audio subsystem bindings document. Signed-off-by: Inha Song ideal.s...@samsung.com --- .../bindings/sound/samsung,trats2-wm1811.txt | 25 ++ 1 file changed, 25 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt diff --git a/Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt b/Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt new file mode 100644 index 000..319ff07 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt @@ -0,0 +1,25 @@ +Samsung Exynos Trats2 audio with WM1811 codec + +Required properties: + + - compatible : Must be samsung,trats2-audio + - samsung,i2s-controller : The phandle of the I2S controller + - samsung,model : The user visible name of this sound + - samsung,audio-codec : The phandle of the WM1811 audio codec + - samsung,audio-routing : A list of the connections between audio + components. each entry is a pair of strings, the first being the + connection's sink, the second being the connection's source + +Example: + +sound { + compatible = samsung,trats2-audio; + samsung,i2s-controller = i2s0; + samsung,model = Trats2; + samsung,audio-codec = wm1811; + samsung,audio-routing = + SPK, SPKOUTLN, + SPK, SPKOUTLP, + SPK, SPKOUTRN, + SPK, SPKOUTRP; +}; -- 2.0.0.390.gcb682f8 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[alsa-devel] [PATCH v4 0/3] Sound support for Exynos4412 Trats2 board
This patch-set adds basic sound support for the Trats2 boards. It just support primary I2s and external speaker playback. Changes in v4: - Move to clock out parent settings in exynos4412-trats2.dts - Remove unnecessary lines in Trats2 machine driver. - Change name of dai stream to more cleary. - Add MFD_WM8994 to select in machine driver kconfig. Changes in v3: - Set clock out parent to XUSBXTI in pmu_system_controller DT node. Changes in v2: - Remove unnecessary lines in Trats2 machine driver. - move clock enable/disable to .startup / .shutdown. - Fix code style issues. - Remove mclk DT property in Trats2 sound and add MCLK1 property in WM1811 node. (MCLK1 is optional property in WM8994 node - refer: Document/devicetree/bindings/sound/wm8994.txt) - Use mclk that defined in WM1811 DT node. - Add samsung,audio-codec property to required properties. Inha Song (3): ASoC: samsung: Add machine driver for Trats2 ASoC: samsung: Document Trats2 audio subsystem bindings ARM: dts: Add sound nodes for exynos4412-trats2 .../bindings/sound/samsung,trats2-wm1811.txt | 25 +++ arch/arm/boot/dts/exynos4412-trats2.dts| 42 sound/soc/samsung/Kconfig | 9 + sound/soc/samsung/Makefile | 2 + sound/soc/samsung/trats2_wm1811.c | 211 + 5 files changed, 289 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt create mode 100644 sound/soc/samsung/trats2_wm1811.c -- 2.0.0.390.gcb682f8 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[alsa-devel] [PATCH v4 3/3] ARM: dts: Add sound nodes for exynos4412-trats2
This patch add WM1811 audio codec, I2S interface and the sound machine nodes to enable audio on exynos4412-trats2 board. Signed-off-by: Inha Song ideal.s...@samsung.com --- arch/arm/boot/dts/exynos4412-trats2.dts | 42 + 1 file changed, 42 insertions(+) diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts index 29231b4..6205b98 100644 --- a/arch/arm/boot/dts/exynos4412-trats2.dts +++ b/arch/arm/boot/dts/exynos4412-trats2.dts @@ -203,6 +203,25 @@ }; }; + i2c@138A { + samsung,i2c-sda-delay = 100; + samsung,i2c-slave-addr = 0x10; + samsung,i2c-max-bus-freq = 10; + pinctrl-0 = i2c4_bus; + pinctrl-names = default; + status = okay; + + wm1811: wm1811@1a { + compatible = wlf,wm1811; + reg = 0x1a; + clocks = pmu_system_controller 0; + clock-names = MCLK1; + DCVDD-supply = ldo3_reg; + DBVDD1-supply = ldo3_reg; + wlf,ldo1ena = gpj0 4 0; + }; + }; + i2c@138D { samsung,i2c-sda-delay = 100; samsung,i2c-slave-addr = 0x10; @@ -838,6 +857,24 @@ }; }; + i2s0: i2s@0383 { + pinctrl-0 = i2s0_bus; + pinctrl-names = default; + status = okay; + }; + + sound { + compatible = samsung,trats2-audio; + samsung,i2s-controller = i2s0; + samsung,model = Trats2; + samsung,audio-codec = wm1811; + samsung,audio-routing = + SPK, SPKOUTLN, + SPK, SPKOUTLP, + SPK, SPKOUTRN, + SPK, SPKOUTRP; + }; + exynos-usbphy@125B { status = okay; }; @@ -865,6 +902,11 @@ }; }; +pmu_system_controller { + assigned-clocks = pmu_system_controller 0; + assigned-clock-parents = clock CLK_XUSBXTI; +}; + pinctrl_0 { pinctrl-names = default; pinctrl-0 = sleep0; -- 2.0.0.390.gcb682f8 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[alsa-devel] [PATCH v4 1/3] ASoC: samsung: Add machine driver for Trats2
This patch add the sound machine driver for Trats2 board. The codec operate in master mode. Signed-off-by: Inha Song ideal.s...@samsung.com --- sound/soc/samsung/Kconfig | 9 ++ sound/soc/samsung/Makefile| 2 + sound/soc/samsung/trats2_wm1811.c | 211 ++ 3 files changed, 222 insertions(+) create mode 100644 sound/soc/samsung/trats2_wm1811.c diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index fc67f97..df6734d 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -245,3 +245,12 @@ config SND_SOC_ARNDALE_RT5631_ALC5631 depends on SND_SOC_SAMSUNG select SND_SAMSUNG_I2S select SND_SOC_RT5631 + +config SND_SOC_SAMSUNG_TRATS2_WM1811 + tristate SoC I2S Audio support for WM1811 on Tizen Trats2 board + depends on SND_SOC_SAMSUNG + select SND_SAMSUNG_I2S + select MFD_WM8994 + select SND_SOC_WM8994 + help + Say Y if you want to add support for SoC audio on the Tizen Trats2 board. diff --git a/sound/soc/samsung/Makefile b/sound/soc/samsung/Makefile index 31e3dba..e2b7b1b 100644 --- a/sound/soc/samsung/Makefile +++ b/sound/soc/samsung/Makefile @@ -46,6 +46,7 @@ snd-soc-littlemill-objs := littlemill.o snd-soc-bells-objs := bells.o snd-soc-odroidx2-max98090-objs := odroidx2_max98090.o snd-soc-arndale-rt5631-objs := arndale_rt5631.o +snd-soc-trats2-wm1811-objs := trats2_wm1811.o obj-$(CONFIG_SND_SOC_SAMSUNG_JIVE_WM8750) += snd-soc-jive-wm8750.o obj-$(CONFIG_SND_SOC_SAMSUNG_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o @@ -73,3 +74,4 @@ obj-$(CONFIG_SND_SOC_LITTLEMILL) += snd-soc-littlemill.o obj-$(CONFIG_SND_SOC_BELLS) += snd-soc-bells.o obj-$(CONFIG_SND_SOC_ODROIDX2) += snd-soc-odroidx2-max98090.o obj-$(CONFIG_SND_SOC_ARNDALE_RT5631_ALC5631) += snd-soc-arndale-rt5631.o +obj-$(CONFIG_SND_SOC_SAMSUNG_TRATS2_WM1811) += snd-soc-trats2-wm1811.o diff --git a/sound/soc/samsung/trats2_wm1811.c b/sound/soc/samsung/trats2_wm1811.c new file mode 100644 index 000..e87ea1f --- /dev/null +++ b/sound/soc/samsung/trats2_wm1811.c @@ -0,0 +1,211 @@ +/* + * Copyright (C) 2015 Samsung Electronics Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include linux/of.h +#include linux/module.h +#include linux/clk.h +#include sound/soc.h +#include sound/pcm_params.h +#include i2s.h +#include ../codecs/wm8994.h + +struct trats2_machine_priv { + struct clk *clk_mclk; +}; + +static struct trats2_machine_priv trats2_wm1811_priv; + +static const struct snd_kcontrol_new trats2_controls[] = { + SOC_DAPM_PIN_SWITCH(SPK), +}; + +static const struct snd_soc_dapm_widget trats2_dapm_widgets[] = { + SND_SOC_DAPM_SPK(SPK, NULL), +}; + +static int trats2_aif1_hw_params(struct snd_pcm_substream *substream, +struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream-private_data; + struct snd_soc_dai *codec_dai = rtd-codec_dai; + struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd-card); + unsigned int sysclk_rate; + unsigned int mclk_rate = + (unsigned int)clk_get_rate(priv-clk_mclk); + int ret; + + /* SYSCLK must be greater than 4.096MHz */ + if (params_rate(params) == 8000 || params_rate(params) == 11025) + sysclk_rate = params_rate(params) * 512; + else + sysclk_rate = params_rate(params) * 256; + + /* Set the codec FLL1 */ + ret = snd_soc_dai_set_pll(codec_dai, WM8994_FLL1, WM8994_FLL_SRC_MCLK1, + mclk_rate, sysclk_rate); + if (ret 0) { + dev_err(codec_dai-dev, Failed to set FLL1: %d\n, ret); + return ret; + } + + /* Set the codec SYSCLK */ + ret = snd_soc_dai_set_sysclk(codec_dai, WM8994_SYSCLK_FLL1, +sysclk_rate, SND_SOC_CLOCK_IN); + if (ret 0) { + dev_err(codec_dai-dev, Failed to set SYSCLK: %d\n, ret); + return ret; + } + + return 0; +} + +static int trats2_aif1_startup(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream-private_data; + struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd-card); + int ret; + + ret = clk_prepare_enable(priv-clk_mclk); + if (ret) { + dev_err(rtd-card-dev, Failed to enable mclk: %d\n, ret); + return ret; + } + + return 0; +} + +static void trats2_aif1_shutdown(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream-private_data; + struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd
Re: [alsa-devel] [PATCH v3 3/4] ARM: dts: set clock out parent to XUSBXTI
Hi, Thanks for your comment. On Thu, 22 Jan 2015 13:25:07 +0100 Sylwester Nawrocki s.nawro...@samsung.com wrote: On 22/01/15 12:18, Inha Song wrote: This patch set clock out parent to XUSBXTI. Signed-off-by: Inha Song ideal.s...@samsung.com --- arch/arm/boot/dts/exynos4.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi index b8168f1..020bbaf 100644 --- a/arch/arm/boot/dts/exynos4.dtsi +++ b/arch/arm/boot/dts/exynos4.dtsi @@ -141,6 +141,8 @@ pmu_system_controller: system-controller@1002 { compatible = samsung,exynos4210-pmu, syscon; reg = 0x1002 0x4000; + assigned-clocks = pmu_system_controller 0; + assigned-clock-parents = clock CLK_XUSBXTI; }; Looks good, except it needs to be done only for the Trats2 board, i.e. the PMU device node including these properties should be added to exynos4412-trats2.dts. I think it's fine to make it a one patch including all dts changes. Opps! I understand. I will move this node to exynos4412-trats2.dts. pmu_system_controller { assigned-clocks = pmu_system_controller 0; assigned-clock-parents = clock CLK_XUSBXTI; }; Thanks! Best Regards, Inha Song. -- Regards, Sylwester ___ Alsa-devel mailing list alsa-de...@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [alsa-devel] [PATCH v3 1/4] ASoC: samsung: Add machine driver for Trats2
Hi, Thanks for your review. On Thu, 22 Jan 2015 13:16:03 +0100 Sylwester Nawrocki s.nawro...@samsung.com wrote: On 22/01/15 12:17, Inha Song wrote: diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index fc67f97..8031423 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -245,3 +245,11 @@ config SND_SOC_ARNDALE_RT5631_ALC5631 depends on SND_SOC_SAMSUNG select SND_SAMSUNG_I2S select SND_SOC_RT5631 + +config SND_SOC_SAMSUNG_TRATS2_WM1811 + tristate SoC I2S Audio support for WM1811 on Tizen Trats2 board + depends on SND_SOC_SAMSUNG + select SND_SOC_WM8994 + select SND_SAMSUNG_I2S Shouldn't you also select the MFD part of WM8994 here ? Maybe, I will add also select MFD_WM8994 +++ b/sound/soc/samsung/trats2_wm1811.c @@ -0,0 +1,218 @@ +static struct snd_soc_dai_link trats2_dai[] = { + { + .name = WM1811 AIF1, + .stream_name= Pri_Dai, Could we have a less cryptic name here, e.g. HiFi Primary ? Looks like HiFi Primary, I will fix. + .codec_dai_name = wm8994-aif1, + .codec_name = wm8994-codec, + .ops= trats2_aif1_ops, + .dai_fmt= SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBM_CFM, + }, +}; +static int trats2_audio_probe(struct platform_device *pdev) +{ + struct device_node *np = pdev-dev.of_node; + struct snd_soc_card *card = trats2_card; + struct device_node *codec_node; + struct snd_soc_dai_link *dai_link = card-dai_link; + struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(card); + int ret; + + if (!np) { + dev_err(pdev-dev, of node is missing.\n); + return -ENODEV; I'd say this whole np test could be dropped, we will fail right below at the snd_soc_of_parse_card_name() function call if np is NULL. Such a situation seems highly unlikely anyway. I will remove :) + } + + card-dev = pdev-dev; + + ret = snd_soc_of_parse_card_name(card, samsung,model); + if (ret) { + dev_err(pdev-dev, + Card name is not provided\n); I guess it would fit in a single line. Oh, Thanks. + return ret; + } + +static struct platform_driver trats2_audio_driver = { + .driver = { + .name = trats2-audio, + .owner = THIS_MODULE, You can drop this .owner field assignment, it's also done in module_platform_driver() macro. Yes, I will fix based on your comments :) Thanks, Best Regards, Inha Song. + .pm = snd_soc_pm_ops, + .of_match_table = trats2_audio_of_match, + }, + .probe = trats2_audio_probe, + .remove = trats2_audio_remove, +}; + +module_platform_driver(trats2_audio_driver); -- Regards, Sylwester -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [alsa-devel] [PATCH v4 3/3] ARM: dts: Add sound nodes for exynos4412-trats2
Hi Kukjin, Sorry, I missed to adding in Cc. Best Regards, Inha Song. On Fri, 23 Jan 2015 14:03:30 +0900 Inha Song ideal.s...@samsung.com wrote: This patch add WM1811 audio codec, I2S interface and the sound machine nodes to enable audio on exynos4412-trats2 board. Signed-off-by: Inha Song ideal.s...@samsung.com --- arch/arm/boot/dts/exynos4412-trats2.dts | 42 + 1 file changed, 42 insertions(+) diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts index 29231b4..6205b98 100644 --- a/arch/arm/boot/dts/exynos4412-trats2.dts +++ b/arch/arm/boot/dts/exynos4412-trats2.dts @@ -203,6 +203,25 @@ }; }; + i2c@138A { + samsung,i2c-sda-delay = 100; + samsung,i2c-slave-addr = 0x10; + samsung,i2c-max-bus-freq = 10; + pinctrl-0 = i2c4_bus; + pinctrl-names = default; + status = okay; + + wm1811: wm1811@1a { + compatible = wlf,wm1811; + reg = 0x1a; + clocks = pmu_system_controller 0; + clock-names = MCLK1; + DCVDD-supply = ldo3_reg; + DBVDD1-supply = ldo3_reg; + wlf,ldo1ena = gpj0 4 0; + }; + }; + i2c@138D { samsung,i2c-sda-delay = 100; samsung,i2c-slave-addr = 0x10; @@ -838,6 +857,24 @@ }; }; + i2s0: i2s@0383 { + pinctrl-0 = i2s0_bus; + pinctrl-names = default; + status = okay; + }; + + sound { + compatible = samsung,trats2-audio; + samsung,i2s-controller = i2s0; + samsung,model = Trats2; + samsung,audio-codec = wm1811; + samsung,audio-routing = + SPK, SPKOUTLN, + SPK, SPKOUTLP, + SPK, SPKOUTRN, + SPK, SPKOUTRP; + }; + exynos-usbphy@125B { status = okay; }; @@ -865,6 +902,11 @@ }; }; +pmu_system_controller { + assigned-clocks = pmu_system_controller 0; + assigned-clock-parents = clock CLK_XUSBXTI; +}; + pinctrl_0 { pinctrl-names = default; pinctrl-0 = sleep0; -- 2.0.0.390.gcb682f8 ___ Alsa-devel mailing list alsa-de...@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] ARM: dts: exynos5422-odroidxu3: add sound nodes
Hi, Thanks for your comment. On Wed, 21 Jan 2015 12:41:55 +0100 Sylwester Nawrocki s.nawro...@samsung.com wrote: Hi, On 21/01/15 06:58, Inha Song wrote: Add MAX98090 audio codec, I2S interface and the sound nodes to support audio on Odroid-XU3 board. Signed-off-by: Inha Song ideal.s...@samsung.com --- arch/arm/boot/dts/exynos5422-odroidxu3.dts | 34 ++ 1 file changed, 34 insertions(+) diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts index 7874da2..79493d1 100644 --- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts +++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts @@ -310,6 +310,40 @@ rtc@101E { status = okay; }; + + sound: sound { + compatible = samsung,odroidu3-audio; How about using simple-card instead ? I've been trying to switch Odroid X2/U3 to simple card. Here a corresponding dts patch: http://www.spinics.net/lists/linux-samsung-soc/msg41083.html For that recent patches for the I2S driver which area already in -next might be needed. Oh, I missed your patchs. I will rework this patch based on your patch. Best Regards, Inha Song. + samsung,model = Odroid-XU3; + samsung,i2s-controller = i2s0; + samsung,audio-codec = max98090; + assigned-clocks = clock_audss EXYNOS_MOUT_AUDSS, + clock_audss EXYNOS_MOUT_I2S; + assigned-clock-parents = clock CLK_FIN_PLL, + clock_audss EXYNOS_MOUT_AUDSS; + samsung,audio-routing = + Headphone Jack, HPL, + Headphone Jack, HPR, + Headphone Jack, MICBIAS, + IN1, Headphone Jack, + Speakers, SPKL, + Speakers, SPKR; + }; +}; + +hsi2c_5 { + status = okay; + max98090: max98090@10 { + compatible = maxim,max98090; + reg = 0x10; + interrupt-parent = gpx3; + interrupts = 2 0; + clocks = clock_audss EXYNOS_DOUT_AUD_BUS; + clock-names = mclk; + }; +}; -- Thanks, Sylwester -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [alsa-devel] [PATCH v2 3/3] ARM: dts: Add sound nodes for exynos4412-trats2
Hi, Thanks for your comments. On Wed, 21 Jan 2015 17:23:21 +0100 Sylwester Nawrocki s.nawro...@samsung.com wrote: Hi, On 19/01/15 10:48, Inha Song wrote: --- a/arch/arm/boot/dts/exynos4412-trats2.dts +++ b/arch/arm/boot/dts/exynos4412-trats2.dts + sound { + compatible = samsung,trats2-audio; + assigned-clocks = pmu_system_controller 0; + assigned-clock-parents = clock CLK_XUSBXTI; How about putting these properties in the pmu_system_controller node? After all the mux clock being configured here belongs to the PMU subsystem. Wouldn't it work that way ? OK, I will move assigned clock properties to pmu_system_controller DT node. Best Regards, Inha Song. + samsung,i2s-controller = i2s0; + samsung,model = Trats2; + samsung,audio-codec = wm1811; + samsung,audio-routing = + SPK, SPKOUTLN, + SPK, SPKOUTLP, + SPK, SPKOUTRN, + SPK, SPKOUTRP; + }; -- Regards, Sylwester ___ Alsa-devel mailing list alsa-de...@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] ARM: dts: exynos5422-odroidxu3: add sound nodes
Add MAX98090 audio codec, I2S interface and the sound nodes to support audio on Odroid-XU3 board. Signed-off-by: Inha Song ideal.s...@samsung.com --- arch/arm/boot/dts/exynos5422-odroidxu3.dts | 34 ++ 1 file changed, 34 insertions(+) diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts index 7874da2..79493d1 100644 --- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts +++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts @@ -310,6 +310,40 @@ rtc@101E { status = okay; }; + + sound: sound { + compatible = samsung,odroidu3-audio; + samsung,model = Odroid-XU3; + samsung,i2s-controller = i2s0; + samsung,audio-codec = max98090; + assigned-clocks = clock_audss EXYNOS_MOUT_AUDSS, + clock_audss EXYNOS_MOUT_I2S; + assigned-clock-parents = clock CLK_FIN_PLL, + clock_audss EXYNOS_MOUT_AUDSS; + samsung,audio-routing = + Headphone Jack, HPL, + Headphone Jack, HPR, + Headphone Jack, MICBIAS, + IN1, Headphone Jack, + Speakers, SPKL, + Speakers, SPKR; + }; +}; + +hsi2c_5 { + status = okay; + max98090: max98090@10 { + compatible = maxim,max98090; + reg = 0x10; + interrupt-parent = gpx3; + interrupts = 2 0; + clocks = clock_audss EXYNOS_DOUT_AUD_BUS; + clock-names = mclk; + }; +}; + +i2s0 { + status = okay; }; hdmi { -- 2.0.0.390.gcb682f8 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[alsa-devel] [PATCH v2 3/3] ARM: dts: Add sound nodes for exynos4412-trats2
This patch add WM1811 audio codec, I2S interface and the sound machine nodes to enable audio on exynos4412-trats2 board. Signed-off-by: Inha Song ideal.s...@samsung.com --- arch/arm/boot/dts/exynos4412-trats2.dts | 39 + 1 file changed, 39 insertions(+) diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts index 29231b4..7a52cca 100644 --- a/arch/arm/boot/dts/exynos4412-trats2.dts +++ b/arch/arm/boot/dts/exynos4412-trats2.dts @@ -203,6 +203,25 @@ }; }; + i2c@138A { + samsung,i2c-sda-delay = 100; + samsung,i2c-slave-addr = 0x10; + samsung,i2c-max-bus-freq = 10; + pinctrl-0 = i2c4_bus; + pinctrl-names = default; + status = okay; + + wm1811: wm1811@1a { + compatible = wlf,wm1811; + reg = 0x1a; + clocks = pmu_system_controller 0; + clock-names = MCLK1; + DCVDD-supply = ldo3_reg; + DBVDD1-supply = ldo3_reg; + wlf,ldo1ena = gpj0 4 0; + }; + }; + i2c@138D { samsung,i2c-sda-delay = 100; samsung,i2c-slave-addr = 0x10; @@ -838,6 +857,26 @@ }; }; + i2s0: i2s@0383 { + pinctrl-0 = i2s0_bus; + pinctrl-names = default; + status = okay; + }; + + sound { + compatible = samsung,trats2-audio; + assigned-clocks = pmu_system_controller 0; + assigned-clock-parents = clock CLK_XUSBXTI; + samsung,i2s-controller = i2s0; + samsung,model = Trats2; + samsung,audio-codec = wm1811; + samsung,audio-routing = + SPK, SPKOUTLN, + SPK, SPKOUTLP, + SPK, SPKOUTRN, + SPK, SPKOUTRP; + }; + exynos-usbphy@125B { status = okay; }; -- 2.0.0.390.gcb682f8 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[alsa-devel] [PATCH v2 0/3] Sound support for Exynos4412 Trats2 board
This patch-set adds basic sound support for the Trats2 boards. It just support primary I2s and external speaker playback. Changes in v2: - Remove unnecessary lines in Trats2 machine driver - move clock enable/disable to .startup / .shutdown - Fix code style issues - Remove mclk DT property in Trats2 sound and add MCLK1 property in WM1811 node. (MCLK1 is optional property in WM8994 node - refer: Document/devicetree/bindings/sound/wm8994.txt) - Use mclk that defined in WM1811 DT node. - Add samsung,audio-codec property to required properties. Inha Song (3): ASoC: samsung: Add machine driver for Trats2 ASoC: samsung: Document Trats2 audio subsystem bindings ARM: dts: Add sound nodes for exynos4412-trats2 .../bindings/sound/samsung,trats2-wm1811.txt | 25 +++ arch/arm/boot/dts/exynos4412-trats2.dts| 39 sound/soc/samsung/Kconfig | 8 + sound/soc/samsung/Makefile | 2 + sound/soc/samsung/trats2_wm1811.c | 218 + 5 files changed, 292 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt create mode 100644 sound/soc/samsung/trats2_wm1811.c -- 2.0.0.390.gcb682f8 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[alsa-devel] [PATCH v2 1/3] ASoC: samsung: Add machine driver for Trats2
This patch add the sound machine driver for Trats2 board. The codec operate in master mode. Signed-off-by: Inha Song ideal.s...@samsung.com --- sound/soc/samsung/Kconfig | 8 ++ sound/soc/samsung/Makefile| 2 + sound/soc/samsung/trats2_wm1811.c | 218 ++ 3 files changed, 228 insertions(+) create mode 100644 sound/soc/samsung/trats2_wm1811.c diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index fc67f97..8031423 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -245,3 +245,11 @@ config SND_SOC_ARNDALE_RT5631_ALC5631 depends on SND_SOC_SAMSUNG select SND_SAMSUNG_I2S select SND_SOC_RT5631 + +config SND_SOC_SAMSUNG_TRATS2_WM1811 + tristate SoC I2S Audio support for WM1811 on Tizen Trats2 board + depends on SND_SOC_SAMSUNG + select SND_SOC_WM8994 + select SND_SAMSUNG_I2S + help + Say Y if you want to add support for SoC audio on the Tizen Trats2 board. diff --git a/sound/soc/samsung/Makefile b/sound/soc/samsung/Makefile index 31e3dba..e2b7b1b 100644 --- a/sound/soc/samsung/Makefile +++ b/sound/soc/samsung/Makefile @@ -46,6 +46,7 @@ snd-soc-littlemill-objs := littlemill.o snd-soc-bells-objs := bells.o snd-soc-odroidx2-max98090-objs := odroidx2_max98090.o snd-soc-arndale-rt5631-objs := arndale_rt5631.o +snd-soc-trats2-wm1811-objs := trats2_wm1811.o obj-$(CONFIG_SND_SOC_SAMSUNG_JIVE_WM8750) += snd-soc-jive-wm8750.o obj-$(CONFIG_SND_SOC_SAMSUNG_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o @@ -73,3 +74,4 @@ obj-$(CONFIG_SND_SOC_LITTLEMILL) += snd-soc-littlemill.o obj-$(CONFIG_SND_SOC_BELLS) += snd-soc-bells.o obj-$(CONFIG_SND_SOC_ODROIDX2) += snd-soc-odroidx2-max98090.o obj-$(CONFIG_SND_SOC_ARNDALE_RT5631_ALC5631) += snd-soc-arndale-rt5631.o +obj-$(CONFIG_SND_SOC_SAMSUNG_TRATS2_WM1811) += snd-soc-trats2-wm1811.o diff --git a/sound/soc/samsung/trats2_wm1811.c b/sound/soc/samsung/trats2_wm1811.c new file mode 100644 index 000..b937612 --- /dev/null +++ b/sound/soc/samsung/trats2_wm1811.c @@ -0,0 +1,218 @@ +/* + * Copyright (C) 2015 Samsung Electronics Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include linux/of.h +#include linux/module.h +#include linux/clk.h +#include sound/soc.h +#include sound/pcm_params.h +#include i2s.h +#include ../codecs/wm8994.h + +struct trats2_machine_priv { + struct clk *clk_mclk; +}; + +static struct trats2_machine_priv trats2_wm1811_priv; + +static const struct snd_kcontrol_new trats2_controls[] = { + SOC_DAPM_PIN_SWITCH(SPK), +}; + +static const struct snd_soc_dapm_widget trats2_dapm_widgets[] = { + SND_SOC_DAPM_SPK(SPK, NULL), +}; + +static int trats2_aif1_hw_params(struct snd_pcm_substream *substream, +struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream-private_data; + struct snd_soc_dai *codec_dai = rtd-codec_dai; + struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd-card); + unsigned int sysclk_rate; + unsigned int mclk_rate = + (unsigned int)clk_get_rate(priv-clk_mclk); + int ret; + + /* SYSCLK must be greater than 4.096MHz */ + if (params_rate(params) == 8000 || params_rate(params) == 11025) + sysclk_rate = params_rate(params) * 512; + else + sysclk_rate = params_rate(params) * 256; + + /* Set the codec FLL1 */ + ret = snd_soc_dai_set_pll(codec_dai, WM8994_FLL1, WM8994_FLL_SRC_MCLK1, + mclk_rate, sysclk_rate); + if (ret 0) { + dev_err(codec_dai-dev, Failed to set FLL1: %d\n, ret); + return ret; + } + + /* Set the codec SYSCLK */ + ret = snd_soc_dai_set_sysclk(codec_dai, WM8994_SYSCLK_FLL1, +sysclk_rate, SND_SOC_CLOCK_IN); + if (ret 0) { + dev_err(codec_dai-dev, Failed to set SYSCLK: %d\n, ret); + return ret; + } + + return 0; +} + +static int trats2_aif1_startup(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream-private_data; + struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd-card); + int ret; + + ret = clk_prepare_enable(priv-clk_mclk); + if (ret) { + dev_err(rtd-card-dev, Failed to enable mclk: %d\n, ret); + return ret; + } + + return 0; +} + +static void trats2_aif1_shutdown(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream-private_data; + struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd-card
Re: [alsa-devel] [PATCH 2/3] ASoC: samsung: Document Trats2 audio subsystem bindings
Hi Mark, Thank you for your feedback and sorry for late response. I think, I should remove clock settings in machine driver. If the clock settings are necessary, I will add assigned-clocks nodes in trats2 sound DT like odroid board. Best Regards, Inha Song. On Mon, Jan 05, 2015 at 08:25:16PM +0900, Inha Song wrote: + - clocks : Reference to the codec master clock + - clock-names : The clock should be named mclk This should be done in the CODEC driver, not in the machine driver - the CODEC always needs the clock, it's not something specific to this machine. Even if we decide that for Linux the best thing to do is to manage the clock in the machine driver it should be described in the DT as being attached to the CODEC. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[alsa-devel] [PATCH 0/3] Sound support for Exynos4412 Trats2 board
This patch-set adds basic sound support for the Trats2 boards. It just support primary I2s and external speaker playback. Inha Song (3): ASoC: samsung: Add machine driver for Trats2 ASoC: samsung: Document Trats2 audio subsystem bindings ARM: dts: Add sound nodes for exynos4412-trats2 .../bindings/sound/samsung,trats2-wm1811.txt | 31 +++ arch/arm/boot/dts/exynos4412-trats2.dts| 38 sound/soc/samsung/Kconfig | 8 + sound/soc/samsung/Makefile | 2 + sound/soc/samsung/trats2_wm1811.c | 216 + 5 files changed, 295 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt create mode 100644 sound/soc/samsung/trats2_wm1811.c -- 2.0.0.390.gcb682f8 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[alsa-devel] [PATCH 3/3] ARM: dts: Add sound nodes for exynos4412-trats2
This patch add WM1811 audio codec, I2S interface and the sound machine nodes to enable audio on exynos4412-trats2 board. Signed-off-by: Inha Song ideal.s...@samsung.com --- arch/arm/boot/dts/exynos4412-trats2.dts | 38 + 1 file changed, 38 insertions(+) diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts index 29231b4..2943ce7 100644 --- a/arch/arm/boot/dts/exynos4412-trats2.dts +++ b/arch/arm/boot/dts/exynos4412-trats2.dts @@ -203,6 +203,23 @@ }; }; + i2c@138A { + samsung,i2c-sda-delay = 100; + samsung,i2c-slave-addr = 0x10; + samsung,i2c-max-bus-freq = 10; + pinctrl-0 = i2c4_bus; + pinctrl-names = default; + status = okay; + + wm1811: wm1811@1a { + compatible = wlf,wm1811; + reg = 0x1a; + DCVDD-supply = ldo3_reg; + DBVDD1-supply = ldo3_reg; + wlf,ldo1ena = gpj0 4 0; + }; + }; + i2c@138D { samsung,i2c-sda-delay = 100; samsung,i2c-slave-addr = 0x10; @@ -838,6 +855,27 @@ }; }; + i2s0: i2s@0383 { + pinctrl-0 = i2s0_bus; + pinctrl-names = default; + status = okay; + }; + + sound { + compatible = samsung,trats2-audio; + clocks = pmu_system_controller 0; + clock-names = mclk; + assigned-clocks = pmu_system_controller 0; + assigned-clock-parents = clock CLK_XUSBXTI; + samsung,i2s-controller = i2s0; + samsung,model = wm1811; + samsung,audio-routing = + SPK, SPKOUTLN, + SPK, SPKOUTLP, + SPK, SPKOUTRN, + SPK, SPKOUTRP; + }; + exynos-usbphy@125B { status = okay; }; -- 2.0.0.390.gcb682f8 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[alsa-devel] [PATCH 1/3] ASoC: samsung: Add machine driver for Trats2
This patch add the sound machine driver for Trats2 board. The codec operate in master mode. So, Reference to the codec master clock must be defined in DT. Signed-off-by: Inha Song ideal.s...@samsung.com --- sound/soc/samsung/Kconfig | 8 ++ sound/soc/samsung/Makefile| 2 + sound/soc/samsung/trats2_wm1811.c | 216 ++ 3 files changed, 226 insertions(+) create mode 100644 sound/soc/samsung/trats2_wm1811.c diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index fc67f97..8031423 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -245,3 +245,11 @@ config SND_SOC_ARNDALE_RT5631_ALC5631 depends on SND_SOC_SAMSUNG select SND_SAMSUNG_I2S select SND_SOC_RT5631 + +config SND_SOC_SAMSUNG_TRATS2_WM1811 + tristate SoC I2S Audio support for WM1811 on Tizen Trats2 board + depends on SND_SOC_SAMSUNG + select SND_SOC_WM8994 + select SND_SAMSUNG_I2S + help + Say Y if you want to add support for SoC audio on the Tizen Trats2 board. diff --git a/sound/soc/samsung/Makefile b/sound/soc/samsung/Makefile index 31e3dba..e2b7b1b 100644 --- a/sound/soc/samsung/Makefile +++ b/sound/soc/samsung/Makefile @@ -46,6 +46,7 @@ snd-soc-littlemill-objs := littlemill.o snd-soc-bells-objs := bells.o snd-soc-odroidx2-max98090-objs := odroidx2_max98090.o snd-soc-arndale-rt5631-objs := arndale_rt5631.o +snd-soc-trats2-wm1811-objs := trats2_wm1811.o obj-$(CONFIG_SND_SOC_SAMSUNG_JIVE_WM8750) += snd-soc-jive-wm8750.o obj-$(CONFIG_SND_SOC_SAMSUNG_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o @@ -73,3 +74,4 @@ obj-$(CONFIG_SND_SOC_LITTLEMILL) += snd-soc-littlemill.o obj-$(CONFIG_SND_SOC_BELLS) += snd-soc-bells.o obj-$(CONFIG_SND_SOC_ODROIDX2) += snd-soc-odroidx2-max98090.o obj-$(CONFIG_SND_SOC_ARNDALE_RT5631_ALC5631) += snd-soc-arndale-rt5631.o +obj-$(CONFIG_SND_SOC_SAMSUNG_TRATS2_WM1811) += snd-soc-trats2-wm1811.o diff --git a/sound/soc/samsung/trats2_wm1811.c b/sound/soc/samsung/trats2_wm1811.c new file mode 100644 index 000..fc96842 --- /dev/null +++ b/sound/soc/samsung/trats2_wm1811.c @@ -0,0 +1,216 @@ +/* + * Copyright (C) 2015 Samsung Electronics Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include linux/of.h +#include linux/module.h +#include linux/clk.h +#include sound/soc.h +#include sound/pcm_params.h +#include i2s.h +#include i2s-regs.h +#include ../codecs/wm8994.h + +struct trats2_machine_priv { + struct clk *clk_mclk; +}; + +static struct trats2_machine_priv trats2_wm1811_priv; + +static const struct snd_kcontrol_new trats2_controls[] = { + SOC_DAPM_PIN_SWITCH(SPK), +}; + +const struct snd_soc_dapm_widget trats2_dapm_widgets[] = { + SND_SOC_DAPM_SPK(SPK, NULL), +}; + +static int trats2_aif1_hw_params(struct snd_pcm_substream *substream, +struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream-private_data; + struct snd_soc_dai *cpu_dai = rtd-cpu_dai; + struct snd_soc_dai *codec_dai = rtd-codec_dai; + struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd-card); + unsigned int sysclk_rate; + unsigned int mclk_rate = + (unsigned int)clk_get_rate(priv-clk_mclk); + int ret; + + /* Set the codec DAI configuration to Master*/ + ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S + | SND_SOC_DAIFMT_NB_NF + | SND_SOC_DAIFMT_CBM_CFM); + if (ret 0) { + dev_err(codec_dai-dev, + Failed to set codec dai format: %d\n, ret); + return ret; + } + + /* Set the cpu DAI configuration to Slave */ + ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S + | SND_SOC_DAIFMT_NB_NF + | SND_SOC_DAIFMT_CBM_CFM); + if (ret 0) { + dev_err(cpu_dai-dev, + Failed to set cpu dai format: %d\n, ret); + return ret; + } + + /* SYSCLK must be greater than 4.096MHz */ + if (params_rate(params) == 8000 || params_rate(params) == 11025) + sysclk_rate = params_rate(params) * 512; + else + sysclk_rate = params_rate(params) * 256; + + /* Set the codec FLL1 */ + ret = snd_soc_dai_set_pll(codec_dai, WM8994_FLL1, WM8994_FLL_SRC_MCLK1, + mclk_rate, sysclk_rate); + if (ret 0) { + dev_err(codec_dai-dev, Failed to set FLL1: %d\n, ret); + return ret; + } + + /* Set the codec SYSCLK */ + ret
[alsa-devel] [PATCH 2/3] ASoC: samsung: Document Trats2 audio subsystem bindings
This patch add Trats2 audio subsystem bindings document. Signed-off-by: Inha Song ideal.s...@samsung.com --- .../bindings/sound/samsung,trats2-wm1811.txt | 31 ++ 1 file changed, 31 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt diff --git a/Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt b/Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt new file mode 100644 index 000..9d4d3f1 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt @@ -0,0 +1,31 @@ +Samsung Exynos Trats2 audio with WM1811 codec + +Required properties: + + - compatible : Must be samsung,trats2-audio + + - clocks : Reference to the codec master clock + - clock-names : The clock should be named mclk + + - samsung,i2s-controller : The phandle of the I2S controller + + - samsung,model : The user visible name of this sound + + - samsung,audio-routing : A list of the connections between audio + components. each entry is a pair of strings, the first being the + connection's sink, the second being the connection's source + +Example: + +sound { + compatible = samsung,trats2-audio; + clocks = pmu_system_controller 0; + clock-names = mclk; + samsung,i2s-controller = i2s0; + samsung,model = wm1811; + samsung,audio-routing = + SPK, SPKOUTLN, + SPK, SPKOUTLP, + SPK, SPKOUTRN, + SPK, SPKOUTRP; +}; -- 2.0.0.390.gcb682f8 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [alsa-devel] [PATCH 1/3] ASoC: samsung: Add machine driver for Trats2
Hi, Thanks for your comments. Hi, A few small comments inline. On 01/05/2015 12:25 PM, Inha Song wrote: --- /dev/null +++ b/sound/soc/samsung/trats2_wm1811.c @@ -0,0 +1,216 @@ [...] +#include linux/of.h +#include linux/module.h +#include linux/clk.h +#include sound/soc.h +#include sound/pcm_params.h +#include i2s.h +#include i2s-regs.h You probably don't need i2s-regs.h OK, I will remove. +#include ../codecs/wm8994.h + +struct trats2_machine_priv { + struct clk *clk_mclk; +}; + +static struct trats2_machine_priv trats2_wm1811_priv; + +static const struct snd_kcontrol_new trats2_controls[] = { + SOC_DAPM_PIN_SWITCH(SPK), +}; + +const struct snd_soc_dapm_widget trats2_dapm_widgets[] = { static Sorry for my mistake. + SND_SOC_DAPM_SPK(SPK, NULL), +}; + +static int trats2_aif1_hw_params(struct snd_pcm_substream *substream, +struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream-private_data; + struct snd_soc_dai *cpu_dai = rtd-cpu_dai; + struct snd_soc_dai *codec_dai = rtd-codec_dai; + struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd-card); + unsigned int sysclk_rate; + unsigned int mclk_rate = + (unsigned int)clk_get_rate(priv-clk_mclk); + int ret; + + /* Set the codec DAI configuration to Master*/ + ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S + | SND_SOC_DAIFMT_NB_NF + | SND_SOC_DAIFMT_CBM_CFM); + if (ret 0) { + dev_err(codec_dai-dev, + Failed to set codec dai format: %d\n, ret); + return ret; + } + + /* Set the cpu DAI configuration to Slave */ + ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S + | SND_SOC_DAIFMT_NB_NF + | SND_SOC_DAIFMT_CBM_CFM); + if (ret 0) { + dev_err(cpu_dai-dev, + Failed to set cpu dai format: %d\n, ret); + return ret; + } Use the dai_fmt field in the dai_link struct to setup the DAI link format. This will configure both the CPU and the CODEC DAI with the specified format, no need to do it manually. Ok, move to dai_fmt. [...] +static struct snd_soc_ops trats2_aif1_ops = { const I will fix this. + .hw_params = trats2_aif1_hw_params, +}; + +static int trats2_init_paiftx(struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_codec *codec = rtd-codec; + struct snd_soc_card *card = rtd-card; + struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(card); + int ret; + + ret = clk_prepare_enable(priv-clk_mclk); Maybe just do this in the platform device probe handler and you should have a matching disable call somewhere. Ok, I will move clk_prepare_enable call to snd_soc_ops-startup and clk_disable_unprepare call to snd_soc_ops-shutdown. Best Regards, Inha Song. + if (ret) { + dev_err(codec-dev, Failed to enable mclk: %d\n, ret); + return ret; + } + + return 0; +} [...] ___ Alsa-devel mailing list alsa-de...@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html