Commit 953db8de authored by Mark Brown's avatar Mark Brown

ASoC: rsnd: reg cleanup

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

These are Renesas Sound driver cleanups for Gen3/Gen4.
parents ff9496da 07f6232f
...@@ -119,7 +119,7 @@ static void rsnd_cmd_debug_info(struct seq_file *m, ...@@ -119,7 +119,7 @@ static void rsnd_cmd_debug_info(struct seq_file *m,
struct rsnd_dai_stream *io, struct rsnd_dai_stream *io,
struct rsnd_mod *mod) struct rsnd_mod *mod)
{ {
rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SCU, rsnd_debugfs_mod_reg_show(m, mod, RSND_BASE_SCU,
0x180 + rsnd_mod_id_raw(mod) * 0x20, 0x30); 0x180 + rsnd_mod_id_raw(mod) * 0x20, 0x30);
} }
#define DEBUG_INFO .debug_info = rsnd_cmd_debug_info #define DEBUG_INFO .debug_info = rsnd_cmd_debug_info
...@@ -157,10 +157,6 @@ int rsnd_cmd_probe(struct rsnd_priv *priv) ...@@ -157,10 +157,6 @@ int rsnd_cmd_probe(struct rsnd_priv *priv)
struct rsnd_cmd *cmd; struct rsnd_cmd *cmd;
int i, nr; int i, nr;
/* This driver doesn't support Gen1 at this point */
if (rsnd_is_gen1(priv))
return 0;
/* same number as DVC */ /* same number as DVC */
nr = priv->dvc_nr; nr = priv->dvc_nr;
if (!nr) if (!nr)
......
...@@ -1512,7 +1512,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv) ...@@ -1512,7 +1512,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv)
continue; continue;
for_each_endpoint_of_node(ports, dai_np) { for_each_endpoint_of_node(ports, dai_np) {
__rsnd_dai_probe(priv, dai_np, dai_np, 0, dai_i); __rsnd_dai_probe(priv, dai_np, dai_np, 0, dai_i);
if (rsnd_is_gen3(priv) || rsnd_is_gen4(priv)) { if (!rsnd_is_gen1(priv) && !rsnd_is_gen2(priv)) {
rdai = rsnd_rdai_get(priv, dai_i); rdai = rsnd_rdai_get(priv, dai_i);
rsnd_parse_connect_graph(priv, &rdai->playback, dai_np); rsnd_parse_connect_graph(priv, &rdai->playback, dai_np);
...@@ -1531,7 +1531,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv) ...@@ -1531,7 +1531,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv)
for_each_child_of_node(node, dai_np) { for_each_child_of_node(node, dai_np) {
__rsnd_dai_probe(priv, dai_np, np, dai_i, dai_i); __rsnd_dai_probe(priv, dai_np, np, dai_i, dai_i);
if (rsnd_is_gen3(priv) || rsnd_is_gen4(priv)) { if (!rsnd_is_gen1(priv) && !rsnd_is_gen2(priv)) {
rdai = rsnd_rdai_get(priv, dai_i); rdai = rsnd_rdai_get(priv, dai_i);
rsnd_parse_connect_simple(priv, &rdai->playback, dai_np); rsnd_parse_connect_simple(priv, &rdai->playback, dai_np);
......
...@@ -284,7 +284,7 @@ static void rsnd_ctu_debug_info(struct seq_file *m, ...@@ -284,7 +284,7 @@ static void rsnd_ctu_debug_info(struct seq_file *m,
struct rsnd_dai_stream *io, struct rsnd_dai_stream *io,
struct rsnd_mod *mod) struct rsnd_mod *mod)
{ {
rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SCU, rsnd_debugfs_mod_reg_show(m, mod, RSND_BASE_SCU,
0x500 + rsnd_mod_id_raw(mod) * 0x100, 0x100); 0x500 + rsnd_mod_id_raw(mod) * 0x100, 0x100);
} }
#define DEBUG_INFO .debug_info = rsnd_ctu_debug_info #define DEBUG_INFO .debug_info = rsnd_ctu_debug_info
...@@ -323,10 +323,6 @@ int rsnd_ctu_probe(struct rsnd_priv *priv) ...@@ -323,10 +323,6 @@ int rsnd_ctu_probe(struct rsnd_priv *priv)
char name[CTU_NAME_SIZE]; char name[CTU_NAME_SIZE];
int i, nr, ret; int i, nr, ret;
/* This driver doesn't support Gen1 at this point */
if (rsnd_is_gen1(priv))
return 0;
node = rsnd_ctu_of_node(priv); node = rsnd_ctu_of_node(priv);
if (!node) if (!node)
return 0; /* not used is not error */ return 0; /* not used is not error */
......
...@@ -585,8 +585,8 @@ rsnd_gen2_dma_addr(struct rsnd_dai_stream *io, ...@@ -585,8 +585,8 @@ rsnd_gen2_dma_addr(struct rsnd_dai_stream *io,
{ {
struct rsnd_priv *priv = rsnd_io_to_priv(io); struct rsnd_priv *priv = rsnd_io_to_priv(io);
struct device *dev = rsnd_priv_to_dev(priv); struct device *dev = rsnd_priv_to_dev(priv);
phys_addr_t ssi_reg = rsnd_gen_get_phy_addr(priv, RSND_GEN2_SSI); phys_addr_t ssi_reg = rsnd_gen_get_phy_addr(priv, RSND_BASE_SSI);
phys_addr_t src_reg = rsnd_gen_get_phy_addr(priv, RSND_GEN2_SCU); phys_addr_t src_reg = rsnd_gen_get_phy_addr(priv, RSND_BASE_SCU);
int is_ssi = !!(rsnd_io_to_mod_ssi(io) == mod) || int is_ssi = !!(rsnd_io_to_mod_ssi(io) == mod) ||
!!(rsnd_io_to_mod_ssiu(io) == mod); !!(rsnd_io_to_mod_ssiu(io) == mod);
int use_src = !!rsnd_io_to_mod_src(io); int use_src = !!rsnd_io_to_mod_src(io);
...@@ -666,7 +666,7 @@ rsnd_gen4_dma_addr(struct rsnd_dai_stream *io, struct rsnd_mod *mod, ...@@ -666,7 +666,7 @@ rsnd_gen4_dma_addr(struct rsnd_dai_stream *io, struct rsnd_mod *mod,
int is_play, int is_from) int is_play, int is_from)
{ {
struct rsnd_priv *priv = rsnd_io_to_priv(io); struct rsnd_priv *priv = rsnd_io_to_priv(io);
phys_addr_t addr = rsnd_gen_get_phy_addr(priv, RSND_GEN4_SDMC); phys_addr_t addr = rsnd_gen_get_phy_addr(priv, RSND_BASE_SDMC);
int id = rsnd_mod_id(mod); int id = rsnd_mod_id(mod);
int busif = rsnd_mod_id_sub(mod); int busif = rsnd_mod_id_sub(mod);
......
...@@ -294,7 +294,7 @@ static void rsnd_dvc_debug_info(struct seq_file *m, ...@@ -294,7 +294,7 @@ static void rsnd_dvc_debug_info(struct seq_file *m,
struct rsnd_dai_stream *io, struct rsnd_dai_stream *io,
struct rsnd_mod *mod) struct rsnd_mod *mod)
{ {
rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SCU, rsnd_debugfs_mod_reg_show(m, mod, RSND_BASE_SCU,
0xe00 + rsnd_mod_id(mod) * 0x100, 0x60); 0xe00 + rsnd_mod_id(mod) * 0x100, 0x60);
} }
#define DEBUG_INFO .debug_info = rsnd_dvc_debug_info #define DEBUG_INFO .debug_info = rsnd_dvc_debug_info
...@@ -331,10 +331,6 @@ int rsnd_dvc_probe(struct rsnd_priv *priv) ...@@ -331,10 +331,6 @@ int rsnd_dvc_probe(struct rsnd_priv *priv)
char name[RSND_DVC_NAME_SIZE]; char name[RSND_DVC_NAME_SIZE];
int i, nr, ret; int i, nr, ret;
/* This driver doesn't support Gen1 at this point */
if (rsnd_is_gen1(priv))
return 0;
node = rsnd_dvc_of_node(priv); node = rsnd_dvc_of_node(priv);
if (!node) if (!node)
return 0; /* not used is not error */ return 0; /* not used is not error */
......
This diff is collapsed.
...@@ -259,7 +259,7 @@ static void rsnd_mix_debug_info(struct seq_file *m, ...@@ -259,7 +259,7 @@ static void rsnd_mix_debug_info(struct seq_file *m,
struct rsnd_dai_stream *io, struct rsnd_dai_stream *io,
struct rsnd_mod *mod) struct rsnd_mod *mod)
{ {
rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SCU, rsnd_debugfs_mod_reg_show(m, mod, RSND_BASE_SCU,
0xd00 + rsnd_mod_id(mod) * 0x40, 0x30); 0xd00 + rsnd_mod_id(mod) * 0x40, 0x30);
} }
#define DEBUG_INFO .debug_info = rsnd_mix_debug_info #define DEBUG_INFO .debug_info = rsnd_mix_debug_info
...@@ -295,10 +295,6 @@ int rsnd_mix_probe(struct rsnd_priv *priv) ...@@ -295,10 +295,6 @@ int rsnd_mix_probe(struct rsnd_priv *priv)
char name[MIX_NAME_SIZE]; char name[MIX_NAME_SIZE];
int i, nr, ret; int i, nr, ret;
/* This driver doesn't support Gen1 at this point */
if (rsnd_is_gen1(priv))
return 0;
node = rsnd_mix_of_node(priv); node = rsnd_mix_of_node(priv);
if (!node) if (!node)
return 0; /* not used is not error */ return 0; /* not used is not error */
......
...@@ -20,20 +20,11 @@ ...@@ -20,20 +20,11 @@
#include <sound/soc.h> #include <sound/soc.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
#define RSND_GEN1_SRU 0 #define RSND_BASE_ADG 0
#define RSND_GEN1_ADG 1 #define RSND_BASE_SSI 1
#define RSND_GEN1_SSI 2 #define RSND_BASE_SSIU 2
#define RSND_BASE_SCU 3 // for Gen2/Gen3
#define RSND_GEN2_SCU 0 #define RSND_BASE_SDMC 3 // for Gen4 reuse
#define RSND_GEN2_ADG 1
#define RSND_GEN2_SSIU 2
#define RSND_GEN2_SSI 3
#define RSND_GEN4_ADG 0
#define RSND_GEN4_SSIU 1
#define RSND_GEN4_SSI 2
#define RSND_GEN4_SDMC 3
#define RSND_BASE_MAX 4 #define RSND_BASE_MAX 4
/* /*
...@@ -200,7 +191,6 @@ enum rsnd_reg { ...@@ -200,7 +191,6 @@ enum rsnd_reg {
SSI_SYS_INT_ENABLE5, SSI_SYS_INT_ENABLE5,
SSI_SYS_INT_ENABLE6, SSI_SYS_INT_ENABLE6,
SSI_SYS_INT_ENABLE7, SSI_SYS_INT_ENABLE7,
SSI_BUSIF,
HDMI0_SEL, HDMI0_SEL,
HDMI1_SEL, HDMI1_SEL,
SSI9_BUSIF0_MODE, SSI9_BUSIF0_MODE,
...@@ -713,7 +703,7 @@ struct rsnd_priv { ...@@ -713,7 +703,7 @@ struct rsnd_priv {
#define rsnd_is_gen2(priv) (((priv)->flags & RSND_GEN_MASK) == RSND_GEN2) #define rsnd_is_gen2(priv) (((priv)->flags & RSND_GEN_MASK) == RSND_GEN2)
#define rsnd_is_gen3(priv) (((priv)->flags & RSND_GEN_MASK) == RSND_GEN3) #define rsnd_is_gen3(priv) (((priv)->flags & RSND_GEN_MASK) == RSND_GEN3)
#define rsnd_is_gen4(priv) (((priv)->flags & RSND_GEN_MASK) == RSND_GEN4) #define rsnd_is_gen4(priv) (((priv)->flags & RSND_GEN_MASK) == RSND_GEN4)
#define rsnd_is_e3(priv) (((priv)->flags & \ #define rsnd_is_gen3_e3(priv) (((priv)->flags & \
(RSND_GEN_MASK | RSND_SOC_MASK)) == \ (RSND_GEN_MASK | RSND_SOC_MASK)) == \
(RSND_GEN3 | RSND_SOC_E)) (RSND_GEN3 | RSND_SOC_E))
......
...@@ -310,7 +310,7 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io, ...@@ -310,7 +310,7 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io,
/* /*
* E3 need to overwrite * E3 need to overwrite
*/ */
if (rsnd_is_e3(priv)) if (rsnd_is_gen3_e3(priv))
switch (rsnd_mod_id(mod)) { switch (rsnd_mod_id(mod)) {
case 0: case 0:
case 4: case 4:
...@@ -606,13 +606,13 @@ static void rsnd_src_debug_info(struct seq_file *m, ...@@ -606,13 +606,13 @@ static void rsnd_src_debug_info(struct seq_file *m,
struct rsnd_dai_stream *io, struct rsnd_dai_stream *io,
struct rsnd_mod *mod) struct rsnd_mod *mod)
{ {
rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SCU, rsnd_debugfs_mod_reg_show(m, mod, RSND_BASE_SCU,
rsnd_mod_id(mod) * 0x20, 0x20); rsnd_mod_id(mod) * 0x20, 0x20);
seq_puts(m, "\n"); seq_puts(m, "\n");
rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SCU, rsnd_debugfs_mod_reg_show(m, mod, RSND_BASE_SCU,
0x1c0, 0x20); 0x1c0, 0x20);
seq_puts(m, "\n"); seq_puts(m, "\n");
rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SCU, rsnd_debugfs_mod_reg_show(m, mod, RSND_BASE_SCU,
0x200 + rsnd_mod_id(mod) * 0x40, 0x40); 0x200 + rsnd_mod_id(mod) * 0x40, 0x40);
} }
#define DEBUG_INFO .debug_info = rsnd_src_debug_info #define DEBUG_INFO .debug_info = rsnd_src_debug_info
...@@ -652,10 +652,6 @@ int rsnd_src_probe(struct rsnd_priv *priv) ...@@ -652,10 +652,6 @@ int rsnd_src_probe(struct rsnd_priv *priv)
char name[RSND_SRC_NAME_SIZE]; char name[RSND_SRC_NAME_SIZE];
int i, nr, ret; int i, nr, ret;
/* This driver doesn't support Gen1 at this point */
if (rsnd_is_gen1(priv))
return 0;
node = rsnd_src_of_node(priv); node = rsnd_src_of_node(priv);
if (!node) if (!node)
return 0; /* not used is not error */ return 0; /* not used is not error */
......
...@@ -1049,7 +1049,7 @@ static void rsnd_ssi_debug_info(struct seq_file *m, ...@@ -1049,7 +1049,7 @@ static void rsnd_ssi_debug_info(struct seq_file *m,
seq_printf(m, "chan: %d\n", ssi->chan); seq_printf(m, "chan: %d\n", ssi->chan);
seq_printf(m, "user: %d\n", ssi->usrcnt); seq_printf(m, "user: %d\n", ssi->usrcnt);
rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SSI, rsnd_debugfs_mod_reg_show(m, mod, RSND_BASE_SSI,
rsnd_mod_id(mod) * 0x40, 0x40); rsnd_mod_id(mod) * 0x40, 0x40);
} }
#define DEBUG_INFO .debug_info = rsnd_ssi_debug_info #define DEBUG_INFO .debug_info = rsnd_ssi_debug_info
......
...@@ -413,7 +413,7 @@ static void rsnd_ssiu_debug_info(struct seq_file *m, ...@@ -413,7 +413,7 @@ static void rsnd_ssiu_debug_info(struct seq_file *m,
struct rsnd_dai_stream *io, struct rsnd_dai_stream *io,
struct rsnd_mod *mod) struct rsnd_mod *mod)
{ {
rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SSIU, rsnd_debugfs_mod_reg_show(m, mod, RSND_BASE_SSIU,
rsnd_mod_id(mod) * 0x80, 0x80); rsnd_mod_id(mod) * 0x80, 0x80);
} }
#define DEBUG_INFO .debug_info = rsnd_ssiu_debug_info #define DEBUG_INFO .debug_info = rsnd_ssiu_debug_info
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment