intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: Deepak M <m.deepak@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 2/9] drm/i915/dsi: add support for DSI sequence block v2 gpio element
Date: Mon, 4 Apr 2016 19:19:02 +0300	[thread overview]
Message-ID: <20160404161902.GK4329@intel.com> (raw)
In-Reply-To: <87152feec8f921dc82502af1b29c0956b0d360bb.1458299160.git.jani.nikula@intel.com>

On Fri, Mar 18, 2016 at 01:11:10PM +0200, Jani Nikula wrote:
> In sequence block v2, and only in v2, the gpio source (i.e. IOSF port)
> is specified separately.
> 
> v2: initialize gpio_source to 0 and handle v1 and v2 in the same branch
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 22 ++++++++++++++++++----
>  1 file changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
> index f687b2e9d8ca..af1a47b5224f 100644
> --- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
> +++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
> @@ -198,7 +198,7 @@ static const u8 *mipi_exec_delay(struct intel_dsi *intel_dsi, const u8 *data)
>  
>  static const u8 *mipi_exec_gpio(struct intel_dsi *intel_dsi, const u8 *data)
>  {
> -	u8 gpio_index, action;
> +	u8 gpio_source, gpio_index, action, port;
>  	u16 function, pad;
>  	u32 val;
>  	struct drm_device *dev = intel_dsi->base.base.dev;
> @@ -209,6 +209,12 @@ static const u8 *mipi_exec_gpio(struct intel_dsi *intel_dsi, const u8 *data)
>  
>  	gpio_index = *data++;
>  
> +	/* gpio source in sequence v2 only */
> +	if (dev_priv->vbt.dsi.seq_version == 2)
> +		gpio_source = (*data >> 1) & 3;
> +	else
> +		gpio_source = 0;
> +
>  	/* pull up/down */
>  	action = *data++ & 1;
>  
> @@ -225,6 +231,15 @@ static const u8 *mipi_exec_gpio(struct intel_dsi *intel_dsi, const u8 *data)
>  	if (dev_priv->vbt.dsi.seq_version >= 3) {
>  		DRM_DEBUG_KMS("GPIO element v3 not supported\n");
>  		goto out;
> +	} else {
> +		if (gpio_source == 0) {
> +			port = IOSF_PORT_GPIO_NC;
> +		} else if (gpio_source == 1) {
> +			port = IOSF_PORT_GPIO_SC;
> +		} else {
> +			DRM_DEBUG_KMS("unknown gpio source %u\n", gpio_source);
> +			goto out;
> +		}
>  	}
>  
>  	function = gtable[gpio_index].function_reg;
> @@ -234,15 +249,14 @@ static const u8 *mipi_exec_gpio(struct intel_dsi *intel_dsi, const u8 *data)
>  	if (!gtable[gpio_index].init) {
>  		/* program the function */
>  		/* FIXME: remove constant below */
> -		vlv_iosf_sb_write(dev_priv, IOSF_PORT_GPIO_NC, function,
> -				  0x2000CC00);
> +		vlv_iosf_sb_write(dev_priv, port, function, 0x2000CC00);
>  		gtable[gpio_index].init = 1;
>  	}
>  
>  	val = 0x4 | action;
>  
>  	/* pull up/down */
> -	vlv_iosf_sb_write(dev_priv, IOSF_PORT_GPIO_NC, pad, val);
> +	vlv_iosf_sb_write(dev_priv, port, pad, val);
>  	mutex_unlock(&dev_priv->sb_lock);
>  
>  out:
> -- 
> 2.1.4

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-04-04 16:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 11:11 [PATCH v2 0/9] drm/i915/dsi: improved gpio element support for vlv/chv/bxt Jani Nikula
2016-03-18 11:11 ` [PATCH v2 1/9] drm/i915/dsi: refer to gpio index instead of gpio to avoid confusion Jani Nikula
2016-03-24 11:57   ` Mika Kahola
2016-04-01 11:53     ` Jani Nikula
2016-03-18 11:11 ` [PATCH v2 2/9] drm/i915/dsi: add support for DSI sequence block v2 gpio element Jani Nikula
2016-04-04 16:19   ` Ville Syrjälä [this message]
2016-04-05  7:33     ` Jani Nikula
2016-03-18 11:11 ` [PATCH v2 3/9] drm/i915/dsi: clean up vlv gpio table and definitions Jani Nikula
2016-04-04 17:07   ` Ville Syrjälä
2016-03-18 11:11 ` [PATCH v2 4/9] drm/i915/dsi: add gpio indexes to the gpio table Jani Nikula
2016-04-04 17:37   ` Ville Syrjälä
2016-03-18 11:11 ` [PATCH v2 5/9] drm/i915/dsi: abstract VLV gpio element execution to a separate function Jani Nikula
2016-03-18 11:11 ` [PATCH v2 6/9] drm/i915/dsi: add support for sequence block v3 gpio for VLV Jani Nikula
2016-03-18 11:11 ` [PATCH v2 7/9] drm/i915/chv: add more IOSF port definitions Jani Nikula
2016-04-04 17:43   ` Ville Syrjälä
2016-04-05  7:34     ` Jani Nikula
2016-03-18 11:11 ` [PATCH v2 8/9] drm/i915/dsi: add support for gpio elements on CHV Jani Nikula
2016-04-04 18:11   ` Ville Syrjälä
2016-03-18 11:11 ` [PATCH v2 9/9] drm/i915/bxt: add bxt dsi gpio element support Jani Nikula
2016-03-23 10:55   ` Mika Kahola
2016-03-23 11:19     ` Jani Nikula
2016-04-04 17:46   ` Ville Syrjälä
2016-03-21  8:52 ` ✗ Fi.CI.BAT: warning for drm/i915/dsi: improved gpio element support for vlv/chv/bxt 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=20160404161902.GK4329@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).