* [PATCH 10/12] ASoC: rsnd: add missing DT example for Simple Card [not found] ` <87egeliyaz.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> @ 2015-12-17 2:59 ` Kuninori Morimoto 2015-12-18 20:16 ` Rob Herring [not found] ` <87zix9hjfx.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> 2015-12-17 2:59 ` [PATCH 11/12] ASoC: rsnd: add missing DT example for Simple Card with TDM Kuninori Morimoto 2015-12-17 3:00 ` [PATCH 12/12] ASoC: rsnd: add Multi channel support Kuninori Morimoto 2 siblings, 2 replies; 11+ messages in thread From: Kuninori Morimoto @ 2015-12-17 2:59 UTC (permalink / raw) To: Mark Brown; +Cc: Simon, Linux-DT, Linux-ALSA, Liam Girdwood From: Kuninori Morimoto <kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> --- .../devicetree/bindings/sound/renesas,rsnd.txt | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt index 59cebfb..bb9f33405 100644 --- a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt @@ -249,3 +249,43 @@ rcar_sound: sound@ec500000 { }; }; }; + +Example: simple sound card + + rsnd_ak4643: sound { + compatible = "simple-audio-card"; + + simple-audio-card,format = "left_j"; + simple-audio-card,bitclock-master = <&sndcodec>; + simple-audio-card,frame-master = <&sndcodec>; + + sndcpu: simple-audio-card,cpu { + sound-dai = <&rcar_sound>; + }; + + sndcodec: simple-audio-card,codec { + sound-dai = <&ak4643>; + clocks = <&audio_clock>; + }; + }; + +&rcar_sound { + pinctrl-0 = <&sound_pins &sound_clk_pins>; + pinctrl-names = "default"; + + /* Single DAI */ + #sound-dai-cells = <0>; + + status = "okay"; + + rcar_sound,dai { + dai0 { + playback = <&ssi0 &src2 &dvc0>; + capture = <&ssi1 &src3 &dvc1>; + }; + }; +}; + +&ssi1 { + shared-pin; +}; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 10/12] ASoC: rsnd: add missing DT example for Simple Card 2015-12-17 2:59 ` [PATCH 10/12] ASoC: rsnd: add missing DT example for Simple Card Kuninori Morimoto @ 2015-12-18 20:16 ` Rob Herring [not found] ` <87zix9hjfx.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> 1 sibling, 0 replies; 11+ messages in thread From: Rob Herring @ 2015-12-18 20:16 UTC (permalink / raw) To: Kuninori Morimoto; +Cc: Linux-DT, Linux-ALSA, Mark Brown, Liam Girdwood, Simon On Thu, Dec 17, 2015 at 02:59:09AM +0000, Kuninori Morimoto wrote: > > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> > > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> > --- > .../devicetree/bindings/sound/renesas,rsnd.txt | 40 ++++++++++++++++++++++ > 1 file changed, 40 insertions(+) Acked-by: Rob Herring <robh@kernel.org> ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <87zix9hjfx.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>]
* Re: [PATCH 10/12] ASoC: rsnd: add missing DT example for Simple Card [not found] ` <87zix9hjfx.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> @ 2015-12-19 4:18 ` Rob Herring 0 siblings, 0 replies; 11+ messages in thread From: Rob Herring @ 2015-12-19 4:18 UTC (permalink / raw) To: Kuninori Morimoto; +Cc: Mark Brown, Simon, Linux-DT, Linux-ALSA, Liam Girdwood On Thu, Dec 17, 2015 at 02:59:09AM +0000, Kuninori Morimoto wrote: > > From: Kuninori Morimoto <kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> > > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> > --- > .../devicetree/bindings/sound/renesas,rsnd.txt | 40 ++++++++++++++++++++++ > 1 file changed, 40 insertions(+) Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 11/12] ASoC: rsnd: add missing DT example for Simple Card with TDM [not found] ` <87egeliyaz.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> 2015-12-17 2:59 ` [PATCH 10/12] ASoC: rsnd: add missing DT example for Simple Card Kuninori Morimoto @ 2015-12-17 2:59 ` Kuninori Morimoto 2015-12-18 20:15 ` Rob Herring [not found] ` <87y4cthjf9.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> 2015-12-17 3:00 ` [PATCH 12/12] ASoC: rsnd: add Multi channel support Kuninori Morimoto 2 siblings, 2 replies; 11+ messages in thread From: Kuninori Morimoto @ 2015-12-17 2:59 UTC (permalink / raw) To: Mark Brown; +Cc: Simon, Linux-DT, Linux-ALSA, Liam Girdwood From: Kuninori Morimoto <kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> --- .../devicetree/bindings/sound/renesas,rsnd.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt index bb9f33405..162e94c 100644 --- a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt @@ -289,3 +289,22 @@ Example: simple sound card &ssi1 { shared-pin; }; + +Example: simple sound card for TDM + + rsnd_tdm: sound { + compatible = "simple-audio-card"; + + simple-audio-card,format = "left_j"; + simple-audio-card,bitclock-master = <&sndcodec>; + simple-audio-card,frame-master = <&sndcodec>; + + sndcpu: simple-audio-card,cpu { + sound-dai = <&rcar_sound>; + dai-tdm-slot-num = <6>; + }; + + sndcodec: simple-audio-card,codec { + sound-dai = <&xxx>; + }; + }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 11/12] ASoC: rsnd: add missing DT example for Simple Card with TDM 2015-12-17 2:59 ` [PATCH 11/12] ASoC: rsnd: add missing DT example for Simple Card with TDM Kuninori Morimoto @ 2015-12-18 20:15 ` Rob Herring [not found] ` <87y4cthjf9.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> 1 sibling, 0 replies; 11+ messages in thread From: Rob Herring @ 2015-12-18 20:15 UTC (permalink / raw) To: Kuninori Morimoto; +Cc: Linux-DT, Linux-ALSA, Mark Brown, Liam Girdwood, Simon On Thu, Dec 17, 2015 at 02:59:31AM +0000, Kuninori Morimoto wrote: > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> > > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> > --- > .../devicetree/bindings/sound/renesas,rsnd.txt | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) Acked-by: Rob Herring <robh@kernel.org> ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <87y4cthjf9.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>]
* Re: [PATCH 11/12] ASoC: rsnd: add missing DT example for Simple Card with TDM [not found] ` <87y4cthjf9.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> @ 2015-12-19 4:18 ` Rob Herring 0 siblings, 0 replies; 11+ messages in thread From: Rob Herring @ 2015-12-19 4:18 UTC (permalink / raw) To: Kuninori Morimoto; +Cc: Mark Brown, Simon, Linux-DT, Linux-ALSA, Liam Girdwood On Thu, Dec 17, 2015 at 02:59:31AM +0000, Kuninori Morimoto wrote: > From: Kuninori Morimoto <kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> > > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> > --- > .../devicetree/bindings/sound/renesas,rsnd.txt | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 12/12] ASoC: rsnd: add Multi channel support [not found] ` <87egeliyaz.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> 2015-12-17 2:59 ` [PATCH 10/12] ASoC: rsnd: add missing DT example for Simple Card Kuninori Morimoto 2015-12-17 2:59 ` [PATCH 11/12] ASoC: rsnd: add missing DT example for Simple Card with TDM Kuninori Morimoto @ 2015-12-17 3:00 ` Kuninori Morimoto 2015-12-18 20:04 ` Rob Herring [not found] ` <87wpsdhje9.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> 2 siblings, 2 replies; 11+ messages in thread From: Kuninori Morimoto @ 2015-12-17 3:00 UTC (permalink / raw) To: Mark Brown; +Cc: Simon, Linux-DT, Linux-ALSA, Liam Girdwood From: Kuninori Morimoto <kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> This patch adds Multi channel support on Renesas R-Car sound. This patch is tested on Salvator-X board, but it can't use Multi channel, because supported format is different between codec chip and R-Car. Thus, it was tested on board which doesn't mount codec chip, with oscilloscope. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> --- .../devicetree/bindings/sound/renesas,rsnd.txt | 18 ++++ sound/soc/sh/rcar/core.c | 6 +- sound/soc/sh/rcar/gen.c | 3 + sound/soc/sh/rcar/rsnd.h | 15 ++- sound/soc/sh/rcar/ssi.c | 114 ++++++++++++++++++++- sound/soc/sh/rcar/ssiu.c | 55 ++++++++-- 6 files changed, 194 insertions(+), 17 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt index 162e94c..8ee0fa9 100644 --- a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt @@ -308,3 +308,21 @@ Example: simple sound card for TDM sound-dai = <&xxx>; }; }; + +Example: simple sound card for Multi channel + +&rcar_sound { + pinctrl-0 = <&sound_pins &sound_clk_pins>; + pinctrl-names = "default"; + + /* Single DAI */ + #sound-dai-cells = <0>; + + status = "okay"; + + rcar_sound,dai { + dai0 { + playback = <&ssi0 &ssi1 &ssi2 &src0 &dvc0>; + }; + }; +}; diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 7781cef..ca05a0a 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -215,7 +215,11 @@ int rsnd_get_slot_num(struct rsnd_dai_stream *io) int rsnd_get_slot_width(struct rsnd_dai_stream *io) { struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); - int chan = runtime->channels / rsnd_get_slot_num(io); + int chan = runtime->channels; + + /* Multi channel Mode */ + if (rsnd_ssi_multi_slaves(io)) + chan /= rsnd_get_slot_num(io); /* TDM Extend Mode needs 8ch */ if (chan == 6) diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c index 7c5485e..c7aee9e 100644 --- a/sound/soc/sh/rcar/gen.c +++ b/sound/soc/sh/rcar/gen.c @@ -226,6 +226,9 @@ static int rsnd_gen2_probe(struct rsnd_priv *priv) const static struct rsnd_regmap_field_conf conf_ssiu[] = { RSND_GEN_S_REG(SSI_MODE0, 0x800), RSND_GEN_S_REG(SSI_MODE1, 0x804), + RSND_GEN_S_REG(SSI_MODE2, 0x808), + RSND_GEN_S_REG(SSI_CONTROL, 0x810), + /* FIXME: it needs SSI_MODE2/3 in the future */ RSND_GEN_M_REG(SSI_BUSIF_MODE, 0x0, 0x80), RSND_GEN_M_REG(SSI_BUSIF_ADINR, 0x4, 0x80), diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index f803e14..317dd79 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -47,6 +47,8 @@ enum rsnd_reg { RSND_REG_SSI_MODE, /* Gen2 only */ RSND_REG_SSI_MODE0, RSND_REG_SSI_MODE1, + RSND_REG_SSI_MODE2, + RSND_REG_SSI_CONTROL, RSND_REG_SSI_CTRL, /* Gen2 only */ RSND_REG_SSI_BUSIF_MODE, /* Gen2 only */ RSND_REG_SSI_BUSIF_ADINR, /* Gen2 only */ @@ -181,7 +183,10 @@ enum rsnd_mod_type { RSND_MOD_CTU, RSND_MOD_CMD, RSND_MOD_SRC, - RSND_MOD_SSIP, /* SSI parent */ + RSND_MOD_SSIM3, /* SSI multi 3 */ + RSND_MOD_SSIM2, /* SSI multi 2 */ + RSND_MOD_SSIM1, /* SSI multi 1 */ + RSND_MOD_SSIP, /* SSI parent */ RSND_MOD_SSI, RSND_MOD_SSIU, RSND_MOD_MAX, @@ -542,6 +547,7 @@ void rsnd_ssi_remove(struct rsnd_priv *priv); struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id); int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod); int rsnd_ssi_use_busif(struct rsnd_dai_stream *io); +u32 rsnd_ssi_multi_slaves(struct rsnd_dai_stream *io); #define rsnd_ssi_is_pin_sharing(io) \ __rsnd_ssi_is_pin_sharing(rsnd_io_to_mod_ssi(io)) @@ -549,10 +555,9 @@ int __rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod); #define rsnd_ssi_of_node(priv) \ of_get_child_by_name(rsnd_priv_to_dev(priv)->of_node, "rcar_sound,ssi") -#define rsnd_parse_connect_ssi(rdai, playback, capture) \ - rsnd_parse_connect_common(rdai, rsnd_ssi_mod_get, \ - rsnd_ssi_of_node(rsnd_rdai_to_priv(rdai)), \ - playback, capture) +void rsnd_parse_connect_ssi(struct rsnd_dai *rdai, + struct device_node *playback, + struct device_node *capture); /* * R-Car SSIU diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 0b91692..7db05fd 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -96,6 +96,7 @@ struct rsnd_ssi { #define rsnd_mod_to_ssi(_mod) container_of((_mod), struct rsnd_ssi, mod) #define rsnd_ssi_mode_flags(p) ((p)->flags) #define rsnd_ssi_is_parent(ssi, io) ((ssi) == rsnd_io_to_mod_ssip(io)) +#define rsnd_ssi_is_multi_slave(ssi, io) ((mod) != rsnd_io_to_mod_ssi(io)) int rsnd_ssi_use_busif(struct rsnd_dai_stream *io) { @@ -171,6 +172,41 @@ static int rsnd_ssi_irq_disable(struct rsnd_mod *ssi_mod) return 0; } +u32 rsnd_ssi_multi_slaves(struct rsnd_dai_stream *io) +{ + struct rsnd_mod *mod; + struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); + struct rsnd_priv *priv = rsnd_io_to_priv(io); + struct device *dev = rsnd_priv_to_dev(priv); + enum rsnd_mod_type types[] = { + RSND_MOD_SSIM1, + RSND_MOD_SSIM2, + RSND_MOD_SSIM3, + }; + int i, mask; + + switch (runtime->channels) { + case 2: /* Multi channel is not needed for Stereo */ + return 0; + case 6: + break; + default: + dev_err(dev, "unsupported channel\n"); + return 0; + } + + mask = 0; + for (i = 0; i < ARRAY_SIZE(types); i++) { + mod = rsnd_io_to_mod(io, types[i]); + if (!mod) + continue; + + mask |= 1 << rsnd_mod_id(mod); + } + + return mask; +} + static int rsnd_ssi_master_clk_start(struct rsnd_ssi *ssi, struct rsnd_dai_stream *io) { @@ -194,6 +230,9 @@ static int rsnd_ssi_master_clk_start(struct rsnd_ssi *ssi, if (ssi_parent_mod && !rsnd_ssi_is_parent(mod, io)) return 0; + if (rsnd_ssi_is_multi_slave(mod, io)) + return 0; + if (ssi->usrcnt > 1) { if (ssi->rate != rate) { dev_err(dev, "SSI parent/child should use same rate\n"); @@ -437,8 +476,14 @@ static int __rsnd_ssi_start(struct rsnd_mod *mod, cr = ssi->cr_own | ssi->cr_clk | - ssi->cr_mode | - EN; + ssi->cr_mode; + + /* + * EN will be set via SSIU :: SSI_CONTROL + * if Multi channel mode + */ + if (!rsnd_ssi_multi_slaves(io)) + cr |= EN; rsnd_mod_write(mod, SSICR, cr); rsnd_mod_write(mod, SSIWSR, ssi->wsr); @@ -609,6 +654,13 @@ static int rsnd_ssi_common_probe(struct rsnd_mod *mod, struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); int ret; + /* + * SSIP/SSIU/IRQ are not needed on + * SSI Multi slaves + */ + if (rsnd_ssi_is_multi_slave(mod, io)) + return 0; + rsnd_ssi_parent_attach(mod, io, priv); ret = rsnd_ssiu_attach(io, mod); @@ -641,6 +693,13 @@ static int rsnd_ssi_dma_probe(struct rsnd_mod *mod, int dma_id = 0; /* not needed */ int ret; + /* + * SSIP/SSIU/IRQ/DMA are not needed on + * SSI Multi slaves + */ + if (rsnd_ssi_is_multi_slave(mod, io)) + return 0; + ret = rsnd_ssi_common_probe(mod, io, priv); if (ret) return ret; @@ -732,6 +791,57 @@ static struct rsnd_mod_ops rsnd_ssi_non_ops = { /* * ssi mod function */ +static void rsnd_ssi_connect(struct rsnd_mod *mod, + struct rsnd_dai_stream *io) +{ + struct rsnd_dai *rdai = rsnd_io_to_rdai(io); + enum rsnd_mod_type types[] = { + RSND_MOD_SSI, + RSND_MOD_SSIM1, + RSND_MOD_SSIM2, + RSND_MOD_SSIM3, + }; + enum rsnd_mod_type type; + int i; + + /* try SSI -> SSIM1 -> SSIM2 -> SSIM3 */ + for (i = 0; i < ARRAY_SIZE(types); i++) { + type = types[i]; + if (!rsnd_io_to_mod(io, type)) { + rsnd_dai_connect(mod, io, type); + rsnd_set_slot(rdai, 2 * (i + 1), (i + 1)); + return; + } + } +} + +void rsnd_parse_connect_ssi(struct rsnd_dai *rdai, + struct device_node *playback, + struct device_node *capture) +{ + struct rsnd_priv *priv = rsnd_rdai_to_priv(rdai); + struct device_node *node; + struct device_node *np; + struct rsnd_mod *mod; + int i; + + node = rsnd_ssi_of_node(priv); + if (!node) + return; + + i = 0; + for_each_child_of_node(node, np) { + mod = rsnd_ssi_mod_get(priv, i); + if (np == playback) + rsnd_ssi_connect(mod, &rdai->playback); + if (np == capture) + rsnd_ssi_connect(mod, &rdai->capture); + i++; + } + + of_node_put(node); +} + struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id) { if (WARN_ON(id < 0 || id >= rsnd_ssi_nr(priv))) diff --git a/sound/soc/sh/rcar/ssiu.c b/sound/soc/sh/rcar/ssiu.c index 7ae05a7..3fe9e08 100644 --- a/sound/soc/sh/rcar/ssiu.c +++ b/sound/soc/sh/rcar/ssiu.c @@ -27,8 +27,11 @@ static int rsnd_ssiu_init(struct rsnd_mod *mod, struct rsnd_priv *priv) { struct rsnd_dai *rdai = rsnd_io_to_rdai(io); + u32 multi_ssi_slaves = rsnd_ssi_multi_slaves(io); int use_busif = rsnd_ssi_use_busif(io); int id = rsnd_mod_id(mod); + u32 mask1, val1; + u32 mask2, val2; /* * SSI_MODE0 @@ -38,6 +41,9 @@ static int rsnd_ssiu_init(struct rsnd_mod *mod, /* * SSI_MODE1 */ + mask1 = (1 << 4) | (1 << 20); /* mask sync bit */ + mask2 = (1 << 4); /* mask sync bit */ + val1 = val2 = 0; if (rsnd_ssi_is_pin_sharing(io)) { int shift = -1; @@ -51,15 +57,36 @@ static int rsnd_ssiu_init(struct rsnd_mod *mod, case 4: shift = 16; break; + default: + return -EINVAL; } - if (shift >= 0) - rsnd_mod_bset(mod, SSI_MODE1, - 0x3 << shift, - rsnd_rdai_is_clk_master(rdai) ? - 0x2 << shift : 0x1 << shift); + mask1 |= 0x3 << shift; + val1 = rsnd_rdai_is_clk_master(rdai) ? + 0x2 << shift : 0x1 << shift; + + } else if (multi_ssi_slaves) { + + mask2 |= 0x00000007; + mask1 |= 0x0000000f; + + switch (multi_ssi_slaves) { + case 0x0206: /* SSI0/1/2/9 */ + val2 = (1 << 4) | /* SSI0129 sync */ + rsnd_rdai_is_clk_master(rdai) ? 0x2 : 0x1; + /* fall through */ + case 0x0006: /* SSI0/1/2 */ + val1 = rsnd_rdai_is_clk_master(rdai) ? + 0xa : 0x5; + + if (!val2) /* SSI012 sync */ + val1 |= (1 << 4); + } } + rsnd_mod_bset(mod, SSI_MODE1, mask1, val1); + rsnd_mod_bset(mod, SSI_MODE2, mask2, val2); + return 0; } @@ -104,8 +131,13 @@ static int rsnd_ssiu_start_gen2(struct rsnd_mod *mod, struct rsnd_dai_stream *io, struct rsnd_priv *priv) { - if (rsnd_ssi_use_busif(io)) - rsnd_mod_write(mod, SSI_CTRL, 0x1); + if (!rsnd_ssi_use_busif(io)) + return 0; + + rsnd_mod_write(mod, SSI_CTRL, 0x1); + + if (rsnd_ssi_multi_slaves(io)) + rsnd_mod_write(mod, SSI_CONTROL, 0x1); return 0; } @@ -114,8 +146,13 @@ static int rsnd_ssiu_stop_gen2(struct rsnd_mod *mod, struct rsnd_dai_stream *io, struct rsnd_priv *priv) { - if (rsnd_ssi_use_busif(io)) - rsnd_mod_write(mod, SSI_CTRL, 0); + if (!rsnd_ssi_use_busif(io)) + return 0; + + rsnd_mod_write(mod, SSI_CTRL, 0); + + if (rsnd_ssi_multi_slaves(io)) + rsnd_mod_write(mod, SSI_CONTROL, 0); return 0; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 12/12] ASoC: rsnd: add Multi channel support 2015-12-17 3:00 ` [PATCH 12/12] ASoC: rsnd: add Multi channel support Kuninori Morimoto @ 2015-12-18 20:04 ` Rob Herring 2015-12-19 11:37 ` Mark Brown [not found] ` <87wpsdhje9.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> 1 sibling, 1 reply; 11+ messages in thread From: Rob Herring @ 2015-12-18 20:04 UTC (permalink / raw) To: Kuninori Morimoto; +Cc: Linux-DT, Linux-ALSA, Mark Brown, Liam Girdwood, Simon On Thu, Dec 17, 2015 at 03:00:10AM +0000, Kuninori Morimoto wrote: > > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> > > This patch adds Multi channel support on Renesas R-Car sound. > This patch is tested on Salvator-X board, but it can't use > Multi channel, because supported format is different between > codec chip and R-Car. > Thus, it was tested on board which doesn't mount codec chip, > with oscilloscope. > > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> > --- > .../devicetree/bindings/sound/renesas,rsnd.txt | 18 ++++ For the binding: Acked-by: Rob Herring <robh@kernel.org> > sound/soc/sh/rcar/core.c | 6 +- > sound/soc/sh/rcar/gen.c | 3 + > sound/soc/sh/rcar/rsnd.h | 15 ++- > sound/soc/sh/rcar/ssi.c | 114 ++++++++++++++++++++- > sound/soc/sh/rcar/ssiu.c | 55 ++++++++-- > 6 files changed, 194 insertions(+), 17 deletions(-) ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 12/12] ASoC: rsnd: add Multi channel support 2015-12-18 20:04 ` Rob Herring @ 2015-12-19 11:37 ` Mark Brown [not found] ` <20151219113709.GG5727-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> 0 siblings, 1 reply; 11+ messages in thread From: Mark Brown @ 2015-12-19 11:37 UTC (permalink / raw) To: Rob Herring; +Cc: Kuninori Morimoto, Simon, Linux-DT, Linux-ALSA, Liam Girdwood [-- Attachment #1: Type: text/plain, Size: 1958 bytes --] On Fri, Dec 18, 2015 at 02:04:51PM -0600, Rob Herring wrote: > On Thu, Dec 17, 2015 at 03:00:10AM +0000, Kuninori Morimoto wrote: > > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> > > --- > > .../devicetree/bindings/sound/renesas,rsnd.txt | 18 ++++ > For the binding: > Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Rob, it looks like something's up with your mail system - I'm getting two copies of all your mails. It looks like I'm getting one copy sent with TLS and one copy sent without TLS both from rob-hp-laptop with different message IDs: Delivered-To: broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C46E204A2; Sat, 19 Dec 2015 04:17:58 +0000 (UTC) Received: from rob-hp-laptop (unknown [68.66.83.131]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F0AEF20490; Sat, 19 Dec 2015 04:17:56 +0000 (UTC) Message-ID: <20151219041755.GG14936@rob-hp-laptop> (sfid-20151219_041801_069806_5E8B0949) and Delivered-To: broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B6B4E204AF for <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>; Sat, 19 Dec 2015 04:19:20 +0000 (UTC) Received: from rob-hp-laptop (unknown [68.66.83.131]) by mail.kernel.org (Postfix) with ESMTP id 02201204D2 for <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>; Sat, 19 Dec 2015 04:19:20 +0000 (UTC) Received: by rob-hp-laptop (Postfix, from userid 1000) id D0F442C02FD; Fri, 18 Dec 2015 22:09:13 -0600 (CST) ... Message-Id: <20151219040913.D0F442C02FD@rob-hp-laptop> (sfid-20151219_041922_802186_2104CD68) [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 473 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <20151219113709.GG5727-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>]
* Re: [PATCH 12/12] ASoC: rsnd: add Multi channel support [not found] ` <20151219113709.GG5727-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> @ 2015-12-22 18:47 ` Rob Herring 0 siblings, 0 replies; 11+ messages in thread From: Rob Herring @ 2015-12-22 18:47 UTC (permalink / raw) To: Mark Brown; +Cc: Kuninori Morimoto, Simon, Linux-DT, Linux-ALSA, Liam Girdwood On Sat, Dec 19, 2015 at 5:37 AM, Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote: > On Fri, Dec 18, 2015 at 02:04:51PM -0600, Rob Herring wrote: >> On Thu, Dec 17, 2015 at 03:00:10AM +0000, Kuninori Morimoto wrote: > >> > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> >> > --- >> > .../devicetree/bindings/sound/renesas,rsnd.txt | 18 ++++ > >> For the binding: > >> Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> > > Rob, it looks like something's up with your mail system - I'm getting > two copies of all your mails. It looks like I'm getting one copy sent > with TLS and one copy sent without TLS both from rob-hp-laptop with > different message IDs: Yeah, I've been playing with my mail setup and messed up with this batch mail I had accumulated offline. Thanks for letting me know. Rob -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <87wpsdhje9.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>]
* Re: [PATCH 12/12] ASoC: rsnd: add Multi channel support [not found] ` <87wpsdhje9.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> @ 2015-12-19 4:18 ` Rob Herring 0 siblings, 0 replies; 11+ messages in thread From: Rob Herring @ 2015-12-19 4:18 UTC (permalink / raw) To: Kuninori Morimoto; +Cc: Mark Brown, Simon, Linux-DT, Linux-ALSA, Liam Girdwood On Thu, Dec 17, 2015 at 03:00:10AM +0000, Kuninori Morimoto wrote: > > From: Kuninori Morimoto <kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> > > This patch adds Multi channel support on Renesas R-Car sound. > This patch is tested on Salvator-X board, but it can't use > Multi channel, because supported format is different between > codec chip and R-Car. > Thus, it was tested on board which doesn't mount codec chip, > with oscilloscope. > > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> > --- > .../devicetree/bindings/sound/renesas,rsnd.txt | 18 ++++ For the binding: Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> > sound/soc/sh/rcar/core.c | 6 +- > sound/soc/sh/rcar/gen.c | 3 + > sound/soc/sh/rcar/rsnd.h | 15 ++- > sound/soc/sh/rcar/ssi.c | 114 ++++++++++++++++++++- > sound/soc/sh/rcar/ssiu.c | 55 ++++++++-- > 6 files changed, 194 insertions(+), 17 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2015-12-22 18:47 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <87egeliyaz.wl%kuninori.morimoto.gx@renesas.com>
[not found] ` <87egeliyaz.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2015-12-17 2:59 ` [PATCH 10/12] ASoC: rsnd: add missing DT example for Simple Card Kuninori Morimoto
2015-12-18 20:16 ` Rob Herring
[not found] ` <87zix9hjfx.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2015-12-19 4:18 ` Rob Herring
2015-12-17 2:59 ` [PATCH 11/12] ASoC: rsnd: add missing DT example for Simple Card with TDM Kuninori Morimoto
2015-12-18 20:15 ` Rob Herring
[not found] ` <87y4cthjf9.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2015-12-19 4:18 ` Rob Herring
2015-12-17 3:00 ` [PATCH 12/12] ASoC: rsnd: add Multi channel support Kuninori Morimoto
2015-12-18 20:04 ` Rob Herring
2015-12-19 11:37 ` Mark Brown
[not found] ` <20151219113709.GG5727-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-12-22 18:47 ` Rob Herring
[not found] ` <87wpsdhje9.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2015-12-19 4:18 ` Rob Herring
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox