Loading drivers/gpu/drm/sti/sti_hda.c +104 −1 Original line number Diff line number Diff line Loading @@ -326,6 +326,103 @@ static void hda_enable_hd_dacs(struct sti_hda *hda, bool enable) } } #define DBGFS_DUMP(reg) seq_printf(s, "\n %-25s 0x%08X", #reg, \ readl(hda->regs + reg)) static void hda_dbg_cfg(struct seq_file *s, int val) { seq_puts(s, "\tAWG "); seq_puts(s, val & CFG_AWG_ASYNC_EN ? "enabled" : "disabled"); } static void hda_dbg_awg_microcode(struct seq_file *s, void __iomem *reg) { unsigned int i; seq_puts(s, "\n\n"); seq_puts(s, " HDA AWG microcode:"); for (i = 0; i < AWG_MAX_INST; i++) { if (i % 8 == 0) seq_printf(s, "\n %04X:", i); seq_printf(s, " %04X", readl(reg + i * 4)); } } static void hda_dbg_video_dacs_ctrl(struct seq_file *s, void __iomem *reg) { u32 val = readl(reg); u32 mask; switch ((u32)reg & VIDEO_DACS_CONTROL_MASK) { case VIDEO_DACS_CONTROL_SYSCFG2535: mask = DAC_CFG_HD_OFF_MASK; break; case VIDEO_DACS_CONTROL_SYSCFG5072: mask = DAC_CFG_HD_HZUVW_OFF_MASK; break; default: DRM_DEBUG_DRIVER("Warning: DACS ctrl register not supported!"); return; } seq_puts(s, "\n"); seq_printf(s, "\n %-25s 0x%08X", "VIDEO_DACS_CONTROL", val); seq_puts(s, "\tHD DACs "); seq_puts(s, val & mask ? "disabled" : "enabled"); } static int hda_dbg_show(struct seq_file *s, void *data) { struct drm_info_node *node = s->private; struct sti_hda *hda = (struct sti_hda *)node->info_ent->data; struct drm_device *dev = node->minor->dev; int ret; ret = mutex_lock_interruptible(&dev->struct_mutex); if (ret) return ret; seq_printf(s, "HD Analog: (vaddr = 0x%p)", hda->regs); DBGFS_DUMP(HDA_ANA_CFG); hda_dbg_cfg(s, readl(hda->regs + HDA_ANA_CFG)); DBGFS_DUMP(HDA_ANA_SCALE_CTRL_Y); DBGFS_DUMP(HDA_ANA_SCALE_CTRL_CB); DBGFS_DUMP(HDA_ANA_SCALE_CTRL_CR); DBGFS_DUMP(HDA_ANA_ANC_CTRL); DBGFS_DUMP(HDA_ANA_SRC_Y_CFG); DBGFS_DUMP(HDA_ANA_SRC_C_CFG); hda_dbg_awg_microcode(s, hda->regs + HDA_SYNC_AWGI); if (hda->video_dacs_ctrl) hda_dbg_video_dacs_ctrl(s, hda->video_dacs_ctrl); seq_puts(s, "\n"); mutex_unlock(&dev->struct_mutex); return 0; } static struct drm_info_list hda_debugfs_files[] = { { "hda", hda_dbg_show, 0, NULL }, }; static void hda_debugfs_exit(struct sti_hda *hda, struct drm_minor *minor) { drm_debugfs_remove_files(hda_debugfs_files, ARRAY_SIZE(hda_debugfs_files), minor); } static int hda_debugfs_init(struct sti_hda *hda, struct drm_minor *minor) { unsigned int i; for (i = 0; i < ARRAY_SIZE(hda_debugfs_files); i++) hda_debugfs_files[i].data = hda; return drm_debugfs_create_files(hda_debugfs_files, ARRAY_SIZE(hda_debugfs_files), minor->debugfs_root, minor); } /** * Configure AWG, writing instructions * Loading Loading @@ -688,6 +785,9 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data) /* force to disable hd dacs at startup */ hda_enable_hd_dacs(hda, false); if (hda_debugfs_init(hda, drm_dev->primary)) DRM_ERROR("HDA debugfs setup failed\n"); return 0; err_sysfs: Loading @@ -700,7 +800,10 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data) static void sti_hda_unbind(struct device *dev, struct device *master, void *data) { /* do nothing */ struct sti_hda *hda = dev_get_drvdata(dev); struct drm_device *drm_dev = data; hda_debugfs_exit(hda, drm_dev->primary); } static const struct component_ops sti_hda_ops = { Loading Loading
drivers/gpu/drm/sti/sti_hda.c +104 −1 Original line number Diff line number Diff line Loading @@ -326,6 +326,103 @@ static void hda_enable_hd_dacs(struct sti_hda *hda, bool enable) } } #define DBGFS_DUMP(reg) seq_printf(s, "\n %-25s 0x%08X", #reg, \ readl(hda->regs + reg)) static void hda_dbg_cfg(struct seq_file *s, int val) { seq_puts(s, "\tAWG "); seq_puts(s, val & CFG_AWG_ASYNC_EN ? "enabled" : "disabled"); } static void hda_dbg_awg_microcode(struct seq_file *s, void __iomem *reg) { unsigned int i; seq_puts(s, "\n\n"); seq_puts(s, " HDA AWG microcode:"); for (i = 0; i < AWG_MAX_INST; i++) { if (i % 8 == 0) seq_printf(s, "\n %04X:", i); seq_printf(s, " %04X", readl(reg + i * 4)); } } static void hda_dbg_video_dacs_ctrl(struct seq_file *s, void __iomem *reg) { u32 val = readl(reg); u32 mask; switch ((u32)reg & VIDEO_DACS_CONTROL_MASK) { case VIDEO_DACS_CONTROL_SYSCFG2535: mask = DAC_CFG_HD_OFF_MASK; break; case VIDEO_DACS_CONTROL_SYSCFG5072: mask = DAC_CFG_HD_HZUVW_OFF_MASK; break; default: DRM_DEBUG_DRIVER("Warning: DACS ctrl register not supported!"); return; } seq_puts(s, "\n"); seq_printf(s, "\n %-25s 0x%08X", "VIDEO_DACS_CONTROL", val); seq_puts(s, "\tHD DACs "); seq_puts(s, val & mask ? "disabled" : "enabled"); } static int hda_dbg_show(struct seq_file *s, void *data) { struct drm_info_node *node = s->private; struct sti_hda *hda = (struct sti_hda *)node->info_ent->data; struct drm_device *dev = node->minor->dev; int ret; ret = mutex_lock_interruptible(&dev->struct_mutex); if (ret) return ret; seq_printf(s, "HD Analog: (vaddr = 0x%p)", hda->regs); DBGFS_DUMP(HDA_ANA_CFG); hda_dbg_cfg(s, readl(hda->regs + HDA_ANA_CFG)); DBGFS_DUMP(HDA_ANA_SCALE_CTRL_Y); DBGFS_DUMP(HDA_ANA_SCALE_CTRL_CB); DBGFS_DUMP(HDA_ANA_SCALE_CTRL_CR); DBGFS_DUMP(HDA_ANA_ANC_CTRL); DBGFS_DUMP(HDA_ANA_SRC_Y_CFG); DBGFS_DUMP(HDA_ANA_SRC_C_CFG); hda_dbg_awg_microcode(s, hda->regs + HDA_SYNC_AWGI); if (hda->video_dacs_ctrl) hda_dbg_video_dacs_ctrl(s, hda->video_dacs_ctrl); seq_puts(s, "\n"); mutex_unlock(&dev->struct_mutex); return 0; } static struct drm_info_list hda_debugfs_files[] = { { "hda", hda_dbg_show, 0, NULL }, }; static void hda_debugfs_exit(struct sti_hda *hda, struct drm_minor *minor) { drm_debugfs_remove_files(hda_debugfs_files, ARRAY_SIZE(hda_debugfs_files), minor); } static int hda_debugfs_init(struct sti_hda *hda, struct drm_minor *minor) { unsigned int i; for (i = 0; i < ARRAY_SIZE(hda_debugfs_files); i++) hda_debugfs_files[i].data = hda; return drm_debugfs_create_files(hda_debugfs_files, ARRAY_SIZE(hda_debugfs_files), minor->debugfs_root, minor); } /** * Configure AWG, writing instructions * Loading Loading @@ -688,6 +785,9 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data) /* force to disable hd dacs at startup */ hda_enable_hd_dacs(hda, false); if (hda_debugfs_init(hda, drm_dev->primary)) DRM_ERROR("HDA debugfs setup failed\n"); return 0; err_sysfs: Loading @@ -700,7 +800,10 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data) static void sti_hda_unbind(struct device *dev, struct device *master, void *data) { /* do nothing */ struct sti_hda *hda = dev_get_drvdata(dev); struct drm_device *drm_dev = data; hda_debugfs_exit(hda, drm_dev->primary); } static const struct component_ops sti_hda_ops = { Loading