Re: [v4] drm/i915/dsi: do not register gmbus if it was reserved for MIPI display

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all, could you please share your comments for the latest patch? Thanks!

Best regards,
Shawn

>
>Gmbus driver would setup all Intel i2c GMBuses. But DDC bus may configured as gpio and reserved for MIPI driver to control panel power on/off sequence.
>
>Using i2c tool to communicate to peripherals via i2c interface reversed for gmbus(DDC). There will be some high/low pulse appear on DDC SCL and SDA (might be host sent out i2c slave address). MIPI panel would be impacted due to unexpected signal then caused abnormal display or shut down issue.
>
>v2: gmbus driver should not add i2c adapter for DDC interface
>    if LFP display was configured to support MIPI panel.
>v3: fix sparse warning
>v4: before gmbus driver add/delete/access i2c adapter would
>    call intel_gmbus_is_valid_pin() to know target adapter
>    is available or not. Avoid to access unexisting adapter.
>    Driver should check DSI status and pin's availability in
>    intel_gmbus_is_valid_pin().
>
>Cc: Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>
>Cc: Vandita Kulkarni <vandita.kulkarni@xxxxxxxxx>
>Cc: Cooper Chiou <cooper.chiou@xxxxxxxxx>
>Cc: William Tseng <william.tseng@xxxxxxxxx>
>Signed-off-by: Lee Shawn C <shawn.c.lee@xxxxxxxxx>
>---
> drivers/gpu/drm/i915/display/intel_gmbus.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
>diff --git a/drivers/gpu/drm/i915/display/intel_gmbus.c b/drivers/gpu/drm/i915/display/intel_gmbus.c
>index ceb1bf8a8c3c..852e499e2e8c 100644
>--- a/drivers/gpu/drm/i915/display/intel_gmbus.c
>+++ b/drivers/gpu/drm/i915/display/intel_gmbus.c
>@@ -118,11 +118,29 @@ static const struct gmbus_pin *get_gmbus_pin(struct drm_i915_private *dev_priv,
> 		return &gmbus_pins[pin];
> }
> 
>+static bool intel_gmbus_ddc_reserve_for_mipi_dsi(struct drm_i915_private *dev_priv,
>+					     unsigned int pin)
>+{
>+	if (intel_bios_is_dsi_present(dev_priv, NULL)) {
>+		if (DISPLAY_VER(dev_priv) >= 11) {
>+			if ((pin == GMBUS_PIN_2_BXT && dev_priv->vbt.dsi.config->dual_link) ||
>+			     pin == GMBUS_PIN_1_BXT) {
>+				return true;
>+			}
>+		}
>+	}
>+
>+	return false;
>+}
>+
> bool intel_gmbus_is_valid_pin(struct drm_i915_private *dev_priv,
> 			      unsigned int pin)
> {
> 	unsigned int size;
> 
>+	if (intel_gmbus_ddc_reserve_for_mipi_dsi(dev_priv, pin))
>+		return false;
>+
> 	if (INTEL_PCH_TYPE(dev_priv) >= PCH_DG1)
> 		size = ARRAY_SIZE(gmbus_pins_dg1);
> 	else if (INTEL_PCH_TYPE(dev_priv) >= PCH_ICP)
>--
>2.17.1
>




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux