• Shashank Sharma's avatar
    drm: Helper for lspcon in drm_dp_dual_mode · 056996b9
    Shashank Sharma authored
    This patch adds lspcon support in dp_dual_mode helper.
    lspcon is essentially a dp->hdmi dongle with dual personality.
    
    LS mode: It works as a passive dongle, by level shifting DP++
    signals to HDMI signals, in LS mode.
    PCON mode: It works as a protocol converter active dongle
    in pcon mode, by converting DP++ outputs to HDMI 2.0 outputs.
    
    This patch adds support for lspcon detection and mode set
    switch operations, as a dp dual mode dongle.
    
    v2: Addressed review comments from Ville
    - add adaptor id for lspcon devices (0x08), use it to identify lspcon
    - change function names
      old: drm_lspcon_get_current_mode/drm_lspcon_change_mode
      new: drm_lspcon_get_mode/drm_lspcon_set_mode
    - change drm_lspcon_get_mode type to int, to match
      drm_dp_dual_mode_get_tmds_output
    - change 'err' to 'ret' to match the rest of the functions
    - remove pointless typecasting during call to dual_mode_read
    - fix the but while setting value of data, while writing lspcon mode
    - fix indentation
    - change mdelay(10) -> msleep(10)
    - return ETIMEDOUT instead of EFAULT, when lspcon mode change times out
    - Add an empty line to separate std regs macros and lspcon regs macros
      Indent bit definition
    
    v3: Addressed review comments from Rodrigo
    - change macro name from DP_DUAL_MODE_TYPE_LSPCON to
      DP_DUAL_MODE_TYPE_HAS_DPCD for better readability
    - change macro name from DP_DUAL_MODE_LSPCON_MODE_PCON to
      DP_DUAL_MODE_LSPCON_MODE_PCON for better readability
    - add comment for MCA specific offsets like 0x40 and 0x41
    - remove DP_DUAL_MODE_REV_TYPE2 check while checking lspcon adapter id
    
    v4: Addressed review comments from Ville
    - Fixed indentation at few places
    - s/current_mode/mode
    - s/reqd_mode/mode
    - remove unnecessary void* cast
    - remove drm_edid.h from includes
    - Add a comment for _HAS_DPCD
    - Fix enum description, for lspcon_mode.
    
    v5: Rebase
    v6: Rebase
    Signed-off-by: default avatarShashank Sharma <shashank.sharma@intel.com>
    Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
    Acked-by: default avatarDave Airlie <airlied@gmail.com>
    Acked-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/1476720277-16298-1-git-send-email-shashank.sharma@intel.com
    056996b9
drm_dp_dual_mode_helper.c 13.1 KB