Commit b13d8e28 authored by Jani Nikula's avatar Jani Nikula

drm/i915/dsi: use a temp variable for referencing the gpio table

The shorthand is easier. Also change the struct name. No functional
changes.
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/6572c108424a67b02367ea69cbbe00a03af9b958.1459884518.git.jani.nikula@intel.com
parent 515d07de
...@@ -75,12 +75,12 @@ static inline struct vbt_panel *to_vbt_panel(struct drm_panel *panel) ...@@ -75,12 +75,12 @@ static inline struct vbt_panel *to_vbt_panel(struct drm_panel *panel)
#define VLV_GPIO_PCONF0(base_offset) (base_offset) #define VLV_GPIO_PCONF0(base_offset) (base_offset)
#define VLV_GPIO_PAD_VAL(base_offset) ((base_offset) + 8) #define VLV_GPIO_PAD_VAL(base_offset) ((base_offset) + 8)
struct gpio_table { struct gpio_map {
u16 base_offset; u16 base_offset;
bool init; bool init;
}; };
static struct gpio_table vlv_gpio_table[] = { static struct gpio_map vlv_gpio_table[] = {
{ VLV_GPIO_NC_0_HV_DDI0_HPD }, { VLV_GPIO_NC_0_HV_DDI0_HPD },
{ VLV_GPIO_NC_1_HV_DDI0_DDC_SDA }, { VLV_GPIO_NC_1_HV_DDI0_DDC_SDA },
{ VLV_GPIO_NC_2_HV_DDI0_DDC_SCL }, { VLV_GPIO_NC_2_HV_DDI0_DDC_SCL },
...@@ -190,6 +190,7 @@ static const u8 *mipi_exec_delay(struct intel_dsi *intel_dsi, const u8 *data) ...@@ -190,6 +190,7 @@ static const u8 *mipi_exec_delay(struct intel_dsi *intel_dsi, const u8 *data)
static void vlv_exec_gpio(struct drm_i915_private *dev_priv, static void vlv_exec_gpio(struct drm_i915_private *dev_priv,
u8 gpio_source, u8 gpio_index, bool value) u8 gpio_source, u8 gpio_index, bool value)
{ {
struct gpio_map *map;
u16 pconf0, padval; u16 pconf0, padval;
u32 tmp; u32 tmp;
u8 port; u8 port;
...@@ -199,6 +200,8 @@ static void vlv_exec_gpio(struct drm_i915_private *dev_priv, ...@@ -199,6 +200,8 @@ static void vlv_exec_gpio(struct drm_i915_private *dev_priv,
return; return;
} }
map = &vlv_gpio_table[gpio_index];
if (dev_priv->vbt.dsi.seq_version >= 3) { if (dev_priv->vbt.dsi.seq_version >= 3) {
DRM_DEBUG_KMS("GPIO element v3 not supported\n"); DRM_DEBUG_KMS("GPIO element v3 not supported\n");
return; return;
...@@ -213,14 +216,14 @@ static void vlv_exec_gpio(struct drm_i915_private *dev_priv, ...@@ -213,14 +216,14 @@ static void vlv_exec_gpio(struct drm_i915_private *dev_priv,
} }
} }
pconf0 = VLV_GPIO_PCONF0(vlv_gpio_table[gpio_index].base_offset); pconf0 = VLV_GPIO_PCONF0(map->base_offset);
padval = VLV_GPIO_PAD_VAL(vlv_gpio_table[gpio_index].base_offset); padval = VLV_GPIO_PAD_VAL(map->base_offset);
mutex_lock(&dev_priv->sb_lock); mutex_lock(&dev_priv->sb_lock);
if (!vlv_gpio_table[gpio_index].init) { if (!map->init) {
/* FIXME: remove constant below */ /* FIXME: remove constant below */
vlv_iosf_sb_write(dev_priv, port, pconf0, 0x2000CC00); vlv_iosf_sb_write(dev_priv, port, pconf0, 0x2000CC00);
vlv_gpio_table[gpio_index].init = true; map->init = true;
} }
tmp = 0x4 | value; tmp = 0x4 | value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment