ssi.c (678ea0037263bb8afb139c4035be5ad4bc610a2f) ssi.c (5ba17b42e1755c3c5cfe96370cfd47f34d01f62c)
1/*
2 * Renesas R-Car SSIU/SSI support
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 *
7 * Based on fsi.c
8 * Kuninori Morimoto <morimoto.kuninori@renesas.com>

--- 843 unchanged lines hidden (view full) ---

852
853int __rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod)
854{
855 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
856
857 return !!(rsnd_ssi_mode_flags(ssi) & RSND_SSI_CLK_PIN_SHARE);
858}
859
1/*
2 * Renesas R-Car SSIU/SSI support
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 *
7 * Based on fsi.c
8 * Kuninori Morimoto <morimoto.kuninori@renesas.com>

--- 843 unchanged lines hidden (view full) ---

852
853int __rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod)
854{
855 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
856
857 return !!(rsnd_ssi_mode_flags(ssi) & RSND_SSI_CLK_PIN_SHARE);
858}
859
860static u32 *rsnd_ssi_get_status(struct rsnd_dai_stream *io,
861 struct rsnd_mod *mod,
862 enum rsnd_mod_type type)
863{
864 /*
865 * SSIP (= SSI parent) needs to be special, otherwise,
866 * 2nd SSI might doesn't start. see also rsnd_mod_call()
867 *
868 * We can't include parent SSI status on SSI, because we don't know
869 * how many SSI requests parent SSI. Thus, it is localed on "io" now.
870 * ex) trouble case
871 * Playback: SSI0
872 * Capture : SSI1 (needs SSI0)
873 *
874 * 1) start Capture -> SSI0/SSI1 are started.
875 * 2) start Playback -> SSI0 doesn't work, because it is already
876 * marked as "started" on 1)
877 *
878 * OTOH, using each mod's status is good for MUX case.
879 * It doesn't need to start in 2nd start
880 * ex)
881 * IO-0: SRC0 -> CTU1 -+-> MUX -> DVC -> SSIU -> SSI0
882 * |
883 * IO-1: SRC1 -> CTU2 -+
884 *
885 * 1) start IO-0 -> start SSI0
886 * 2) start IO-1 -> SSI0 doesn't need to start, because it is
887 * already started on 1)
888 */
889 if (type == RSND_MOD_SSIP)
890 return &io->parent_ssi_status;
891
892 return rsnd_mod_get_status(io, mod, type);
893}
894
860int rsnd_ssi_probe(struct rsnd_priv *priv)
861{
862 struct device_node *node;
863 struct device_node *np;
864 struct device *dev = rsnd_priv_to_dev(priv);
865 struct rsnd_mod_ops *ops;
866 struct clk *clk;
867 struct rsnd_ssi *ssi;

--- 46 unchanged lines hidden (view full) ---

914
915 ops = &rsnd_ssi_non_ops;
916 if (of_get_property(np, "pio-transfer", NULL))
917 ops = &rsnd_ssi_pio_ops;
918 else
919 ops = &rsnd_ssi_dma_ops;
920
921 ret = rsnd_mod_init(priv, rsnd_mod_get(ssi), ops, clk,
895int rsnd_ssi_probe(struct rsnd_priv *priv)
896{
897 struct device_node *node;
898 struct device_node *np;
899 struct device *dev = rsnd_priv_to_dev(priv);
900 struct rsnd_mod_ops *ops;
901 struct clk *clk;
902 struct rsnd_ssi *ssi;

--- 46 unchanged lines hidden (view full) ---

949
950 ops = &rsnd_ssi_non_ops;
951 if (of_get_property(np, "pio-transfer", NULL))
952 ops = &rsnd_ssi_pio_ops;
953 else
954 ops = &rsnd_ssi_dma_ops;
955
956 ret = rsnd_mod_init(priv, rsnd_mod_get(ssi), ops, clk,
922 RSND_MOD_SSI, i);
957 rsnd_ssi_get_status, RSND_MOD_SSI, i);
923 if (ret)
924 goto rsnd_ssi_probe_done;
925
926 i++;
927 }
928
929 ret = 0;
930

--- 15 unchanged lines hidden ---
958 if (ret)
959 goto rsnd_ssi_probe_done;
960
961 i++;
962 }
963
964 ret = 0;
965

--- 15 unchanged lines hidden ---