diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2023-02-01 02:02:22 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-02-01 11:43:57 +0000 |
commit | c2bc65274a307e11743d0f56a762f8e57f279b9e (patch) | |
tree | 0db8a35cb7fba1274327fbdb3f2ad46b5eec6b87 /sound/soc/sh/rcar/gen.c | |
parent | f76fec606d07b43d21475a0dda6294613379e224 (diff) | |
download | linux-stable-c2bc65274a307e11743d0f56a762f8e57f279b9e.tar.gz linux-stable-c2bc65274a307e11743d0f56a762f8e57f279b9e.tar.bz2 linux-stable-c2bc65274a307e11743d0f56a762f8e57f279b9e.zip |
ASoC: rsnd: add R-Car Gen4 Sound support
This patch is tested on V4H White Hawk + ARD-AUDIO-DA7212
Signed-off-by: Linh Phung <linh.phung.jy@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o7qe5ej5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sh/rcar/gen.c')
-rw-r--r-- | sound/soc/sh/rcar/gen.c | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c index 925565baaa41..86bdecc24956 100644 --- a/sound/soc/sh/rcar/gen.c +++ b/sound/soc/sh/rcar/gen.c @@ -216,6 +216,74 @@ static int _rsnd_gen_regmap_init(struct rsnd_priv *priv, } /* + * Gen4 + */ +static int rsnd_gen4_probe(struct rsnd_priv *priv) +{ + static const struct rsnd_regmap_field_conf conf_ssiu[] = { + RSND_GEN_S_REG(SSI_SYS_INT_ENABLE0, 0x850), + RSND_GEN_S_REG(SSI_SYS_INT_ENABLE2, 0x858), + RSND_GEN_S_REG(SSI_SYS_INT_ENABLE4, 0x890), + RSND_GEN_S_REG(SSI_SYS_INT_ENABLE6, 0x898), + RSND_GEN_S_REG(SSI_SYS_STATUS0, 0x840), + RSND_GEN_S_REG(SSI_SYS_STATUS2, 0x848), + RSND_GEN_S_REG(SSI_SYS_STATUS4, 0x880), + RSND_GEN_S_REG(SSI_SYS_STATUS6, 0x888), + + RSND_GEN_S_REG(SSI_BUSIF0_MODE, 0x0), + RSND_GEN_S_REG(SSI_BUSIF0_ADINR, 0x4), + RSND_GEN_S_REG(SSI_BUSIF0_DALIGN, 0x8), + RSND_GEN_S_REG(SSI_BUSIF1_MODE, 0x20), + RSND_GEN_S_REG(SSI_BUSIF1_ADINR, 0x24), + RSND_GEN_S_REG(SSI_BUSIF1_DALIGN, 0x28), + RSND_GEN_S_REG(SSI_BUSIF2_MODE, 0x40), + RSND_GEN_S_REG(SSI_BUSIF2_ADINR, 0x44), + RSND_GEN_S_REG(SSI_BUSIF2_DALIGN, 0x48), + RSND_GEN_S_REG(SSI_BUSIF3_MODE, 0x60), + RSND_GEN_S_REG(SSI_BUSIF3_ADINR, 0x64), + RSND_GEN_S_REG(SSI_BUSIF3_DALIGN, 0x68), + RSND_GEN_S_REG(SSI_BUSIF4_MODE, 0x500), + RSND_GEN_S_REG(SSI_BUSIF4_ADINR, 0x504), + RSND_GEN_S_REG(SSI_BUSIF4_DALIGN, 0x508), + RSND_GEN_S_REG(SSI_BUSIF5_MODE, 0x520), + RSND_GEN_S_REG(SSI_BUSIF5_ADINR, 0x524), + RSND_GEN_S_REG(SSI_BUSIF5_DALIGN, 0x528), + RSND_GEN_S_REG(SSI_BUSIF6_MODE, 0x540), + RSND_GEN_S_REG(SSI_BUSIF6_ADINR, 0x544), + RSND_GEN_S_REG(SSI_BUSIF6_DALIGN, 0x548), + RSND_GEN_S_REG(SSI_BUSIF7_MODE, 0x560), + RSND_GEN_S_REG(SSI_BUSIF7_ADINR, 0x564), + RSND_GEN_S_REG(SSI_BUSIF7_DALIGN, 0x568), + RSND_GEN_S_REG(SSI_CTRL, 0x010), + RSND_GEN_S_REG(SSI_INT_ENABLE, 0x018), + RSND_GEN_S_REG(SSI_MODE, 0x00c), + RSND_GEN_S_REG(SSI_MODE2, 0xa0c), + }; + static const struct rsnd_regmap_field_conf conf_adg[] = { + RSND_GEN_S_REG(BRRA, 0x00), + RSND_GEN_S_REG(BRRB, 0x04), + RSND_GEN_S_REG(BRGCKR, 0x08), + RSND_GEN_S_REG(AUDIO_CLK_SEL0, 0x0c), + }; + static const struct rsnd_regmap_field_conf conf_ssi[] = { + RSND_GEN_S_REG(SSICR, 0x00), + RSND_GEN_S_REG(SSISR, 0x04), + RSND_GEN_S_REG(SSITDR, 0x08), + RSND_GEN_S_REG(SSIRDR, 0x0c), + RSND_GEN_S_REG(SSIWSR, 0x20), + }; + static const struct rsnd_regmap_field_conf conf_sdmc[] = { + RSND_GEN_M_REG(SSI_BUSIF, 0x0, 0x8000), + }; + int ret_adg = rsnd_gen_regmap_init(priv, 10, RSND_GEN4_ADG, "adg", conf_adg); + int ret_ssiu = rsnd_gen_regmap_init(priv, 10, RSND_GEN4_SSIU, "ssiu", conf_ssiu); + int ret_ssi = rsnd_gen_regmap_init(priv, 10, RSND_GEN4_SSI, "ssi", conf_ssi); + int ret_sdmc = rsnd_gen_regmap_init(priv, 10, RSND_GEN4_SDMC, "sdmc", conf_sdmc); + + return ret_adg | ret_ssiu | ret_ssi | ret_sdmc; +} + +/* * Gen2 */ static int rsnd_gen2_probe(struct rsnd_priv *priv) @@ -484,6 +552,8 @@ int rsnd_gen_probe(struct rsnd_priv *priv) else if (rsnd_is_gen2(priv) || rsnd_is_gen3(priv)) ret = rsnd_gen2_probe(priv); + else if (rsnd_is_gen4(priv)) + ret = rsnd_gen4_probe(priv); if (ret < 0) dev_err(dev, "unknown generation R-Car sound device\n"); |