From patchwork Fri Apr 16 22:39:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 423446 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4CFDC43460 for ; Fri, 16 Apr 2021 22:41:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CD923613C7 for ; Fri, 16 Apr 2021 22:41:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234757AbhDPWll (ORCPT ); Fri, 16 Apr 2021 18:41:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234956AbhDPWlg (ORCPT ); Fri, 16 Apr 2021 18:41:36 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59BC9C061761 for ; Fri, 16 Apr 2021 15:41:11 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id j32so5361801pgm.6 for ; Fri, 16 Apr 2021 15:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1zzEPLt2L+BYGWWUtwKGlLBkITyompRv0awY1GtFc2I=; b=DQCL5ZFyphxZ1QO/SqxcuHkYpHsOlUFFWpTaJ0eym0do+pBr9pGhfLTwZy2gMZ/uR7 +MreGHioboXLpIZqUbUB9FCFiX/uQZIqhee9O860dSefs0U2PT+orYOO9IP5DOEkJeHc AQGVivLqSsI39MKq2eqThRePW/VGXG2IwwaqU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1zzEPLt2L+BYGWWUtwKGlLBkITyompRv0awY1GtFc2I=; b=Pge/kGR5qTobM2Y7sUGn2XU8/c/p2Iu4QT95K4qdH3w4lpp3fX2juz12p9MXMBMA7P KyBTzmiMa+6rnsjxooFN0Okzslqw2qUva0P0BHMTpppg7r3/w0y4MFChHIxD/PhQ9pxX pK8E4CMnpuI6BgAWVen40qzKNR9IWJaMjY2Pd/FSxp/AdAIywDkzNhNFT8cMc/arMz8l fLAXprsYEJj6kTcfhPR0j6hn+g5A1DI5NWYuSYMMn4h6fG5Mzss+hN+EhaiLn+gCL0k5 xVeZ2Wj463M/E8+gsUz0Q4vl+FJtlLIEJLJtKxNlXfKMLlSrbdZvSNLSS2JooeMJ3NZ3 Oo0A== X-Gm-Message-State: AOAM530/f90xv3mgUe/NxjNbRbMetkCzO5LBSPm0V12krnAGZEZgmwvL vEMrBCOGZT087VoD4bWsojhB9w== X-Google-Smtp-Source: ABdhPJyKtLU8yG3gP39Hbtv2xS0iZITkzY/NeuveTMuhb0Iwbz573n33UsWqv9Cv2jt5y7DXmSYwWQ== X-Received: by 2002:a65:590a:: with SMTP id f10mr1124558pgu.358.1618612870865; Fri, 16 Apr 2021 15:41:10 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:dc8a:c9d0:aa5b:5386]) by smtp.gmail.com with ESMTPSA id r6sm5633659pgp.64.2021.04.16.15.41.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 15:41:10 -0700 (PDT) From: Douglas Anderson To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Sam Ravnborg , Wolfram Sang Cc: Stephen Boyd , robdclark@chromium.org, Maarten Lankhorst , Stanislav Lisovskiy , Steev Klimaszewski , Bjorn Andersson , linux-arm-msm@vger.kernel.org, Linus W , Douglas Anderson , Daniel Vetter , David Airlie , Thierry Reding , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 16/27] drm/panel: panel-simple: Get rid of hacky HPD chicken-and-egg code Date: Fri, 16 Apr 2021 15:39:39 -0700 Message-Id: <20210416153909.v4.16.I40eeedc23459d1e3fc96fa6cdad775d88c6e706c@changeid> X-Mailer: git-send-email 2.31.1.368.gbe11c130af-goog In-Reply-To: <20210416223950.3586967-1-dianders@chromium.org> References: <20210416223950.3586967-1-dianders@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org When I added support for the hpd-gpio to simple-panel in commit 48834e6084f1 ("drm/panel-simple: Support hpd-gpios for delaying prepare()"), I added a special case to handle a circular dependency I was running into on the ti-sn65dsi86 bridge chip. On my board the hpd-gpio is actually provided by the bridge chip. That was causing some circular dependency problems that I had to work around by getting the hpd-gpio late. I've now reorganized the ti-sn65dsi86 bridge chip driver to be a collection of sub-drivers. Now the GPIO part can probe separately and that breaks the chain. Let's get rid of the old code to clean things up. Signed-off-by: Douglas Anderson Reviewed-by: Bjorn Andersson --- (no changes since v1) drivers/gpu/drm/panel/panel-simple.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 6b22872b3281..90a17ca79d06 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -366,8 +366,7 @@ static int panel_simple_unprepare(struct drm_panel *panel) return 0; } -static int panel_simple_get_hpd_gpio(struct device *dev, - struct panel_simple *p, bool from_probe) +static int panel_simple_get_hpd_gpio(struct device *dev, struct panel_simple *p) { int err; @@ -375,17 +374,10 @@ static int panel_simple_get_hpd_gpio(struct device *dev, if (IS_ERR(p->hpd_gpio)) { err = PTR_ERR(p->hpd_gpio); - /* - * If we're called from probe we won't consider '-EPROBE_DEFER' - * to be an error--we'll leave the error code in "hpd_gpio". - * When we try to use it we'll try again. This allows for - * circular dependencies where the component providing the - * hpd gpio needs the panel to init before probing. - */ - if (err != -EPROBE_DEFER || !from_probe) { + if (err != -EPROBE_DEFER) dev_err(dev, "failed to get 'hpd' GPIO: %d\n", err); - return err; - } + + return err; } return 0; @@ -416,12 +408,6 @@ static int panel_simple_prepare_once(struct panel_simple *p) msleep(delay); if (p->hpd_gpio) { - if (IS_ERR(p->hpd_gpio)) { - err = panel_simple_get_hpd_gpio(dev, p, false); - if (err) - goto error; - } - if (p->desc->delay.hpd_absent_delay) hpd_wait_us = p->desc->delay.hpd_absent_delay * 1000UL; else @@ -682,7 +668,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) panel->no_hpd = of_property_read_bool(dev->of_node, "no-hpd"); if (!panel->no_hpd) { - err = panel_simple_get_hpd_gpio(dev, panel, true); + err = panel_simple_get_hpd_gpio(dev, panel); if (err) return err; }