Lines Matching +full:dsi +full:- +full:pclk

69 /* ICL DSI Display GPIO Pins */
85 * If single link DSI is being used on any port, the VBT sequence block in intel_dsi_seq_port_to_port()
89 if (hweight8(intel_dsi->ports) == 1) in intel_dsi_seq_port_to_port()
90 return ffs(intel_dsi->ports) - 1; in intel_dsi_seq_port_to_port()
93 if (intel_dsi->ports & BIT(PORT_B)) in intel_dsi_seq_port_to_port()
95 if (intel_dsi->ports & BIT(PORT_C)) in intel_dsi_seq_port_to_port()
105 struct drm_i915_private *dev_priv = to_i915(intel_dsi->base.base.dev); in mipi_exec_send_packet()
111 drm_dbg_kms(&dev_priv->drm, "\n"); in mipi_exec_send_packet()
123 if (drm_WARN_ON(&dev_priv->drm, !intel_dsi->dsi_hosts[port])) in mipi_exec_send_packet()
126 dsi_device = intel_dsi->dsi_hosts[port]->device; in mipi_exec_send_packet()
128 drm_dbg_kms(&dev_priv->drm, "no dsi device for port %c\n", in mipi_exec_send_packet()
134 dsi_device->mode_flags &= ~MIPI_DSI_MODE_LPM; in mipi_exec_send_packet()
136 dsi_device->mode_flags |= MIPI_DSI_MODE_LPM; in mipi_exec_send_packet()
138 dsi_device->channel = (flags >> MIPI_VIRTUAL_CHANNEL_SHIFT) & 3; in mipi_exec_send_packet()
153 drm_dbg(&dev_priv->drm, in mipi_exec_send_packet()
166 drm_dbg(&dev_priv->drm, in mipi_exec_send_packet()
185 struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev); in mipi_exec_delay()
188 drm_dbg_kms(&i915->drm, "%d usecs\n", delay); in mipi_exec_delay()
199 struct drm_i915_private *dev_priv = to_i915(connector->base.dev); in soc_gpio_set_value()
207 gpio_desc = devm_gpiod_get_index(dev_priv->drm.dev, con_id, idx, in soc_gpio_set_value()
210 drm_err(&dev_priv->drm, in soc_gpio_set_value()
230 lookup->dev_id = "0000:00:02.0"; in soc_opaque_gpio_set_value()
231 lookup->table[0] = in soc_opaque_gpio_set_value()
245 struct drm_i915_private *dev_priv = to_i915(connector->base.dev); in vlv_gpio_set_value()
248 if (connector->panel.vbt.dsi.seq_version < 3) { in vlv_gpio_set_value()
250 drm_dbg_kms(&dev_priv->drm, "SC gpio not supported\n"); in vlv_gpio_set_value()
254 drm_dbg_kms(&dev_priv->drm, in vlv_gpio_set_value()
267 struct drm_i915_private *dev_priv = to_i915(connector->base.dev); in chv_gpio_set_value()
269 if (connector->panel.vbt.dsi.seq_version >= 3) { in chv_gpio_set_value()
271 /* XXX: it's unclear whether 255->57 is part of SE. */ in chv_gpio_set_value()
273 gpio_index - CHV_GPIO_IDX_START_SE, value); in chv_gpio_set_value()
276 gpio_index - CHV_GPIO_IDX_START_SW, value); in chv_gpio_set_value()
279 gpio_index - CHV_GPIO_IDX_START_E, value); in chv_gpio_set_value()
282 gpio_index - CHV_GPIO_IDX_START_N, value); in chv_gpio_set_value()
287 drm_dbg_kms(&dev_priv->drm, in chv_gpio_set_value()
293 drm_dbg_kms(&dev_priv->drm, in chv_gpio_set_value()
300 gpio_index - CHV_GPIO_IDX_START_N, value); in chv_gpio_set_value()
328 if (drm_WARN_ON(&dev_priv->drm, DISPLAY_VER(dev_priv) == 11 && gpio >= MIPI_RESET_2)) in icl_native_gpio_set_value()
338 * value. The HPD pin should not be enabled for DSI anyway, in icl_native_gpio_set_value()
340 * used by a non-DSI encoder. in icl_native_gpio_set_value()
345 spin_lock_irq(&dev_priv->irq_lock); in icl_native_gpio_set_value()
350 spin_unlock_irq(&dev_priv->irq_lock); in icl_native_gpio_set_value()
391 struct drm_device *dev = intel_dsi->base.base.dev; in mipi_exec_gpio()
393 struct intel_connector *connector = intel_dsi->attached_connector; in mipi_exec_gpio()
399 if (connector->panel.vbt.dsi.seq_version >= 3) { in mipi_exec_gpio()
406 if (connector->panel.vbt.dsi.seq_version >= 4 && data[2] & BIT(1)) in mipi_exec_gpio()
414 if (connector->panel.vbt.dsi.seq_version == 2) in mipi_exec_gpio()
418 drm_dbg_kms(&i915->drm, "GPIO index %u, number %u, source %u, native %s, set to %s\n", in mipi_exec_gpio()
437 struct intel_dsi *intel_dsi = lookup->intel_dsi; in i2c_adapter_lookup()
446 if (lookup->target_addr != sb->slave_address) in i2c_adapter_lookup()
449 status = acpi_get_handle(lookup->dev_handle, in i2c_adapter_lookup()
450 sb->resource_source.string_ptr, in i2c_adapter_lookup()
457 intel_dsi->i2c_bus_num = adapter->nr; in i2c_adapter_lookup()
465 struct drm_device *drm_dev = intel_dsi->base.base.dev; in i2c_acpi_find_adapter()
466 struct acpi_device *adev = ACPI_COMPANION(drm_dev->dev); in i2c_acpi_find_adapter()
486 struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev); in mipi_exec_i2c()
496 drm_dbg_kms(&i915->drm, "bus %d target-addr 0x%02x reg 0x%02x data %*ph\n", in mipi_exec_i2c()
499 if (intel_dsi->i2c_bus_num < 0) { in mipi_exec_i2c()
500 intel_dsi->i2c_bus_num = vbt_i2c_bus_num; in mipi_exec_i2c()
504 adapter = i2c_get_adapter(intel_dsi->i2c_bus_num); in mipi_exec_i2c()
506 drm_err(&i915->drm, "Cannot find a valid i2c bus for xfer\n"); in mipi_exec_i2c()
524 drm_err(&i915->drm, in mipi_exec_i2c()
537 struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev); in mipi_exec_spi()
539 drm_dbg_kms(&i915->drm, "Skipping SPI element execution\n"); in mipi_exec_spi()
546 struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev); in mipi_exec_pmic()
562 drm_err(&i915->drm, "%s failed, error: %d\n", __func__, ret); in mipi_exec_pmic()
564 drm_err(&i915->drm, in mipi_exec_pmic()
614 struct drm_i915_private *dev_priv = to_i915(intel_dsi->base.base.dev); in intel_dsi_vbt_exec()
615 struct intel_connector *connector = intel_dsi->attached_connector; in intel_dsi_vbt_exec()
619 if (drm_WARN_ON(&dev_priv->drm, in intel_dsi_vbt_exec()
620 seq_id >= ARRAY_SIZE(connector->panel.vbt.dsi.sequence))) in intel_dsi_vbt_exec()
623 data = connector->panel.vbt.dsi.sequence[seq_id]; in intel_dsi_vbt_exec()
627 drm_WARN_ON(&dev_priv->drm, *data != seq_id); in intel_dsi_vbt_exec()
629 drm_dbg_kms(&dev_priv->drm, "Starting MIPI sequence %d - %s\n", in intel_dsi_vbt_exec()
636 if (connector->panel.vbt.dsi.seq_version >= 3) in intel_dsi_vbt_exec()
649 if (connector->panel.vbt.dsi.seq_version >= 3) in intel_dsi_vbt_exec()
659 drm_err(&dev_priv->drm, in intel_dsi_vbt_exec()
665 drm_dbg_kms(&dev_priv->drm, in intel_dsi_vbt_exec()
671 drm_err(&dev_priv->drm, in intel_dsi_vbt_exec()
682 if (seq_id == MIPI_SEQ_POWER_ON && intel_dsi->gpio_panel) in intel_dsi_vbt_exec_sequence()
683 gpiod_set_value_cansleep(intel_dsi->gpio_panel, 1); in intel_dsi_vbt_exec_sequence()
684 if (seq_id == MIPI_SEQ_BACKLIGHT_ON && intel_dsi->gpio_backlight) in intel_dsi_vbt_exec_sequence()
685 gpiod_set_value_cansleep(intel_dsi->gpio_backlight, 1); in intel_dsi_vbt_exec_sequence()
689 if (seq_id == MIPI_SEQ_POWER_OFF && intel_dsi->gpio_panel) in intel_dsi_vbt_exec_sequence()
690 gpiod_set_value_cansleep(intel_dsi->gpio_panel, 0); in intel_dsi_vbt_exec_sequence()
691 if (seq_id == MIPI_SEQ_BACKLIGHT_OFF && intel_dsi->gpio_backlight) in intel_dsi_vbt_exec_sequence()
692 gpiod_set_value_cansleep(intel_dsi->gpio_backlight, 0); in intel_dsi_vbt_exec_sequence()
697 struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev); in intel_dsi_log_params()
699 drm_dbg_kms(&i915->drm, "Pclk %d\n", intel_dsi->pclk); in intel_dsi_log_params()
700 drm_dbg_kms(&i915->drm, "Pixel overlap %d\n", in intel_dsi_log_params()
701 intel_dsi->pixel_overlap); in intel_dsi_log_params()
702 drm_dbg_kms(&i915->drm, "Lane count %d\n", intel_dsi->lane_count); in intel_dsi_log_params()
703 drm_dbg_kms(&i915->drm, "DPHY param reg 0x%x\n", intel_dsi->dphy_reg); in intel_dsi_log_params()
704 drm_dbg_kms(&i915->drm, "Video mode format %s\n", in intel_dsi_log_params()
705 intel_dsi->video_mode == NON_BURST_SYNC_PULSE ? in intel_dsi_log_params()
706 "non-burst with sync pulse" : in intel_dsi_log_params()
707 intel_dsi->video_mode == NON_BURST_SYNC_EVENTS ? in intel_dsi_log_params()
708 "non-burst with sync events" : in intel_dsi_log_params()
709 intel_dsi->video_mode == BURST_MODE ? in intel_dsi_log_params()
711 drm_dbg_kms(&i915->drm, "Burst mode ratio %d\n", in intel_dsi_log_params()
712 intel_dsi->burst_mode_ratio); in intel_dsi_log_params()
713 drm_dbg_kms(&i915->drm, "Reset timer %d\n", intel_dsi->rst_timer_val); in intel_dsi_log_params()
714 drm_dbg_kms(&i915->drm, "Eot %s\n", in intel_dsi_log_params()
715 str_enabled_disabled(intel_dsi->eotp_pkt)); in intel_dsi_log_params()
716 drm_dbg_kms(&i915->drm, "Clockstop %s\n", in intel_dsi_log_params()
717 str_enabled_disabled(!intel_dsi->clock_stop)); in intel_dsi_log_params()
718 drm_dbg_kms(&i915->drm, "Mode %s\n", in intel_dsi_log_params()
719 intel_dsi->operation_mode ? "command" : "video"); in intel_dsi_log_params()
720 if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) in intel_dsi_log_params()
721 drm_dbg_kms(&i915->drm, in intel_dsi_log_params()
723 else if (intel_dsi->dual_link == DSI_DUAL_LINK_PIXEL_ALT) in intel_dsi_log_params()
724 drm_dbg_kms(&i915->drm, in intel_dsi_log_params()
727 drm_dbg_kms(&i915->drm, "Dual link: NONE\n"); in intel_dsi_log_params()
728 drm_dbg_kms(&i915->drm, "Pixel Format %d\n", intel_dsi->pixel_format); in intel_dsi_log_params()
729 drm_dbg_kms(&i915->drm, "TLPX %d\n", intel_dsi->escape_clk_div); in intel_dsi_log_params()
730 drm_dbg_kms(&i915->drm, "LP RX Timeout 0x%x\n", in intel_dsi_log_params()
731 intel_dsi->lp_rx_timeout); in intel_dsi_log_params()
732 drm_dbg_kms(&i915->drm, "Turnaround Timeout 0x%x\n", in intel_dsi_log_params()
733 intel_dsi->turn_arnd_val); in intel_dsi_log_params()
734 drm_dbg_kms(&i915->drm, "Init Count 0x%x\n", intel_dsi->init_count); in intel_dsi_log_params()
735 drm_dbg_kms(&i915->drm, "HS to LP Count 0x%x\n", in intel_dsi_log_params()
736 intel_dsi->hs_to_lp_count); in intel_dsi_log_params()
737 drm_dbg_kms(&i915->drm, "LP Byte Clock %d\n", intel_dsi->lp_byte_clk); in intel_dsi_log_params()
738 drm_dbg_kms(&i915->drm, "DBI BW Timer 0x%x\n", intel_dsi->bw_timer); in intel_dsi_log_params()
739 drm_dbg_kms(&i915->drm, "LP to HS Clock Count 0x%x\n", in intel_dsi_log_params()
740 intel_dsi->clk_lp_to_hs_count); in intel_dsi_log_params()
741 drm_dbg_kms(&i915->drm, "HS to LP Clock Count 0x%x\n", in intel_dsi_log_params()
742 intel_dsi->clk_hs_to_lp_count); in intel_dsi_log_params()
743 drm_dbg_kms(&i915->drm, "BTA %s\n", in intel_dsi_log_params()
744 str_enabled_disabled(!(intel_dsi->video_frmt_cfg_bits & DISABLE_VIDEO_BTA))); in intel_dsi_log_params()
749 struct drm_device *dev = intel_dsi->base.base.dev; in intel_dsi_vbt_init()
751 struct intel_connector *connector = intel_dsi->attached_connector; in intel_dsi_vbt_init()
752 struct mipi_config *mipi_config = connector->panel.vbt.dsi.config; in intel_dsi_vbt_init()
753 struct mipi_pps_data *pps = connector->panel.vbt.dsi.pps; in intel_dsi_vbt_init()
754 struct drm_display_mode *mode = connector->panel.vbt.lfp_vbt_mode; in intel_dsi_vbt_init()
758 drm_dbg_kms(&dev_priv->drm, "\n"); in intel_dsi_vbt_init()
760 intel_dsi->eotp_pkt = mipi_config->eot_pkt_disabled ? 0 : 1; in intel_dsi_vbt_init()
761 intel_dsi->clock_stop = mipi_config->enable_clk_stop ? 1 : 0; in intel_dsi_vbt_init()
762 intel_dsi->lane_count = mipi_config->lane_cnt + 1; in intel_dsi_vbt_init()
763 intel_dsi->pixel_format = in intel_dsi_vbt_init()
765 mipi_config->videomode_color_format << 7); in intel_dsi_vbt_init()
767 intel_dsi->dual_link = mipi_config->dual_link; in intel_dsi_vbt_init()
768 intel_dsi->pixel_overlap = mipi_config->pixel_overlap; in intel_dsi_vbt_init()
769 intel_dsi->operation_mode = mipi_config->is_cmd_mode; in intel_dsi_vbt_init()
770 intel_dsi->video_mode = mipi_config->video_transfer_mode; in intel_dsi_vbt_init()
771 intel_dsi->escape_clk_div = mipi_config->byte_clk_sel; in intel_dsi_vbt_init()
772 intel_dsi->lp_rx_timeout = mipi_config->lp_rx_timeout; in intel_dsi_vbt_init()
773 intel_dsi->hs_tx_timeout = mipi_config->hs_tx_timeout; in intel_dsi_vbt_init()
774 intel_dsi->turn_arnd_val = mipi_config->turn_around_timeout; in intel_dsi_vbt_init()
775 intel_dsi->rst_timer_val = mipi_config->device_reset_timer; in intel_dsi_vbt_init()
776 intel_dsi->init_count = mipi_config->master_init_timer; in intel_dsi_vbt_init()
777 intel_dsi->bw_timer = mipi_config->dbi_bw_timer; in intel_dsi_vbt_init()
778 intel_dsi->video_frmt_cfg_bits = in intel_dsi_vbt_init()
779 mipi_config->bta_enabled ? DISABLE_VIDEO_BTA : 0; in intel_dsi_vbt_init()
780 intel_dsi->bgr_enabled = mipi_config->rgb_flip; in intel_dsi_vbt_init()
783 intel_dsi->pclk = mode->clock; in intel_dsi_vbt_init()
786 if (intel_dsi->dual_link) { in intel_dsi_vbt_init()
787 intel_dsi->pclk /= 2; in intel_dsi_vbt_init()
792 if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) { in intel_dsi_vbt_init()
793 intel_dsi->pclk += DIV_ROUND_UP(mode->vtotal * intel_dsi->pixel_overlap * 60, 1000); in intel_dsi_vbt_init()
801 if (intel_dsi->video_mode == BURST_MODE) { in intel_dsi_vbt_init()
804 if (mipi_config->target_burst_mode_freq == 0) { in intel_dsi_vbt_init()
805 drm_err(&dev_priv->drm, "Burst mode target is not set\n"); in intel_dsi_vbt_init()
816 if (mipi_config->target_burst_mode_freq < bitrate && in intel_dsi_vbt_init()
817 intel_fuzzy_clock_check(mipi_config->target_burst_mode_freq, in intel_dsi_vbt_init()
819 mipi_config->target_burst_mode_freq = bitrate; in intel_dsi_vbt_init()
821 if (mipi_config->target_burst_mode_freq < bitrate) { in intel_dsi_vbt_init()
822 drm_err(&dev_priv->drm, "Burst mode freq is less than computed\n"); in intel_dsi_vbt_init()
827 DIV_ROUND_UP(mipi_config->target_burst_mode_freq * 100, bitrate); in intel_dsi_vbt_init()
829 intel_dsi->pclk = DIV_ROUND_UP(intel_dsi->pclk * burst_mode_ratio, 100); in intel_dsi_vbt_init()
833 intel_dsi->burst_mode_ratio = burst_mode_ratio; in intel_dsi_vbt_init()
838 intel_dsi->backlight_off_delay = pps->bl_disable_delay / 10; in intel_dsi_vbt_init()
839 intel_dsi->backlight_on_delay = pps->bl_enable_delay / 10; in intel_dsi_vbt_init()
840 intel_dsi->panel_on_delay = pps->panel_on_delay / 10; in intel_dsi_vbt_init()
841 intel_dsi->panel_off_delay = pps->panel_off_delay / 10; in intel_dsi_vbt_init()
842 intel_dsi->panel_pwr_cycle_delay = pps->panel_power_cycle_delay / 10; in intel_dsi_vbt_init()
844 intel_dsi->i2c_bus_num = -1; in intel_dsi_vbt_init()
847 for_each_dsi_port(port, intel_dsi->ports) { in intel_dsi_vbt_init()
848 mipi_dsi_attach(intel_dsi->dsi_hosts[port]->device); in intel_dsi_vbt_init()
886 struct drm_device *dev = intel_dsi->base.base.dev; in intel_dsi_vbt_gpio_init()
888 struct intel_connector *connector = intel_dsi->attached_connector; in intel_dsi_vbt_gpio_init()
889 struct mipi_config *mipi_config = connector->panel.vbt.dsi.config; in intel_dsi_vbt_gpio_init()
898 mipi_config->pwm_blc == PPS_BLC_PMIC) { in intel_dsi_vbt_gpio_init()
903 if (IS_VALLEYVIEW(dev_priv) && mipi_config->pwm_blc == PPS_BLC_SOC) { in intel_dsi_vbt_gpio_init()
912 drm_err(&dev_priv->drm, in intel_dsi_vbt_gpio_init()
915 pinctrl = devm_pinctrl_get_select(dev->dev, "soc_pwm0"); in intel_dsi_vbt_gpio_init()
917 drm_err(&dev_priv->drm, in intel_dsi_vbt_gpio_init()
925 intel_dsi->gpio_panel = devm_gpiod_get(dev->dev, "panel", flags); in intel_dsi_vbt_gpio_init()
926 if (IS_ERR(intel_dsi->gpio_panel)) { in intel_dsi_vbt_gpio_init()
927 drm_err(&dev_priv->drm, in intel_dsi_vbt_gpio_init()
929 intel_dsi->gpio_panel = NULL; in intel_dsi_vbt_gpio_init()
934 intel_dsi->gpio_backlight = in intel_dsi_vbt_gpio_init()
935 devm_gpiod_get(dev->dev, "backlight", flags); in intel_dsi_vbt_gpio_init()
936 if (IS_ERR(intel_dsi->gpio_backlight)) { in intel_dsi_vbt_gpio_init()
937 drm_err(&dev_priv->drm, in intel_dsi_vbt_gpio_init()
939 intel_dsi->gpio_backlight = NULL; in intel_dsi_vbt_gpio_init()