Message ID | 1400759708-25831-1-git-send-email-s.nawrocki@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, May 22, 2014 at 01:55:07PM +0200, Sylwester Nawrocki wrote: > + sound { > + compatible = "samsung,odroidx2-audio"; > + samsung,i2s-controller = <&i2s0>; > + samsung,audio-codec = <&max98090>; > + }; Can this not use simple-card?
On 22/05/14 20:46, Mark Brown wrote: > On Thu, May 22, 2014 at 01:55:07PM +0200, Sylwester Nawrocki wrote: > >> + sound { >> + compatible = "samsung,odroidx2-audio"; >> + samsung,i2s-controller = <&i2s0>; >> + samsung,audio-codec = <&max98090>; >> + }; > > Can this not use simple-card? I dug into that and it seems it almost could, but there is one thing I'm not sure how to cover with the simple-card DT bindings and the related driver. There are these two calls: + ret = snd_soc_dai_set_sysclk(cpu_dai, SAMSUNG_I2S_OPCLK, + 0, MOD_OPCLK_PCLK); + /* Set the cpu DAI configuration in order to use CDCLK */ + ret = snd_soc_dai_set_sysclk(cpu_dai, SAMSUNG_I2S_CDCLK, + 0, SND_SOC_CLOCK_OUT); This changes clocks routing so that the CPU DAI in slave mode generates master clock for the codec, on the SoC's CDCLK pin. Then this is a reference clock for the codec's PLL, which is a source of the I2S interface clocks. It's done this way to avoid changing at runtime frequency of the EPLL clock, which may be parent of other clocks than the sound subsystem, e.g. MMC. simple-card just calls set_sysclk once for the CPU DAI and CODEC with the second and last argument set to 0. I'll try and see again if there is some way to use simple-card.
diff --git a/Documentation/devicetree/bindings/sound/samsung,odroidx2-max98090.txt b/Documentation/devicetree/bindings/sound/samsung,odroidx2-max98090.txt new file mode 100644 index 0000000..b37e79a --- /dev/null +++ b/Documentation/devicetree/bindings/sound/samsung,odroidx2-max98090.txt @@ -0,0 +1,32 @@ +Odroid X2/U3 audio complex + +Required properties: +- compatible : "samsung,odroidx2-audio" +- samsung,i2s-controller : phandle to the I2S controller +- samsung,audio-codec : phandle to the audio codec + +Example: + + i2s0: i2s@03830000 { + ... + clocks = <&clock_audss EXYNOS_I2S_BUS>, + <&clock_audss EXYNOS_DOUT_AUD_BUS>; + clock-names = "iis", "i2s_opclk0"; + status = "okay"; + }; + + i2c@13870000 { + ... + max98090: max98090@10 { + compatible = "maxim,max98090"; + reg = <0x10>; + interrupt-parent = <&gpx0>; + interrupts = <1 0>; + }; + }; + + sound { + compatible = "samsung,odroidx2-audio"; + samsung,i2s-controller = <&i2s0>; + samsung,audio-codec = <&max98090>; + };
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> --- .../bindings/sound/samsung,odroidx2-max98090.txt | 32 ++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/samsung,odroidx2-max98090.txt