Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Nguyen Viet Dung <dung.nguyen.aj@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kuninori Morimoto and committed by
Mark Brown
d188e140 e3225939

+7 -4
+1 -1
sound/soc/sh/rcar/core.c
··· 111 111 static const struct of_device_id rsnd_of_match[] = { 112 112 { .compatible = "renesas,rcar_sound-gen1", .data = (void *)RSND_GEN1 }, 113 113 { .compatible = "renesas,rcar_sound-gen2", .data = (void *)RSND_GEN2 }, 114 - { .compatible = "renesas,rcar_sound-gen3", .data = (void *)RSND_GEN2 }, /* gen2 compatible */ 114 + { .compatible = "renesas,rcar_sound-gen3", .data = (void *)RSND_GEN3 }, 115 115 {}, 116 116 }; 117 117 MODULE_DEVICE_TABLE(of, rsnd_of_match);
+2 -2
sound/soc/sh/rcar/dma.c
··· 695 695 696 696 rsnd_dma_of_path(mod, io, is_play, &mod_from, &mod_to); 697 697 698 - /* for Gen2 */ 698 + /* for Gen2 or later */ 699 699 if (mod_from && mod_to) { 700 700 ops = &rsnd_dmapp_ops; 701 701 attach = rsnd_dmapp_attach; ··· 773 773 return 0; 774 774 775 775 /* 776 - * for Gen2 776 + * for Gen2 or later 777 777 */ 778 778 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "audmapp"); 779 779 dmac = devm_kzalloc(dev, sizeof(*dmac), GFP_KERNEL);
+2 -1
sound/soc/sh/rcar/gen.c
··· 414 414 ret = -ENODEV; 415 415 if (rsnd_is_gen1(priv)) 416 416 ret = rsnd_gen1_probe(priv); 417 - else if (rsnd_is_gen2(priv)) 417 + else if (rsnd_is_gen2(priv) || 418 + rsnd_is_gen3(priv)) 418 419 ret = rsnd_gen2_probe(priv); 419 420 420 421 if (ret < 0)
+2
sound/soc/sh/rcar/rsnd.h
··· 538 538 #define RSND_GEN_MASK (0xF << 0) 539 539 #define RSND_GEN1 (1 << 0) 540 540 #define RSND_GEN2 (2 << 0) 541 + #define RSND_GEN3 (3 << 0) 541 542 542 543 /* 543 544 * below value will be filled on rsnd_gen_probe() ··· 610 609 611 610 #define rsnd_is_gen1(priv) (((priv)->flags & RSND_GEN_MASK) == RSND_GEN1) 612 611 #define rsnd_is_gen2(priv) (((priv)->flags & RSND_GEN_MASK) == RSND_GEN2) 612 + #define rsnd_is_gen3(priv) (((priv)->flags & RSND_GEN_MASK) == RSND_GEN3) 613 613 614 614 #define rsnd_flags_has(p, f) ((p)->flags & (f)) 615 615 #define rsnd_flags_set(p, f) ((p)->flags |= (f))