From patchwork Wed Sep 11 15:15:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3464 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id BC79642E8A for ; Wed, 11 Sep 2024 17:16:05 +0200 (CEST) Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-42ac185e26csf54788615e9.3 for ; Wed, 11 Sep 2024 08:16:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1726067765; cv=pass; d=google.com; s=arc-20240605; b=jGFIymElM/FHsVP0tPRnM2O2PiFw861rm76NXHhmhiY3LDYtL7kAhpm8wwVX0FVBYd 80jUr/F8B0fmF/SBxN+Q7nOJEQZKH9JbMntPLhcZxqVDJ7W7SS15P1Vzt6hQaxJQgAtA tJ4jY95R+Cyszn5OjfcoBw1slnZnu6RN20wFTm5yFmRIhb34BtNsohZBzOz61Eq2KbX7 0lc2YTx8cymOAgUH0rsBnNU2wgRwyEbrRJWvFvurb0himiyT/rXP5eI8/n4S+gvp17+n MeSfxHdzxR0ff/UtHI74kgLzskjEc6xAub2aQ/q4pZ8CeGGjrIXPGD9Ra2oLQC9xuUQK cwaw== 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=I6FsrlXT6zYutmIEH6BudZ8Z6gBFRqP7myj5kCa6uBE=; b=Ual6d5/KUKwG9hbCnyxB4M3jzq61wJHqx/tguaJexgi7ZHfPC9Y+Djweia27tZ02xW nSTiE6ohL0uU9mRLp3GPI4+wl1vY58gEEmWZ6aUUr0YDr9uQOkQgepTLKmlamDUHyJyG B1DPew4iLdhDTS9HbviSdb1zfHI1UM3mn3XI4sbeCuyZseBGiXCqDZu1VbEMDYepkQwC jvJW04o5py4pxq9LgihR7FYfjqOkcExBAgH0NYVYjLRv6N0e93B6FcpimbI9QvKe4/xv 8MLHXgxKtPRGX3k0nJZh89ThoU7F/NGoE0W7UELTY1EfYFwtZy3eVbt8dgn+Hbb7S/EJ r8Sw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PkYE4P7d; 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=1726067765; x=1726672565; 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=gVCILuZdsw9e7/kF0zlAaILM8Tu1NmENsvxrgwQI1mhKNu3UINWHLX6Snt5at+gZDU MI5t6Ahj0ntGX5c8o8rWZTd1zwpCwP/BO6Lda7yyb27FdjClv1Iwbtj6PW0DgYwCWh2J BX/1wb/Lst579eTGrWKaDWCgqLEGJY9Y+Es1U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726067765; x=1726672565; 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=aZy1CV/A1kL3/Z9C1IhOD8e0F29KFFAbuwfRaIL5PCRXqVP+eiaBcxlQmnT8dpqUZu dWEQ3JsLa+ZPq2Fs1qF1cmX6EjICc5j8eG99kATNlEjBbEtnhHXeCsQjInwspxOYQwoD c/KRVRFxQ2lAUVXQqGU8UrmUS/fyABFIDkz8PScgv8pPvAYroVBxOiLZBJRHc1yy+dJz QHxOem8A9EXL7Bi88FEWb30b14C79aSUl51Mas67DSl05qxo3aPneM3GMedAnJfrQv6Q RrLHpdHmZipxleHT36pAwGIeAhubuiSjIaoPpTkpWVNQGw361G05ssBMuCOol2zaTuT6 YtLg== X-Forwarded-Encrypted: i=2; AJvYcCWzlJuwsoA8sTUqKEft+MQfbEgHYdSzTnDkUL07dyBcGcpkboNz+4nG68hXicQs2t2tvssI3dyskATB3Ajc@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YxNTIW7eLuLxZKL4dDn5IMCibPr6QzQwNxGhrPadgC5KRk5suvP 1LZLqYKY8lZkrIy/n48LrNZaH3ieOBRQ9aANDbmeqdKU2YHFECPks9Mb99v3XF5dzQ== X-Google-Smtp-Source: AGHT+IEti5iS72cEGz68W/5O+9ubaws2iLfD49yZkJ90jFTRIQPgDwBzg7wDkSuQaLy4wwyUHCDd9w== X-Received: by 2002:a05:600c:5106:b0:42c:ba83:3f0e with SMTP id 5b1f17b1804b1-42cba834410mr71200265e9.7.1726067765381; Wed, 11 Sep 2024 08:16:05 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:3b2a:b0:42c:b9e1:ad0b with SMTP id 5b1f17b1804b1-42cb9e1af78ls15734475e9.2.-pod-prod-07-eu; Wed, 11 Sep 2024 08:16:04 -0700 (PDT) X-Received: by 2002:adf:cf09:0:b0:374:c651:4abf with SMTP id ffacd0b85a97d-3788969feb9mr11299993f8f.52.1726067763823; Wed, 11 Sep 2024 08:16:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726067763; cv=none; d=google.com; s=arc-20160816; b=xZGDGNsuuUlHZSFWU6maBpQcG835nwfBLK8SRR2b0YtQKHyX7o5wf5ZXRssh8z0cht jvSE2YPX9wN6UVUg1h8hgdk24G2buFiam9cS5Z82kGFw27QlRRyzrJvzhcq0SkMUirrW mmzejBYr3Dn5DdGzu5HPa5jeFeJJSiptRUAJYFLNl0rek/SVdhCxj4W6xFXZLojWUJuH 4tb++4DSgwCez+0Z+yJ3SmMkFzzw1XTd8W4zeesx+HxfkrOhB2jVDMkWTWlPHE4iJydO 3zZ1TTyH4CD2jB4WNR8k4ycl5JFJKLBUxfJKcqdwUVAJnpXT8hMuukp4q6kFmDqGx0mw mKiQ== 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=Gr4Xmr9Z68II7U7Kvt60GZCk+YafSLlNiw5I91ywM14hUNbXRj3IZbovU/9nYZhFXp aCXCbmWEvbsbU83EXW3yk3qGIO40vlfKjoAnSaAk3QNoEPo0mm7yOuDM0aMFHot+uLsC ZdISYHP+frGGTJMP6Ag1JlkQm9F/w2ALuXgIH71IC1n0oAWSyGhr8EVmZqhopxrR2onG rPXiS5xjm20+sRx4jBl4rQqZJ2Etfg1FnjwAzZGpbd21vlasU8nxzwG+KeZWIIhlYPXe BXy9v1td49YWmAO/0zfVoEuk3izJTTzmu+cnD9lozVmCZuE61xClFcE7y+WH2AsyF9A5 DUUQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PkYE4P7d; 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 5b1f17b1804b1-42caf2e1e50sor39655865e9.8.2024.09.11.08.16.03 for (Google Transport Security); Wed, 11 Sep 2024 08:16:03 -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:600c:1e1e:b0:42c:b187:bdeb with SMTP id 5b1f17b1804b1-42cb187c004mr100082995e9.29.1726067763065; Wed, 11 Sep 2024 08:16:03 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.41.3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378956d37a1sm11797177f8f.77.2024.09.11.08.16.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 08:16:02 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH v2 07/10] drm: bridge: samsung-dsim: don't re-activate the bridge if already setup Date: Wed, 11 Sep 2024 17:15:52 +0200 Message-ID: <20240911151555.2915258-7-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240911151555.2915258-1-dario.binacchi@amarulasolutions.com> References: <20240911151555.2915258-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=PkYE4P7d; 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);