From patchwork Sun Feb 14 19:40:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12087419 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=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 6618AC433DB for ; Sun, 14 Feb 2021 19:42:59 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 28FC564DE0 for ; Sun, 14 Feb 2021 19:42:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 28FC564DE0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EYFm3Kytem6jw4MMyd1mwlRfN20VpZcEes+KRnASj8Y=; b=bB1Ryftn7ofJnFRCz1UmYVkfz T05ZcV3/4l/DFCWZYdSBkIzIkVYr4tSDa/7sFl8YhNVlWGm0fEyzcmV3B8g4r8vzrcd+gap4DZqYC R0sHju4l5kPNubBSkr07L0nneizRfYhqCs3QktzL9Z+0yZRyGwBX4i8Wy2Elag/RONsS4B15hWAuX YWj7YfHbdqojhGUjzfpq3AvOJrWP/2dYB3PZYh6LXp9Z+AJCzUN+vZMIzYZdjlZDsPDMuRl8CJLsP 9CMrVdP76X6et33ZUKhArWaPyZc/blq0Id/+7TCHEEJug5dyRc574IKEA3+7+GvhhUbojfQy/Y9pr abza4McIQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBNHC-0003y9-Ka; Sun, 14 Feb 2021 19:41:50 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBNGz-0003u7-Cv for linux-arm-kernel@lists.infradead.org; Sun, 14 Feb 2021 19:41:40 +0000 Received: by mail-pj1-x1034.google.com with SMTP id gb24so2482594pjb.4 for ; Sun, 14 Feb 2021 11:41:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SRxs/aOjY1GsbWu/T3aB0+EANdf6JlXR2K+G27uoYio=; b=lR/8/4IFFoTMpCeL7fiEaAelu4F/iUPDfjwLukR0qPIqJVMN0UQICGWjJdI/ISNDZ0 mwO0IcLS/PQ+cfrs3T+K0QEgmQjPMAacO0StWVDksWF7BGvK+kfP5qYZBPNnWn/45Joj zSfCKXtsvHFxb7rfHwyUBpOYvVvHxXjqv01dY= 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=SRxs/aOjY1GsbWu/T3aB0+EANdf6JlXR2K+G27uoYio=; b=sZNhF93XX2MmBmIKlZUl5TDF4hiToM0d5hGPU4eOi+R8CD6MMCxFRlU5L9BuD3AAUp 6GPkuzad5wzLafGmJ3qGeZnyNFTAn0D+BKcV2aBAiq0UXp8tDYhxeX8N8iO2gdgvXTgk 0zcb++A/D7oNz+uJ7T/sqTn6ZywZ8Dr2oIRIDxTcurLUNF7Q/pwKvtleLflGXgmSkve6 +LA2XPeYs/xSyQS7Z2lx0UjxI+lDMdfZOwwW1WbYpGHmsNkHTX3ahJ0CVusY0ESZOpYY IiJRiYz8WxOJ3FioDVn8CMUUdAO8G7UwJYQWWWCyh4FlaMgizMiA+xY3zdlti7dM9iKK ZJDA== X-Gm-Message-State: AOAM533g0Dw8haZ2eggzagH2T5CcLXfpHOvNXkjVKgqnRbzp3Nc9YavY Dh+4qgWcR39+SkeO3hE/qYrzzQ== X-Google-Smtp-Source: ABdhPJx7aJtbIv9KAW+oJiidaq/ehl3ZHXkulFd2VYinMmQZVn+HjeAEbrtWl9HLM99JJZ6vYfsw2g== X-Received: by 2002:a17:902:7c83:b029:e2:b157:e25c with SMTP id y3-20020a1709027c83b02900e2b157e25cmr12216978pll.32.1613331695308; Sun, 14 Feb 2021 11:41:35 -0800 (PST) Received: from ub-XPS-13-9350.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id 125sm15129247pfu.7.2021.02.14.11.41.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Feb 2021 11:41:34 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Laurent Pinchart Subject: [PATCH v3 4/7] drm: sun4i: dsi: Separate code for bridge pre_enable Date: Mon, 15 Feb 2021 01:10:59 +0530 Message-Id: <20210214194102.126146-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210214194102.126146-1-jagan@amarulasolutions.com> References: <20210214194102.126146-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210214_144137_542300_FDCDBD15 X-CRM114-Status: GOOD ( 15.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki , linux-amarula@amarulasolutions.com, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The existing driver has an enablement code for initializing clock, reset, PHY, DSI timings, and finally switching to HS mode. Move the clock, reset. PHY and DSI timings code into bridge pre_enable and keep HS mode switch in enable. As the driver supports fully enabled bridge functionalities, this new enablement code separation will help to initialize the host and slave bridge pre_enable, enable functions properly. Signed-off-by: Jagan Teki --- Changes for v3: - new patch drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 6f3c5330a468..3cdc14daf25c 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -714,7 +714,7 @@ static int sun6i_dsi_start(struct sun6i_dsi *dsi, return 0; } -static void sun6i_dsi_bridge_enable(struct drm_bridge *bridge) +static void sun6i_dsi_bridge_pre_enable(struct drm_bridge *bridge) { struct drm_display_mode *mode = &bridge->encoder->crtc->state->adjusted_mode; struct sun6i_dsi *dsi = bridge_to_sun6i_dsi(bridge); @@ -775,6 +775,11 @@ static void sun6i_dsi_bridge_enable(struct drm_bridge *bridge) if (dsi->panel_bridge) dsi->panel_bridge->funcs->pre_enable(dsi->panel_bridge); +} + +static void sun6i_dsi_bridge_enable(struct drm_bridge *bridge) +{ + struct sun6i_dsi *dsi = bridge_to_sun6i_dsi(bridge); /* * FIXME: This should be moved after the switch to HS mode. @@ -883,6 +888,7 @@ static int sun6i_dsi_bridge_attach(struct drm_bridge *bridge, } static const struct drm_bridge_funcs sun6i_dsi_bridge_funcs = { + .pre_enable = sun6i_dsi_bridge_pre_enable, .enable = sun6i_dsi_bridge_enable, .disable = sun6i_dsi_bridge_disable, .attach = sun6i_dsi_bridge_attach,