From nobody Mon Nov 25 09:34:07 2024 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41C181D0E38 for ; Mon, 28 Oct 2024 10:26:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111175; cv=none; b=hNj8R4x+4H+7KV+rKYHu6HYhL/Vc2KAtAaFfeM0VyK1Zx5HFan1aBA44J7cmOwxk9drEGGwHYLhgpK96jCqoRh45JF7+nGMun8yk9cOsXCcrcOjJEuPDxdCFO+Y8wwCiTHbVct95RFeT0Fq57750/mi1ERKYEeoRH10ULK+XQ7Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111175; c=relaxed/simple; bh=R93VMLohkk+JmS520PXpYqfQBg15NGWIzpjAwA+J2Kw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IDGQiUjfImUG4TDbA41bMuKnhbzHESiPrOgvXqLDww247ca3QPAl69UhwuY81B0XJMQ8eqkTCbV0CcK+nZBmoQz5CcaiObSCiSFy7p7VoBDXxlOH8mre3nn1432yONQxcxrUJ81VArbt1JQNuWtP2pg/NzW2EyX4dGPSU3TF3KA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com; spf=pass smtp.mailfrom=amarulasolutions.com; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b=T0Fd6yjB; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="T0Fd6yjB" Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-539ebb5a20aso4087374e87.2 for ; Mon, 28 Oct 2024 03:26:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1730111171; x=1730715971; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vYexXqsopB/TorltyWtW3DQvmZVEoLO13n0GfiFkuag=; b=T0Fd6yjBYEgaZb3zDq1s5h/LV2LLRVDrIggdpQqSuJBtWs+/Ecd395woqs512paGqG xm54xRsDTAko01E/OdqIbwHLAboe3l44XDazR8QlAtOSMvkls9yVHhC/3pG+3fI5qhIp AHZTdlgJs1LqETco2MRl6O/kgWaD/WHHW7f5Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730111171; x=1730715971; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vYexXqsopB/TorltyWtW3DQvmZVEoLO13n0GfiFkuag=; b=Yv1u963woagsyu+xETeGyGv+iI9WRMMrX+VgdIx2gtNzQRx7IdC1AbN2tgCyEh1hTJ y2vkCLaJe+X+Z5Gv8On1UY1NWMN4OJv9n3NFkmvemGByDbrI+nzq9CNpR5H3a+COrSls Y5Nu/Htq1JBg3zfMD0fxM3xGpslIGLk30x8JfClu6JUdNo5eR0DBjAT629d2YBwqTaaj wllKV5e45BImk1lPtOfQvC47JxIQn82Q6/el37kpnhypA/S9YeYKu7n56+lgag+46tog hFUsIaRkfo5kvb9+LU6cJ6zCm7Wy99nv24cHrIcfrBplx1AKJ3VEpNKzs4JjA4HowgKv dBVQ== X-Gm-Message-State: AOJu0Yw1dA5TvgHPSYf1gWmnfvwSJNCro9818z7ziaIrunbJqWbpBsmv MvpC3SON7C7diF71CLNYrS9Rtffo+KVHl2vxgnofGimxn8ZdbBUNFD4L9dYVCfDNUB8X+9RO+zj yK90= X-Google-Smtp-Source: AGHT+IFPiWSMUJsvLDsFUQKEPXeJtOq9dyzWbF9cm4SlPeUZQ8cIi4gauJvX3gywzP7yEJIBk1InHA== X-Received: by 2002:ac2:4c46:0:b0:535:82eb:21d1 with SMTP id 2adb3069b0e04-53b34a3516cmr2517575e87.57.1730111171159; Mon, 28 Oct 2024 03:26:11 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 03:26:10 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Conor Dooley , Fabio Estevam , Krzysztof Kozlowski , Lucas Stach , Pengutronix Kernel Team , Rob Herring , Sascha Hauer , Shawn Guo , devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 01/10] dt-bindings: soc: imx-blk-ctrl: add 'fsl,power-domains-boot-on' property Date: Mon, 28 Oct 2024 11:25:24 +0100 Message-ID: <20241028102559.1451383-2-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This property lists the state of the power domains, indicating whether they have been left on or off by the bootloader/firmware. This information becomes relevant, for example, in the case of supporting the simple framebuffer. Signed-off-by: Dario Binacchi --- .../bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-= ctrl.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-c= trl.yaml index eeec9965b091..00aa0b8d8ea9 100644 --- a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.ya= ml +++ b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.ya= ml @@ -56,6 +56,15 @@ properties: - const: csi-aclk - const: csi-pclk =20 + fsl,power-domains-boot-on: + description: | + Provide the on/off (1/0) status of the power domains. It allows + specifying whether one or more power domains have already been + initialized and left powered on by the bootloader. + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 5 + maxItems: 5 + required: - compatible - reg --=20 2.43.0 From nobody Mon Nov 25 09:34:07 2024 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB7001D358C for ; Mon, 28 Oct 2024 10:26:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111177; cv=none; b=Dl/sDElVI6TIjI+ghXij102QM+UyqiMpr3YRna1gdS4SIjLlQPldzLR6rWe+j08mkBtzrd1F477izqJ6FMMLP1TESCo5kKQfLN7i00rNDXgV4dhrjifM4brldiVpf7+qyaSJxCNxjTOL33hpM5SnptWizQ/QsNfh4H1It2JydA4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111177; c=relaxed/simple; bh=jOASmNrBy0k5ebd7B11buXOeSSx1yKz2tcuTybTDs10=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kLRtuCJYUo9wcKk5yXUJfm72Y53o4u1J0anJii+c8dlJHQzGsrpeRyECehfNAWTmhBG3nyb8poKgPQlzn99LDAaiSlwNM88nRMYMRMNzjLxpKVbFoHGVqeaizIJX7y5VEuXdrCdeukkhLNsOv8vudf4PtpLL7KOyNfxuJmwAAQc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com; spf=pass smtp.mailfrom=amarulasolutions.com; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b=Ma0I00Jc; arc=none smtp.client-ip=209.85.218.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="Ma0I00Jc" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a9a16b310f5so641619366b.0 for ; Mon, 28 Oct 2024 03:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1730111173; x=1730715973; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ErPoXh63XrcFWpHe9zG8v9aPuGfFzlqWX+d+j6TRc4A=; b=Ma0I00JcwZ90ofVYmxYwzGuUdJ8zjGZOLrVZM728a6LeUpodhyFXp/yhlcEvp1z/Z3 q+eeksdxtxX6ciUCnUfWQK9HwpsxHvVV2QXCOTBk2BJy43jlDLl3/7kgt2qwRDM7kFiS XGQRg8wv1/BJsWIRrcyVGADM/mIIWkHRrFYlQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730111173; x=1730715973; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ErPoXh63XrcFWpHe9zG8v9aPuGfFzlqWX+d+j6TRc4A=; b=EBlZXygsjflpMyWoLkDF4zxE/vFyGgi133s5LZU9hLJS180mQZvmAEs5DZHNcaha+6 TBjz5RJlvOOdyaRyq3Qw2glhT+kHKh6ikYy5wHpLqMbZUM186BTo9uAtyNfuK6DUFyG+ ETJQZLZRb1ViJjRgcyi2I7E7RZig+wxWDanYXniBZcImVp6WDlMLD1oiFOm7mr7oJ6qO zQcTlf+yb1VBi5aDC9eDe731FeyjKrdBzmy3ZtwbNvCJC8YXVAfcKNYnq3pDb+6/4Dvr EkInA419bkT8tYfda9F+AqX4pnkayy7vX2z6cj/QfX9/bcHcQ2899GsdPLeIYk9n9wT5 lK/w== X-Gm-Message-State: AOJu0YwPwW+fB5Wd//rNegwivly1+zmM+4r+DrlXpk7MPZsS3kh2JcPv a8CZaVOw0Rx8EMlcwKTnKjhojAXHBANp3+Gfk7Qs99C1tnU17aziU2kmPC3U4X8latxP9oli1JT cjjk= X-Google-Smtp-Source: AGHT+IGCR28JnEaozP81Xbh2KLif47qmv9KNL7NMIxup/Qx2H3ia0ChVJ6kRCnNRLDGwqzzr1QgmvA== X-Received: by 2002:a17:907:9712:b0:a9a:2afc:e4d7 with SMTP id a640c23a62f3a-a9de619d18bmr803160866b.44.1730111172695; Mon, 28 Oct 2024 03:26:12 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 03:26:12 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Michael Trimarchi , Fabio Estevam , Marek Vasut , Peng Fan , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo , Ulf Hansson , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [RFC PATCH 02/10] pmdomain: imx8m-blk-ctrl: don't turn on a power domain already on Date: Mon, 28 Oct 2024 11:25:25 +0100 Message-ID: <20241028102559.1451383-3-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The patch, by informing pm_genpd_init() with the "is_off" parameter that the power domain is already on, prevents the power_on() callback from being called, thus avoiding the unnecessary repetition of the hardware power-on procedure. This feature is crucial when supporting the simple framebuffer, as the power domains have already been initialized by the bootloader. Co-developed-by: Michael Trimarchi Signed-off-by: Michael Trimarchi Signed-off-by: Dario Binacchi --- drivers/pmdomain/imx/imx8m-blk-ctrl.c | 51 ++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/drivers/pmdomain/imx/imx8m-blk-ctrl.c b/drivers/pmdomain/imx/i= mx8m-blk-ctrl.c index ca942d7929c2..8dc1508571dd 100644 --- a/drivers/pmdomain/imx/imx8m-blk-ctrl.c +++ b/drivers/pmdomain/imx/imx8m-blk-ctrl.c @@ -166,6 +166,24 @@ static int imx8m_blk_ctrl_power_off(struct generic_pm_= domain *genpd) =20 static struct lock_class_key blk_ctrl_genpd_lock_class; =20 +static bool imx8m_blk_ctrl_is_off(struct device *dev, struct generic_pm_do= main *genpd) +{ + struct device_node *node =3D dev->of_node; + struct imx8m_blk_ctrl_domain *domain =3D to_imx8m_blk_ctrl_domain(genpd); + const struct imx8m_blk_ctrl_domain_data *data =3D domain->data; + u32 boot_on; + int index; + + index =3D of_property_match_string(node, "power-domain-names", + data->gpc_name); + if (index < 0 || of_property_read_u32_index(node, + "fsl,power-domains-boot-on", + index, &boot_on)) + return true; + + return !boot_on; +} + static int imx8m_blk_ctrl_probe(struct platform_device *pdev) { const struct imx8m_blk_ctrl_data *bc_data; @@ -173,6 +191,8 @@ static int imx8m_blk_ctrl_probe(struct platform_device = *pdev) struct imx8m_blk_ctrl *bc; void __iomem *base; int i, ret; + bool init_off; + bool *pm_runtime_cleanup; =20 struct regmap_config regmap_config =3D { .reg_bits =3D 32, @@ -221,6 +241,11 @@ static int imx8m_blk_ctrl_probe(struct platform_device= *pdev) "failed to attach power domain \"bus\"\n"); } =20 + pm_runtime_cleanup =3D devm_kcalloc(dev, bc_data->num_domains, + sizeof(*pm_runtime_cleanup), GFP_KERNEL); + if (!pm_runtime_cleanup) + return -ENOMEM; + for (i =3D 0; i < bc_data->num_domains; i++) { const struct imx8m_blk_ctrl_domain_data *data =3D &bc_data->domains[i]; struct imx8m_blk_ctrl_domain *domain =3D &bc->domains[i]; @@ -274,7 +299,8 @@ static int imx8m_blk_ctrl_probe(struct platform_device = *pdev) domain->genpd.power_off =3D imx8m_blk_ctrl_power_off; domain->bc =3D bc; =20 - ret =3D pm_genpd_init(&domain->genpd, NULL, true); + init_off =3D imx8m_blk_ctrl_is_off(dev, &domain->genpd); + ret =3D pm_genpd_init(&domain->genpd, NULL, init_off); if (ret) { dev_err_probe(dev, ret, "failed to init power domain \"%s\"\n", @@ -283,6 +309,24 @@ static int imx8m_blk_ctrl_probe(struct platform_device= *pdev) goto cleanup_pds; } =20 + if (!init_off) { + ret =3D pm_runtime_get_sync(bc->bus_power_dev); + if (ret < 0) { + pm_runtime_put_noidle(bc->bus_power_dev); + dev_err_probe(dev, ret, "failed to power up bus domain\n"); + goto cleanup_pds; + } + + ret =3D pm_runtime_get_sync(domain->power_dev); + if (ret < 0) { + pm_runtime_put(bc->bus_power_dev); + dev_err_probe(dev, ret, "failed to power up peripheral domain\n"); + goto cleanup_pds; + } + + pm_runtime_cleanup[i] =3D true; + } + /* * We use runtime PM to trigger power on/off of the upstream GPC * domain, as a strict hierarchical parent/child power domain @@ -324,6 +368,11 @@ static int imx8m_blk_ctrl_probe(struct platform_device= *pdev) of_genpd_del_provider(dev->of_node); cleanup_pds: for (i--; i >=3D 0; i--) { + if (pm_runtime_cleanup[i]) { + pm_runtime_put(bc->domains[i].power_dev); + pm_runtime_put(bc->bus_power_dev); + } + pm_genpd_remove(&bc->domains[i].genpd); dev_pm_domain_detach(bc->domains[i].power_dev, true); } --=20 2.43.0 From nobody Mon Nov 25 09:34:07 2024 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D77D1D54C5 for ; Mon, 28 Oct 2024 10:26:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111178; cv=none; b=E8FBU3+jxuJ0dNsXNY5mC3dptlX7yKn8j4h/akZhs3QMrv4mlnomCpfCaDC2HJJ86NynZcfiVjgITxBnC3KxQhfP3zmzlCB40Yqa3r/3KVTKCF3/12LivIkiGYZHpDEnv3obVDQ9OeC7RKAJgsGOZnj84jOLdMfUe21sZx0fkto= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111178; c=relaxed/simple; bh=3RJbrpbC6Nxmr4CObGvh2EeJe3fwMHBQ3Iide/lIGUg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W/pImRSzT0fCFm5uCCht42lf9afdQ41luLpwbuKjHQJO1DkVwsNslx1PKDvbRKDDaxuNoxlD7ZfwrqBAfks4Yqp+PdcBoqAfyoWkm39cBizGWjwF4D7FuylwBFqGYoPhbUpHW2n75EZAdBJKXLGFfWkXYZF2+1yaeCJDng6qZNE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com; spf=pass smtp.mailfrom=amarulasolutions.com; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b=pzK7rbA3; arc=none smtp.client-ip=209.85.208.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="pzK7rbA3" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5cb15b84544so5243363a12.2 for ; Mon, 28 Oct 2024 03:26:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1730111174; x=1730715974; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3kjaoDHO/Cxmm9XfSkRfXuiq2XlHBj2nIJAqnJTFngw=; b=pzK7rbA30zfPVq//nKA9dLpaNlQIBkP2rA39is+NLlbcCPYxH05P2+qDqTwoFIXBPD Af/HBq+F5EdFj7SjaOUPq2cXghiaWlNoCSPvE1EVrzy9+OzulFM1SRMZLgwn9e6qx5SW xHeufODskTLxIml4jkEEAzwBxpjZCklHMs0q4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730111174; x=1730715974; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3kjaoDHO/Cxmm9XfSkRfXuiq2XlHBj2nIJAqnJTFngw=; b=obwajZsZbsluq3gXhMM3oGjfwsCRGTqJkfefs//n7TZJvCOi5EhpCP3+4hpPbYg0S/ mP77f9io8wK4BJCuhMjjJPsLO5n52lq8S3kqTEJXub00GgbWsXF7FXzRPeWpMajWYr2g WE7xZkQRcNbJVq9uiOXF+DZNtzH+WB3ulponm5ETbJZCfiUxEV4aAv9gE1bPxiFtkt37 2SFuTG837ZHqaz+0Hku2ydwqKSA+zky2RucbEXQJt5chdLat1+RP1lnUEMkthxfpPLpl llgJRRqyiRsMpVsYogZD5ayXutgx+VOs+NPQkrJtK7O8jwp0OeWDpf3p0Wwct13ec4Ok fPIw== X-Gm-Message-State: AOJu0YxSN8cYVT6rEkSxnNZK6prJMOKAZSMYnnEwBqqweFcrEciDFpSt xrKW3c5btqXLu0XXjXRZ16I3sUT3AjHiSHf0Nf3NrPBo3GxZH5QB0P3qdQ8gkVDlEMDDJATntCU h9ck= X-Google-Smtp-Source: AGHT+IEYNCvHyI4Ub76KdqemIzRCqERBXA/yyqTx2llDK0lvcsPc5x2y/hbBEKlGhDYQLy/s0WjfIA== X-Received: by 2002:a17:907:9721:b0:a99:89bd:d84a with SMTP id a640c23a62f3a-a9de5ee107dmr668398566b.25.1730111174240; Mon, 28 Oct 2024 03:26:14 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 03:26:13 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Andrey Smirnov , Conor Dooley , Fabio Estevam , Krzysztof Kozlowski , Pengutronix Kernel Team , Rob Herring , Sascha Hauer , Shawn Guo , devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 03/10] dt-bindings: power: gpcv2: add 'fsl,boot-on' property Date: Mon, 28 Oct 2024 11:25:26 +0100 Message-ID: <20241028102559.1451383-4-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The property states that the power-domain has been initialized and left on by the bootloader/firmware. This information becomes relevant, for example, in the case of supporting the simple framebuffer. Signed-off-by: Dario Binacchi --- Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml b/D= ocumentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml index dfdb8dfb6b65..718196f516ad 100644 --- a/Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml +++ b/Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml @@ -94,6 +94,12 @@ properties: minItems: 1 maxItems: 4 =20 + fsl,boot-on: + description: | + The power-domain has been initialized and left on by the + bootloader/firmware. + type: boolean + required: - '#power-domain-cells' - reg --=20 2.43.0 From nobody Mon Nov 25 09:34:07 2024 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B30C61D61A2 for ; Mon, 28 Oct 2024 10:26:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111179; cv=none; b=LJEtF9l1umpQthH0eMMj7SjA8Sv7pds7O8bZyn7e4GWRNRAM/k5Dgpj9tHCiCLU2wSdVIF+is/xVaaUlkTa8026gcKEf3dv561i+jEoUTJv0aDuF0FZ3JfMvHXCxlQ0Vi5XZTPEZjM15t+mpHjyYodUC86ujrahjL+ib8bJ2sgU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111179; c=relaxed/simple; bh=js8gtoeOZlGeLq8295+lq+IHMiMRiPiXT/e6W18eRR8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bByyOl1Fubhn4WKEcO3wkJUBT2ubkdWka9Y0sVVIHptin4PVhIIfyaHgkbT/DOQzWAdxqdm1uIqcNZ71lo1TDxOZdgj1TeK3pMPmwqVgPi9znffu/23G3Rl3hGPicjMZmkm0LDmqLd+vUNqPyHN32gfvow3EqVPEh8mLyl3VdLw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com; spf=pass smtp.mailfrom=amarulasolutions.com; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b=MLBc/CUD; arc=none smtp.client-ip=209.85.208.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="MLBc/CUD" Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-5c9428152c0so4756397a12.1 for ; Mon, 28 Oct 2024 03:26:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1730111176; x=1730715976; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3tF2Wj+vRMtC983z9w7XL42BV51oFEPPNHEhybEVd+Q=; b=MLBc/CUDiBMDtEFFQEvkxQ9roetxU0lYbF+fhzmM1/3c4mloJVXF+W4LngTXlzul8u ef18aKSB5BSTLcbMAJrYmn/In9gLl6RzN5e2h5RvamGR9CNaZ5EDI9J6okOfW06ktOSb Fn/TEX68ZavztV6AD/r8LFu9fWhjBbRHJUgIM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730111176; x=1730715976; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3tF2Wj+vRMtC983z9w7XL42BV51oFEPPNHEhybEVd+Q=; b=GJ0CcdGyM92w/oddtSCtO0lfoIYkwgguijX8ZyS+RL/+rJGcp/IMX0EbXCRxwfDW4L vPxpwyfsp3csW2RuVzn85JOeS2dEBlRNU42i2HoD+0YPUUm7ABelXVVWWOaX/OXB5dI/ oBFlNvMNDZkPeFe2pRMeJrTndIXY3UPN1eOo2D8n9AEXbmA2RisRZJczVYiUT7Y2U+e6 LrBPSecJ/untPUcJgBpaeVac6kKZm74sr0PTNCKwEYPc27DezLiwPxP48Ux+exLlTZ4H agGL3mW/ucm/8RKC+sjIzEi0JsaOf8+ok/Ggn5zX2P1ymK2wpaK4nWuO8xQf5maskUYZ CiFA== X-Gm-Message-State: AOJu0Ywu8gWo+DQkYxFxQ+6I4BGfIBPRjexJFXdUQHyyCza5uXIEPExg 0vfBIsV9ho0xttLaxalw3WdJ4dyR7HpKjTI6m92BNPQEPIYBpM875tg+FmlkIHo0gXfRnt3KT1b eEoY= X-Google-Smtp-Source: AGHT+IFdXb6XtLDCZdRMrvkyA0aKsne7r7Yx41P1F2c1jET9YdgAPGWx1KeM7QlZRwkreW9voNIysQ== X-Received: by 2002:a17:907:1c22:b0:a99:f1aa:a71f with SMTP id a640c23a62f3a-a9de5c90d49mr793546866b.11.1730111175841; Mon, 28 Oct 2024 03:26:15 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 03:26:15 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Michael Trimarchi , Fabio Estevam , Krzysztof Kozlowski , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo , Shengjiu Wang , Ulf Hansson , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [RFC PATCH 04/10] pmdomain: imx: gpcv2: don't turn on a power domain already on Date: Mon, 28 Oct 2024 11:25:27 +0100 Message-ID: <20241028102559.1451383-5-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The patch, by informing pm_genpd_init() with the "is_off" parameter that the power domain is already on, prevents the power_on() callback from being called, thus avoiding the unnecessary repetition of the hardware power-on procedure. This feature is crucial when supporting the simple framebuffer, as the power domains have already been initialized by the bootloader. Co-developed-by: Michael Trimarchi Signed-off-by: Michael Trimarchi Signed-off-by: Dario Binacchi --- drivers/pmdomain/imx/gpcv2.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/drivers/pmdomain/imx/gpcv2.c b/drivers/pmdomain/imx/gpcv2.c index 963d61c5af6d..bf9fe4af03c5 100644 --- a/drivers/pmdomain/imx/gpcv2.c +++ b/drivers/pmdomain/imx/gpcv2.c @@ -1324,6 +1324,7 @@ static const struct imx_pgc_domain_data imx8mn_pgc_do= main_data =3D { static int imx_pgc_domain_probe(struct platform_device *pdev) { struct imx_pgc_domain *domain =3D pdev->dev.platform_data; + bool init_off; int ret; =20 domain->dev =3D &pdev->dev; @@ -1354,12 +1355,33 @@ static int imx_pgc_domain_probe(struct platform_dev= ice *pdev) regmap_update_bits(domain->regmap, domain->regs->map, domain->bits.map, domain->bits.map); =20 - ret =3D pm_genpd_init(&domain->genpd, NULL, true); + init_off =3D !of_property_read_bool(domain->dev->of_node, + "fsl,boot-on"); + ret =3D pm_genpd_init(&domain->genpd, NULL, init_off); if (ret) { dev_err(domain->dev, "Failed to init power domain\n"); goto out_domain_unmap; } =20 + if (!init_off) { + ret =3D pm_runtime_get_sync(domain->dev); + if (ret < 0) { + pm_runtime_put_noidle(domain->dev); + dev_err_probe(domain->dev, ret, "failed to power up bus domain\n"); + goto out_genpd_remove; + } + + if (domain->keep_clocks) { + ret =3D clk_bulk_prepare_enable(domain->num_clks, domain->clks); + if (ret) { + dev_err_probe(domain->dev, ret, + "failed to enable clocks for domain: %s\n", + domain->genpd.name); + goto out_pm_put; + } + } + } + if (IS_ENABLED(CONFIG_LOCKDEP) && of_property_read_bool(domain->dev->of_node, "power-domains")) lockdep_set_subclass(&domain->genpd.mlock, 1); @@ -1368,11 +1390,17 @@ static int imx_pgc_domain_probe(struct platform_dev= ice *pdev) &domain->genpd); if (ret) { dev_err(domain->dev, "Failed to add genpd provider\n"); - goto out_genpd_remove; + goto out_clk_unprepare; } =20 return 0; =20 +out_clk_unprepare: + if (!init_off && domain->keep_clocks) + clk_bulk_disable_unprepare(domain->num_clks, domain->clks); +out_pm_put: + if (!init_off) + pm_runtime_put(domain->dev); out_genpd_remove: pm_genpd_remove(&domain->genpd); out_domain_unmap: --=20 2.43.0 From nobody Mon Nov 25 09:34:07 2024 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F5CD1D6DDA for ; Mon, 28 Oct 2024 10:26:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111181; cv=none; b=XUOvC3QcezZRqBFyFsEM+r5FyC20Iq0S/U2rigKcov50OBh6vfaAUNEK514ESCih5gb/YAhScayrP0GTkGNzUWad21AWQtvOJg4bh1aR0WrrbVsRwrLCD3ueW0sUeW1siUr/cKwnbwbiBygn+jX+TdW5NXIgxzUqYQsEfqBwhEs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111181; c=relaxed/simple; bh=3psXIgjRnV7ZKnrPL1AM2s1fm8oNKskaRog0kOCOv3g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RWLtHAnKlLPZt4EM5w0HhfyILX9e6Up8tWGluJ/WL4znUjr4iZa8iwkfnoAUuJcrJnTVtfMnmNs5uFPeYzCJNfPLvN/ooEpNrWtlm1q3n/k5A16OJaFY1zwwZ9FyIxdbZhVJX+lkz2RMhwkPJTNEPOLdJDpnxfhpMCT83EMU8mo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com; spf=pass smtp.mailfrom=amarulasolutions.com; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b=Jcze/9VI; arc=none smtp.client-ip=209.85.218.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="Jcze/9VI" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a7aa086b077so511685166b.0 for ; Mon, 28 Oct 2024 03:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1730111177; x=1730715977; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pgo/k+HOa5AvPj9A+1CCmgMfc+PmvaON+Q6yQ1cAi7o=; b=Jcze/9VIjsysLKdcTvUcudd8yly1ZVSzLHJhka4apu/+gMJCh2UE0MTOb9ktA26Ak8 07su8D6Vasdax0TORKywYvsBSw7eSGccvgagmjVkdKNSFjZNDTc5QkxV5FZFs8R+gIsf hxImFQJ5Dm6oL9ccg7x4Dz0X0NbAn0b1Rugkk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730111177; x=1730715977; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pgo/k+HOa5AvPj9A+1CCmgMfc+PmvaON+Q6yQ1cAi7o=; b=pmMIo0gkDTg7jY5g2z0JbZqOyww+HxoGmpkt4nhlzKKaatCPrx1TSCpIWXsDeWFLxD TDJqy5ZYgieW2A9dZFmAIL14557pFL1AFXTtvUcHjpjHQbG5B3LsJYxEqd7l1AZ6QLUy /YZ+bgvLTaqXbhi3cIgOHfnRRf1Jqf9rDj8adLwxEhYGOjVkdsInTBM5b1o3ob9opCsa lfU2gPYJDVH8O7hhemhf9YGUxSlJym0CdtorI4o/Hs5bDwcT5Au2N33AgLyEalm/tHfu IYd1D4srde6kQTtv3eZbcAP/mMsl0NMwYYCWw3Y3cVB3ghZA4PsGZHzXizFUIDW9Vhsh Y+Zg== X-Gm-Message-State: AOJu0Yxlm6gMhss9eNqVkRIuuwWGVf/YpocqzdURoOPa4wv8VuvLxgZC 3ijt2mLdImHzuJtHhi2Y3ArT0lnWpUqKp3PBJXbVuthg6nIIFTW4M3iMxgIDl8HwZ5vj4K5aeFO Grbg= X-Google-Smtp-Source: AGHT+IE1qExZyTeDCcsOPLbzeTHr0FDTO0+eG+29GGN1U5BkMPni1pRPTaIjSGyhvowARpdu2dlhRg== X-Received: by 2002:a17:907:7292:b0:a9a:d23:f8ca with SMTP id a640c23a62f3a-a9de5c92bfcmr611522566b.13.1730111177428; Mon, 28 Oct 2024 03:26:17 -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.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 03:26:17 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Conor Dooley , David Airlie , Jessica Zhang , Krzysztof Kozlowski , Maarten Lankhorst , Maxime Ripard , Michael Trimarchi , Neil Armstrong , Rob Herring , Simona Vetter , Thomas Zimmermann , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [RFC PATCH 05/10] dt-bindings: display: panel: add 'syna,boot-on' property Date: Mon, 28 Oct 2024 11:25:28 +0100 Message-ID: <20241028102559.1451383-6-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The property states that the panel display has been initialized and left on by the bootloader. This information becomes relevant in the case of supporting the simple framebuffer. Signed-off-by: Dario Binacchi --- .../devicetree/bindings/display/panel/synaptics,r63353.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/synaptics,r633= 53.yaml b/Documentation/devicetree/bindings/display/panel/synaptics,r63353.= yaml index 2fd6e0ec3682..987fd6f8b866 100644 --- a/Documentation/devicetree/bindings/display/panel/synaptics,r63353.yaml +++ b/Documentation/devicetree/bindings/display/panel/synaptics,r63353.yaml @@ -25,6 +25,11 @@ properties: avdd-supply: true dvdd-supply: true =20 + syna,boot-on: + description: | + The display has been initialized and left on by the bootloader/firmw= are. + type: boolean + required: - compatible - reg --=20 2.43.0 From nobody Mon Nov 25 09:34:07 2024 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78EE21D88AC for ; Mon, 28 Oct 2024 10:26:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111183; cv=none; b=lF1DOy+WrYuGvI3lqudA5sg14VpQJ5GWXstFm+Fp+rwKnQCAExmPjkgKrOBAtDQxhBPIMCY4sVOqGqBnMJE7AaGQulRv7EjjdMedfN1Ga65fNlPlFXaYnZ/xqdGjIZMom2r+ErIAH+En5p6NBFHtOko4PeiQn/7WnYAvZIkzSzk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111183; c=relaxed/simple; bh=BT8krpIlKdeuoBoa0Me+C2adjJG9azTiV2+Ezvu9nxg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=n2pY+jx1Mo75Y0uDsza1mFQ9C05J2vNE0w5NO3Er2hdzvQjL8KOYqyME3PUvvwyQs5eFFvFX6R3Dj+fNhhk0oQ+Fep84lOip7oznSNaPsO1qWG9bTCe4dmVXCoRFdl1/ZsmR3nLul6mDU67AM6A9RWSx9YaKvJAInSrB7yQKOxc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com; spf=pass smtp.mailfrom=amarulasolutions.com; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b=YR3nHnAM; arc=none smtp.client-ip=209.85.218.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="YR3nHnAM" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a9a4031f69fso559618066b.0 for ; Mon, 28 Oct 2024 03:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1730111180; x=1730715980; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OXDPpN57LGyZzaHcm0JxAGhhGbbwxVltmDt3enjDY8Q=; b=YR3nHnAMWGgEX865R23Jj1f+E2GXwWEtbVNdGoU1Rck8ZfPy3A3NKV7ht6QixyqBsq YuU468p/fAxPVvRx15sxaQmAtc8DUQWcNK3MiptezZe+tKDemcQWmbXHv1Xjv9QUfEoq /LUE1Xau7A4XSKkObZMkVrh9+tlvjacyb2E2o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730111180; x=1730715980; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OXDPpN57LGyZzaHcm0JxAGhhGbbwxVltmDt3enjDY8Q=; b=jLg0Zq/JAQ5JD7TVrWvgsU6LRQ38IZeanOiCKb0xAzxRsNIkGlsCGikaBzoimKXcdR 6dB0jVOocaJE4rtihAC+q5onDB1mPAFixdG+UI6LNOmKqkATtJchiwDJBk3BoMSOKQ44 otC1FpSvJvx6E8jpN1t3IFGlpQwCQTEnrS99FJlvk/lLJyCH9UNfXMcjgDtbe+tbwnwO 4dJjDZAvEAIdZ2tot8q4nFELRWF3ftsQ0hfveHIY76bXF2Nwe8TPhioZ9XfWREK8yuui KIO3eC5JypgobadYILKwDp/q+WKCJrc1BLNCZLLk1hfVsSgkI29yGB4vg0wiSPGW/LhG Ggkg== X-Gm-Message-State: AOJu0YzA/B8DD18NAoz8a5Djo1s7mjUTK+kLHPdNRtlnaV/yR2NkCiDZ 8Ak23pjbiUAfGbBlGU3fu3mgr/AqafFuoE73OTmVQugB2wN2ROa5sW4wUk0PDk5g8pAF3aT4plm CjS0= X-Google-Smtp-Source: AGHT+IGIIRLGq3ogNM31hjyoqOVoY34pnS1OMJQTrH1F7+5cPe+gR2UOhwfrIkMj1DdEZZ5m3Q3jug== X-Received: by 2002:a17:907:72c2:b0:a99:f67c:2314 with SMTP id a640c23a62f3a-a9de5ee34d7mr848368866b.35.1730111178897; Mon, 28 Oct 2024 03:26:18 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 03:26:18 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Michael Trimarchi , David Airlie , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Neil Armstrong , Simona Vetter , Thomas Zimmermann , dri-devel@lists.freedesktop.org Subject: [RFC PATCH 06/10] drm/panel: synaptics-r63353: don't re-activate the panel if already setup Date: Mon, 28 Oct 2024 11:25:29 +0100 Message-ID: <20241028102559.1451383-7-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The patch does not re-execute the hardware initialization/activation procedure for the panel 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/panel/panel-synaptics-r63353.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-synaptics-r63353.c b/drivers/gpu/d= rm/panel/panel-synaptics-r63353.c index 169c629746c7..93e3ed545b34 100644 --- a/drivers/gpu/drm/panel/panel-synaptics-r63353.c +++ b/drivers/gpu/drm/panel/panel-synaptics-r63353.c @@ -258,6 +258,8 @@ static int r63353_panel_probe(struct mipi_dsi_device *d= si) int ret =3D 0; struct device *dev =3D &dsi->dev; struct r63353_panel *panel; + bool initialized; + enum gpiod_flags rflags; =20 panel =3D devm_kzalloc(&dsi->dev, sizeof(*panel), GFP_KERNEL); if (!panel) @@ -282,7 +284,9 @@ static int r63353_panel_probe(struct mipi_dsi_device *d= si) if (IS_ERR(panel->avdd)) return PTR_ERR(panel->avdd); =20 - panel->reset_gpio =3D devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); + initialized =3D of_property_read_bool(dev->of_node, "syna,boot-on"); + rflags =3D initialized ? GPIOD_ASIS : GPIOD_OUT_LOW; + panel->reset_gpio =3D devm_gpiod_get(dev, "reset", rflags); if (IS_ERR(panel->reset_gpio)) { dev_err(dev, "failed to get RESET GPIO\n"); return PTR_ERR(panel->reset_gpio); @@ -297,6 +301,10 @@ static int r63353_panel_probe(struct mipi_dsi_device *= dsi) return ret; =20 drm_panel_add(&panel->base); + if (initialized) { + r63353_panel_power_on(panel); + panel->base.prepared =3D true; + } =20 ret =3D mipi_dsi_attach(dsi); if (ret < 0) { --=20 2.43.0 From nobody Mon Nov 25 09:34:07 2024 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 916941D8DFB for ; Mon, 28 Oct 2024 10:26:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111184; cv=none; b=AtVDQFe1q0DFb2t8htsR7v9yu2y5lc7d+Zk+88Cmhmdf2R9RjT+/y9MXXNXCOhkxJvFFBLlKGLoJmSUZZvnaFx7owrqEwcdfQ2uXis7wHMRbT9NMPRrLdW3HiqwUJlF6VGL4GLQHGSldfuOy55Th785RMXc92cWv/9TUpHI7OAQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111184; c=relaxed/simple; bh=Vu9YzuIAIwoP+4gLmF6pDw8tNbaMFSbq7jA1Qh9tO4I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JSOyUnAKggMCVnh0MqZINasykbt/msL0JW38RF62jbUyXwK+Tdx667xRn0sBh2P8+W+rGY24TqsGhFW8H8meLwl+vAUrz1okVTWE7Z4YKY9URGHRIVaSWtiyQJrQgIgkq9BK0IlYuyD+EIQVhwPVgnt8LcUQRJAilNqjxYVmf/w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com; spf=pass smtp.mailfrom=amarulasolutions.com; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b=HcJO4w9c; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="HcJO4w9c" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a9a4031f69fso559619766b.0 for ; Mon, 28 Oct 2024 03:26:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1730111181; x=1730715981; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ub+YOxTaEj8h3/OEhQEBYuD58+vmy3bTawAxFBvQf9I=; b=HcJO4w9cWrQA/EJcWcmZ61Ho39MlZQKxPsCmAJN/uD1Pn0NZytvf7euciE8pBfHuiO 4YQP7fHaRkD2Q96QTQNDi2+7PzxK6zXupMWQrF974TGFWk+Oj6zN5BAwxhJz+uXd9MjL m/oLS92rT7JTGznoiox3VAvLfHylhK+g+BSpM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730111181; x=1730715981; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ub+YOxTaEj8h3/OEhQEBYuD58+vmy3bTawAxFBvQf9I=; b=wuvyysUEFy0UiiyCeY+YLKdexLzuhIh08XOEO1ajIlZTCJkHHE2Ducdk35DrVO16Go tmQzsLi/E2zMkDGE2u+RYAyYQzp47ga0xu9vKl0nEapNs0tOe556vhfjkIqrh55xwVWS m+JAU0M/746AbS87mGjwm9q25MHA/R14bsrfWM2wbXuCyIj/gLkAyoJNZjOmKnwOOUrb Gn+pQIFcnJ2LUV8UA9US4UjdK8rxthtMOA2ifnNOK/50JPzDOHwM/Fk2LE2d8dDYzzwN wfXk5VhXdIE1rH4AiVI0JGQgAvGXThy7YtgXm2QzrM0r2wMundYM5g6b6fPJSnaVN470 v44w== X-Gm-Message-State: AOJu0YzSPqGoNPom/xrGPVVd1MIRftx9CqCzrF/1MlOA6+O5yCBfu7V/ cZobix+SUJtGTMlG9lXps3elIlI/otp3kPymNweGkeXPv4xeGTecVjY5eRJDoiFOpCMqmHLHzdK 6P2s= X-Google-Smtp-Source: AGHT+IFjWfGueG7DeWkg63IGIF3kssQUY3V3Yt1YYtp6Z+uW3KJqsSXoNAzX7zrD1vHGbOebgF05zQ== X-Received: by 2002:a17:907:3f9d:b0:a9a:1160:993 with SMTP id a640c23a62f3a-a9de5c91c9dmr860387966b.8.1730111180788; Mon, 28 Oct 2024 03:26:20 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 03:26:20 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Andrzej Hajda , Conor Dooley , David Airlie , Inki Dae , Jagan Teki , Jernej Skrabec , Jonas Karlman , Krzysztof Kozlowski , Laurent Pinchart , Maarten Lankhorst , Marek Szyprowski , Maxime Ripard , Neil Armstrong , Rob Herring , Robert Foss , Simona Vetter , Thomas Zimmermann , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [RFC PATCH 07/10] dt-bindings: bridge: samsung-dsim: add 'samsung,boot-on' property Date: Mon, 28 Oct 2024 11:25:30 +0100 Message-ID: <20241028102559.1451383-8-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The property states that the bridge controller has been initialized and left on by the bootloader. This information becomes relevant in the case of supporting the simple framebuffer. Signed-off-by: Dario Binacchi --- .../bindings/display/bridge/samsung,mipi-dsim.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/display/bridge/samsung,mipi-= dsim.yaml b/Documentation/devicetree/bindings/display/bridge/samsung,mipi-d= sim.yaml index 4ed7a799ba26..34cd93bc41f9 100644 --- a/Documentation/devicetree/bindings/display/bridge/samsung,mipi-dsim.ya= ml +++ b/Documentation/devicetree/bindings/display/bridge/samsung,mipi-dsim.ya= ml @@ -132,6 +132,11 @@ properties: dependencies: lane-polarities: [data-lanes] =20 + samsung,boot-on: + description: + The bridge has been initialized and left on by the bootloader/firmwa= re. + type: boolean + required: - clock-names - clocks --=20 2.43.0 From nobody Mon Nov 25 09:34:07 2024 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B2741D9323 for ; Mon, 28 Oct 2024 10:26:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111186; cv=none; b=BfRzo6otqlMtmegmgaCQJRZEhBbMZMML6gPzkqxto1iZC36NSgF0yI3JvL2VH33NiChMBpEY4gb3PUwBpY3FiEoubLWgu5Tv71NNH8OZcxLguQNC0UdIaNt9JJqpcv9QvK3QqLZ4d3Ml+ACiLMaQWXsXxQTTyjFCTBbhNhIgZsQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111186; c=relaxed/simple; bh=XhJAVJsMqc3jWJeY5sUwKrKe2d7eZOn1JnEjj8THF0o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IVa9sGIeoK6DMOOU8nhSMSfd9oFT9Zm1YqT7vglAdBDp1Y1StbwviCfc32s12jfZnz7gaRdLABN2XfbQLc2y4do4exgRbhm+cTNWpTHZEk93ZYviPDBHGu37iO4/i5/tvz6wUK3CeTqcsLgUXOu8gPOErySVTFYQcK/aCr6V4tI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com; spf=pass smtp.mailfrom=amarulasolutions.com; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b=o0JI3CcO; arc=none smtp.client-ip=209.85.218.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="o0JI3CcO" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a9a0cee600aso535993666b.1 for ; Mon, 28 Oct 2024 03:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1730111183; x=1730715983; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=v0ceU2N4ZWu/FtoiewhZfxk5s76R6vPhrLuwGN01j9U=; b=o0JI3CcOhQ9MIILk3D8Z56WygsfRiYPtczF/iaz1gGGXJmi5jEzplo+srZ7ionKbEq sOC5wDUBay28465I5j/0ICWoM8gUt2PDQ01ubGGZ+k2DNTfikawsQNHeCFIYSMcFx0CV rZSaGA/JCDFiIXzvBNrKGH0pS6TR2msteVH3o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730111183; x=1730715983; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v0ceU2N4ZWu/FtoiewhZfxk5s76R6vPhrLuwGN01j9U=; b=haa7j9ujCeyJcqSby/kTEnEqxh65vsbWSyjuLYa7VsMMK6MR7Gft4CbG5JyobuQWgW 8PBBZomNn+oMiVBYcOFob2obrlaXenT+1ClyVn+1SFv38qbjVGbqYxslA5PgyIFDxAdI 0nlWlTithYPD0tNbl4GPiU5MCgyfc8lDAI9gvyaj5YojclHEC/bRZvQX8+PGd96krF3X iFPLvzCn3NJnAB7k0Tmxfr+nqePHYLnYnRM6J8kTznFaBcHaaLezbToSv5Q4W8anRIiv 1TYbQUZbrKU21pOcfgZ36aST2ZUlLs1BSXBHi8orM3hyrHQmUrMv4tNBdl/01BSBCrzQ j6WQ== X-Gm-Message-State: AOJu0YzZBCeY6pGgQbHvVwa7uH8hMIXth2Nwwk2C7kMlOsVn15L3Bui6 pPbh/Inahrd+Yy7MCDesE971NAddFS8HJLdywrOXS1dXv6LP1yX7T40+Gg2ND40K2qx8ah1p7f0 yZKs= X-Google-Smtp-Source: AGHT+IGk1NWuOLicniG16PKOif/FXsp+NvuIf9J+Hupxj0+7LKo6e8MDUzZowWTysAuCxxUypwbw8A== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =3D &pdev->dev; struct samsung_dsim *dsi; + bool initialized; int ret, i; =20 dsi =3D devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL); @@ -2010,6 +2011,13 @@ int samsung_dsim_probe(struct platform_device *pdev) dsi->bridge.funcs =3D &samsung_dsim_bridge_funcs; dsi->bridge.of_node =3D dev->of_node; dsi->bridge.type =3D DRM_MODE_CONNECTOR_DSI; + initialized =3D of_property_read_bool(dev->of_node, "samsung,boot-on"); + if (initialized) { + dsi->state =3D DSIM_STATE_INITIALIZED | DSIM_STATE_ENABLED; + ret =3D pm_runtime_resume_and_get(dev); + if (ret) + goto err_disable_runtime; + } =20 /* DE_LOW: i.MX8M Mini/Nano LCDIF-DSIM glue logic inverts HS/VS/DE */ if (dsi->plat_data->hw_type =3D=3D 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 =3D dsi->plat_data->host_ops->register_host(dsi); if (ret) - goto err_disable_runtime; + goto err_put_runtime; } =20 return 0; =20 +err_put_runtime: + if (initialized) + pm_runtime_put_sync(dev); err_disable_runtime: pm_runtime_disable(dev); =20 --=20 2.43.0 From nobody Mon Nov 25 09:34:07 2024 Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED06B1D95B3 for ; Mon, 28 Oct 2024 10:26:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111188; cv=none; b=iNKTR3HSgN2RgERqCcTYqtKIkTikJAHyQ6Mnyp6CFezGp8w4rGWerWLnO0327xdr3oHNTM3UQuKs/hcMG4rj/XeR84eiMiOPyMeuUfWCMh9aqDgFvAsCznx89xysKHDcwOyKgLOeEibmxxu+TkRBraWqlkCe5Qm3bS73Uy9I1TU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111188; c=relaxed/simple; bh=Bf/UL0py+Aoem3QDfrlUSLDA/Go0dx2JfQ0vlJCPhuw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k9aYN8RwM41RuiRNKhI/SbV/lfIiZaFsWn8lOUhX3fwSwhunBjKkMeHNp1fBS0s+7wB3XkcnGCz00qzcxcdyE6smNhgWWvWCoOeJZRoYO4QY/bmgb06Vd0Vz17tQgDLp5P3QyCTTXp77wWBcLdU/9ZL5uCLP5Q/4BllnaGGZcqQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com; spf=pass smtp.mailfrom=amarulasolutions.com; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b=LX3qzQMZ; arc=none smtp.client-ip=209.85.208.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="LX3qzQMZ" Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-5c9709c9b0cso5826266a12.1 for ; Mon, 28 Oct 2024 03:26:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1730111184; x=1730715984; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rR+lzb/We4vJpOJMhvb0fzb6ziPa4r87OMQDrQMxLAc=; b=LX3qzQMZACPqF8zlJGN90JMuSGqwSsvEk/rqWVCO9Di0Oy+rAi4C9Ianax864uPV/t MPN071aAZxfMvCX3clUwZP2JIjgHjQ54PUrN+Cs76e+lUCQtuyalZ1qQpWR5+D5b6fjv UAieg9Q4dPcCWmTnn2Te89UY/I4yyu0Xn1ihs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730111184; x=1730715984; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rR+lzb/We4vJpOJMhvb0fzb6ziPa4r87OMQDrQMxLAc=; b=t0v5OygMqZpfPq+d8ZUBLKS7JA95CtZOYkJ0bWkfb0HwUp0MGy4MbGtCFuKvOTQFCK gd9bMZLqjWetVbJNXt9yPaBF7qZ/5K8wmjzDglK93IWBWRNFnKoskLZWYcA7C7eqy5Qv mCVAgIY8FpJdqiZqGEj5pZqYiwSlgbZ9lrjopbRDu0QPPZq8XXJdLKLfLcMa9b8zJvHt RudvQT8PzKlbLsa8N2rG70pO56AsFwlSXlHx/mVyysbtP88a3yvbxDceuaWiG+JIZ5M5 CNZEy5ngsu+Um6GH3C1WC1SvaSpVFroDp40pRtqoEIoRqC8Mi8dV+DHFRG5Ll2twwTBb rimg== X-Gm-Message-State: AOJu0YwGB/aWXu2KSWXVRSaIpnl0SH6jpCR9d9q4oj0b/+QCPc4huwgg tWFN+zcr+rp/MhT0rGnsuQJmkSnW0MwWlqiDgvXcox8TUSp0BYfTYhWDNbS6NhJLM3eRmsIkC0F h0AA= X-Google-Smtp-Source: AGHT+IHAVYFMAgB+KAyZO87/7sx3tp0rbXix+BIz1smt6N19gM+Y6+v1PukMzpc/m5GRKmJHBaYyMg== X-Received: by 2002:a17:907:7e91:b0:a99:403e:2578 with SMTP id a640c23a62f3a-a9de5c91d04mr907125266b.5.1730111184145; Mon, 28 Oct 2024 03:26:24 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 03:26:23 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Conor Dooley , David Airlie , Krzysztof Kozlowski , Maarten Lankhorst , Marek Vasut , Maxime Ripard , Rob Herring , Simona Vetter , Stefan Agner , Thomas Zimmermann , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [RFC PATCH 09/10] dt-bindings: lcdif: add 'fsl,boot-on' property Date: Mon, 28 Oct 2024 11:25:32 +0100 Message-ID: <20241028102559.1451383-10-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The property states that the (e)LCDIF display controller has been initialized and left on by the bootloader. This information becomes relevant in the case of supporting the simple framebuffer. Signed-off-by: Dario Binacchi --- Documentation/devicetree/bindings/display/fsl,lcdif.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/display/fsl,lcdif.yaml b/Doc= umentation/devicetree/bindings/display/fsl,lcdif.yaml index 8e3a98aeec32..937f108daacb 100644 --- a/Documentation/devicetree/bindings/display/fsl,lcdif.yaml +++ b/Documentation/devicetree/bindings/display/fsl,lcdif.yaml @@ -71,6 +71,11 @@ properties: $ref: /schemas/graph.yaml#/properties/port description: The LCDIF output port =20 + fsl,boot-on: + description: | + The controller has been initialized and left on by the bootloader/fi= rmware. + type: boolean + required: - compatible - reg --=20 2.43.0 From nobody Mon Nov 25 09:34:07 2024 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 944FB1D9A59 for ; Mon, 28 Oct 2024 10:26:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111189; cv=none; b=ElNgMwe3QS9XJwaTzKbp3RCs5Oi6JpnUc5cJ5FdzDEpK5BhigMfv5UR/muhac8EWKPcxBX+8tUaYShNYFB3Jjbf2TLeODY0BK94zCsZSc2t0Sy05Etdpjx+iK2ZJ1k5URoRAQmouialw6CCgzqOUMMZ16gb6Ww6NmDJHvkczKew= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730111189; c=relaxed/simple; bh=SGAmR4rTXOAGzH5qe9m5L7xwcpV493faJv+dbyO/XxQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lYTAWrADl2sYMKxVCIOG34BRaSKh4U+nFe+3WXR7Xy2DY+MQ8bQQ2bDkaNdq0UxgI06QMGhAEBSE7mftpLWbZp2WAwGx25jxF/DYQSyrMt5gEQygbcRMeF2s7UaYxKGBFtcVsrUJyuZYXAnJ3aZ+m5BNJKuWYlkXvikUY2TgImA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com; spf=pass smtp.mailfrom=amarulasolutions.com; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b=kW8m69yn; arc=none smtp.client-ip=209.85.218.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="kW8m69yn" Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a9a6b4ca29bso510225966b.3 for ; Mon, 28 Oct 2024 03:26:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1730111186; x=1730715986; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aIDm7KBT1s0AbOc3yV3TQ9ohvs8sUqIvua5HhBI5V8A=; b=kW8m69ynIWguR5/Gg9loXvITIGopK9GVYHQv0ZBvk8osT3ntZ92IEVlFj5sBnbv9/M QYKUtklWlJuro67pREnNj7py/M0CLFtfywnKh4H6dJcxsAKVXD5+oPdNUUBU/49ddXHb MA1Yq1hzzNoLoE5aKMgNeVB4B9frC/gJ537dA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730111186; x=1730715986; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aIDm7KBT1s0AbOc3yV3TQ9ohvs8sUqIvua5HhBI5V8A=; b=kvxYTf0Ak+7qYhRdHaj7z7LDi3+87ILyzIHx+iY925sP1oo1GJIVtSuYG/4+GDiUPf Zp20snNhnT6wttJaccwqnYWQjx8tGVAPQvkEJlqKJqOKWsH4m4rnSW1lCrSv1QsRmQm5 nHVGfFaFfhDMbzIwVkqwq9K6ld700XWSqKQLN1PE8GlXSZ7rppAEXEfNmL75oKo8O3zJ IX9KudHht5/l1pC1eaQHp8Mc1sK8sg/wf1472XffJldiGwDL+4oViz9B52sDO7ZBQo7N 54A3aWjDpjxCH7mInOSg8cZJ3AuGHHuOEmGCAFzNqCB1xfHeDmfbMdrL15ykdzOD3qvz fzBQ== X-Gm-Message-State: AOJu0Yz1Ia4/wyOrmerGc16BB0xmNYYVIH0NhHf0m02Gb3DHg9O81YUY /wQARfw1nXZm7n27/22cZuWFqwZqkjomnvm2Csd7Ep77gvRT18l1aQ64OXYctApW5cWydfb5kf4 wXvY= X-Google-Smtp-Source: AGHT+IEA5nCg2j7DVomJoAqNLW+z2Nbv9V6XM3cl17RychbK0FRUPkeqVCDGC4TH9y5e5TfNamZx8g== X-Received: by 2002:a17:906:da8a:b0:a99:425c:c653 with SMTP id a640c23a62f3a-a9de5ce24f6mr866426966b.22.1730111185881; Mon, 28 Oct 2024 03:26:25 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 03:26:25 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , David Airlie , Fabio Estevam , Maarten Lankhorst , Marek Vasut , Maxime Ripard , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo , Simona Vetter , Stefan Agner , Thomas Zimmermann , dri-devel@lists.freedesktop.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 10/10] drm/mxsfb: stop controller and drain FIFOs if already initialized Date: Mon, 28 Oct 2024 11:25:33 +0100 Message-ID: <20241028102559.1451383-11-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" You can't re-program the controller if it is still running. This may lead to shifted pictures, so stop the controller and drain its FIFOs in case it's already properly setup. This patch is crucial when supporting the simple framebuffer, as the controller has already been initialized by the bootloader. Signed-off-by: Dario Binacchi --- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 3 +++ drivers/gpu/drm/mxsfb/mxsfb_drv.h | 1 + drivers/gpu/drm/mxsfb/mxsfb_kms.c | 14 +++++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsf= b_drv.c index cb5ce4e81fc7..38c94cdc8f6c 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c @@ -10,6 +10,7 @@ =20 #include #include +#include #include #include #include @@ -221,6 +222,8 @@ static int mxsfb_load(struct drm_device *drm, if (!mxsfb) return -ENOMEM; =20 + mxsfb->enabled =3D + of_property_read_bool(drm->dev->of_node, "fsl,boot-on"); mxsfb->drm =3D drm; drm->dev_private =3D mxsfb; mxsfb->devdata =3D devdata; diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.h b/drivers/gpu/drm/mxsfb/mxsf= b_drv.h index d160d921b25f..0f9ae4ce450c 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.h +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.h @@ -47,6 +47,7 @@ struct mxsfb_drm_private { struct drm_bridge *bridge; =20 bool crc_active; + bool enabled; }; =20 static inline struct mxsfb_drm_private * diff --git a/drivers/gpu/drm/mxsfb/mxsfb_kms.c b/drivers/gpu/drm/mxsfb/mxsf= b_kms.c index 7ed2516b6de0..d064a2bb65df 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c @@ -202,9 +202,11 @@ static void mxsfb_enable_controller(struct mxsfb_drm_p= rivate *mxsfb) writel(reg, mxsfb->base + LCDC_CTRL1); =20 writel(CTRL_RUN, mxsfb->base + LCDC_CTRL + REG_SET); + + mxsfb->enabled =3D true; } =20 -static void mxsfb_disable_controller(struct mxsfb_drm_private *mxsfb) +static void _mxsfb_disable_controller(struct mxsfb_drm_private *mxsfb) { u32 reg; =20 @@ -221,6 +223,13 @@ static void mxsfb_disable_controller(struct mxsfb_drm_= private *mxsfb) reg &=3D ~VDCTRL4_SYNC_SIGNALS_ON; writel(reg, mxsfb->base + LCDC_VDCTRL4); =20 + mxsfb->enabled =3D false; +} + +static void mxsfb_disable_controller(struct mxsfb_drm_private *mxsfb) +{ + _mxsfb_disable_controller(mxsfb); + clk_disable_unprepare(mxsfb->clk); if (mxsfb->clk_disp_axi) clk_disable_unprepare(mxsfb->clk_disp_axi); @@ -354,6 +363,9 @@ static void mxsfb_crtc_atomic_enable(struct drm_crtc *c= rtc, u32 bus_format =3D 0; dma_addr_t dma_addr; =20 + if (mxsfb->enabled) + _mxsfb_disable_controller(mxsfb); + pm_runtime_get_sync(drm->dev); mxsfb_enable_axi_clk(mxsfb); =20 --=20 2.43.0