lkml.org 
[lkml]   [2012]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 02/10 v2] drm/i915/intel_i2c: assign HDMI port D to pin pair 6
    Date
    According to i915 documentation [1], "Port D" (DP/HDMI Port D) is
    actually gmbus pin pair 6 (gmbus0.2:0 == 110b GPIOF), not 7 (111b).
    Pin pair 7 is a reserved pair.

    [1] Documentation for [DevSNB+] and [DevIBX], as found on
    http://intellinuxgraphics.org

    Note: the "reserved" and "disabled" pairs do not actually map to a
    physical pair of pins, nor GPIO regs and shouldn't be initialized or used.
    Fixing this is left for a later patch.

    This bug has not been noticed for two reasons:
    1) "gmbus" mode is currently disabled - all transfers are actually using
    "bit-bang" mode which uses the GPIO port 5 (the "HDMI/DPD CTLDATA/CLK"
    pair), at register 0x5024 (defined as GPIOF i915_reg.h).
    Since this is the correct pair of pins for HDMI1, transfers succeed.

    2) Even if gmbus mode is re-enabled, the first attempted transaction
    will fail because it tries to use the wrong ("Reserved") pin pair.
    However, the driver immediately falls back again to the bit-bang
    method, which correctly uses GPIOF, so again, transfers succeed.

    However, if gmbus mode is re-enabled and the GPIO fall-back mode is
    disabled, then reading an attached monitor's EDID fail.

    Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
    ---
    drivers/gpu/drm/i915/i915_reg.h | 6 +++---
    drivers/gpu/drm/i915/intel_i2c.c | 6 +++---
    2 files changed, 6 insertions(+), 6 deletions(-)

    diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
    index 03c53fc..56af0df 100644
    --- a/drivers/gpu/drm/i915/i915_reg.h
    +++ b/drivers/gpu/drm/i915/i915_reg.h
    @@ -697,9 +697,9 @@
    #define GMBUS_PORT_PANEL 3
    #define GMBUS_PORT_DPC 4 /* HDMIC */
    #define GMBUS_PORT_DPB 5 /* SDVO, HDMIB */
    - /* 6 reserved */
    -#define GMBUS_PORT_DPD 7 /* HDMID */
    -#define GMBUS_NUM_PORTS 8
    +#define GMBUS_PORT_DPD 6 /* HDMID */
    +#define GMBUS_PORT_RESERVED 7 /* 7 reserved */
    +#define GMBUS_NUM_PORTS 8
    #define GMBUS1 0x5104 /* command/status */
    #define GMBUS_SW_CLR_INT (1<<31)
    #define GMBUS_SW_RDY (1<<30)
    diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
    index 5e413c4..1135e3e 100644
    --- a/drivers/gpu/drm/i915/intel_i2c.c
    +++ b/drivers/gpu/drm/i915/intel_i2c.c
    @@ -157,8 +157,8 @@ intel_gpio_create(struct drm_i915_private *dev_priv, u32 pin)
    GPIOC,
    GPIOD,
    GPIOE,
    - 0,
    GPIOF,
    + 0,
    };
    struct intel_gpio *gpio;

    @@ -175,7 +175,7 @@ intel_gpio_create(struct drm_i915_private *dev_priv, u32 pin)
    gpio->dev_priv = dev_priv;

    snprintf(gpio->adapter.name, sizeof(gpio->adapter.name),
    - "i915 GPIO%c", "?BACDE?F"[pin]);
    + "i915 GPIO%c", "?BACDEF?"[pin]);
    gpio->adapter.owner = THIS_MODULE;
    gpio->adapter.algo_data = &gpio->algo;
    gpio->adapter.dev.parent = &dev_priv->dev->pdev->dev;
    @@ -376,8 +376,8 @@ int intel_setup_gmbus(struct drm_device *dev)
    "panel",
    "dpc",
    "dpb",
    - "reserved",
    "dpd",
    + "reserved",
    };
    struct drm_i915_private *dev_priv = dev->dev_private;
    int ret, i;
    --
    1.7.7.3


    \
     
     \ /
      Last update: 2012-03-09 19:57    [W:0.024 / U:59.856 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site