]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - sound/soc/sh/rcar/rsnd.h
Merge remote-tracking branches 'asoc/topic/ad1836', 'asoc/topic/ad193x', 'asoc/topic...
[karo-tx-linux.git] / sound / soc / sh / rcar / rsnd.h
index 5dd87f4c919e50650e61e8084856138d47f6f119..4ca66cd899c87415e263219c400fea5ce4e51df0 100644 (file)
  * see gen1/gen2 for detail
  */
 enum rsnd_reg {
-       /* SRU/SCU */
-       RSND_REG_SRC_ROUTE_SEL,
-       RSND_REG_SRC_TMG_SEL0,
-       RSND_REG_SRC_TMG_SEL1,
-       RSND_REG_SRC_TMG_SEL2,
-       RSND_REG_SRC_CTRL,
+       /* SRU/SCU/SSIU */
+       RSND_REG_SRC_ROUTE_SEL,         /* for Gen1 */
+       RSND_REG_SRC_TMG_SEL0,          /* for Gen1 */
+       RSND_REG_SRC_TMG_SEL1,          /* for Gen1 */
+       RSND_REG_SRC_TMG_SEL2,          /* for Gen1 */
+       RSND_REG_SRC_ROUTE_CTRL,        /* for Gen1 */
        RSND_REG_SSI_MODE0,
        RSND_REG_SSI_MODE1,
        RSND_REG_BUSIF_MODE,
-       RSND_REG_BUSIF_ADINR,
+       RSND_REG_INT_ENABLE,            /* for Gen2 */
+       RSND_REG_SRC_ROUTE_MODE0,
+       RSND_REG_SRC_SWRSR,
+       RSND_REG_SRC_SRCIR,
+       RSND_REG_SRC_ADINR,
+       RSND_REG_SRC_IFSCR,
+       RSND_REG_SRC_IFSVR,
+       RSND_REG_SRC_SRCCR,
+       RSND_REG_SRC_MNFSR,
 
        /* ADG */
        RSND_REG_BRRA,
@@ -49,9 +57,9 @@ enum rsnd_reg {
        RSND_REG_AUDIO_CLK_SEL0,
        RSND_REG_AUDIO_CLK_SEL1,
        RSND_REG_AUDIO_CLK_SEL2,
-       RSND_REG_AUDIO_CLK_SEL3,
-       RSND_REG_AUDIO_CLK_SEL4,
-       RSND_REG_AUDIO_CLK_SEL5,
+       RSND_REG_AUDIO_CLK_SEL3,        /* for Gen1 */
+       RSND_REG_AUDIO_CLK_SEL4,        /* for Gen1 */
+       RSND_REG_AUDIO_CLK_SEL5,        /* for Gen1 */
 
        /* SSI */
        RSND_REG_SSICR,
@@ -78,10 +86,6 @@ struct rsnd_dai_stream;
 #define rsnd_mod_bset(m, r, s, d) \
        rsnd_bset(rsnd_mod_to_priv(m), m, RSND_REG_##r, s, d)
 
-#define rsnd_priv_read(p, r)           rsnd_read(p, NULL, RSND_REG_##r)
-#define rsnd_priv_write(p, r, d)       rsnd_write(p, NULL, RSND_REG_##r, d)
-#define rsnd_priv_bset(p, r, s, d)     rsnd_bset(p, NULL, RSND_REG_##r, s, d)
-
 u32 rsnd_read(struct rsnd_priv *priv, struct rsnd_mod *mod, enum rsnd_reg reg);
 void rsnd_write(struct rsnd_priv *priv, struct rsnd_mod *mod,
                enum rsnd_reg reg, u32 data);
@@ -178,11 +182,11 @@ struct rsnd_dai {
        struct rsnd_dai_stream playback;
        struct rsnd_dai_stream capture;
 
-       int clk_master:1;
-       int bit_clk_inv:1;
-       int frm_clk_inv:1;
-       int sys_delay:1;
-       int data_alignment:1;
+       unsigned int clk_master:1;
+       unsigned int bit_clk_inv:1;
+       unsigned int frm_clk_inv:1;
+       unsigned int sys_delay:1;
+       unsigned int data_alignment:1;
 };
 
 #define rsnd_dai_nr(priv) ((priv)->dai_nr)
@@ -233,6 +237,10 @@ int rsnd_adg_probe(struct platform_device *pdev,
                   struct rsnd_priv *priv);
 void rsnd_adg_remove(struct platform_device *pdev,
                   struct rsnd_priv *priv);
+int rsnd_adg_set_convert_clk(struct rsnd_priv *priv,
+                            struct rsnd_mod *mod,
+                            unsigned int src_rate,
+                            unsigned int dst_rate);
 
 /*
  *     R-Car sound priv
@@ -285,6 +293,11 @@ int rsnd_scu_probe(struct platform_device *pdev,
 void rsnd_scu_remove(struct platform_device *pdev,
                     struct rsnd_priv *priv);
 struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id);
+bool rsnd_scu_hpbif_is_enable(struct rsnd_mod *mod);
+unsigned int rsnd_scu_get_ssi_rate(struct rsnd_priv *priv,
+                                  struct rsnd_mod *ssi_mod,
+                                  struct snd_pcm_runtime *runtime);
+
 #define rsnd_scu_nr(priv) ((priv)->scu_nr)
 
 /*