Commit d188e140 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: rsnd: add RSND_GEN3 for R-Car Gen3

rsnd driver is supporting Gen3. The difference between Gen1 and Gen2
were very big, but, between Gen2 and Gen3 are not so much.
Thus, it is assuming Gen2 and Gen3 have compatible, therefore,
there is no RSND_GEN3 and rsnd_is_gen3() macro.
But in the future, it will need Gen2 and Gen3 different operation,
and for Gen4.
This patch adds missing RSND_GEN3 and rsnd_is_gen3() macro.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: default avatarNguyen Viet Dung <dung.nguyen.aj@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent e3225939
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
static const struct of_device_id rsnd_of_match[] = { static const struct of_device_id rsnd_of_match[] = {
{ .compatible = "renesas,rcar_sound-gen1", .data = (void *)RSND_GEN1 }, { .compatible = "renesas,rcar_sound-gen1", .data = (void *)RSND_GEN1 },
{ .compatible = "renesas,rcar_sound-gen2", .data = (void *)RSND_GEN2 }, { .compatible = "renesas,rcar_sound-gen2", .data = (void *)RSND_GEN2 },
{ .compatible = "renesas,rcar_sound-gen3", .data = (void *)RSND_GEN2 }, /* gen2 compatible */ { .compatible = "renesas,rcar_sound-gen3", .data = (void *)RSND_GEN3 },
{}, {},
}; };
MODULE_DEVICE_TABLE(of, rsnd_of_match); MODULE_DEVICE_TABLE(of, rsnd_of_match);
......
...@@ -695,7 +695,7 @@ static int rsnd_dma_alloc(struct rsnd_dai_stream *io, struct rsnd_mod *mod, ...@@ -695,7 +695,7 @@ static int rsnd_dma_alloc(struct rsnd_dai_stream *io, struct rsnd_mod *mod,
rsnd_dma_of_path(mod, io, is_play, &mod_from, &mod_to); rsnd_dma_of_path(mod, io, is_play, &mod_from, &mod_to);
/* for Gen2 */ /* for Gen2 or later */
if (mod_from && mod_to) { if (mod_from && mod_to) {
ops = &rsnd_dmapp_ops; ops = &rsnd_dmapp_ops;
attach = rsnd_dmapp_attach; attach = rsnd_dmapp_attach;
...@@ -773,7 +773,7 @@ int rsnd_dma_probe(struct rsnd_priv *priv) ...@@ -773,7 +773,7 @@ int rsnd_dma_probe(struct rsnd_priv *priv)
return 0; return 0;
/* /*
* for Gen2 * for Gen2 or later
*/ */
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "audmapp"); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "audmapp");
dmac = devm_kzalloc(dev, sizeof(*dmac), GFP_KERNEL); dmac = devm_kzalloc(dev, sizeof(*dmac), GFP_KERNEL);
......
...@@ -414,7 +414,8 @@ int rsnd_gen_probe(struct rsnd_priv *priv) ...@@ -414,7 +414,8 @@ int rsnd_gen_probe(struct rsnd_priv *priv)
ret = -ENODEV; ret = -ENODEV;
if (rsnd_is_gen1(priv)) if (rsnd_is_gen1(priv))
ret = rsnd_gen1_probe(priv); ret = rsnd_gen1_probe(priv);
else if (rsnd_is_gen2(priv)) else if (rsnd_is_gen2(priv) ||
rsnd_is_gen3(priv))
ret = rsnd_gen2_probe(priv); ret = rsnd_gen2_probe(priv);
if (ret < 0) if (ret < 0)
......
...@@ -538,6 +538,7 @@ struct rsnd_priv { ...@@ -538,6 +538,7 @@ struct rsnd_priv {
#define RSND_GEN_MASK (0xF << 0) #define RSND_GEN_MASK (0xF << 0)
#define RSND_GEN1 (1 << 0) #define RSND_GEN1 (1 << 0)
#define RSND_GEN2 (2 << 0) #define RSND_GEN2 (2 << 0)
#define RSND_GEN3 (3 << 0)
/* /*
* below value will be filled on rsnd_gen_probe() * below value will be filled on rsnd_gen_probe()
...@@ -609,6 +610,7 @@ struct rsnd_priv { ...@@ -609,6 +610,7 @@ struct rsnd_priv {
#define rsnd_is_gen1(priv) (((priv)->flags & RSND_GEN_MASK) == RSND_GEN1) #define rsnd_is_gen1(priv) (((priv)->flags & RSND_GEN_MASK) == RSND_GEN1)
#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_flags_has(p, f) ((p)->flags & (f)) #define rsnd_flags_has(p, f) ((p)->flags & (f))
#define rsnd_flags_set(p, f) ((p)->flags |= (f)) #define rsnd_flags_set(p, f) ((p)->flags |= (f))
......
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