From patchwork Tue Sep 3 15:31:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3408 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id AC05E3FA49 for ; Tue, 3 Sep 2024 17:32:07 +0200 (CEST) Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-42c7b39e953sf16169115e9.0 for ; Tue, 03 Sep 2024 08:32:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377527; cv=pass; d=google.com; s=arc-20240605; b=Qdk01Vhy+jR3wiWbeOBOyBLz26xHEIEFi6B+AVvCPTrZIuutT4nMp1EZuqJSXRxcdT ae6G58L/zakxO6JSl51PmD9uzGS3FGTGpGIEWyTuL3qXj7bRYg9oAE7IQppSjeZvik6s VUL4ejwU5QpXtomzj8rTCkn6oqzbaqPo44v9t2c4CCXXwE8XhGoUWyYJmVXeBhO05KE3 2iA5rFJBUEUV4GnMJ5bP+t/YKuh8xI+WOXN28Ab2vvN90Q5C6Ll0Pu4KPi6W7lkZn+P5 lZYfT/lR7/9X+lZjAesX7roX00PDRgAH/M8y//QC+X+0YKjxUjEjSb2mFQvYnLUoJvvq 0hgQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=erq75h9BPaWfOzVj4ES1EdAF8vaVJL0kqZxVXpr4rG8=; fh=HixIfLf0TVkrRStkYI24rfZngZD5OMcBqB5Y+zhBDu8=; b=BcFPoTmfKgBQZESfhdKcMPk6o4PjPdsRSQ7vGwqv3qSVSMMD4SQqkKCIvfhibFT4RF NYZG5Qv9HF77+JH9Hou531RfOz+Bb7wwNccUQxrhk7k1JwixdZ2Ki/4txFTM3fCg9FUK KO7cp8ZkqJuppMBBBAKRwOb/h7YoDyKJlvbGO26NbpDk5j+xoqfUCRYPS9hwYMCbgwiW l6GyZxsvQUY6tHGwpaaYTyqcGddcKY0Ht5ZhaivYtv1tquPG5Xld/AiltRVQ1AgqoRpI k+X/hI15ySK3rHdr/k2WIPLfeaOAszpXabI7UtZ2BNhodaX+GoZXeRw/ls9FmCgL2cSq isDg==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=A6bEQQdY; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377527; x=1725982327; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=erq75h9BPaWfOzVj4ES1EdAF8vaVJL0kqZxVXpr4rG8=; b=I5VSYj+2+/yC9P3qwqyabi5LU2Ym2blx7KJ+mg7C4492wCvpEQQhVx36+X34xXmckV RVhPHb8bQ06xW4164Ktjx7klhkC9ADeVaZoFPPRIxPUb0HeC+HCxwyJkUcPrur+TPwMz 6xw9CFaiJlNW9EHgwkSbGbWDFP1aOk7SEU/44= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377527; x=1725982327; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=erq75h9BPaWfOzVj4ES1EdAF8vaVJL0kqZxVXpr4rG8=; b=u8dG6E/S8jKCRDJmqNhGuh6AUwTJkOdeExWEfyvopLeXzalXL/gq2qD10JhcbNPS74 bAOPiBP9CjQexcqOtXib09/vXrsmuURv4+Ld2RAUOxrQs3vZJGCzg8vAuLuj0lPlD6uv uSlvjFrssW4vaVRoW0CupHX8CaqNSveRs6ZCxnr6A/dq7ymGmR6vu2FD5oHDLaygE7Fu HXTAcOEWKb4UVmekT7DeuorwiAE77IiSV7X6/FnOWBHfltsiFoyCp02e0Re3fE6+GQoW zzlq5GuEfXOLuXbdbTdbm1GiN8fSC8C4mMZ+nbJQRt+/bjyqEWOooldGiSkW9TRy/zBL hHng== X-Forwarded-Encrypted: i=2; AJvYcCVtqFFGA+4aPNtiwXJynJWMCMbTBzbZsCSVaRVRZg+nZ0HFtPzvXL7eAAlXwVvCqzFHwcVROs2GXnAL+cqu@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yyj1Np5D5V+ArixvjCmmq7GLBZD+MOr1XmnPTktvLlgp4JHu9GN B5MeRbGKGduYYmP50OzDSftOUSM/6ySQMZZ1Jemf7eZ6NWGs2zIakRIw/G34t6Is2g== X-Google-Smtp-Source: AGHT+IHLNFTchPSujKVt88YZDHc88dgt4nWzXvHegU/DVMgRcSaPX+HiG7d+7zTf2zag9uOqPv2TQA== X-Received: by 2002:a05:600c:3ca9:b0:424:71f7:77f2 with SMTP id 5b1f17b1804b1-42bb4e9f1a9mr111866475e9.16.1725377527261; Tue, 03 Sep 2024 08:32:07 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:2d06:b0:42b:b4f2:862c with SMTP id 5b1f17b1804b1-42bb4f287f9ls12005435e9.2.-pod-prod-00-eu-canary; Tue, 03 Sep 2024 08:32:06 -0700 (PDT) X-Received: by 2002:a5d:6190:0:b0:374:c7cd:8818 with SMTP id ffacd0b85a97d-374c7cd8a12mr4855521f8f.22.1725377525650; Tue, 03 Sep 2024 08:32:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377525; cv=none; d=google.com; s=arc-20160816; b=lGyKhYgoUleYx2AcdQJadRAybC79LCBsX0OpDfQWSLNAJx9sAUYRb5B3gAV35l5bjb 9nd3tK81/GIRjeQRKm+ImFg4MftpnSXJDmJzzRsrPHqjX2KW0F2hDjpRqi6M99lceUiI zwOendJjS59quc+0D1SD5JNW8QjhdvRkl97oGkG42MRzAF3XHJ4F7JrZ9TCw9Cukpi/y iUgOjS7SGOOM7Vy9eBjxl2lrO1lM6AJiwiybfusN2avzqHqpC4tKcWJiuvb5bjyZMAqB 7IcyR2qykwVR0WUEqQhCwCY6WnkuSOrr8rZPQ3/E5zp2JAV8vT48oyg2jzMBICTdLq0Y /W4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=886dheCSQMH5QLZJoUq/AcWn8+XxfzrNMN/ystOgZrA=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=ajXnZtEbXEu+LzfRe81Vfw7Eue6Kd4zenYqF+/Nqh5yvOTyGWupMiM6NwpURo07Cuu OsvTScN24pHH2ePfHoGNoCxp9JgvlHZ7wJzFtqVWioSb0oO0N5tGPxMMHV0JnzVilcWk yXju1YiLqMKjEImA/P5f88oUINqN5xrLvyJVEvODlUyrxXouTLrn1aGv4ZBZEnpIlc6p 7RxyQG9kgt0Yqs0YcYn+AkYzKrEAmZck7DpEIXtpLVNVYWXW/64wzZxmfNesIr8QLEAG +Swq3+dWu2HKc4skpw/jw8YuOZrB9ei0WvM6KJFwe7xhM850TEjvyF9nFa0xzfbHtFsb R2sQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=A6bEQQdY; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id ffacd0b85a97d-374b9abd1c2sor2161043f8f.5.2024.09.03.08.32.05 for (Google Transport Security); Tue, 03 Sep 2024 08:32:05 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6000:543:b0:36b:c65c:661e with SMTP id ffacd0b85a97d-3749c1cdf6amr11070489f8f.13.1725377524893; Tue, 03 Sep 2024 08:32:04 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42baf1b0c18sm192963055e9.37.2024.09.03.08.32.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:32:04 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 07/10] drm: bridge: samsung-dsim: don't re-activate the bridge if already setup Date: Tue, 3 Sep 2024 17:31:54 +0200 Message-ID: <20240903153157.918185-7-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153157.918185-1-dario.binacchi@amarulasolutions.com> References: <20240903153157.918185-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=A6bEQQdY; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The patch does not re-execute the hardware initialization/activation procedure for the bridge if it is already operational. This feature is crucial when supporting the simple framebuffer, as the controller has already been initialized by the bootloader. Co-Developed-by: Michael Trimarchi Signed-off-by: Dario Binacchi --- drivers/gpu/drm/bridge/samsung-dsim.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 95fedc68b0ae..bcf1746bfb6b 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1912,6 +1912,7 @@ int samsung_dsim_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct samsung_dsim *dsi; + bool initialized; int ret, i; dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL); @@ -1989,6 +1990,13 @@ int samsung_dsim_probe(struct platform_device *pdev) dsi->bridge.funcs = &samsung_dsim_bridge_funcs; dsi->bridge.of_node = dev->of_node; dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; + initialized = of_property_read_bool(dev->of_node, "samsung,boot-on"); + if (initialized) { + dsi->state = DSIM_STATE_INITIALIZED | DSIM_STATE_ENABLED; + ret = pm_runtime_resume_and_get(dev); + if (ret) + goto err_disable_runtime; + } /* DE_LOW: i.MX8M Mini/Nano LCDIF-DSIM glue logic inverts HS/VS/DE */ if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) @@ -1999,11 +2007,14 @@ int samsung_dsim_probe(struct platform_device *pdev) if (dsi->plat_data->host_ops && dsi->plat_data->host_ops->register_host) { ret = dsi->plat_data->host_ops->register_host(dsi); if (ret) - goto err_disable_runtime; + goto err_put_runtime; } return 0; +err_put_runtime: + if (initialized) + pm_runtime_put_sync(dev); err_disable_runtime: pm_runtime_disable(dev);