All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shashank Sharma <shashank.sharma@intel.com>
To: intel-gfx@lists.freedesktop.org, daniel.vetter@intel.com
Cc: akashdeep.sharma@inte.com
Subject: [PATCH 7/7] drm/i915: Add lspcon hpd handler
Date: Tue, 22 Mar 2016 19:55:08 +0530	[thread overview]
Message-ID: <1458656708-31228-8-git-send-email-shashank.sharma@intel.com> (raw)
In-Reply-To: <1458656708-31228-1-git-send-email-shashank.sharma@intel.com>

This patch adds a new hpd handler for lspcon.
As lspcon has its own way of reading EDID and detecting
the device, it wont be efficient to use the existing hpd
functions to handle the hot_plug scenarios. This new function
reads the EDID and checks the status of the sink device.

Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
---
 drivers/gpu/drm/i915/intel_lspcon.c | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_lspcon.c b/drivers/gpu/drm/i915/intel_lspcon.c
index 6ef320b..0c064b9 100644
--- a/drivers/gpu/drm/i915/intel_lspcon.c
+++ b/drivers/gpu/drm/i915/intel_lspcon.c
@@ -278,6 +278,38 @@ bool lspcon_device_init(struct intel_lspcon *lspcon)
 	return true;
 }
 
+enum irqreturn
+lspcon_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
+{
+	struct drm_device *dev = intel_dig_port->base.base.dev;
+	struct intel_encoder *intel_encoder = &intel_dig_port->base;
+	struct intel_connector *intel_connector;
+	bool changed = false;
+
+	mutex_lock(&dev->mode_config.mutex);
+	if (intel_encoder->hot_plug)
+		intel_encoder->hot_plug(intel_encoder);
+
+	for_each_intel_connector(dev, intel_connector) {
+		if (intel_connector->encoder == intel_encoder) {
+			struct drm_connector *connector =
+				&intel_connector->base;
+
+			DRM_DEBUG_DRIVER("Hptplug: Connector %s (pin %i).\n",
+				connector->name, intel_encoder->hpd_pin);
+			if (intel_hpd_irq_event(dev, connector))
+				changed = true;
+		}
+	}
+	mutex_unlock(&dev->mode_config.mutex);
+
+	if (changed) {
+		DRM_DEBUG_DRIVER("Sending event for change\n");
+		drm_kms_helper_hotplug_event(dev);
+	}
+	return IRQ_HANDLED;
+}
+
 static int lspcon_get_edid_over_aux(void *data,
 	u8 *buf, unsigned int block, size_t len)
 {
@@ -516,6 +548,9 @@ void intel_lspcon_init_connector(struct intel_digital_port *intel_dig_port)
 	intel_connector->get_hw_state = intel_ddi_connector_get_hw_state;
 	i915_debugfs_connector_add(connector);
 
+	/* HPD handler */
+	intel_dig_port->hpd_pulse = lspcon_hpd_pulse;
+
 	/* init DP */
 	if (intel_dp_init_minimum(intel_dig_port, intel_connector)) {
 		DRM_ERROR("DP init for LSPCON failed\n");
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-03-22 14:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-22 14:25 [PATCH 0/7] Add lspcon support Shashank Sharma
2016-03-22 14:25 ` [PATCH 1/7] drm/i915: add lspcon vbt bit parsing Shashank Sharma
2016-03-22 15:54   ` Jani Nikula
2016-03-22 16:50     ` Sharma, Shashank
2016-03-22 17:05       ` Ville Syrjälä
2016-03-22 17:10         ` Sharma, Shashank
2016-03-22 14:25 ` [PATCH 2/7] drm/i915: Add lspcon data structures Shashank Sharma
2016-03-22 14:25 ` [PATCH 3/7] drm/i915: Add new lspcon file Shashank Sharma
2016-03-22 14:25 ` [PATCH 4/7] drm/i915: Add and initialize lspcon connector Shashank Sharma
2016-03-22 14:25 ` [PATCH 5/7] drm/i915: Add and register lspcon connector functions Shashank Sharma
2016-03-22 14:25 ` [PATCH 6/7] drm/i915: Add lspcon core functions Shashank Sharma
2016-03-22 14:25 ` Shashank Sharma [this message]
2016-03-22 16:20 ` [PATCH 0/7] Add lspcon support Ville Syrjälä
2016-03-22 16:47   ` Sharma, Shashank
2016-03-23  9:03     ` Daniel Vetter
2016-03-23  9:12       ` Sharma, Shashank
2016-03-25 16:02       ` Sharma, Shashank
2016-03-22 16:32 ` ✗ Fi.CI.BAT: warning for " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1458656708-31228-8-git-send-email-shashank.sharma@intel.com \
    --to=shashank.sharma@intel.com \
    --cc=akashdeep.sharma@inte.com \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.