From nobody Mon Feb 9 17:58:17 2026 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (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 5636F313295 for ; Wed, 28 Jan 2026 16:10:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616662; cv=none; b=TwMEhARQ6xueLKYIZqdaRR0grBsDqc+IPamVnpZmwjUnkUoOoiyX6o0shdDdPrYJkUZzOUQ5m1JVkPnHCKah0uQWYx3brOklH+Pwj1EnjAvry7ZeIHYIKCfJ3Y82lqqQmr6zz3gZ2JiMFgntoOTvU0PCrNVEn6zk9HC5sXwQ6gM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616662; c=relaxed/simple; bh=A57iIyprnVVgXhFe5kC51yr0jTxIdK2LZO5HdrKp1WA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OZNBS6VbdtrmEwEbSOsqMmQng0J9gEBsxD7Z1xDgnQoVLf1/3bpjJnBa76GWLdlv7AcnPs0bdB7aNQTch/Rx23I8ZOrWXi2ZB0IKD2YkeIjiBLWu/+MgQA5l0Thbyj/AFqRcZNaDZPylzLImjxnnSRooIxrQqoiXWE5L0npZ9JY= 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=MCmkrr8d; arc=none smtp.client-ip=209.85.218.53 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="MCmkrr8d" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-b8715a4d9fdso2716866b.0 for ; Wed, 28 Jan 2026 08:10:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769616657; x=1770221457; 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=iN7RPaetGrCUTSxMSp2jttEhwD8uGc4/qT3ZtQUJgjk=; b=MCmkrr8djzNFnlcajREnK5/+2Uz/mFERo3i0dQDr6UMYz2mNtOx210O7IoaamFcPtz lPdPQ48sEQOVbC2l7KsbN/P5d8w8Erh4kYUmL9VMqfWxEQFMKs/A0LFPXPWyLptUZL6y utOh2H7mYeOxO3WgpKkmiDDwhNv1Np180OiSnUQaY0D76olHPoGgwmwYckvKkjJLXwMN FdFVnWyyHqK1XAWUnEhOXyDMLIv9lQLCQmOTw67bUbM/JxhUsPPXBXQ6ZMKUUkfz5unr MlQIz+IyJihIL4LA/j/P4St6tus1x8ElmbYlij4wNe2aE83GLbUxz+1xf7yVJCYz3tCf pqHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769616657; x=1770221457; 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=iN7RPaetGrCUTSxMSp2jttEhwD8uGc4/qT3ZtQUJgjk=; b=WQ6bAhYB5Ao94Fi3OaJd56hEyE6blGaOHVTwOLeePSGTAcVLBqrRYlHKdfHAQ2DZxj c/8GBrIlh1q4REO3wVabZQMDcaPnOPXyNzm8wOgYp/ogvW8lNC5uOrV2dBkaor5M/ejN RW1rstL+i8e5Zr+aVnwZk+sKZLinrEaXIOblb4AXBYg4XCcZv06TPF+P0J7hfrtT3sgf +G9QOulWph/djmBox69y5djU9MIZ5p+6Hz/tr3BiDpeT3pBrZoM6O6M2QUcW1T2oBE4s NkrBO6CpQSe36MiNarDcoBxASFDS4Rdndlu5DXi2tq5jAT0pl+5+6etUhvTH1V2Ahrum YF6A== X-Forwarded-Encrypted: i=1; AJvYcCVQ/51unHjfKvO9dcYWiDW/C0Saxrht1yM+BLwDlBPoaAg0TEYZB9ENVNItFFbCXvJJTWLLpp9ATl2HrIA=@vger.kernel.org X-Gm-Message-State: AOJu0Yz9cFy8bUxS6hIz6Yv8p19J/PjhvhxGFQpOlB+1MHfPwV6PBHOl RDXHu/i/j3Su5WsL1tEuT2Z99FEvhIwe0P0q6F3CwW2cgWLGNUl7aHE0YSjALGyLIzw= X-Gm-Gg: AZuq6aLMayOuBneGpLcYDmfPDMmuL3GSGzXVgEsPhMVI6NzWwmH0JZaYSotSxcGAAmv eyHjkxnBcz49ckGe0HjqMpyre6uJzAV/oxOBeGScNQZ45Y4oWMrhh4iw2E7+AwWX0HpjYK06qEw g4ZVJtpJA+RITkLieFYcHDpdU+lmemAV1oaHNOkyVYqnnzdtWgDEKG4bVpmbrZLQJ60SRlRhgAJ 280NUNOjQMW8Spe4DLPqt1JPjSYZbBat3O2rSwhB7mhmk4bkA2nludVGyvsHAkix1dSN8dE2QM8 N5sMBQimuJrr5XeiuMjGGmlS3vipt/kNJOsF+K12LNjVHMCwPqB0HfyrRSmHSL9x1PuYbcoWGCp +s4VX/pKnGOoB3ky1IPbveFJQWHFpsKsibU45RjOY+FeWj6zuGTU0ovuI7HrGXOsxLYcfikcXLO qMerjqv0joCO2u/YcnIedTlE3CDihaxm6UM7FREdupi45mv9l13e7zIYKQN8whNXNB9YJEmDI4M YlgNj2va5LxIs8L X-Received: by 2002:a17:907:7289:b0:b88:5d85:47c with SMTP id a640c23a62f3a-b8dab1bc003mr399775066b.26.1769616656849; Wed, 28 Jan 2026 08:10:56 -0800 (PST) Received: from puffmais2.c.googlers.com (244.175.141.34.bc.googleusercontent.com. [34.141.175.244]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8dbf1c021fsm148553366b.49.2026.01.28.08.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jan 2026 08:10:56 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 28 Jan 2026 16:10:56 +0000 Subject: [PATCH v4 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: <20260128-gs101-pd-v4-7-cbe7bd5a4060@linaro.org> References: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> In-Reply-To: <20260128-gs101-pd-v4-0-cbe7bd5a4060@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.2 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 8df46b41f9bc8f0b2a03300169a4b52457faaf4d..2214d9f32d5967b60e84f68f4e9= 9a725d66a39eb 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.52.0.457.g6b5491de43-goog