From patchwork Thu Jan 30 22:43:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vivek Kasireddy X-Patchwork-Id: 11358863 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D006E1398 for ; Thu, 30 Jan 2020 22:48:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B7A8120708 for ; Thu, 30 Jan 2020 22:48:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B7A8120708 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DEA9F6FA4B; Thu, 30 Jan 2020 22:48:13 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5975B6FA4B for ; Thu, 30 Jan 2020 22:48:12 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jan 2020 14:48:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,382,1574150400"; d="scan'208";a="428527266" Received: from orsmsx104.amr.corp.intel.com ([10.22.225.131]) by fmsmga005.fm.intel.com with ESMTP; 30 Jan 2020 14:48:11 -0800 Received: from orsmsx113.amr.corp.intel.com (10.22.240.9) by ORSMSX104.amr.corp.intel.com (10.22.225.131) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 30 Jan 2020 14:48:10 -0800 Received: from vkasired-desk2.fm.intel.com (10.22.254.139) by ORSMSX113.amr.corp.intel.com (10.22.240.9) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 30 Jan 2020 14:48:10 -0800 From: Vivek Kasireddy To: Date: Thu, 30 Jan 2020 14:43:23 -0800 Message-ID: <20200130224323.14434-1-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <87wo999qmu.fsf@intel.com> References: <87wo999qmu.fsf@intel.com> MIME-Version: 1.0 X-Originating-IP: [10.22.254.139] Subject: [Intel-gfx] [PATCH] drm/i915/hotplug: Use phy to get the hpd_pin instead of the port (v2) X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jani Nikula Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On some platforms such as Elkhart Lake, although we may use DDI D to drive a connector, we have to use PHY A (Combo Phy PORT A) to detect the hotplug interrupts as per the spec because there is no one-to-one mapping between DDIs and PHYs. Therefore, use the function intel_port_to_phy() which contains the logic for such mapping(s) to find the correct hpd_pin. This change should not affect other platforms as there is always a one-to-one mapping between DDIs and PHYs. v2: - Convert the case statements to use PHYs instead of PORTs (Jani) Cc: Jani Nikula Cc: Matt Roper Cc: José Roberto de Souza Signed-off-by: Vivek Kasireddy --- drivers/gpu/drm/i915/display/intel_hotplug.c | 24 +++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c index 042d98bae1ea..2bcfa4682511 100644 --- a/drivers/gpu/drm/i915/display/intel_hotplug.c +++ b/drivers/gpu/drm/i915/display/intel_hotplug.c @@ -89,29 +89,31 @@ enum hpd_pin intel_hpd_pin_default(struct drm_i915_private *dev_priv, enum port port) { - switch (port) { - case PORT_A: + enum phy phy = intel_port_to_phy(dev_priv, port); + + switch (phy) { + case PHY_A: return HPD_PORT_A; - case PORT_B: + case PHY_B: return HPD_PORT_B; - case PORT_C: + case PHY_C: return HPD_PORT_C; - case PORT_D: + case PHY_D: return HPD_PORT_D; - case PORT_E: + case PHY_E: return HPD_PORT_E; - case PORT_F: + case PHY_F: if (IS_CNL_WITH_PORT_F(dev_priv)) return HPD_PORT_E; return HPD_PORT_F; - case PORT_G: + case PHY_G: return HPD_PORT_G; - case PORT_H: + case PHY_H: return HPD_PORT_H; - case PORT_I: + case PHY_I: return HPD_PORT_I; default: - MISSING_CASE(port); + MISSING_CASE(phy); return HPD_NONE; } }