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: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/bxt: add bxt dsi gpio element support
Date: Thu, 7 Apr 2016 15:21:55 +0300	[thread overview]
Message-ID: <20160407122155.GD4329@intel.com> (raw)
In-Reply-To: <1460029672-3099-1-git-send-email-jani.nikula@intel.com>

On Thu, Apr 07, 2016 at 02:47:52PM +0300, Jani Nikula wrote:
> Request the GPIO by index through the consumer API. For now, use a quick
> hack to store the already requested ones, simply because I have no idea
> whether this actually works or not, and I have no way to test it.

Would be cool if someone dumped out the relevant ACPI table(s) on
a machine that needs this stuff, so that we can see if things look
sane on that level.

> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 28 +++++++++++++++++++++++++++-
>  1 file changed, 27 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
> index 5e2c31d9a748..7e6a21c05c6a 100644
> --- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
> +++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
> @@ -29,6 +29,7 @@
>  #include <drm/drm_edid.h>
>  #include <drm/i915_drm.h>
>  #include <drm/drm_panel.h>
> +#include <linux/gpio.h>
>  #include <linux/slab.h>
>  #include <video/mipi_display.h>
>  #include <asm/intel-mid.h>
> @@ -295,6 +296,31 @@ static void chv_exec_gpio(struct drm_i915_private *dev_priv,
>  	mutex_unlock(&dev_priv->sb_lock);
>  }
>  
> +static void bxt_exec_gpio(struct drm_i915_private *dev_priv,
> +			  u8 gpio_source, u8 gpio_index, bool value)
> +{
> +	/* XXX: this table is a quick ugly hack. */
> +	static struct gpio_desc *bxt_gpio_table[U8_MAX + 1];
> +	struct gpio_desc *gpio_desc = bxt_gpio_table[gpio_index];
> +
> +	if (!gpio_desc) {
> +		gpio_desc = devm_gpiod_get_index(dev_priv->dev->dev,
> +						 NULL, gpio_index,
> +						 value ? GPIOD_OUT_LOW :
> +						 GPIOD_OUT_HIGH);
> +
> +		if (IS_ERR_OR_NULL(gpio_desc)) {
> +			DRM_ERROR("GPIO index %u request failed (%ld)\n",
> +				  gpio_index, PTR_ERR(gpio_desc));
> +			return;
> +		}
> +
> +		bxt_gpio_table[gpio_index] = gpio_desc;
> +	}
> +
> +	gpiod_set_value(gpio_desc, value);
> +}
> +
>  static const u8 *mipi_exec_gpio(struct intel_dsi *intel_dsi, const u8 *data)
>  {
>  	struct drm_device *dev = intel_dsi->base.base.dev;
> @@ -321,7 +347,7 @@ static const u8 *mipi_exec_gpio(struct intel_dsi *intel_dsi, const u8 *data)
>  	else if (IS_CHERRYVIEW(dev_priv))
>  		chv_exec_gpio(dev_priv, gpio_source, gpio_index, value);
>  	else
> -		DRM_DEBUG_KMS("GPIO element not supported on this platform\n");
> +		bxt_exec_gpio(dev_priv, gpio_source, gpio_index, value);
>  
>  	return data;
>  }
> -- 
> 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-07 12:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-05 19:30 [PATCH v3 0/6] drm/i915/dsi: improved gpio element support for vlv/chv/bxt Jani Nikula
2016-04-05 19:30 ` [PATCH v3 1/6] drm/i915/dsi: clean up vlv gpio table and definitions Jani Nikula
2016-04-07 12:59   ` Ville Syrjälä
2016-04-05 19:30 ` [PATCH v3 2/6] drm/i915/dsi: abstract VLV gpio element execution to a separate function Jani Nikula
2016-04-07 13:00   ` Ville Syrjälä
2016-04-05 19:30 ` [PATCH v3 3/6] drm/i915/dsi: use a temp variable for referencing the gpio table Jani Nikula
2016-04-07 13:01   ` Ville Syrjälä
2016-04-07 13:39     ` Jani Nikula
2016-04-05 19:30 ` [PATCH v3 4/6] drm/i915/dsi: add support for sequence block v3 gpio for VLV Jani Nikula
2016-04-07 13:04   ` Ville Syrjälä
2016-04-07 13:14     ` Jani Nikula
2016-04-05 19:30 ` [PATCH v3 5/6] drm/i915/dsi: add support for gpio elements on CHV Jani Nikula
2016-04-07 13:16   ` Ville Syrjälä
2016-04-05 19:30 ` [PATCH v3 6/6] drm/i915/bxt: add bxt dsi gpio element support Jani Nikula
2016-04-07 11:47   ` [PATCH] " Jani Nikula
2016-04-07 12:21     ` Ville Syrjälä [this message]
2016-04-07 12:55       ` Jani Nikula
2016-04-06  7:27 ` ✗ Fi.CI.BAT: failure for drm/i915/dsi: improved gpio element support for vlv/chv/bxt (rev2) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2016-11-15 15:44 [PATCH] drm/i915/bxt: add bxt dsi gpio element support Jani Nikula

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=20160407122155.GD4329@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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).