Lines Matching full:dsi
3 * linux/drivers/video/omap2/dss/dsi.c
9 #define DSS_SUBSYS_NAME "DSI"
46 /* DSI Protocol Engine */
212 /* DSI PLL HSDIV indices */
434 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_write_reg() local
438 case DSI_PROTO: base = dsi->proto_base; break; in dsi_write_reg()
439 case DSI_PHY: base = dsi->phy_base; break; in dsi_write_reg()
440 case DSI_PLL: base = dsi->pll_base; break; in dsi_write_reg()
450 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_read_reg() local
454 case DSI_PROTO: base = dsi->proto_base; break; in dsi_read_reg()
455 case DSI_PHY: base = dsi->phy_base; break; in dsi_read_reg()
456 case DSI_PLL: base = dsi->pll_base; break; in dsi_read_reg()
466 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_bus_lock() local
468 down(&dsi->bus_lock); in dsi_bus_lock()
474 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_bus_unlock() local
476 up(&dsi->bus_lock); in dsi_bus_unlock()
481 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_bus_is_locked() local
483 return dsi->bus_lock.count == 0; in dsi_bus_is_locked()
538 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_perf_mark_setup() local
539 dsi->perf_setup_time = ktime_get(); in dsi_perf_mark_setup()
544 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_perf_mark_start() local
545 dsi->perf_start_time = ktime_get(); in dsi_perf_mark_start()
550 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_perf_show() local
560 setup_time = ktime_sub(dsi->perf_start_time, dsi->perf_setup_time); in dsi_perf_show()
565 trans_time = ktime_sub(t, dsi->perf_start_time); in dsi_perf_show()
572 total_bytes = dsi->update_bytes; in dsi_perf_show()
574 printk(KERN_INFO "DSI(%s): %u us + %u us = %u us (%uHz), " in dsi_perf_show()
611 pr_debug("DSI IRQ: 0x%x: %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", in print_irq_status()
643 pr_debug("DSI VC(%d) IRQ 0x%x: %s%s%s%s%s%s%s%s%s\n", in print_irq_status_vc()
665 pr_debug("DSI CIO IRQ 0x%x: %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", in print_irq_status_cio()
694 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_collect_irq_stats() local
697 spin_lock(&dsi->irq_stats_lock); in dsi_collect_irq_stats()
699 dsi->irq_stats.irq_count++; in dsi_collect_irq_stats()
700 dss_collect_irq_stats(irqstatus, dsi->irq_stats.dsi_irqs); in dsi_collect_irq_stats()
703 dss_collect_irq_stats(vcstatus[i], dsi->irq_stats.vc_irqs[i]); in dsi_collect_irq_stats()
705 dss_collect_irq_stats(ciostatus, dsi->irq_stats.cio_irqs); in dsi_collect_irq_stats()
707 spin_unlock(&dsi->irq_stats_lock); in dsi_collect_irq_stats()
718 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_handle_irq_errors() local
722 DSSERR("DSI error, irqstatus %x\n", irqstatus); in dsi_handle_irq_errors()
724 spin_lock(&dsi->errors_lock); in dsi_handle_irq_errors()
725 dsi->errors |= irqstatus & DSI_IRQ_ERROR_MASK; in dsi_handle_irq_errors()
726 spin_unlock(&dsi->errors_lock); in dsi_handle_irq_errors()
733 DSSERR("DSI VC(%d) error, vc irqstatus %x\n", in dsi_handle_irq_errors()
742 DSSERR("DSI CIO error, cio irqstatus %x\n", ciostatus); in dsi_handle_irq_errors()
788 struct dsi_data *dsi; in omap_dsi_irq_handler() local
793 dsi = dsi_get_dsidrv_data(dsidev); in omap_dsi_irq_handler()
795 if (!dsi->is_enabled) in omap_dsi_irq_handler()
798 spin_lock(&dsi->irq_lock); in omap_dsi_irq_handler()
804 spin_unlock(&dsi->irq_lock); in omap_dsi_irq_handler()
837 del_timer(&dsi->te_timer); in omap_dsi_irq_handler()
842 memcpy(&dsi->isr_tables_copy, &dsi->isr_tables, in omap_dsi_irq_handler()
843 sizeof(dsi->isr_tables)); in omap_dsi_irq_handler()
845 spin_unlock(&dsi->irq_lock); in omap_dsi_irq_handler()
847 dsi_handle_isrs(&dsi->isr_tables_copy, irqstatus, vcstatus, ciostatus); in omap_dsi_irq_handler()
856 /* dsi->irq_lock has to be locked by the caller */
889 /* dsi->irq_lock has to be locked by the caller */
892 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in _omap_dsi_set_irqs() local
897 _omap_dsi_configure_irqs(dsidev, dsi->isr_tables.isr_table, in _omap_dsi_set_irqs()
898 ARRAY_SIZE(dsi->isr_tables.isr_table), mask, in _omap_dsi_set_irqs()
902 /* dsi->irq_lock has to be locked by the caller */
905 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in _omap_dsi_set_irqs_vc() local
907 _omap_dsi_configure_irqs(dsidev, dsi->isr_tables.isr_table_vc[vc], in _omap_dsi_set_irqs_vc()
908 ARRAY_SIZE(dsi->isr_tables.isr_table_vc[vc]), in _omap_dsi_set_irqs_vc()
913 /* dsi->irq_lock has to be locked by the caller */
916 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in _omap_dsi_set_irqs_cio() local
918 _omap_dsi_configure_irqs(dsidev, dsi->isr_tables.isr_table_cio, in _omap_dsi_set_irqs_cio()
919 ARRAY_SIZE(dsi->isr_tables.isr_table_cio), in _omap_dsi_set_irqs_cio()
926 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in _dsi_initialize_irq() local
930 spin_lock_irqsave(&dsi->irq_lock, flags); in _dsi_initialize_irq()
932 memset(&dsi->isr_tables, 0, sizeof(dsi->isr_tables)); in _dsi_initialize_irq()
939 spin_unlock_irqrestore(&dsi->irq_lock, flags); in _dsi_initialize_irq()
1001 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_register_isr() local
1005 spin_lock_irqsave(&dsi->irq_lock, flags); in dsi_register_isr()
1007 r = _dsi_register_isr(isr, arg, mask, dsi->isr_tables.isr_table, in dsi_register_isr()
1008 ARRAY_SIZE(dsi->isr_tables.isr_table)); in dsi_register_isr()
1013 spin_unlock_irqrestore(&dsi->irq_lock, flags); in dsi_register_isr()
1021 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_unregister_isr() local
1025 spin_lock_irqsave(&dsi->irq_lock, flags); in dsi_unregister_isr()
1027 r = _dsi_unregister_isr(isr, arg, mask, dsi->isr_tables.isr_table, in dsi_unregister_isr()
1028 ARRAY_SIZE(dsi->isr_tables.isr_table)); in dsi_unregister_isr()
1033 spin_unlock_irqrestore(&dsi->irq_lock, flags); in dsi_unregister_isr()
1041 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_register_isr_vc() local
1045 spin_lock_irqsave(&dsi->irq_lock, flags); in dsi_register_isr_vc()
1048 dsi->isr_tables.isr_table_vc[channel], in dsi_register_isr_vc()
1049 ARRAY_SIZE(dsi->isr_tables.isr_table_vc[channel])); in dsi_register_isr_vc()
1054 spin_unlock_irqrestore(&dsi->irq_lock, flags); in dsi_register_isr_vc()
1062 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_unregister_isr_vc() local
1066 spin_lock_irqsave(&dsi->irq_lock, flags); in dsi_unregister_isr_vc()
1069 dsi->isr_tables.isr_table_vc[channel], in dsi_unregister_isr_vc()
1070 ARRAY_SIZE(dsi->isr_tables.isr_table_vc[channel])); in dsi_unregister_isr_vc()
1075 spin_unlock_irqrestore(&dsi->irq_lock, flags); in dsi_unregister_isr_vc()
1083 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_register_isr_cio() local
1087 spin_lock_irqsave(&dsi->irq_lock, flags); in dsi_register_isr_cio()
1089 r = _dsi_register_isr(isr, arg, mask, dsi->isr_tables.isr_table_cio, in dsi_register_isr_cio()
1090 ARRAY_SIZE(dsi->isr_tables.isr_table_cio)); in dsi_register_isr_cio()
1095 spin_unlock_irqrestore(&dsi->irq_lock, flags); in dsi_register_isr_cio()
1103 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_unregister_isr_cio() local
1107 spin_lock_irqsave(&dsi->irq_lock, flags); in dsi_unregister_isr_cio()
1109 r = _dsi_unregister_isr(isr, arg, mask, dsi->isr_tables.isr_table_cio, in dsi_unregister_isr_cio()
1110 ARRAY_SIZE(dsi->isr_tables.isr_table_cio)); in dsi_unregister_isr_cio()
1115 spin_unlock_irqrestore(&dsi->irq_lock, flags); in dsi_unregister_isr_cio()
1122 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_get_errors() local
1125 spin_lock_irqsave(&dsi->errors_lock, flags); in dsi_get_errors()
1126 e = dsi->errors; in dsi_get_errors()
1127 dsi->errors = 0; in dsi_get_errors()
1128 spin_unlock_irqrestore(&dsi->errors_lock, flags); in dsi_get_errors()
1135 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_runtime_get() local
1139 r = pm_runtime_resume_and_get(&dsi->pdev->dev); in dsi_runtime_get()
1147 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_runtime_put() local
1152 r = pm_runtime_put_sync(&dsi->pdev->dev); in dsi_runtime_put()
1158 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_regulator_init() local
1161 if (dsi->vdds_dsi_reg != NULL) in dsi_regulator_init()
1164 vdds_dsi = devm_regulator_get(&dsi->pdev->dev, "vdd"); in dsi_regulator_init()
1168 DSSERR("can't get DSI VDD regulator\n"); in dsi_regulator_init()
1172 dsi->vdds_dsi_reg = vdds_dsi; in dsi_regulator_init()
1182 * required after DSIPHY reset to complete the reset of the DSI complex in _dsi_print_reset_status()
1199 pr_debug("DSI resets: PLL (%d) CIO (%d) PHY (%x%x%x, %d, %d, %d)\n", in _dsi_print_reset_status()
1229 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_get_pll_hsdiv_dispc_rate() local
1231 return dsi->pll.cinfo.clkout[HSDIV_DISPC]; in dsi_get_pll_hsdiv_dispc_rate()
1236 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_get_pll_hsdiv_dsi_rate() local
1238 return dsi->pll.cinfo.clkout[HSDIV_DSI]; in dsi_get_pll_hsdiv_dsi_rate()
1243 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_get_txbyteclkhs() local
1245 return dsi->pll.cinfo.clkdco / 16; in dsi_get_txbyteclkhs()
1251 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_fclk_rate() local
1253 if (dss_get_dsi_clk_source(dsi->module_id) == OMAP_DSS_CLK_SRC_FCK) { in dsi_fclk_rate()
1254 /* DSI FCLK source is DSS_CLK_FCK */ in dsi_fclk_rate()
1255 r = clk_get_rate(dsi->dss_clk); in dsi_fclk_rate()
1257 /* DSI FCLK source is dsi_pll_hsdiv_dsi_clk */ in dsi_fclk_rate()
1285 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_set_lp_clk_divisor() local
1292 lp_clk_div = dsi->user_lp_cinfo.lp_clk_div; in dsi_set_lp_clk_divisor()
1302 dsi->current_lp_cinfo.lp_clk = lp_clk; in dsi_set_lp_clk_divisor()
1303 dsi->current_lp_cinfo.lp_clk_div = lp_clk_div; in dsi_set_lp_clk_divisor()
1316 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_enable_scp_clk() local
1318 if (dsi->scp_clk_refcount++ == 0) in dsi_enable_scp_clk()
1324 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_disable_scp_clk() local
1326 WARN_ON(dsi->scp_clk_refcount == 0); in dsi_disable_scp_clk()
1327 if (--dsi->scp_clk_refcount == 0) in dsi_disable_scp_clk()
1343 /* DSI-PLL power command 0x3 is not working */ in dsi_pll_power()
1354 DSSERR("Failed to set DSI PLL power mode to %d\n", in dsi_pll_power()
1377 struct dsi_data *dsi = container_of(pll, struct dsi_data, pll); in dsi_pll_enable() local
1378 struct platform_device *dsidev = dsi->pdev; in dsi_pll_enable()
1396 if (!dsi->vdds_dsi_enabled) { in dsi_pll_enable()
1397 r = regulator_enable(dsi->vdds_dsi_reg); in dsi_pll_enable()
1400 dsi->vdds_dsi_enabled = true; in dsi_pll_enable()
1426 if (dsi->vdds_dsi_enabled) { in dsi_pll_enable()
1427 regulator_disable(dsi->vdds_dsi_reg); in dsi_pll_enable()
1428 dsi->vdds_dsi_enabled = false; in dsi_pll_enable()
1438 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_pll_uninit() local
1442 WARN_ON(!dsi->vdds_dsi_enabled); in dsi_pll_uninit()
1443 regulator_disable(dsi->vdds_dsi_reg); in dsi_pll_uninit()
1444 dsi->vdds_dsi_enabled = false; in dsi_pll_uninit()
1455 struct dsi_data *dsi = container_of(pll, struct dsi_data, pll); in dsi_pll_disable() local
1456 struct platform_device *dsidev = dsi->pdev; in dsi_pll_disable()
1464 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_dump_dsidev_clocks() local
1465 struct dss_pll_clock_info *cinfo = &dsi->pll.cinfo; in dsi_dump_dsidev_clocks()
1467 int dsi_module = dsi->module_id; in dsi_dump_dsidev_clocks()
1468 struct dss_pll *pll = &dsi->pll; in dsi_dump_dsidev_clocks()
1476 seq_printf(s, "- DSI%d PLL -\n", dsi_module + 1); in dsi_dump_dsidev_clocks()
1478 seq_printf(s, "dsi pll clkin\t%lu\n", clk_get_rate(pll->clkin)); in dsi_dump_dsidev_clocks()
1503 seq_printf(s, "- DSI%d -\n", dsi_module + 1); in dsi_dump_dsidev_clocks()
1505 seq_printf(s, "dsi fclk source = %s (%s)\n", in dsi_dump_dsidev_clocks()
1516 seq_printf(s, "LP_CLK\t\t%lu\n", dsi->current_lp_cinfo.lp_clk); in dsi_dump_dsidev_clocks()
1537 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_dump_dsidev_irqs() local
1541 spin_lock_irqsave(&dsi->irq_stats_lock, flags); in dsi_dump_dsidev_irqs()
1543 stats = dsi->irq_stats; in dsi_dump_dsidev_irqs()
1544 memset(&dsi->irq_stats, 0, sizeof(dsi->irq_stats)); in dsi_dump_dsidev_irqs()
1545 dsi->irq_stats.last_reset = jiffies; in dsi_dump_dsidev_irqs()
1547 spin_unlock_irqrestore(&dsi->irq_stats_lock, flags); in dsi_dump_dsidev_irqs()
1556 seq_printf(s, "-- DSI%d interrupts --\n", dsi->module_id + 1); in dsi_dump_dsidev_irqs()
1800 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_set_lane_config() local
1814 for (i = 0; i < dsi->num_lanes_used; ++i) { in dsi_set_lane_config()
1819 for (t = 0; t < dsi->num_lanes_supported; ++t) in dsi_set_lane_config()
1820 if (dsi->lanes[t].function == functions[i]) in dsi_set_lane_config()
1823 if (t == dsi->num_lanes_supported) in dsi_set_lane_config()
1827 polarity = dsi->lanes[t].polarity; in dsi_set_lane_config()
1834 for (; i < dsi->num_lanes_supported; ++i) { in dsi_set_lane_config()
1848 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in ns2ddr() local
1851 unsigned long ddr_clk = dsi->pll.cinfo.clkdco / 4; in ns2ddr()
1857 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in ddr2ns() local
1859 unsigned long ddr_clk = dsi->pll.cinfo.clkdco / 4; in ddr2ns()
1944 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_cio_enable_lane_override() local
1947 u8 lptxscp_start = dsi->num_lanes_supported == 3 ? 22 : 26; in dsi_cio_enable_lane_override()
1951 for (i = 0; i < dsi->num_lanes_supported; ++i) { in dsi_cio_enable_lane_override()
1952 unsigned p = dsi->lanes[i].polarity; in dsi_cio_enable_lane_override()
1992 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_cio_wait_tx_clk_esc_reset() local
2004 for (i = 0; i < dsi->num_lanes_supported; ++i) in dsi_cio_wait_tx_clk_esc_reset()
2005 in_use[i] = dsi->lanes[i].function != DSI_LANE_UNUSED; in dsi_cio_wait_tx_clk_esc_reset()
2015 for (i = 0; i < dsi->num_lanes_supported; ++i) { in dsi_cio_wait_tx_clk_esc_reset()
2020 if (ok == dsi->num_lanes_supported) in dsi_cio_wait_tx_clk_esc_reset()
2024 for (i = 0; i < dsi->num_lanes_supported; ++i) { in dsi_cio_wait_tx_clk_esc_reset()
2041 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_get_lane_mask() local
2045 for (i = 0; i < dsi->num_lanes_supported; ++i) { in dsi_get_lane_mask()
2046 if (dsi->lanes[i].function != DSI_LANE_UNUSED) in dsi_get_lane_mask()
2055 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_cio_init() local
2059 DSSDBG("DSI CIO init starts"); in dsi_cio_init()
2061 r = dss_dsi_enable_pads(dsi->module_id, dsi_get_lane_mask(dsidev)); in dsi_cio_init()
2068 * required after DSIPHY reset to complete the reset of the DSI complex in dsi_cio_init()
2090 if (dsi->ulps_enabled) { in dsi_cio_init()
2107 for (i = 0; i < dsi->num_lanes_supported; ++i) { in dsi_cio_init()
2108 if (dsi->lanes[i].function == DSI_LANE_UNUSED) in dsi_cio_init()
2134 if (dsi->ulps_enabled) { in dsi_cio_init()
2135 /* Keep Mark-1 state for 1ms (as per DSI spec) */ in dsi_cio_init()
2150 if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { in dsi_cio_init()
2153 dsi->vm_timings.ddr_clk_always_on, 13, 13); in dsi_cio_init()
2156 dsi->ulps_enabled = false; in dsi_cio_init()
2167 if (dsi->ulps_enabled) in dsi_cio_init()
2171 dss_dsi_disable_pads(dsi->module_id, dsi_get_lane_mask(dsidev)); in dsi_cio_init()
2177 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_cio_uninit() local
2184 dss_dsi_disable_pads(dsi->module_id, dsi_get_lane_mask(dsidev)); in dsi_cio_uninit()
2191 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_config_tx_fifo() local
2196 dsi->vc[0].tx_fifo_size = size1; in dsi_config_tx_fifo()
2197 dsi->vc[1].tx_fifo_size = size2; in dsi_config_tx_fifo()
2198 dsi->vc[2].tx_fifo_size = size3; in dsi_config_tx_fifo()
2199 dsi->vc[3].tx_fifo_size = size4; in dsi_config_tx_fifo()
2203 int size = dsi->vc[i].tx_fifo_size; in dsi_config_tx_fifo()
2224 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_config_rx_fifo() local
2229 dsi->vc[0].rx_fifo_size = size1; in dsi_config_rx_fifo()
2230 dsi->vc[1].rx_fifo_size = size2; in dsi_config_rx_fifo()
2231 dsi->vc[2].rx_fifo_size = size3; in dsi_config_rx_fifo()
2232 dsi->vc[3].rx_fifo_size = size4; in dsi_config_rx_fifo()
2236 int size = dsi->vc[i].rx_fifo_size; in dsi_config_rx_fifo()
2278 struct dsi_data *dsi = dsi_get_dsidrv_data(vp_data->dsidev); in dsi_packet_sent_handler_vp() local
2279 const int channel = dsi->update_channel; in dsi_packet_sent_handler_vp()
2280 u8 bit = dsi->te_enabled ? 30 : 31; in dsi_packet_sent_handler_vp()
2288 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_sync_vc_vp() local
2297 bit = dsi->te_enabled ? 30 : 31; in dsi_sync_vc_vp()
2329 struct dsi_data *dsi = dsi_get_dsidrv_data(l4_data->dsidev); in dsi_packet_sent_handler_l4() local
2330 const int channel = dsi->update_channel; in dsi_packet_sent_handler_l4()
2373 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_sync_vc() local
2380 switch (dsi->vc[channel].source) { in dsi_sync_vc()
2412 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_vc_initial_config() local
2438 dsi->vc[channel].source = DSI_VC_SOURCE_L4; in dsi_vc_initial_config()
2444 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_vc_config_source() local
2446 if (dsi->vc[channel].source == source) in dsi_vc_config_source()
2472 dsi->vc[channel].source = source; in dsi_vc_config_source()
2481 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_vc_enable_hs() local
2498 if (dsi->vm_timings.ddr_clk_always_on && enable) in dsi_vc_enable_hs()
2584 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_vc_send_bta() local
2586 if (dsi->debug_write || dsi->debug_read) in dsi_vc_send_bta()
2652 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_vc_write_long_header() local
2658 data_id = data_type | dsi->vc[channel].vc_id << 6; in dsi_vc_write_long_header()
2683 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_vc_send_long() local
2689 if (dsi->debug_write) in dsi_vc_send_long()
2693 if (dsi->vc[channel].tx_fifo_size * 32 * 4 < len + 4) { in dsi_vc_send_long()
2704 if (dsi->debug_write) in dsi_vc_send_long()
2719 if (dsi->debug_write) in dsi_vc_send_long()
2746 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_vc_send_short() local
2752 if (dsi->debug_write) in dsi_vc_send_short()
2764 data_id = data_type | dsi->vc[channel].vc_id << 6; in dsi_vc_send_short()
2875 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_vc_dcs_send_read_request() local
2878 if (dsi->debug_read) in dsi_vc_dcs_send_read_request()
2895 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_vc_generic_send_read_request() local
2900 if (dsi->debug_read) in dsi_vc_generic_send_read_request()
2931 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_vc_read_rx_fifo() local
2944 if (dsi->debug_read) in dsi_vc_read_rx_fifo()
2957 if (dsi->debug_read) in dsi_vc_read_rx_fifo()
2974 if (dsi->debug_read) in dsi_vc_read_rx_fifo()
2993 if (dsi->debug_read) in dsi_vc_read_rx_fifo()
3008 if (dsi->debug_read) in dsi_vc_read_rx_fifo()
3105 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_enter_ulps() local
3114 WARN_ON(dsi->ulps_enabled); in dsi_enter_ulps()
3116 if (dsi->ulps_enabled) in dsi_enter_ulps()
3155 for (i = 0; i < dsi->num_lanes_supported; ++i) { in dsi_enter_ulps()
3156 if (dsi->lanes[i].function == DSI_LANE_UNUSED) in dsi_enter_ulps()
3187 dsi->ulps_enabled = true; in dsi_enter_ulps()
3307 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_config_vp_num_line_buffers() local
3310 if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { in dsi_config_vp_num_line_buffers()
3311 int bpp = dsi_get_pixel_size(dsi->pix_fmt); in dsi_config_vp_num_line_buffers()
3312 struct omap_video_timings *timings = &dsi->timings; in dsi_config_vp_num_line_buffers()
3317 if (dsi->line_buffer_size <= timings->x_res * bpp / 8) in dsi_config_vp_num_line_buffers()
3332 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_config_vp_sync_events() local
3336 if (dsi->vm_timings.trans_mode == OMAP_DSS_DSI_PULSE_MODE) in dsi_config_vp_sync_events()
3354 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_config_blanking_modes() local
3355 int blanking_mode = dsi->vm_timings.blanking_mode; in dsi_config_blanking_modes()
3356 int hfp_blanking_mode = dsi->vm_timings.hfp_blanking_mode; in dsi_config_blanking_modes()
3357 int hbp_blanking_mode = dsi->vm_timings.hbp_blanking_mode; in dsi_config_blanking_modes()
3358 int hsa_blanking_mode = dsi->vm_timings.hsa_blanking_mode; in dsi_config_blanking_modes()
3437 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_config_cmd_mode_interleaving() local
3444 struct omap_video_timings *timings = &dsi->timings; in dsi_config_cmd_mode_interleaving()
3445 int bpp = dsi_get_pixel_size(dsi->pix_fmt); in dsi_config_cmd_mode_interleaving()
3446 int ndl = dsi->num_lanes_used - 1; in dsi_config_cmd_mode_interleaving()
3447 int dsi_fclk_hsdiv = dsi->user_dsi_cinfo.mX[HSDIV_DSI] + 1; in dsi_config_cmd_mode_interleaving()
3526 DSSDBG("DSI HS interleaving(TXBYTECLKHS) HSA %d, HFP %d, HBP %d, BLLP %d\n", in dsi_config_cmd_mode_interleaving()
3530 DSSDBG("DSI LP interleaving(bytes) HSA %d, HFP %d, HBP %d, BLLP %d\n", in dsi_config_cmd_mode_interleaving()
3554 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_proto_config() local
3574 switch (dsi_get_pixel_size(dsi->pix_fmt)) { in dsi_proto_config()
3608 if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { in dsi_proto_config()
3624 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_proto_timings() local
3632 int ndl = dsi->num_lanes_used - 1; in dsi_proto_timings()
3685 if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { in dsi_proto_timings()
3687 int hsa = dsi->vm_timings.hsa; in dsi_proto_timings()
3688 int hfp = dsi->vm_timings.hfp; in dsi_proto_timings()
3689 int hbp = dsi->vm_timings.hbp; in dsi_proto_timings()
3690 int vsa = dsi->vm_timings.vsa; in dsi_proto_timings()
3691 int vfp = dsi->vm_timings.vfp; in dsi_proto_timings()
3692 int vbp = dsi->vm_timings.vbp; in dsi_proto_timings()
3693 int window_sync = dsi->vm_timings.window_sync; in dsi_proto_timings()
3695 struct omap_video_timings *timings = &dsi->timings; in dsi_proto_timings()
3696 int bpp = dsi_get_pixel_size(dsi->pix_fmt); in dsi_proto_timings()
3699 hsync_end = dsi->vm_timings.trans_mode == OMAP_DSS_DSI_PULSE_MODE; in dsi_proto_timings()
3738 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_configure_pins() local
3756 if (num_pins < 4 || num_pins > dsi->num_lanes_supported * 2 in dsi_configure_pins()
3772 if (dx < 0 || dx >= dsi->num_lanes_supported * 2) in dsi_configure_pins()
3775 if (dy < 0 || dy >= dsi->num_lanes_supported * 2) in dsi_configure_pins()
3795 memcpy(dsi->lanes, lanes, sizeof(dsi->lanes)); in dsi_configure_pins()
3796 dsi->num_lanes_used = num_lanes; in dsi_configure_pins()
3804 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_enable_video_output() local
3805 struct omap_overlay_manager *mgr = dsi->output.manager; in dsi_enable_video_output()
3806 int bpp = dsi_get_pixel_size(dsi->pix_fmt); in dsi_enable_video_output()
3807 struct omap_dss_device *out = &dsi->output; in dsi_enable_video_output()
3821 if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { in dsi_enable_video_output()
3822 switch (dsi->pix_fmt) { in dsi_enable_video_output()
3846 word_count = DIV_ROUND_UP(dsi->timings.x_res * bpp, 8); in dsi_enable_video_output()
3862 if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { in dsi_enable_video_output()
3875 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_disable_video_output() local
3876 struct omap_overlay_manager *mgr = dsi->output.manager; in dsi_disable_video_output()
3878 if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { in dsi_disable_video_output()
3896 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_update_screen_dispc() local
3897 struct omap_overlay_manager *mgr = dsi->output.manager; in dsi_update_screen_dispc()
3906 const unsigned channel = dsi->update_channel; in dsi_update_screen_dispc()
3907 const unsigned line_buf_size = dsi->line_buffer_size; in dsi_update_screen_dispc()
3908 u16 w = dsi->timings.x_res; in dsi_update_screen_dispc()
3909 u16 h = dsi->timings.y_res; in dsi_update_screen_dispc()
3915 bytespp = dsi_get_pixel_size(dsi->pix_fmt) / 8; in dsi_update_screen_dispc()
3939 if (dsi->te_enabled) in dsi_update_screen_dispc()
3955 r = schedule_delayed_work(&dsi->framedone_timeout_work, in dsi_update_screen_dispc()
3959 dss_mgr_set_timings(mgr, &dsi->timings); in dsi_update_screen_dispc()
3963 if (dsi->te_enabled) { in dsi_update_screen_dispc()
3971 mod_timer(&dsi->te_timer, jiffies + msecs_to_jiffies(250)); in dsi_update_screen_dispc()
3985 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_handle_framedone() local
3990 if (dsi->te_enabled) { in dsi_handle_framedone()
3995 dsi->framedone_callback(error, dsi->framedone_data); in dsi_handle_framedone()
4003 struct dsi_data *dsi = container_of(work, struct dsi_data, in dsi_framedone_timeout_work_callback() local
4010 * DSI */ in dsi_framedone_timeout_work_callback()
4014 dsi_handle_framedone(dsi->pdev, -ETIMEDOUT); in dsi_framedone_timeout_work_callback()
4020 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_framedone_irq_callback() local
4023 * turns itself off. However, DSI still has the pixels in its buffers, in dsi_framedone_irq_callback()
4027 cancel_delayed_work(&dsi->framedone_timeout_work); in dsi_framedone_irq_callback()
4036 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_update() local
4040 dsi->update_channel = channel; in dsi_update()
4042 dsi->framedone_callback = callback; in dsi_update()
4043 dsi->framedone_data = data; in dsi_update()
4046 dsi->update_bytes = dsi->timings.x_res * dsi->timings.y_res * in dsi_update()
4047 dsi_get_pixel_size(dsi->pix_fmt) / 8; in dsi_update()
4058 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_configure_dispc_clocks() local
4065 dispc_cinfo.lck_div = dsi->user_dispc_cinfo.lck_div; in dsi_configure_dispc_clocks()
4066 dispc_cinfo.pck_div = dsi->user_dispc_cinfo.pck_div; in dsi_configure_dispc_clocks()
4074 dsi->mgr_config.clock_info = dispc_cinfo; in dsi_configure_dispc_clocks()
4082 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_display_init_dispc() local
4085 dss_select_lcd_clk_source(mgr->id, dsi->module_id == 0 ? in dsi_display_init_dispc()
4089 if (dsi->mode == OMAP_DSS_DSI_CMD_MODE) { in dsi_display_init_dispc()
4097 dsi->mgr_config.stallmode = true; in dsi_display_init_dispc()
4098 dsi->mgr_config.fifohandcheck = true; in dsi_display_init_dispc()
4100 dsi->mgr_config.stallmode = false; in dsi_display_init_dispc()
4101 dsi->mgr_config.fifohandcheck = false; in dsi_display_init_dispc()
4108 dsi->timings.interlace = false; in dsi_display_init_dispc()
4109 dsi->timings.hsync_level = OMAPDSS_SIG_ACTIVE_HIGH; in dsi_display_init_dispc()
4110 dsi->timings.vsync_level = OMAPDSS_SIG_ACTIVE_HIGH; in dsi_display_init_dispc()
4111 dsi->timings.data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; in dsi_display_init_dispc()
4112 dsi->timings.de_level = OMAPDSS_SIG_ACTIVE_HIGH; in dsi_display_init_dispc()
4113 dsi->timings.sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE; in dsi_display_init_dispc()
4115 dss_mgr_set_timings(mgr, &dsi->timings); in dsi_display_init_dispc()
4121 dsi->mgr_config.io_pad_mode = DSS_IO_PAD_MODE_BYPASS; in dsi_display_init_dispc()
4122 dsi->mgr_config.video_port_width = in dsi_display_init_dispc()
4123 dsi_get_pixel_size(dsi->pix_fmt); in dsi_display_init_dispc()
4124 dsi->mgr_config.lcden_sig_polarity = 0; in dsi_display_init_dispc()
4126 dss_mgr_set_lcd_config(mgr, &dsi->mgr_config); in dsi_display_init_dispc()
4130 if (dsi->mode == OMAP_DSS_DSI_CMD_MODE) in dsi_display_init_dispc()
4141 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_display_uninit_dispc() local
4143 if (dsi->mode == OMAP_DSS_DSI_CMD_MODE) in dsi_display_uninit_dispc()
4152 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_configure_dsi_clocks() local
4156 cinfo = dsi->user_dsi_cinfo; in dsi_configure_dsi_clocks()
4158 r = dss_pll_set_config(&dsi->pll, &cinfo); in dsi_configure_dsi_clocks()
4160 DSSERR("Failed to set dsi clocks\n"); in dsi_configure_dsi_clocks()
4169 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_display_init_dsi() local
4172 r = dss_pll_enable(&dsi->pll); in dsi_display_init_dsi()
4180 dss_select_dsi_clk_source(dsi->module_id, dsi->module_id == 0 ? in dsi_display_init_dsi()
4214 dss_select_dsi_clk_source(dsi->module_id, OMAP_DSS_CLK_SRC_FCK); in dsi_display_init_dsi()
4216 dss_pll_disable(&dsi->pll); in dsi_display_init_dsi()
4224 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_display_uninit_dsi() local
4226 if (enter_ulps && !dsi->ulps_enabled) in dsi_display_uninit_dsi()
4236 dss_select_dsi_clk_source(dsi->module_id, OMAP_DSS_CLK_SRC_FCK); in dsi_display_uninit_dsi()
4244 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_display_enable() local
4251 mutex_lock(&dsi->lock); in dsi_display_enable()
4263 mutex_unlock(&dsi->lock); in dsi_display_enable()
4270 mutex_unlock(&dsi->lock); in dsi_display_enable()
4279 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_display_disable() local
4285 mutex_lock(&dsi->lock); in dsi_display_disable()
4296 mutex_unlock(&dsi->lock); in dsi_display_disable()
4302 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_enable_te() local
4304 dsi->te_enabled = enable; in dsi_enable_te()
4442 static bool dsi_cm_calc(struct dsi_data *dsi, in dsi_cm_calc() argument
4451 clkin = clk_get_rate(dsi->pll.clkin); in dsi_cm_calc()
4453 ndl = dsi->num_lanes_used - 1; in dsi_cm_calc()
4466 ctx->dsidev = dsi->pdev; in dsi_cm_calc()
4467 ctx->pll = &dsi->pll; in dsi_cm_calc()
4483 struct dsi_data *dsi = dsi_get_dsidrv_data(ctx->dsidev); in dsi_vm_calc_blanking() local
4486 int ndl = dsi->num_lanes_used - 1; in dsi_vm_calc_blanking()
4519 * When there are no line buffers, DISPC and DSI must have the in dsi_vm_calc_blanking()
4520 * same tput. Otherwise DISPC tput needs to be higher than DSI's. in dsi_vm_calc_blanking()
4522 if (dsi->line_buffer_size < xres * bitspp / 8) { in dsi_vm_calc_blanking()
4530 /* DSI tput must be over the min requirement */ in dsi_vm_calc_blanking()
4534 /* When non-burst mode, DSI tput must be below max requirement. */ in dsi_vm_calc_blanking()
4551 /* DSI htot to match the panel's nominal pck */ in dsi_vm_calc_blanking()
4558 /* total DSI blanking needed to achieve panel's TL */ in dsi_vm_calc_blanking()
4561 /* DISPC htot to match the DSI TL */ in dsi_vm_calc_blanking()
4564 /* verify that the DSI and DISPC TLs are the same */ in dsi_vm_calc_blanking()
4570 /* setup DSI videomode */ in dsi_vm_calc_blanking()
4694 print_dsi_vm("dsi ", &ctx->dsi_vm); in dsi_vm_calc_dispc_cb()
4740 static bool dsi_vm_calc(struct dsi_data *dsi, in dsi_vm_calc() argument
4748 int ndl = dsi->num_lanes_used - 1; in dsi_vm_calc()
4752 clkin = clk_get_rate(dsi->pll.clkin); in dsi_vm_calc()
4755 ctx->dsidev = dsi->pdev; in dsi_vm_calc()
4756 ctx->pll = &dsi->pll; in dsi_vm_calc()
4786 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_set_config() local
4791 mutex_lock(&dsi->lock); in dsi_set_config()
4793 dsi->pix_fmt = config->pixel_format; in dsi_set_config()
4794 dsi->mode = config->mode; in dsi_set_config()
4797 ok = dsi_vm_calc(dsi, config, &ctx); in dsi_set_config()
4799 ok = dsi_cm_calc(dsi, config, &ctx); in dsi_set_config()
4802 DSSERR("failed to find suitable DSI clock settings\n"); in dsi_set_config()
4810 config->lp_clk_min, config->lp_clk_max, &dsi->user_lp_cinfo); in dsi_set_config()
4812 DSSERR("failed to find suitable DSI LP clock settings\n"); in dsi_set_config()
4816 dsi->user_dsi_cinfo = ctx.dsi_cinfo; in dsi_set_config()
4817 dsi->user_dispc_cinfo = ctx.dispc_cinfo; in dsi_set_config()
4819 dsi->timings = ctx.dispc_vm; in dsi_set_config()
4820 dsi->vm_timings = ctx.dsi_vm; in dsi_set_config()
4822 mutex_unlock(&dsi->lock); in dsi_set_config()
4826 mutex_unlock(&dsi->lock); in dsi_set_config()
4832 * Return a hardcoded channel for the DSI output. This should work for
4842 DSSWARN("DSI not supported\n"); in dsi_get_channel()
4884 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_request_vc() local
4887 for (i = 0; i < ARRAY_SIZE(dsi->vc); i++) { in dsi_request_vc()
4888 if (!dsi->vc[i].dssdev) { in dsi_request_vc()
4889 dsi->vc[i].dssdev = dssdev; in dsi_request_vc()
4902 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_set_vc_id() local
4914 if (dsi->vc[channel].dssdev != dssdev) { in dsi_set_vc_id()
4920 dsi->vc[channel].vc_id = vc_id; in dsi_set_vc_id()
4928 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_release_vc() local
4931 dsi->vc[channel].dssdev == dssdev) { in dsi_release_vc()
4932 dsi->vc[channel].dssdev = NULL; in dsi_release_vc()
4933 dsi->vc[channel].vc_id = 0; in dsi_release_vc()
4940 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_get_clocks() local
4949 dsi->dss_clk = clk; in dsi_get_clocks()
5039 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_init_output() local
5040 struct omap_dss_device *out = &dsi->output; in dsi_init_output()
5043 out->id = dsi->module_id == 0 ? in dsi_init_output()
5047 out->name = dsi->module_id == 0 ? "dsi.0" : "dsi.1"; in dsi_init_output()
5048 out->dispc_channel = dsi_get_channel(dsi->module_id); in dsi_init_output()
5049 out->ops.dsi = &dsi_ops; in dsi_init_output()
5057 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_uninit_output() local
5058 struct omap_dss_device *out = &dsi->output; in dsi_uninit_output()
5066 struct dsi_data *dsi = dsi_get_dsidrv_data(pdev); in dsi_probe_of() local
5088 num_pins > dsi->num_lanes_supported * 2) { in dsi_probe_of()
5104 r = dsi_configure_pins(&dsi->output, &pin_cfg); in dsi_probe_of()
5202 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_init_pll_data() local
5203 struct dss_pll *pll = &dsi->pll; in dsi_init_pll_data()
5213 pll->name = dsi->module_id == 0 ? "dsi0" : "dsi1"; in dsi_init_pll_data()
5214 pll->id = dsi->module_id == 0 ? DSS_PLL_DSI1 : DSS_PLL_DSI2; in dsi_init_pll_data()
5216 pll->base = dsi->pll_base; in dsi_init_pll_data()
5255 struct dsi_data *dsi; in dsi_bind() local
5260 dsi = devm_kzalloc(&dsidev->dev, sizeof(*dsi), GFP_KERNEL); in dsi_bind()
5261 if (!dsi) in dsi_bind()
5264 dsi->pdev = dsidev; in dsi_bind()
5265 platform_set_drvdata(dsidev, dsi); in dsi_bind()
5267 spin_lock_init(&dsi->irq_lock); in dsi_bind()
5268 spin_lock_init(&dsi->errors_lock); in dsi_bind()
5269 dsi->errors = 0; in dsi_bind()
5272 spin_lock_init(&dsi->irq_stats_lock); in dsi_bind()
5273 dsi->irq_stats.last_reset = jiffies; in dsi_bind()
5276 mutex_init(&dsi->lock); in dsi_bind()
5277 sema_init(&dsi->bus_lock, 1); in dsi_bind()
5279 INIT_DEFERRABLE_WORK(&dsi->framedone_timeout_work, in dsi_bind()
5283 timer_setup(&dsi->te_timer, dsi_te_timeout, 0); in dsi_bind()
5290 DSSERR("can't get IORESOURCE_MEM DSI\n"); in dsi_bind()
5301 dsi->proto_base = devm_ioremap(&dsidev->dev, res->start, in dsi_bind()
5303 if (!dsi->proto_base) { in dsi_bind()
5304 DSSERR("can't ioremap DSI protocol engine\n"); in dsi_bind()
5312 DSSERR("can't get IORESOURCE_MEM DSI\n"); in dsi_bind()
5321 dsi->phy_base = devm_ioremap(&dsidev->dev, res->start, in dsi_bind()
5323 if (!dsi->phy_base) { in dsi_bind()
5324 DSSERR("can't ioremap DSI PHY\n"); in dsi_bind()
5332 DSSERR("can't get IORESOURCE_MEM DSI\n"); in dsi_bind()
5341 dsi->pll_base = devm_ioremap(&dsidev->dev, res->start, in dsi_bind()
5343 if (!dsi->pll_base) { in dsi_bind()
5344 DSSERR("can't ioremap DSI PLL\n"); in dsi_bind()
5348 dsi->irq = platform_get_irq(dsi->pdev, 0); in dsi_bind()
5349 if (dsi->irq < 0) { in dsi_bind()
5354 r = devm_request_irq(&dsidev->dev, dsi->irq, omap_dsi_irq_handler, in dsi_bind()
5355 IRQF_SHARED, dev_name(&dsidev->dev), dsi->pdev); in dsi_bind()
5367 DSSERR("unsupported DSI module\n"); in dsi_bind()
5377 DSSERR("unsupported DSI module\n"); in dsi_bind()
5381 dsi->module_id = d->id; in dsi_bind()
5383 dsi->module_id = dsidev->id; in dsi_bind()
5386 /* DSI VCs initialization */ in dsi_bind()
5387 for (i = 0; i < ARRAY_SIZE(dsi->vc); i++) { in dsi_bind()
5388 dsi->vc[i].source = DSI_VC_SOURCE_L4; in dsi_bind()
5389 dsi->vc[i].dssdev = NULL; in dsi_bind()
5390 dsi->vc[i].vc_id = 0; in dsi_bind()
5406 dev_dbg(&dsidev->dev, "OMAP DSI rev %d.%d\n", in dsi_bind()
5409 /* DSI on OMAP3 doesn't have register DSI_GNQ, set number in dsi_bind()
5413 dsi->num_lanes_supported = 1 + REG_GET(dsidev, DSI_GNQ, 11, 9); in dsi_bind()
5415 dsi->num_lanes_supported = 3; in dsi_bind()
5417 dsi->line_buffer_size = dsi_get_line_buf_size(dsidev); in dsi_bind()
5424 DSSERR("Invalid DSI DT data\n"); in dsi_bind()
5431 DSSERR("Failed to populate DSI child devices: %d\n", r); in dsi_bind()
5436 if (dsi->module_id == 0) in dsi_bind()
5438 else if (dsi->module_id == 1) in dsi_bind()
5442 if (dsi->module_id == 0) in dsi_bind()
5444 else if (dsi->module_id == 1) in dsi_bind()
5462 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); in dsi_unbind() local
5466 WARN_ON(dsi->scp_clk_refcount > 0); in dsi_unbind()
5468 dss_pll_unregister(&dsi->pll); in dsi_unbind()
5474 if (dsi->vdds_dsi_reg != NULL && dsi->vdds_dsi_enabled) { in dsi_unbind()
5475 regulator_disable(dsi->vdds_dsi_reg); in dsi_unbind()
5476 dsi->vdds_dsi_enabled = false; in dsi_unbind()
5499 struct dsi_data *dsi = dsi_get_dsidrv_data(pdev); in dsi_runtime_suspend() local
5501 dsi->is_enabled = false; in dsi_runtime_suspend()
5504 /* wait for current handler to finish before turning the DSI off */ in dsi_runtime_suspend()
5505 synchronize_irq(dsi->irq); in dsi_runtime_suspend()
5515 struct dsi_data *dsi = dsi_get_dsidrv_data(pdev); in dsi_runtime_resume() local
5522 dsi->is_enabled = true; in dsi_runtime_resume()
5552 { .compatible = "ti,omap3-dsi", .data = dsi_of_data_omap3, },
5553 { .compatible = "ti,omap4-dsi", .data = dsi_of_data_omap4, },
5554 { .compatible = "ti,omap5-dsi", .data = dsi_of_data_omap5, },