]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
ASoC: tegra-alt: mixer register dump for debug
authorMohan Kumar <mkumard@nvidia.com>
Wed, 19 Jul 2017 04:18:31 +0000 (09:48 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Fri, 28 Jul 2017 10:01:26 +0000 (03:01 -0700)
Support to dump mixer register values with the help
of mixer controls for debugging purpose.

Bug 200329344

Change-Id: I9c0b418f53556e727428ae3a3b0be222a3e85c5f
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1522830
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
sound/soc/tegra-alt/tegra210_admaif_alt.c
sound/soc/tegra-alt/tegra210_admaif_alt.h
sound/soc/tegra-alt/tegra210_mixer_alt.c
sound/soc/tegra-alt/tegra210_mixer_alt.h

index ea76cfa107a476cb7ab481bb48f98f0e86e4f8ca..cc2832b81b5312ce922b4a763249e2cd7b95b5e6 100644 (file)
@@ -642,6 +642,7 @@ static int tegra210_ape_dump_reg_put(struct snd_kcontrol *kcontrol,
        if (admaif->reg_dump_flag) {
                tegra_adma_dump_ch_reg();
                tegra_admaif_reg_dump(admaif);
+               tegra_mixer_reg_dump();
        }
 
        return 0;
index 80b340b5e5c7ea6f500ed26baa8eeabf3e57e583..fcded2b7aeffb02d2525854cdb73c96931d216d7 100644 (file)
@@ -167,5 +167,6 @@ struct tegra210_admaif {
 };
 
 extern void tegra_adma_dump_ch_reg(void);
+extern void tegra_mixer_reg_dump(void);
 
 #endif
index b265273c41e85d7838c3aaa502da570d157470c0..a1bb582304fa093341e18fc0daae25315cbafcc6 100644 (file)
@@ -115,6 +115,55 @@ static int tegra210_mixer_resume(struct device *dev)
 }
 #endif
 
+static struct tegra210_mixer *mixer_dev;
+void tegra_mixer_reg_dump(void)
+{
+       int i;
+
+       pr_info("MIXER Reg Dump\n");
+       pm_runtime_get_sync(mixer_dev->dev);
+
+       for(i = 0; i < TEGRA210_MIXER_AXBAR_RX_MAX; i++) {
+               pr_info("RX%d Status %x\n", i,
+                       readl(mixer_dev->base_addr +
+                               i*TEGRA210_MIXER_AXBAR_RX_STRIDE +
+                               TEGRA210_MIXER_AXBAR_RX1_STATUS));
+               pr_info("RX%d Cif ctrl %x\n", i,
+                       readl(mixer_dev->base_addr +
+                               i*TEGRA210_MIXER_AXBAR_RX_STRIDE +
+                               TEGRA210_MIXER_AXBAR_RX1_CIF_CTRL));
+               pr_info("RX%d CTRL %x\n", i,
+                       readl(mixer_dev->base_addr +
+                               i*TEGRA210_MIXER_AXBAR_RX_STRIDE +
+                               TEGRA210_MIXER_AXBAR_RX1_CTRL));
+               pr_info("RX%d DBG0 %x\n", i,
+                       readl(mixer_dev->base_addr +
+                               i*TEGRA210_MIXER_AXBAR_RX_STRIDE +
+                               TEGRA210_MIXER_AXBAR_RX1_DBG0));
+       }
+
+       for(i = 0; i < TEGRA210_MIXER_AXBAR_TX_MAX; i++) {
+               pr_info("TX%d Enable %x\n", i,
+                       readl(mixer_dev->base_addr +
+                               i*TEGRA210_MIXER_AXBAR_TX_STRIDE +
+                               TEGRA210_MIXER_AXBAR_TX1_ENABLE));
+               pr_info("TX%d Status %x\n", i,
+                       readl(mixer_dev->base_addr +
+                               i*TEGRA210_MIXER_AXBAR_TX_STRIDE +
+                               TEGRA210_MIXER_AXBAR_TX1_STATUS));
+               pr_info("TX%d Adder config %x\n", i,
+                       readl(mixer_dev->base_addr +
+                               i*TEGRA210_MIXER_AXBAR_TX_STRIDE +
+                               TEGRA210_MIXER_AXBAR_TX1_ADDER_CONFIG));
+               pr_info("TX%d DBG0 %x\n", i,
+                       readl(mixer_dev->base_addr +
+                               i*TEGRA210_MIXER_AXBAR_TX_STRIDE +
+                               TEGRA210_MIXER_AXBAR_TX1_DBG0));
+       }
+       pm_runtime_put_sync(mixer_dev->dev);
+}
+EXPORT_SYMBOL_GPL(tegra_mixer_reg_dump);
+
 static int tegra210_mixer_write_ram(struct tegra210_mixer *mixer,
                                unsigned int addr,
                                unsigned int val)
@@ -721,6 +770,8 @@ static int tegra210_mixer_platform_probe(struct platform_device *pdev)
                goto err;
        }
 
+       mixer_dev = mixer;
+       mixer->dev = &pdev->dev;
        mixer->soc_data = soc_data;
        mixer->is_shutdown = false;
        mixer->gain_coeff[0] = 0;
@@ -763,6 +814,7 @@ static int tegra210_mixer_platform_probe(struct platform_device *pdev)
                goto err;
        }
 
+       mixer->base_addr = regs;
        mixer->regmap = devm_regmap_init_mmio(&pdev->dev, regs,
                                            &tegra210_mixer_regmap_config);
        if (IS_ERR(mixer->regmap)) {
index d4c80d39646c5651732b2b6f0946c9f6ff9a8ddb..19ebcbe2b9ac1f461bbfbe80a9cbca7a51b4b4ca 100644 (file)
@@ -133,6 +133,9 @@ struct tegra210_mixer {
        const struct tegra210_mixer_soc_data *soc_data;
        unsigned int channels_via_control[TEGRA210_MIXER_TOTAL_PATH];
        bool is_shutdown;
+       struct device   *dev;
+       void __iomem *base_addr;
 };
+void tegra_mixer_reg_dump(void);
 
 #endif