Lines Matching refs:hda

258 	struct sti_hda *hda;  member
264 static u32 hda_read(struct sti_hda *hda, int offset) in hda_read() argument
266 return readl(hda->regs + offset); in hda_read()
269 static void hda_write(struct sti_hda *hda, u32 val, int offset) in hda_write() argument
271 writel(val, hda->regs + offset); in hda_write()
300 static void hda_enable_hd_dacs(struct sti_hda *hda, bool enable) in hda_enable_hd_dacs() argument
302 if (hda->video_dacs_ctrl) { in hda_enable_hd_dacs()
305 val = readl(hda->video_dacs_ctrl); in hda_enable_hd_dacs()
311 writel(val, hda->video_dacs_ctrl); in hda_enable_hd_dacs()
316 readl(hda->regs + reg))
348 struct sti_hda *hda = (struct sti_hda *)node->info_ent->data; in hda_dbg_show() local
350 seq_printf(s, "HD Analog: (vaddr = 0x%p)", hda->regs); in hda_dbg_show()
352 hda_dbg_cfg(s, readl(hda->regs + HDA_ANA_CFG)); in hda_dbg_show()
359 hda_dbg_awg_microcode(s, hda->regs + HDA_SYNC_AWGI); in hda_dbg_show()
360 if (hda->video_dacs_ctrl) in hda_dbg_show()
361 hda_dbg_video_dacs_ctrl(s, hda->video_dacs_ctrl); in hda_dbg_show()
370 static void hda_debugfs_init(struct sti_hda *hda, struct drm_minor *minor) in hda_debugfs_init() argument
375 hda_debugfs_files[i].data = hda; in hda_debugfs_init()
389 static void sti_hda_configure_awg(struct sti_hda *hda, u32 *awg_instr, int nb) in sti_hda_configure_awg() argument
396 hda_write(hda, awg_instr[i], HDA_SYNC_AWGI + i * 4); in sti_hda_configure_awg()
398 hda_write(hda, 0, HDA_SYNC_AWGI + i * 4); in sti_hda_configure_awg()
403 struct sti_hda *hda = bridge->driver_private; in sti_hda_disable() local
406 if (!hda->enabled) in sti_hda_disable()
412 val = hda_read(hda, HDA_ANA_CFG); in sti_hda_disable()
414 hda_write(hda, val, HDA_ANA_CFG); in sti_hda_disable()
415 hda_write(hda, 0, HDA_ANA_ANC_CTRL); in sti_hda_disable()
417 hda_enable_hd_dacs(hda, false); in sti_hda_disable()
420 clk_disable_unprepare(hda->clk_hddac); in sti_hda_disable()
421 clk_disable_unprepare(hda->clk_pix); in sti_hda_disable()
423 hda->enabled = false; in sti_hda_disable()
428 struct sti_hda *hda = bridge->driver_private; in sti_hda_pre_enable() local
436 if (hda->enabled) in sti_hda_pre_enable()
440 if (clk_prepare_enable(hda->clk_pix)) in sti_hda_pre_enable()
442 if (clk_prepare_enable(hda->clk_hddac)) in sti_hda_pre_enable()
445 if (!hda_get_mode_idx(hda->mode, &mode_idx)) { in sti_hda_pre_enable()
480 hda_enable_hd_dacs(hda, true); in sti_hda_pre_enable()
483 hda_write(hda, SCALE_CTRL_Y_DFLT, HDA_ANA_SCALE_CTRL_Y); in sti_hda_pre_enable()
484 hda_write(hda, SCALE_CTRL_CB_DFLT, HDA_ANA_SCALE_CTRL_CB); in sti_hda_pre_enable()
485 hda_write(hda, SCALE_CTRL_CR_DFLT, HDA_ANA_SCALE_CTRL_CR); in sti_hda_pre_enable()
488 hda_write(hda , src_filter_y, HDA_ANA_SRC_Y_CFG); in sti_hda_pre_enable()
489 hda_write(hda, src_filter_c, HDA_ANA_SRC_C_CFG); in sti_hda_pre_enable()
491 hda_write(hda, coef_y[i], HDA_COEFF_Y_PH1_TAP123 + i * 4); in sti_hda_pre_enable()
492 hda_write(hda, coef_c[i], HDA_COEFF_C_PH1_TAP123 + i * 4); in sti_hda_pre_enable()
497 val |= (hda->mode.flags & DRM_MODE_FLAG_INTERLACE) ? in sti_hda_pre_enable()
501 hda_write(hda, val, HDA_ANA_CFG); in sti_hda_pre_enable()
504 sti_hda_configure_awg(hda, hda_supported_modes[mode_idx].awg_instr, in sti_hda_pre_enable()
508 val = hda_read(hda, HDA_ANA_CFG); in sti_hda_pre_enable()
510 hda_write(hda, val, HDA_ANA_CFG); in sti_hda_pre_enable()
512 hda->enabled = true; in sti_hda_pre_enable()
519 struct sti_hda *hda = bridge->driver_private; in sti_hda_set_mode() local
526 memcpy(&hda->mode, mode, sizeof(struct drm_display_mode)); in sti_hda_set_mode()
528 if (!hda_get_mode_idx(hda->mode, &mode_idx)) { in sti_hda_set_mode()
548 ret = clk_set_rate(hda->clk_hddac, hddac_rate); in sti_hda_set_mode()
554 ret = clk_set_rate(hda->clk_pix, mode->clock * 1000); in sti_hda_set_mode()
579 struct sti_hda *hda = hda_connector->hda; in sti_hda_connector_get_modes() local
585 drm_mode_duplicate(hda->drm_dev, in sti_hda_connector_get_modes()
613 struct sti_hda *hda = hda_connector->hda; in sti_hda_connector_mode_valid() local
618 result = clk_round_rate(hda->clk_pix, target); in sti_hda_connector_mode_valid()
643 struct sti_hda *hda = hda_connector->hda; in sti_hda_late_register() local
645 hda_debugfs_init(hda, hda->drm_dev->primary); in sti_hda_late_register()
673 struct sti_hda *hda = dev_get_drvdata(dev); in sti_hda_bind() local
682 hda->drm_dev = drm_dev; in sti_hda_bind()
692 connector->hda = hda; in sti_hda_bind()
698 bridge->driver_private = hda; in sti_hda_bind()
720 hda_enable_hd_dacs(hda, false); in sti_hda_bind()
741 struct sti_hda *hda; in sti_hda_probe() local
746 hda = devm_kzalloc(dev, sizeof(*hda), GFP_KERNEL); in sti_hda_probe()
747 if (!hda) in sti_hda_probe()
750 hda->dev = pdev->dev; in sti_hda_probe()
758 hda->regs = devm_ioremap(dev, res->start, resource_size(res)); in sti_hda_probe()
759 if (!hda->regs) in sti_hda_probe()
765 hda->video_dacs_ctrl = devm_ioremap(dev, res->start, in sti_hda_probe()
767 if (!hda->video_dacs_ctrl) in sti_hda_probe()
772 hda->video_dacs_ctrl = NULL; in sti_hda_probe()
776 hda->clk_pix = devm_clk_get(dev, "pix"); in sti_hda_probe()
777 if (IS_ERR(hda->clk_pix)) { in sti_hda_probe()
779 return PTR_ERR(hda->clk_pix); in sti_hda_probe()
782 hda->clk_hddac = devm_clk_get(dev, "hddac"); in sti_hda_probe()
783 if (IS_ERR(hda->clk_hddac)) { in sti_hda_probe()
785 return PTR_ERR(hda->clk_hddac); in sti_hda_probe()
788 platform_set_drvdata(pdev, hda); in sti_hda_probe()