Lines Matching full:frontend

79 static void sun4i_frontend_scaler_init(struct sun4i_frontend *frontend)  in sun4i_frontend_scaler_init()  argument
83 if (frontend->data->has_coef_access_ctrl) in sun4i_frontend_scaler_init()
84 regmap_write_bits(frontend->regs, SUN4I_FRONTEND_FRM_CTRL_REG, in sun4i_frontend_scaler_init()
89 regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_HORZCOEF0_REG(i), in sun4i_frontend_scaler_init()
91 regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_HORZCOEF0_REG(i), in sun4i_frontend_scaler_init()
93 regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_HORZCOEF1_REG(i), in sun4i_frontend_scaler_init()
95 regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_HORZCOEF1_REG(i), in sun4i_frontend_scaler_init()
97 regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_VERTCOEF_REG(i), in sun4i_frontend_scaler_init()
99 regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_VERTCOEF_REG(i), in sun4i_frontend_scaler_init()
103 if (frontend->data->has_coef_rdy) in sun4i_frontend_scaler_init()
104 regmap_write_bits(frontend->regs, in sun4i_frontend_scaler_init()
110 int sun4i_frontend_init(struct sun4i_frontend *frontend) in sun4i_frontend_init() argument
112 return pm_runtime_get_sync(frontend->dev); in sun4i_frontend_init()
116 void sun4i_frontend_exit(struct sun4i_frontend *frontend) in sun4i_frontend_exit() argument
118 pm_runtime_put(frontend->dev); in sun4i_frontend_exit()
156 void sun4i_frontend_update_buffer(struct sun4i_frontend *frontend, in sun4i_frontend_update_buffer() argument
179 regmap_write(frontend->regs, SUN4I_FRONTEND_TB_OFF0_REG, in sun4i_frontend_update_buffer()
186 regmap_write(frontend->regs, SUN4I_FRONTEND_TB_OFF1_REG, in sun4i_frontend_update_buffer()
194 regmap_write(frontend->regs, SUN4I_FRONTEND_TB_OFF2_REG, in sun4i_frontend_update_buffer()
208 DRM_DEBUG_DRIVER("Frontend stride: %d bytes\n", fb->pitches[0]); in sun4i_frontend_update_buffer()
209 regmap_write(frontend->regs, SUN4I_FRONTEND_LINESTRD0_REG, in sun4i_frontend_update_buffer()
213 regmap_write(frontend->regs, SUN4I_FRONTEND_LINESTRD1_REG, in sun4i_frontend_update_buffer()
217 regmap_write(frontend->regs, SUN4I_FRONTEND_LINESTRD2_REG, in sun4i_frontend_update_buffer()
226 regmap_write(frontend->regs, SUN4I_FRONTEND_BUF_ADDR0_REG, dma_addr); in sun4i_frontend_update_buffer()
232 regmap_write(frontend->regs, SUN4I_FRONTEND_BUF_ADDR1_REG, in sun4i_frontend_update_buffer()
240 regmap_write(frontend->regs, SUN4I_FRONTEND_BUF_ADDR2_REG, in sun4i_frontend_update_buffer()
402 int sun4i_frontend_update_formats(struct sun4i_frontend *frontend, in sun4i_frontend_update_formats() argument
446 regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_HORZPHASE_REG, in sun4i_frontend_update_formats()
447 frontend->data->ch_phase[0]); in sun4i_frontend_update_formats()
448 regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_HORZPHASE_REG, in sun4i_frontend_update_formats()
449 frontend->data->ch_phase[ch1_phase_idx]); in sun4i_frontend_update_formats()
450 regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_VERTPHASE0_REG, in sun4i_frontend_update_formats()
451 frontend->data->ch_phase[0]); in sun4i_frontend_update_formats()
452 regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_VERTPHASE0_REG, in sun4i_frontend_update_formats()
453 frontend->data->ch_phase[ch1_phase_idx]); in sun4i_frontend_update_formats()
454 regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_VERTPHASE1_REG, in sun4i_frontend_update_formats()
455 frontend->data->ch_phase[0]); in sun4i_frontend_update_formats()
456 regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_VERTPHASE1_REG, in sun4i_frontend_update_formats()
457 frontend->data->ch_phase[ch1_phase_idx]); in sun4i_frontend_update_formats()
470 regmap_write(frontend->regs, in sun4i_frontend_update_formats()
477 regmap_update_bits(frontend->regs, SUN4I_FRONTEND_BYPASS_REG, in sun4i_frontend_update_formats()
480 regmap_write(frontend->regs, SUN4I_FRONTEND_INPUT_FMT_REG, in sun4i_frontend_update_formats()
488 regmap_write(frontend->regs, SUN4I_FRONTEND_OUTPUT_FMT_REG, in sun4i_frontend_update_formats()
495 void sun4i_frontend_update_coord(struct sun4i_frontend *frontend, in sun4i_frontend_update_coord() argument
504 DRM_DEBUG_DRIVER("Frontend size W: %u H: %u\n", in sun4i_frontend_update_coord()
513 regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_INSIZE_REG, in sun4i_frontend_update_coord()
515 regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_INSIZE_REG, in sun4i_frontend_update_coord()
518 regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_OUTSIZE_REG, in sun4i_frontend_update_coord()
520 regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_OUTSIZE_REG, in sun4i_frontend_update_coord()
523 regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_HORZFACT_REG, in sun4i_frontend_update_coord()
525 regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_HORZFACT_REG, in sun4i_frontend_update_coord()
528 regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_VERTFACT_REG, in sun4i_frontend_update_coord()
530 regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_VERTFACT_REG, in sun4i_frontend_update_coord()
533 regmap_write_bits(frontend->regs, SUN4I_FRONTEND_FRM_CTRL_REG, in sun4i_frontend_update_coord()
539 int sun4i_frontend_enable(struct sun4i_frontend *frontend) in sun4i_frontend_enable() argument
541 regmap_write_bits(frontend->regs, SUN4I_FRONTEND_FRM_CTRL_REG, in sun4i_frontend_enable()
560 struct sun4i_frontend *frontend; in sun4i_frontend_bind() local
565 frontend = devm_kzalloc(dev, sizeof(*frontend), GFP_KERNEL); in sun4i_frontend_bind()
566 if (!frontend) in sun4i_frontend_bind()
569 dev_set_drvdata(dev, frontend); in sun4i_frontend_bind()
570 frontend->dev = dev; in sun4i_frontend_bind()
571 frontend->node = dev->of_node; in sun4i_frontend_bind()
573 frontend->data = of_device_get_match_data(dev); in sun4i_frontend_bind()
574 if (!frontend->data) in sun4i_frontend_bind()
581 frontend->regs = devm_regmap_init_mmio(dev, regs, in sun4i_frontend_bind()
583 if (IS_ERR(frontend->regs)) { in sun4i_frontend_bind()
584 dev_err(dev, "Couldn't create the frontend regmap\n"); in sun4i_frontend_bind()
585 return PTR_ERR(frontend->regs); in sun4i_frontend_bind()
588 frontend->reset = devm_reset_control_get(dev, NULL); in sun4i_frontend_bind()
589 if (IS_ERR(frontend->reset)) { in sun4i_frontend_bind()
591 return PTR_ERR(frontend->reset); in sun4i_frontend_bind()
594 frontend->bus_clk = devm_clk_get(dev, "ahb"); in sun4i_frontend_bind()
595 if (IS_ERR(frontend->bus_clk)) { in sun4i_frontend_bind()
597 return PTR_ERR(frontend->bus_clk); in sun4i_frontend_bind()
600 frontend->mod_clk = devm_clk_get(dev, "mod"); in sun4i_frontend_bind()
601 if (IS_ERR(frontend->mod_clk)) { in sun4i_frontend_bind()
603 return PTR_ERR(frontend->mod_clk); in sun4i_frontend_bind()
606 frontend->ram_clk = devm_clk_get(dev, "ram"); in sun4i_frontend_bind()
607 if (IS_ERR(frontend->ram_clk)) { in sun4i_frontend_bind()
609 return PTR_ERR(frontend->ram_clk); in sun4i_frontend_bind()
612 list_add_tail(&frontend->list, &drv->frontend_list); in sun4i_frontend_bind()
621 struct sun4i_frontend *frontend = dev_get_drvdata(dev); in sun4i_frontend_unbind() local
623 list_del(&frontend->list); in sun4i_frontend_unbind()
644 struct sun4i_frontend *frontend = dev_get_drvdata(dev); in sun4i_frontend_runtime_resume() local
647 clk_set_rate(frontend->mod_clk, 300000000); in sun4i_frontend_runtime_resume()
649 clk_prepare_enable(frontend->bus_clk); in sun4i_frontend_runtime_resume()
650 clk_prepare_enable(frontend->mod_clk); in sun4i_frontend_runtime_resume()
651 clk_prepare_enable(frontend->ram_clk); in sun4i_frontend_runtime_resume()
653 ret = reset_control_reset(frontend->reset); in sun4i_frontend_runtime_resume()
659 regmap_update_bits(frontend->regs, SUN4I_FRONTEND_EN_REG, in sun4i_frontend_runtime_resume()
663 sun4i_frontend_scaler_init(frontend); in sun4i_frontend_runtime_resume()
670 struct sun4i_frontend *frontend = dev_get_drvdata(dev); in sun4i_frontend_runtime_suspend() local
672 clk_disable_unprepare(frontend->ram_clk); in sun4i_frontend_runtime_suspend()
673 clk_disable_unprepare(frontend->mod_clk); in sun4i_frontend_runtime_suspend()
674 clk_disable_unprepare(frontend->bus_clk); in sun4i_frontend_runtime_suspend()
676 reset_control_assert(frontend->reset); in sun4i_frontend_runtime_suspend()
698 .compatible = "allwinner,sun4i-a10-display-frontend",
702 .compatible = "allwinner,sun7i-a20-display-frontend",
706 .compatible = "allwinner,sun8i-a23-display-frontend",
710 .compatible = "allwinner,sun8i-a33-display-frontend",
722 .name = "sun4i-frontend",
730 MODULE_DESCRIPTION("Allwinner A10 Display Engine Frontend Driver");