From nobody Fri Apr 10 01:05:53 2026 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.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 8390D29A9C8 for ; Thu, 5 Mar 2026 06:12:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772691123; cv=none; b=sXedOqdhzTn8dPgPkm/wLCt+kFJmnVGuI41lGLvkxuwUbWdzRqZV2rbZhrl+3y3HzFkLdQml8oOJkN9U3JVBTS2mT6Tq3s3W/l4cl69fqsBxHAjVCU0xhx+NThfwbOYmH65bYZgd4lMCsdaF33iB9DSG/qA1+yX7YeCcGnEqNPs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772691123; c=relaxed/simple; bh=0U4HtqSeHlGrJn9AJ7ErQ0CtQcraLAhfSS8YefF1XM0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aSrbFOkN6AkTtBlntbV06QZpIjdXMSVPgcoPqIYTKMnnbpmIRg+dG/ojt4BEDqt3KQzjBnSWtn/Q9Xb/VNgYfyme79aEzj8B7cjQHmLLpmC19L0/QcSlWTUO7SHM+aHcOOFTt1hPrFFtBxarDY1qySZ6BwzYNv3Fdz2YzVwtw8Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=MumPSCyi; arc=none smtp.client-ip=209.85.208.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MumPSCyi" Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-65faaa8b807so4648698a12.3 for ; Wed, 04 Mar 2026 22:12:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1772691120; x=1773295920; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=VJGr1pYRHm/J99djTiuPZ983bNSUstvUPO/CtwCwtA8=; b=MumPSCyiIIGFBv3kg1V87YDaCD1aff37dN1kN1S8195p2Xn4a+d88P1PpZq0tT9UXT 1ZQvR+5qx61vBHI2iJf33z+UP999MH8Sv3EWepaoX4TcOoEj5+USVR2P7FKDfoKcGZ7h Q+QLftigKtQBCFH6/c6fT4zxc9zeXcPEeMlrUfCjiT9WQqbM59V1hs/tTkU/zujle8wy Qa9LQwxZvubO2mAYzrOa3po6l/7x/7SFyJKVimo4WTo6HmeZ4TH0bftrn0vnznIc6iK1 0/8LmnrvehLILbFcMgjZgZFQYBIuruCG1JzXbZhChgCw/zjDM3iUP+Acya6BXf6lZN9g dRew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772691120; x=1773295920; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=VJGr1pYRHm/J99djTiuPZ983bNSUstvUPO/CtwCwtA8=; b=mhgQy1xeNOGpWVX0qRlq5F45eQNxuzcwmuySOzyE9bg8M1BQ9iq0Djxs03Z8gcqMSw gjSbTOUgGmOPIgo1p9LzcTqegWofZPw2YPaOsYFZilpLIt8fea+Ln2kq7g2GnANHuJ1/ PHHNOIcZLOJsgI2SLMGg/Op/psi6rhq23Nqmo1M5NSCldZxAfF8l0s9zWSlCmRjyUodJ 6Bzkob57SkGddF74QKozJHAxv96iwsI65rDSk95lwVd1TY3SxOyakpZfy+/dcevIPxvX uHpFXPsR4gW5HZaw3R8L1Wz4cgb4LUvvFRgEKiiaH7XPTOe4vbOXV73/v36jMXhGXmbz /XIw== X-Forwarded-Encrypted: i=1; AJvYcCUUWMxkS1Z9rziP2AJFSRTodqsLTrpo5YceB08LeLn37wBgVEj+zbvvFNt7OI9WkSAJdZHeD8yz+wtmjJA=@vger.kernel.org X-Gm-Message-State: AOJu0YzMClu9IDILqBoALWumjAzTouommJkPbYzkzrYC/xyY2CKWJRLu NUFRMaZSFpkUO1PljvYuZj6IPFt3i59XUrn/+7NHDnb3bc7F95fpPVVpdfwNB8L8ycs= X-Gm-Gg: ATEYQzzLDIHOg8vzyIU8vnhVmi/Qx8YZqHWkwStk0N1P3yPucdo+HyDqjEWKAXS7kHh NNpFwLFyH9b71KGs9Ob4pUE5m1BWvx/5DSXzXxc/3fX9qcsVT486zVL6K5UhbSzCBL4HS+Xp4s8 a3USaT5uHC65CmkGzfj5OQK/87Go/JZkcYdF4DFfXIjQApJSEFkyoi0iJULAsa7JuzMUdW4HM0C Nr9zLdTrpId8BOWEJ6FznnWyAqeMn/fB4gnjIvHqvysAbQMxWAHWnm3KUgYWarA3djLZ0XaVLQ9 ZNFhET8aDrIiGTrvKsKGgnP3JSuvjSRZtn2REVMyi+2EqjpOYomJySgKHIihgWVOl00dvIRZTu1 fQJFQVi7F8rJQbWEq2oyInT6jTXtgCfUwa39LQ4zqYxpLoulTh3VBNkFuGu2Jgm6nrO1ftve9GE 90KdCGt/ODtymiNehtxEHgFDh3Jwn2YVS5E4BArdSoxtMFDF157eikQ3MudAy21Mdw2uKu+lJYu fgGeXCCPssAkiE= X-Received: by 2002:a17:907:2d87:b0:b88:5158:d106 with SMTP id a640c23a62f3a-b93f154b56dmr291262066b.52.1772691119766; Wed, 04 Mar 2026 22:11:59 -0800 (PST) Received: from puffmais2.c.googlers.com (221.210.91.34.bc.googleusercontent.com. [34.91.210.221]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b935aec3243sm849355966b.53.2026.03.04.22.11.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2026 22:11:59 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Thu, 05 Mar 2026 06:11:56 +0000 Subject: [PATCH v6 07/10] pmdomain: samsung: add support for google,gs101-pd Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260305-gs101-pd-v6-7-8cb953c1a723@linaro.org> References: <20260305-gs101-pd-v6-0-8cb953c1a723@linaro.org> In-Reply-To: <20260305-gs101-pd-v6-0-8cb953c1a723@linaro.org> To: Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Conor Dooley , Krzysztof Kozlowski , Ulf Hansson , Liam Girdwood , Mark Brown Cc: Peter Griffin , Tudor Ambarus , Juan Yescas , Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= , Marek Szyprowski X-Mailer: b4 0.14.3 On Google gs101, direct mmio register access to the PMU registers doesn't work and access must happen via a regmap created by the PMU driver instead. Add a flag to the device match data to denote this case, and obtain the regmap using the parent node in DT if true, while keeping to use the traditional direct mmio regmap otherwise. Additionally, the status is just one bit on gs101. Tested-by: Marek Szyprowski Signed-off-by: Andr=C3=A9 Draszik --- v4: - add 'use_parent_regmap' flag instead of going by 'syscon' compatible in parent, as it's not a given that the parent provides a syscon- compatible regmap (it actually doesn't anymore after recent changes on gs101) I've still kept Marek's Tested-by from v3, as legacy Exynos code doesn't change. --- drivers/pmdomain/samsung/exynos-pm-domains.c | 66 +++++++++++++++++++-----= ---- 1 file changed, 46 insertions(+), 20 deletions(-) diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomai= n/samsung/exynos-pm-domains.c index 8df46b41f9bc..2214d9f32d59 100644 --- a/drivers/pmdomain/samsung/exynos-pm-domains.c +++ b/drivers/pmdomain/samsung/exynos-pm-domains.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -21,6 +22,7 @@ struct exynos_pm_domain_config { /* Value for LOCAL_PWR_CFG and STATUS fields for each domain */ u32 local_pwr_cfg; + bool use_parent_regmap; }; =20 /* @@ -93,8 +95,16 @@ static const struct exynos_pm_domain_config exynos5433_c= fg =3D { .local_pwr_cfg =3D 0xf, }; =20 +static const struct exynos_pm_domain_config gs101_cfg =3D { + .local_pwr_cfg =3D BIT(0), + .use_parent_regmap =3D true, +}; + static const struct of_device_id exynos_pm_domain_of_match[] =3D { { + .compatible =3D "google,gs101-pd", + .data =3D &gs101_cfg, + }, { .compatible =3D "samsung,exynos4210-pd", .data =3D &exynos4210_cfg, }, { @@ -122,17 +132,9 @@ static int exynos_pd_probe(struct platform_device *pde= v) struct of_phandle_args child, parent; struct exynos_pm_domain *pd; struct resource *res; - void __iomem *base; unsigned int val; int on, ret; =20 - struct regmap_config reg_config =3D { - .reg_bits =3D 32, - .val_bits =3D 32, - .reg_stride =3D 4, - .use_relaxed_mmio =3D true, - }; - pm_domain_cfg =3D of_device_get_match_data(dev); pd =3D devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL); if (!pd) @@ -143,25 +145,49 @@ static int exynos_pd_probe(struct platform_device *pd= ev) return -ENOMEM; =20 /* - * The resource typically points into the address space of the PMU. + * The resource typically points into the address space of the PMU and + * we have to consider two cases: + * 1) some implementations require a custom regmap (from PMU parent) + * 2) this driver might map the same addresses as the PMU driver * Therefore, avoid using devm_platform_get_and_ioremap_resource() and - * instead use platform_get_resource() and devm_ioremap() to avoid + * instead use platform_get_resource() here, and below for case 1) use + * syscon_node_to_regmap() while for case 2) use devm_ioremap() to avoid * conflicts due to address space overlap. */ res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) return dev_err_probe(dev, -ENXIO, "missing IO resources"); =20 - base =3D devm_ioremap(dev, res->start, resource_size(res)); - if (!base) - return dev_err_probe(dev, -ENOMEM, - "failed to ioremap PMU registers"); - - reg_config.max_register =3D resource_size(res) - reg_config.reg_stride; - pd->regmap =3D devm_regmap_init_mmio(dev, base, ®_config); - if (IS_ERR(pd->regmap)) - return dev_err_probe(dev, PTR_ERR(base), - "failed to init regmap"); + if (pm_domain_cfg->use_parent_regmap) { + pd->regmap =3D syscon_node_to_regmap(dev->parent->of_node); + if (IS_ERR(pd->regmap)) + return dev_err_probe(dev, PTR_ERR(pd->regmap), + "failed to acquire PMU regmap"); + + pd->configuration_reg =3D res->start; + pd->status_reg =3D res->start; + } else { + void __iomem *base; + + const struct regmap_config reg_config =3D { + .reg_bits =3D 32, + .val_bits =3D 32, + .reg_stride =3D 4, + .use_relaxed_mmio =3D true, + .max_register =3D (resource_size(res) + - reg_config.reg_stride), + }; + + base =3D devm_ioremap(dev, res->start, resource_size(res)); + if (!base) + return dev_err_probe(dev, -ENOMEM, + "failed to ioremap PMU registers"); + + pd->regmap =3D devm_regmap_init_mmio(dev, base, ®_config); + if (IS_ERR(pd->regmap)) + return dev_err_probe(dev, PTR_ERR(base), + "failed to init regmap"); + } =20 pd->pd.power_off =3D exynos_pd_power_off; pd->pd.power_on =3D exynos_pd_power_on; --=20 2.53.0.473.g4a7958ca14-goog