From patchwork Mon Oct 28 10:25:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3599 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 1BF6F3F338 for ; Mon, 28 Oct 2024 11:26:25 +0100 (CET) Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-5cbb0b2c6e8sf2153672a12.0 for ; Mon, 28 Oct 2024 03:26:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1730111185; cv=pass; d=google.com; s=arc-20240605; b=Gx6KhiYrle9ko4GLcJZWvLuHo/Yh/TJisNCoOKcnhEXnJMRmYiRKxEkrDdvm5hy7Xm 6jYvB6OiFtzOZxih77LR6W4YETdDtJXX4B+mVMZ7kJJTBqHVCZkdzzS5qqIFHL2M/FtR H6lHZIJMHaJqM11+zEIrXB8YmyNX9UDqhjtCpN+zRHtkUniw0TxB10r8zoNnkD+UlTnh DHezf/XYlwwv7cDe7kGo0MUvPt3+fzPQoCIOA9OGxFJxwU32b+TQspkfv3lvanA32N1i NuYs2S02Wtrj+asvN2ODc+MHJsLW/kq+tjxpld3tQLJsT/yL0BIIFaUGqjHItyTrCXC/ pHHQ== 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:cc:to:from:dkim-signature; bh=1VlqPW7eRg8ZAyZ1Tiy4tftGh2w6rQ+4sktFQR5GfXs=; fh=2RCcL7oa3XHI1+MQQgcQj9buSSA+rdf2ZwVSCcRUlng=; b=FFKe/NPMVgM1f74QffQht0wIL4IrkglT6lCWQlffagpF7yhh798exwmnYpX9ytz7AC 3+oZith3+kHl+LpaR8jR1Im0kpghSv7TWolIUArvfIdvHLkkpEPzG/vUK6lxuQs3KqZY K6OEXezXXS0HQoNFpS9VY+TXWBklq96BV0gQh7BbOCheccD4rP7gtHIMkbvTg6WgFGeU alAN2hcTMu+w8wdTDrABQvvHUlSbuyuxhxEPD2WbnZsIUnldVXU2YoCCUtZ1RApZv7Sd Z0pDPjPLeGKd8cQBrHYxkU2c5BbseAAkCVwbhg8D5JWlLzrHF78sJKV31L8gINLv54x2 Dp+w==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ARtkHr3O; 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=1730111185; x=1730715985; 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:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=1VlqPW7eRg8ZAyZ1Tiy4tftGh2w6rQ+4sktFQR5GfXs=; b=dJj/QilEKmX/iAn6ZW9hKkZqwJra4LxUGoRF/I+uPFeKiKF3sCx6ntNDei5tWwU4ut s76bP+hjMxX5X+08UC58EVv3Ylka3tP8NmGYqfPD5A146QdIdkvPyPRB5gp407lKx9lA cLJFDtvk98eutmXz1HDVfvbnfMmUecUxKV0Sg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730111185; x=1730715985; 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:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1VlqPW7eRg8ZAyZ1Tiy4tftGh2w6rQ+4sktFQR5GfXs=; b=gF/kXtb+PfoFj6/HrU86KC2W5LEaXcA1/cuHV/fcO/jqOBO527hii3qT2RTO/1N9iP UI00vLaJIi4FAWM2zwrKzZyu95PP18QFQRPGUWuXtXKCZLoujWGeyAwTmH7g5G0EzMkU 5NCSWn/jTaJ+1udjnh2F3uJRTMmk9RC3zsnwhx7Sz3kzQ5eQCILXr8kYn0SJJe46LTF4 IRDPKuhOFOVARWGJVVzd3W3126+QuFTrJXuZIl8AXFZvPJpKZBaa02adQHNZGHP1pexX 8sku3vk1wbKSoEGDSBzr7hZNKgCTyayPARZEmtalBEnr8kgBmlpCfd4uAoNaeWj7qQY3 5LyQ== X-Forwarded-Encrypted: i=2; AJvYcCUXkYszwAEnHznBWW6OAwlW8amyXNtQWj+73Cr4WQ59VTk0GVaCb3w7yP2keYSsSMiRQWo3n/kWdA9jgZg7@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yw7t86ossLlMavgroyBuBOhIvDkCmagznP89ejZVEH8gowI3lP+ NGcOTOMbsnTh1AuaJUtiG87OnM5NlL6NfYXGdPinPDdjyqoOXDJtgHkQePFiyhO/6w== X-Google-Smtp-Source: AGHT+IHJOlwAn1igK9lpqLidFIUQFaHNmZyXHxvQx10VKA47CGgX7o8UXLu5wOYOZUhDl8trPnCyRw== X-Received: by 2002:a17:907:1c12:b0:a99:7177:3f6a with SMTP id a640c23a62f3a-a9de62f4b79mr758028566b.63.1730111184757; Mon, 28 Oct 2024 03:26:24 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:2685:b0:5c9:1f95:513c with SMTP id 4fb4d7f45d1cf-5cb999dcd7als104413a12.1.-pod-prod-02-eu; Mon, 28 Oct 2024 03:26:23 -0700 (PDT) X-Received: by 2002:a17:907:7f16:b0:a99:dde6:9f42 with SMTP id a640c23a62f3a-a9de619ed20mr553841466b.47.1730111183145; Mon, 28 Oct 2024 03:26:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1730111183; cv=none; d=google.com; s=arc-20240605; b=Sz/EnDxX4WcCT3EYbVb3cKB5/po3ZsBwbB2V2P2YeOF+aVQLszs6iHNgBmN9nh3bHc 02AqdW8gOF6HSkvULaiJZrpixD+mxyrKh9qENB+fmq1AiuWH3tOTMVz228NmQlN8KOZm 94Ov8Vuv1lw4bpdTibMapnktPoSOfKkjx6cgnYWp35XuDpp3ePeFj1d5Ce1KAhIxT640 0rSyWdN5J6QQD7tsakQ0ltZGOD4GW+Wf6q4MvUGHQK3wtzf1Gbz9WNtzxuN0VlPaSkrp JCT1v7YLVmp4wazvcBGDhZQoMk6u9sIu1U8s2FpPUwH4BIkCSE4kupxAboMHWEqAH1uf mG8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=v0ceU2N4ZWu/FtoiewhZfxk5s76R6vPhrLuwGN01j9U=; fh=Bx0TBdorJNXnjpNS/rCkV121OY0vkC9jMru1cgClbHw=; b=Zmy6mTvFvCH0xZBfjliwJ4wG+zHWI2isgTfG7pgF1g9WhThmy8AYu/GsZaBb+0CPZ6 eJtAsIj/gQFGbkuNyj9PpjIA2E7hVgDvjCegeTprAuStGKRN3bvSsZy3W6n4wnAIQUJ5 +chUEKgqmvEo8CwcFnkCitKJxrTwHINvjwJOjAPJkAMq9gtODs8n2Mt02DNZPuZxXKDX MiMRRnMIcuvJQskCPrLVBzOCqwpxjO1jVNXaiSKUTz6wiONSWYPTvMvZdDXRbsCGHm3p UcrXlZs8nqW/JUGWEj+UXnTV+E8rCrunANLvDivXxFJBZmv3catfbGuIrkO6jGySvAM3 EuZg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ARtkHr3O; 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 a640c23a62f3a-a9b1f290efbsor259099666b.15.2024.10.28.03.26.23 for (Google Transport Security); Mon, 28 Oct 2024 03:26:23 -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:a17:906:c105:b0:a9a:10c9:f4b8 with SMTP id a640c23a62f3a-a9de62eaf3dmr759573966b.61.1730111182612; Mon, 28 Oct 2024 03:26:22 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.41.121]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9b1f297b04sm363613966b.134.2024.10.28.03.26.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 03:26:22 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Michael Trimarchi , Andrzej Hajda , David Airlie , Inki Dae , Jagan Teki , Jernej Skrabec , Jonas Karlman , Laurent Pinchart , Maarten Lankhorst , Marek Szyprowski , Maxime Ripard , Neil Armstrong , Robert Foss , Simona Vetter , Thomas Zimmermann , dri-devel@lists.freedesktop.org Subject: [RFC PATCH 08/10] drm: bridge: samsung-dsim: don't re-activate the bridge if already setup Date: Mon, 28 Oct 2024 11:25:31 +0100 Message-ID: <20241028102559.1451383-9-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241028102559.1451383-1-dario.binacchi@amarulasolutions.com> References: <20241028102559.1451383-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=ARtkHr3O; 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: 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 430f8adebf9c..7c03215bb004 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1933,6 +1933,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); @@ -2010,6 +2011,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) @@ -2020,11 +2028,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);