summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorManjula Gupta <magupta@nvidia.com>2011-05-05 19:34:33 +0530
committerNiket Sirsi <nsirsi@nvidia.com>2011-05-09 17:59:24 -0700
commit52e7d11bc42abb7643191bccf55fc9fc66b640d2 (patch)
treeeccc04fac3baa28be634efecfeca63a37eda5ef7 /arch
parentcae416e076b8c31c422b71b6df82a7921132ee11 (diff)
ARM: tegra: Adds an API to dump spdif registers.
Change-Id: Ic3eb5d136be746b55bea4efe302e0f417dfc1eb6 Reviewed-on: http://git-master/r/30512 Tested-by: Manjula Gupta <magupta@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-by: Scott Peterson <speterson@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/include/mach/spdif.h3
-rw-r--r--arch/arm/mach-tegra/spdif.c32
2 files changed, 32 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/include/mach/spdif.h b/arch/arm/mach-tegra/include/mach/spdif.h
index 2ccfc9f861f6..1fdf7f1f8765 100644
--- a/arch/arm/mach-tegra/include/mach/spdif.h
+++ b/arch/arm/mach-tegra/include/mach/spdif.h
@@ -393,7 +393,7 @@ struct spdif_regs_cache {
int spdif_ctrl_0;
int spdif_status_0;
int spdif_strobe_ctrl_0;
- int spdif_data_fifo_scr_0;
+ int spdif_data_fifo_csr_0;
int spdif_ch_sta_rx_a_0;
int spdif_ch_sta_rx_b_0;
int spdif_ch_sta_rx_c_0;
@@ -429,5 +429,6 @@ u32 spdif_get_fifo_full_empty_count(unsigned long base, int mode);
int spdif_initialize(unsigned long base, int mode);
void spdif_get_all_regs(unsigned long base, struct spdif_regs_cache* regs);
void spdif_set_all_regs(unsigned long base, struct spdif_regs_cache* regs);
+void spdif_dump_registers(unsigned long base, struct spdif_regs_cache* regs);
#endif /* __ARCH_ARM_MACH_TEGRA_SPDIF_H */
diff --git a/arch/arm/mach-tegra/spdif.c b/arch/arm/mach-tegra/spdif.c
index c01829e708de..a8207e3f545d 100644
--- a/arch/arm/mach-tegra/spdif.c
+++ b/arch/arm/mach-tegra/spdif.c
@@ -241,12 +241,40 @@ int spdif_initialize(unsigned long base, int mode)
return 0;
}
+void spdif_dump_registers(unsigned long base, struct spdif_regs_cache* regs)
+{
+ pr_info("%s: Start.\n", __func__);
+
+ spdif_get_all_regs(base, regs);
+ pr_info("CTRL %08x\n", regs->spdif_ctrl_0);
+ pr_info("STATUS %08x\n", regs->spdif_status_0);
+ pr_info("STROBE_CTRL %08x\n", regs->spdif_strobe_ctrl_0);
+ pr_info("FIFO_CSR %08x\n", regs->spdif_data_fifo_csr_0);
+ pr_info("CH_STA_RX_A %08x\n", regs->spdif_ch_sta_rx_a_0);
+ pr_info("CH_STA_RX_B %08x\n", regs->spdif_ch_sta_rx_b_0);
+ pr_info("CH_STA_RX_C %08x\n", regs->spdif_ch_sta_rx_c_0);
+ pr_info("CH_STA_RX_D %08x\n", regs->spdif_ch_sta_rx_d_0);
+ pr_info("CH_STA_RX_E %08x\n", regs->spdif_ch_sta_rx_e_0);
+ pr_info("CH_STA_RX_F %08x\n", regs->spdif_ch_sta_rx_f_0);
+ pr_info("CH_STA_TX_A %08x\n", regs->spdif_ch_sta_tx_a_0);
+ pr_info("CH_STA_TX_B %08x\n", regs->spdif_ch_sta_tx_b_0);
+ pr_info("CH_STA_TX_C %08x\n", regs->spdif_ch_sta_tx_c_0);
+ pr_info("CH_STA_TX_D %08x\n", regs->spdif_ch_sta_tx_d_0);
+ pr_info("CH_STA_TX_E %08x\n", regs->spdif_ch_sta_tx_e_0);
+ pr_info("CH_STA_TX_F %08x\n", regs->spdif_ch_sta_tx_f_0);
+ pr_info("USR_STA_RX_A %08x\n", regs->spdif_usr_sta_rx_a_0);
+ pr_info("USR_DAT_TX_A %08x\n", regs->spdif_usr_dat_tx_a_0);
+
+ pr_info("%s: End.\n", __func__);
+
+}
+
void spdif_get_all_regs(unsigned long base, struct spdif_regs_cache* regs)
{
regs->spdif_ctrl_0 = spdif_readl(base, SPDIF_CTRL_0);
regs->spdif_status_0 = spdif_readl(base, SPDIF_STATUS_0);
regs->spdif_strobe_ctrl_0 = spdif_readl(base, SPDIF_STROBE_CTRL_0);
- regs->spdif_data_fifo_scr_0 = spdif_readl(base, SPDIF_DATA_FIFO_CSR_0);
+ regs->spdif_data_fifo_csr_0 = spdif_readl(base, SPDIF_DATA_FIFO_CSR_0);
regs->spdif_ch_sta_rx_a_0 = spdif_readl(base, SPDIF_CH_STA_RX_A_0);
regs->spdif_ch_sta_rx_b_0 = spdif_readl(base, SPDIF_CH_STA_RX_B_0);
regs->spdif_ch_sta_rx_c_0 = spdif_readl(base, SPDIF_CH_STA_RX_C_0);
@@ -268,7 +296,7 @@ void spdif_set_all_regs(unsigned long base, struct spdif_regs_cache* regs)
spdif_writel(base, regs->spdif_ctrl_0, SPDIF_CTRL_0);
spdif_writel(base, regs->spdif_status_0, SPDIF_STATUS_0);
spdif_writel(base, regs->spdif_strobe_ctrl_0, SPDIF_STROBE_CTRL_0);
- spdif_writel(base, regs->spdif_data_fifo_scr_0, SPDIF_DATA_FIFO_CSR_0);
+ spdif_writel(base, regs->spdif_data_fifo_csr_0, SPDIF_DATA_FIFO_CSR_0);
spdif_writel(base, regs->spdif_ch_sta_rx_a_0, SPDIF_CH_STA_RX_A_0);
spdif_writel(base, regs->spdif_ch_sta_rx_b_0, SPDIF_CH_STA_RX_B_0);
spdif_writel(base, regs->spdif_ch_sta_rx_c_0, SPDIF_CH_STA_RX_C_0);