All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Deepak M <m.deepak@intel.com>, jani.nikula@intel.com
Subject: [PATCH 6/8] drm/i915/dsi: add support for sequence block v3 gpio for VLV
Date: Thu, 17 Mar 2016 17:04:44 +0200	[thread overview]
Message-ID: <4add47dfeeb9d5dfa450159fe5e62856b023a1ab.1458226863.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1458226863.git.jani.nikula@intel.com>
In-Reply-To: <cover.1458226863.git.jani.nikula@intel.com>

From: Deepak M <m.deepak@intel.com>

Currently all gpio indices we support (via the gpio table) fall in NC
anyway, but prepare for bigger indices.

[Rewritten by Jani, based on earlier work by Deepak.]

Signed-off-by: Deepak M <m.deepak@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
index 3c6275f85ae2..040ec5d6a7ac 100644
--- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
+++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
@@ -58,6 +58,10 @@ static inline struct vbt_panel *to_vbt_panel(struct drm_panel *panel)
 
 #define NS_KHZ_RATIO 1000000
 
+#define VLV_IOSF_MAX_GPIO_NUM_NC	26
+#define VLV_IOSF_MAX_GPIO_NUM_SC	128
+#define VLV_IOSF_MAX_GPIO_NUM		172
+
 #define VLV_GPIO_NC_0_HV_DDI0_HPD	0x4130
 #define VLV_GPIO_NC_1_HV_DDI0_DDC_SDA	0x4120
 #define VLV_GPIO_NC_2_HV_DDI0_DDC_SCL	0x4110
@@ -198,8 +202,16 @@ static void vlv_exec_gpio(struct drm_i915_private *dev_priv,
 	}
 
 	if (dev_priv->vbt.dsi.seq_version >= 3) {
-		DRM_DEBUG_KMS("GPIO element v3 not supported\n");
-		return;
+		if (gpio_index <= VLV_IOSF_MAX_GPIO_NUM_NC) {
+			port = IOSF_PORT_GPIO_NC;
+		} else if (gpio_index <= VLV_IOSF_MAX_GPIO_NUM_SC) {
+			port = IOSF_PORT_GPIO_SC;
+		} else if (gpio_index <= VLV_IOSF_MAX_GPIO_NUM) {
+			port = IOSF_PORT_GPIO_SUS;
+		} else {
+			DRM_DEBUG_KMS("invalid gpio index %u\n", gpio_index);
+			return;
+		}
 	} else if (dev_priv->vbt.dsi.seq_version == 2) {
 		if (gpio_source == 0) {
 			port = IOSF_PORT_GPIO_NC;
-- 
2.1.4

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

  parent reply	other threads:[~2016-03-17 15:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-17 15:04 [PATCH 0/8] drm/i915/dsi: improved gpio element support for vlv/chv Jani Nikula
2016-03-17 15:04 ` [PATCH 1/8] drm/i915/dsi: refer to gpio index instead of gpio to avoid confusion Jani Nikula
2016-03-17 15:04 ` [PATCH 2/8] drm/i915/dsi: add support for DSI sequence block v2 gpio element Jani Nikula
2016-03-17 15:12   ` Ville Syrjälä
2016-03-17 15:04 ` [PATCH 3/8] drm/i915/dsi: do not define VLV gpio pad registers separately Jani Nikula
2016-03-17 15:32   ` Ville Syrjälä
2016-03-17 15:04 ` [PATCH 4/8] drm/i915/dsi: abstract VLV gpio element execution to a separate function Jani Nikula
2016-03-17 15:04 ` [PATCH 5/8] drm/i915/dsi: clean up the VLV gpio table and definitions Jani Nikula
2016-03-17 15:04 ` Jani Nikula [this message]
2016-03-17 15:04 ` [PATCH 7/8] drm/i915/chv: add more IOSF port definitions Jani Nikula
2016-03-17 15:04 ` [PATCH 8/8] drm/i915/dsi: add support for gpio elements on CHV Jani Nikula
2016-03-18  7:27 ` ✗ Fi.CI.BAT: failure for drm/i915/dsi: improved gpio element support for vlv/chv 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=4add47dfeeb9d5dfa450159fe5e62856b023a1ab.1458226863.git.jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=m.deepak@intel.com \
    /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.