From patchwork Fri Apr 8 16:21:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12806946 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 442C3C433EF for ; Fri, 8 Apr 2022 16:24:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XABKHPXJtlQ/p8ejHFkmR3DwEQ01MEduZhFCnDGGo4A=; b=GYRCLISaHd6wxR ZNNPfXNw3ACm+64SgEOqu9tv/oPri7z5DDZZDnZ75y0rGYkBQUzPr83zm7IKrKQZ7pZGXdR66i4Nr rYSG/AvgkWxzB7F0r+u2yebyd+zqRzXbFcKj5fUKdiOaZYsT198XEBSs9psbKVV4x8Qg9Z3JEFFJr 1bYHkZ3LTXGm3eq8itNI/wgCcMZS22U0F+cGfua1Kq7CWk2egajaacKhJqVclx+zKrcBO0pI5xPvP bf7l3Vv9uQeliebtmyaYtPDLZEJkA/gfWrwibepx0wJNxXTJyGXmxPg9sqol2q85roNOZENb69eIP pbYxy88SASTR/mAXsw5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncrOD-000Tnz-Ta; Fri, 08 Apr 2022 16:23:14 +0000 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncrNk-000TX0-58 for linux-arm-kernel@lists.infradead.org; Fri, 08 Apr 2022 16:22:45 +0000 Received: by mail-pf1-x429.google.com with SMTP id s8so8753374pfk.12 for ; Fri, 08 Apr 2022 09:22:41 -0700 (PDT) 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=cgQ5H26dXpBSM4rzqEEf72CNZpQ5iTR6sOekInJL9nA=; b=qGFgE8d/FspNS34svbsGDyPnuRy9Upu/mTr9Ef8Tu5CYyNTpw+nZ6ggmcKV9shfu8n s3q0yl1yl7qKniYUx5mx1k1WfO9anF/XSdxeQFVA9YAUf4vn5cpxhjeEufXsuvyRD+MA JZWNKWs0OXIjG/HYBwYGi875S7zRkHwDKx8Qs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cgQ5H26dXpBSM4rzqEEf72CNZpQ5iTR6sOekInJL9nA=; b=JzBUR8HSaJ/mEdUutjoelu0o3bYLEjuuxaUe0XFgPh4ifhjFYijK4F1LmEUgcqhp4j w8SVtle0yAnyPrykqUIvW066Sfkanw3l19H70T32VuOmdHB7Sbabu3qm/Q/FHzg9gpAC uK/e4/YKBkBe09K/17KqVGQD8C7vzk/CA63hIIDZJ3AuHuwtMK5HLnA3tXUb4VrhO1dL ee6zpyJuWcgbnryppiZkcQQNgbvwFAzMQQD7RpQLr52Kvtf6Q+Jd1+qf/HHRs23aLmkO V7DAGCplqM7kHH1sTI6IUiNmZjiXP+4JyliOGF24Fn75eJSSaiTNFzEGNfH/tQpeT65E QTMg== X-Gm-Message-State: AOAM531P4XAd7V2xHlWEihlLQmM0DB7LPvfwzXcRQppDLc53sJrkG+3v h2GxRmq0gnvazaAhKTY32FhEXg== X-Google-Smtp-Source: ABdhPJz7BYgkTc1Jr7yE94AtJvsLtYwfoFOJxo6erKU4BeLpwnKWJwOinWC2GIqbOH2+0zjtoftLRw== X-Received: by 2002:a63:c00e:0:b0:398:a2b7:be6 with SMTP id h14-20020a63c00e000000b00398a2b70be6mr1775772pgg.214.1649434961113; Fri, 08 Apr 2022 09:22:41 -0700 (PDT) Received: from j-ThinkPad-E14-Gen-2.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id n18-20020a056a0007d200b004fdac35672fsm24929863pfu.68.2022.04.08.09.22.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 09:22:40 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Rob Herring Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH 04/11] drm: bridge: samsung-dsim: Add DSI init in bridge pre_enable() Date: Fri, 8 Apr 2022 21:51:01 +0530 Message-Id: <20220408162108.184583-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408162108.184583-1-jagan@amarulasolutions.com> References: <20220408162108.184583-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220408_092244_226532_4333D5D7 X-CRM114-Status: GOOD ( 12.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Host transfer() in DSI master will invoke only when the DSI commands are sent from DSI devices like DSI Panel or DSI bridges and this host transfer wouldn't invoke for I2C-based-DSI bridge drivers. Handling DSI host initialization in transfer calls misses the controller setup for I2C configured DSI bridges. This patch adds the DSI initialization from transfer to bridge pre_enable as the bridge pre_enable API is invoked by core as it is common across all classes of DSI device drivers. v1: * keep DSI init in host transfer Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index ff05c8e01cff..3e12b469dfa8 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1290,6 +1290,13 @@ static void samsung_dsim_atomic_pre_enable(struct drm_bridge *bridge, } dsi->state |= DSIM_STATE_ENABLED; + + if (!(dsi->state & DSIM_STATE_INITIALIZED)) { + ret = samsung_dsim_init(dsi); + if (ret) + return; + dsi->state |= DSIM_STATE_INITIALIZED; + } } static void samsung_dsim_atomic_enable(struct drm_bridge *bridge,