From patchwork Fri Apr 16 22:39:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 422717 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 6A151C433ED for ; Fri, 16 Apr 2021 22:41:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5CF22613C3 for ; Fri, 16 Apr 2021 22:41:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235113AbhDPWli (ORCPT ); Fri, 16 Apr 2021 18:41:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234839AbhDPWlg (ORCPT ); Fri, 16 Apr 2021 18:41:36 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EEADC06138E for ; Fri, 16 Apr 2021 15:41:08 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id h20so14738368plr.4 for ; Fri, 16 Apr 2021 15:41:08 -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=e0QEnKfzihSwkUCUDGgWB7m6oBMdGB/Jg6G+CQJIJ/k=; b=BJEXFVrJglXTtCKWO5BcKDAJ8HiyFKWqH+mvRCmMjCmnkd3DLzlWhTn1fdIg5HQv3S 3Gql/hN0ZaLFfrfDU/TNvKV68ACKKuWZz2aooKWej1qeZNp5/NZar2/du0JSb+CBRiAk G6z9GF+1B8SzhuORPXDFry43kuky8nLzbIT2E= 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=e0QEnKfzihSwkUCUDGgWB7m6oBMdGB/Jg6G+CQJIJ/k=; b=F7jTNOSv54a46YrcPMWEdv1z6KU1Q727rgzs7/jBGzLu7DKgn+DeMAjUpSJDkk97y7 lLWeiA+flEbA4LV6OVVi3w4Iv/t4HW/8ndDzP+fn8wAdIEWhodG1uXSqY6tEIWPcXgYz EYlLWdlkgBsOL2CGGAwxXpia+/OJz1zwBSlGECZiwiACCZVuTEDegp5824YLKxAuY40z 265a7ouOsZWJioPgSqzrAhVxIFKDbWlwmk8VxotkAUBeXvub2fRbAhcFyflaZD65TrYF kbn+/DBmlYz1unMD58SK7ji8JaucDVpvWADuuiZIUolePIT+luyA9mL7tUtgHdeoHu5N 2QKg== X-Gm-Message-State: AOAM531qdpGPSDI7Eo8FxQkDp20LUgAe7qpi+Y0Ac81XF5WwWqsGGmqe Hl7Q1itdT/8mMdlyYVFh0wjn9w== X-Google-Smtp-Source: ABdhPJxVcP4GeB0Q80asqybNMgUJp0GMle4/sAyPnAkbN5/yDiouXth2EZvymAtPSU+eTKLwJl/oew== X-Received: by 2002:a17:90a:4381:: with SMTP id r1mr12486696pjg.214.1618612868578; Fri, 16 Apr 2021 15:41:08 -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.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 15:41:08 -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 , Robert Foss , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 14/27] drm/bridge: ti-sn65dsi86: Move all the chip-related init to the start Date: Fri, 16 Apr 2021 15:39:37 -0700 Message-Id: <20210416153909.v4.14.Ide8ba40feb2e43bc98a11edbb08d696d62dcd83e@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 This is just code motion of the probe routine to move all the things that are for the "whole chip" (instead of the GPIO parts or the MIPI-to-eDP parts) together at the start of probe. This is in preparation for breaking the driver into sub-drivers. Since we're using devm for all of the "whole chip" stuff this is actually quite easy now. Signed-off-by: Douglas Anderson Reviewed-by: Bjorn Andersson --- (no changes since v1) drivers/gpu/drm/bridge/ti-sn65dsi86.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index 53f1f7b3022f..57bc489a0412 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -1253,12 +1253,6 @@ static int ti_sn65dsi86_probe(struct i2c_client *client, return PTR_ERR(pdata->regmap); } - ret = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &pdata->panel, NULL); - if (ret) { - DRM_ERROR("could not find any panel node\n"); - return ret; - } - pdata->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); if (IS_ERR(pdata->enable_gpio)) { DRM_ERROR("failed to get enable gpio from DT\n"); @@ -1266,8 +1260,6 @@ static int ti_sn65dsi86_probe(struct i2c_client *client, return ret; } - ti_sn_bridge_parse_lanes(pdata, dev->of_node); - ret = ti_sn65dsi86_parse_regulators(pdata); if (ret) { DRM_ERROR("failed to parse regulators\n"); @@ -1278,12 +1270,22 @@ static int ti_sn65dsi86_probe(struct i2c_client *client, if (IS_ERR(pdata->refclk)) return PTR_ERR(pdata->refclk); - ret = ti_sn_bridge_parse_dsi_host(pdata); + pm_runtime_enable(dev); + ret = devm_add_action_or_reset(dev, ti_sn65dsi86_runtime_disable, dev); if (ret) return ret; - pm_runtime_enable(dev); - ret = devm_add_action_or_reset(dev, ti_sn65dsi86_runtime_disable, dev); + ti_sn65dsi86_debugfs_init(pdata); + + ret = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &pdata->panel, NULL); + if (ret) { + DRM_ERROR("could not find any panel node\n"); + return ret; + } + + ti_sn_bridge_parse_lanes(pdata, dev->of_node); + + ret = ti_sn_bridge_parse_dsi_host(pdata); if (ret) return ret; @@ -1301,8 +1303,6 @@ static int ti_sn65dsi86_probe(struct i2c_client *client, drm_bridge_add(&pdata->bridge); - ti_sn65dsi86_debugfs_init(pdata); - return 0; }