From patchwork Tue Jan 19 15:15:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kumar, Shobhit" X-Patchwork-Id: 8063331 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E6940BEEE5 for ; Tue, 19 Jan 2016 15:15:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 16CBF2026D for ; Tue, 19 Jan 2016 15:15:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 40D3B2021A for ; Tue, 19 Jan 2016 15:15:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A2EED6E7A3; Tue, 19 Jan 2016 07:15:19 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id B489A6E7A3 for ; Tue, 19 Jan 2016 07:15:18 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 19 Jan 2016 07:15:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,317,1449561600"; d="scan'208";a="863858356" Received: from shobhit-desk.iind.intel.com ([10.223.22.123]) by orsmga001.jf.intel.com with ESMTP; 19 Jan 2016 07:15:02 -0800 From: Shobhit Kumar To: intel-gfx@lists.freedesktop.org Date: Tue, 19 Jan 2016 20:45:00 +0530 Message-Id: <1453216500-12571-1-git-send-email-shobhit.kumar@intel.com> X-Mailer: git-send-email 1.9.1 Cc: jani.nikula@intel.com, Shobhit Kumar , bloften80@gmail.com Subject: [Intel-gfx] [PATCH] drm/i915: Retry few time if gpiod_get fails during intel_dsi_init X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP INTEL_SOC_PMIC is loading later than I915 failing the gpiod_get and pwm_get calls in i915. Add a retry to give time for the INTEL_SOC_PMIC to load. This was fine till now but broke in latest kernel. Maybe load time for the INTEL_SOC_PMIC has increased. Since the lookup tables for GPIO (panel enable) and PWM both are exported by same intel_soc_pmic driver, just retrying for the driver to load in intel_dsi_init is sufficient. By the time we come to setup_backlight, pwm would have been exported as well. Signed-off-by: Shobhit Kumar --- drivers/gpu/drm/i915/intel_dsi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c index 91cef35..e309ef6 100644 --- a/drivers/gpu/drm/i915/intel_dsi.c +++ b/drivers/gpu/drm/i915/intel_dsi.c @@ -1192,10 +1192,14 @@ void intel_dsi_init(struct drm_device *dev) * Panel control. */ if (dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC) { + int retry = 4; + do { intel_dsi->gpio_panel = gpiod_get(dev->dev, "panel", GPIOD_OUT_HIGH); + msleep(50); + } while (IS_ERR(intel_dsi->gpio_panel) && --retry); - if (IS_ERR(intel_dsi->gpio_panel)) { + if (!retry) { DRM_ERROR("Failed to own gpio for panel control\n"); intel_dsi->gpio_panel = NULL; }