* [PATCH 0/2] Initial support for Exynos850 SoC in ACPM clk driver
@ 2026-05-12 20:40 Alexey Klimov
2026-05-12 20:40 ` [PATCH 1/2] clk: samsung: acpm: introduce driver data for SoC-specific clocks Alexey Klimov
2026-05-12 20:40 ` [PATCH 2/2] clk: samsung: acpm: add initial Exynos850 support Alexey Klimov
0 siblings, 2 replies; 5+ messages in thread
From: Alexey Klimov @ 2026-05-12 20:40 UTC (permalink / raw)
To: Sam Protsenko, Tudor Ambarus, Krzysztof Kozlowski,
Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Michael Turquette,
Stephen Boyd, Brian Masney
Cc: linux-samsung-soc, linux-clk, linux-kernel
This series adds support for the Exynos850 SoC to the Samsung ACPM clock
driver.
Currently, the driver hardcodes the GS101 clock variants directly within
its probe() routine. To cleanly support Exynos850 (and potentially other
SoCs that utilize the ACPM protocol in future), this series first
refactors the driver a little bit to be SoC-agnostic, and then wires up
the new Exynos850 data.
First patch introduces `driver_data` to dynamically extract clock lists,
number of clocks, names of clocks, and mailbox channel id, removing the
GS101 hardcoding.
Second patch introduces the `exynos850_acpm_clks` array and
"exynos850-acpm-clk" device ID.
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
---
Alexey Klimov (2):
clk: samsung: acpm: introduce driver data for SoC-specific clocks
clk: samsung: acpm: add initial Exynos850 support
drivers/clk/samsung/clk-acpm.c | 36 +++++++++++++++++++++++++++++++-----
1 file changed, 31 insertions(+), 5 deletions(-)
---
base-commit: e98d21c170b01ddef366f023bbfcf6b31509fa83
change-id: 20260512-exynos850-acpm-clk-bed1c23b66eb
Best regards,
--
Alexey Klimov <alexey.klimov@linaro.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] clk: samsung: acpm: introduce driver data for SoC-specific clocks
2026-05-12 20:40 [PATCH 0/2] Initial support for Exynos850 SoC in ACPM clk driver Alexey Klimov
@ 2026-05-12 20:40 ` Alexey Klimov
2026-05-18 10:57 ` Tudor Ambarus
2026-05-12 20:40 ` [PATCH 2/2] clk: samsung: acpm: add initial Exynos850 support Alexey Klimov
1 sibling, 1 reply; 5+ messages in thread
From: Alexey Klimov @ 2026-05-12 20:40 UTC (permalink / raw)
To: Sam Protsenko, Tudor Ambarus, Krzysztof Kozlowski,
Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Michael Turquette,
Stephen Boyd, Brian Masney
Cc: linux-samsung-soc, linux-clk, linux-kernel
Currently, the ACPM clock driver hardcodes the GS101 clock variant
arrays and counts directly in probe() routine. To support additional
other SoCs (for instance Exynos850 SoC) that use the same ACPM protocol
but have different clock trees, the driver needs to be more flexible.
Introduce driver data attached to the platform_device_id table.
Update the probe function to dynamically extract the clock lists,
number of clocks, its names and mailbox channel id based on the matching
device ID.
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
---
drivers/clk/samsung/clk-acpm.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/clk/samsung/clk-acpm.c b/drivers/clk/samsung/clk-acpm.c
index d8944160793a..604604b5b814 100644
--- a/drivers/clk/samsung/clk-acpm.c
+++ b/drivers/clk/samsung/clk-acpm.c
@@ -113,6 +113,8 @@ static int acpm_clk_register(struct device *dev, struct acpm_clk *aclk,
static int acpm_clk_probe(struct platform_device *pdev)
{
+ const struct acpm_clk_driver_data *drv_data;
+ const struct platform_device_id *id;
struct acpm_handle *acpm_handle;
struct clk_hw_onecell_data *clk_data;
struct clk_hw **hws;
@@ -126,8 +128,14 @@ static int acpm_clk_probe(struct platform_device *pdev)
return dev_err_probe(dev, PTR_ERR(acpm_handle),
"Failed to get acpm handle\n");
- count = acpm_clk_gs101.nr_clks;
- mbox_chan_id = acpm_clk_gs101.mbox_chan_id;
+ id = platform_get_device_id(pdev);
+ if (!id || !id->driver_data)
+ return -ENODEV;
+
+ drv_data = (const struct acpm_clk_driver_data *)id->driver_data;
+
+ count = drv_data->nr_clks;
+ mbox_chan_id = drv_data->mbox_chan_id;
clk_data = devm_kzalloc(dev, struct_size(clk_data, hws, count),
GFP_KERNEL);
@@ -154,8 +162,7 @@ static int acpm_clk_probe(struct platform_device *pdev)
hws[i] = &aclk->hw;
- err = acpm_clk_register(dev, aclk,
- acpm_clk_gs101.clks[i].name);
+ err = acpm_clk_register(dev, aclk, drv_data->clks[i].name);
if (err)
return dev_err_probe(dev, err,
"Failed to register clock\n");
@@ -166,7 +173,7 @@ static int acpm_clk_probe(struct platform_device *pdev)
}
static const struct platform_device_id acpm_clk_id[] = {
- { "gs101-acpm-clk" },
+ { "gs101-acpm-clk", (kernel_ulong_t)&acpm_clk_gs101 },
{}
};
MODULE_DEVICE_TABLE(platform, acpm_clk_id);
--
2.51.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] clk: samsung: acpm: add initial Exynos850 support
2026-05-12 20:40 [PATCH 0/2] Initial support for Exynos850 SoC in ACPM clk driver Alexey Klimov
2026-05-12 20:40 ` [PATCH 1/2] clk: samsung: acpm: introduce driver data for SoC-specific clocks Alexey Klimov
@ 2026-05-12 20:40 ` Alexey Klimov
2026-05-18 11:03 ` Tudor Ambarus
1 sibling, 1 reply; 5+ messages in thread
From: Alexey Klimov @ 2026-05-12 20:40 UTC (permalink / raw)
To: Sam Protsenko, Tudor Ambarus, Krzysztof Kozlowski,
Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Michael Turquette,
Stephen Boyd, Brian Masney
Cc: linux-samsung-soc, linux-clk, linux-kernel
The Exynos850 SoC utilizes the APM co-processor for clock management
via ACPM, similar to the GS101 SoC.
Add the Exynos850-specific clock variant array (including mif, int,
cpucl0, cpucl1, g3d, aud, cam, disp, and cp) and wire it up to the
driver data infrastructure. Add the "exynos850-acpm-clk" device ID
to enable dynamic instantiation of these clocks during probe().
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
---
drivers/clk/samsung/clk-acpm.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/clk/samsung/clk-acpm.c b/drivers/clk/samsung/clk-acpm.c
index 604604b5b814..d9b2604db03a 100644
--- a/drivers/clk/samsung/clk-acpm.c
+++ b/drivers/clk/samsung/clk-acpm.c
@@ -40,6 +40,18 @@ struct acpm_clk_driver_data {
.name = cname, \
}
+static const struct acpm_clk_variant exynos850_acpm_clks[] = {
+ ACPM_CLK("mif"),
+ ACPM_CLK("int"),
+ ACPM_CLK("cpucl0"),
+ ACPM_CLK("cpucl1"),
+ ACPM_CLK("g3d"),
+ ACPM_CLK("aud"),
+ ACPM_CLK("cam"),
+ ACPM_CLK("disp"),
+ ACPM_CLK("cp"),
+};
+
static const struct acpm_clk_variant gs101_acpm_clks[] = {
ACPM_CLK("mif"),
ACPM_CLK("int"),
@@ -57,6 +69,12 @@ static const struct acpm_clk_variant gs101_acpm_clks[] = {
ACPM_CLK("bo"),
};
+static const struct acpm_clk_driver_data acpm_clk_exynos850 = {
+ .clks = exynos850_acpm_clks,
+ .nr_clks = ARRAY_SIZE(exynos850_acpm_clks),
+ .mbox_chan_id = 0,
+};
+
static const struct acpm_clk_driver_data acpm_clk_gs101 = {
.clks = gs101_acpm_clks,
.nr_clks = ARRAY_SIZE(gs101_acpm_clks),
@@ -173,6 +191,7 @@ static int acpm_clk_probe(struct platform_device *pdev)
}
static const struct platform_device_id acpm_clk_id[] = {
+ { "exynos850-acpm-clk", (kernel_ulong_t)&acpm_clk_exynos850 },
{ "gs101-acpm-clk", (kernel_ulong_t)&acpm_clk_gs101 },
{}
};
--
2.51.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] clk: samsung: acpm: introduce driver data for SoC-specific clocks
2026-05-12 20:40 ` [PATCH 1/2] clk: samsung: acpm: introduce driver data for SoC-specific clocks Alexey Klimov
@ 2026-05-18 10:57 ` Tudor Ambarus
0 siblings, 0 replies; 5+ messages in thread
From: Tudor Ambarus @ 2026-05-18 10:57 UTC (permalink / raw)
To: Alexey Klimov, Sam Protsenko, Krzysztof Kozlowski,
Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Michael Turquette,
Stephen Boyd, Brian Masney
Cc: linux-samsung-soc, linux-clk, linux-kernel
On 5/12/26 11:40 PM, Alexey Klimov wrote:
> Currently, the ACPM clock driver hardcodes the GS101 clock variant
> arrays and counts directly in probe() routine. To support additional
> other SoCs (for instance Exynos850 SoC) that use the same ACPM protocol
> but have different clock trees, the driver needs to be more flexible.
>
> Introduce driver data attached to the platform_device_id table.
> Update the probe function to dynamically extract the clock lists,
> number of clocks, its names and mailbox channel id based on the matching
> device ID.
>
> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
> ---
> drivers/clk/samsung/clk-acpm.c | 17 ++++++++++++-----
> 1 file changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/clk/samsung/clk-acpm.c b/drivers/clk/samsung/clk-acpm.c
> index d8944160793a..604604b5b814 100644
> --- a/drivers/clk/samsung/clk-acpm.c
> +++ b/drivers/clk/samsung/clk-acpm.c
> @@ -113,6 +113,8 @@ static int acpm_clk_register(struct device *dev, struct acpm_clk *aclk,
>
> static int acpm_clk_probe(struct platform_device *pdev)
> {
> + const struct acpm_clk_driver_data *drv_data;
> + const struct platform_device_id *id;
> struct acpm_handle *acpm_handle;
> struct clk_hw_onecell_data *clk_data;
> struct clk_hw **hws;
> @@ -126,8 +128,14 @@ static int acpm_clk_probe(struct platform_device *pdev)
> return dev_err_probe(dev, PTR_ERR(acpm_handle),
> "Failed to get acpm handle\n");
>
> - count = acpm_clk_gs101.nr_clks;
> - mbox_chan_id = acpm_clk_gs101.mbox_chan_id;
> + id = platform_get_device_id(pdev);
> + if (!id || !id->driver_data)
> + return -ENODEV;
> +
> + drv_data = (const struct acpm_clk_driver_data *)id->driver_data;
> +
> + count = drv_data->nr_clks;
> + mbox_chan_id = drv_data->mbox_chan_id;
>
> clk_data = devm_kzalloc(dev, struct_size(clk_data, hws, count),
> GFP_KERNEL);
> @@ -154,8 +162,7 @@ static int acpm_clk_probe(struct platform_device *pdev)
>
> hws[i] = &aclk->hw;
>
> - err = acpm_clk_register(dev, aclk,
> - acpm_clk_gs101.clks[i].name);
> + err = acpm_clk_register(dev, aclk, drv_data->clks[i].name);
> if (err)
> return dev_err_probe(dev, err,
> "Failed to register clock\n");
> @@ -166,7 +173,7 @@ static int acpm_clk_probe(struct platform_device *pdev)
> }
>
> static const struct platform_device_id acpm_clk_id[] = {
> - { "gs101-acpm-clk" },
> + { "gs101-acpm-clk", (kernel_ulong_t)&acpm_clk_gs101 },
you need to include linux/mod_devicetable.h for kernel_ulong_t.
With that:
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> {}
> };
> MODULE_DEVICE_TABLE(platform, acpm_clk_id);
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] clk: samsung: acpm: add initial Exynos850 support
2026-05-12 20:40 ` [PATCH 2/2] clk: samsung: acpm: add initial Exynos850 support Alexey Klimov
@ 2026-05-18 11:03 ` Tudor Ambarus
0 siblings, 0 replies; 5+ messages in thread
From: Tudor Ambarus @ 2026-05-18 11:03 UTC (permalink / raw)
To: Alexey Klimov, Sam Protsenko, Krzysztof Kozlowski,
Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Michael Turquette,
Stephen Boyd, Brian Masney
Cc: linux-samsung-soc, linux-clk, linux-kernel
On 5/12/26 11:40 PM, Alexey Klimov wrote:
> The Exynos850 SoC utilizes the APM co-processor for clock management
> via ACPM, similar to the GS101 SoC.
>
> Add the Exynos850-specific clock variant array (including mif, int,
> cpucl0, cpucl1, g3d, aud, cam, disp, and cp) and wire it up to the
> driver data infrastructure. Add the "exynos850-acpm-clk" device ID
> to enable dynamic instantiation of these clocks during probe().
>
> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
> ---
> drivers/clk/samsung/clk-acpm.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/drivers/clk/samsung/clk-acpm.c b/drivers/clk/samsung/clk-acpm.c
> index 604604b5b814..d9b2604db03a 100644
> --- a/drivers/clk/samsung/clk-acpm.c
> +++ b/drivers/clk/samsung/clk-acpm.c
> @@ -40,6 +40,18 @@ struct acpm_clk_driver_data {
> .name = cname, \
> }
>
> +static const struct acpm_clk_variant exynos850_acpm_clks[] = {
> + ACPM_CLK("mif"),
> + ACPM_CLK("int"),
> + ACPM_CLK("cpucl0"),
> + ACPM_CLK("cpucl1"),
> + ACPM_CLK("g3d"),
> + ACPM_CLK("aud"),
> + ACPM_CLK("cam"),
> + ACPM_CLK("disp"),
> + ACPM_CLK("cp"),
> +};
What clocks did you test from the array?
you need bindings for the clocks, otherwise you'll reference the clocks
in device tree with raw integers. See:
See include/dt-bindings/clock/google,gs101-acpm.h.
Since the bindings patch have to be defined in their own patch:
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> +
> static const struct acpm_clk_variant gs101_acpm_clks[] = {
> ACPM_CLK("mif"),
> ACPM_CLK("int"),
> @@ -57,6 +69,12 @@ static const struct acpm_clk_variant gs101_acpm_clks[] = {
> ACPM_CLK("bo"),
> };
>
> +static const struct acpm_clk_driver_data acpm_clk_exynos850 = {
> + .clks = exynos850_acpm_clks,
> + .nr_clks = ARRAY_SIZE(exynos850_acpm_clks),
> + .mbox_chan_id = 0,
> +};
> +
> static const struct acpm_clk_driver_data acpm_clk_gs101 = {
> .clks = gs101_acpm_clks,
> .nr_clks = ARRAY_SIZE(gs101_acpm_clks),
> @@ -173,6 +191,7 @@ static int acpm_clk_probe(struct platform_device *pdev)
> }
>
> static const struct platform_device_id acpm_clk_id[] = {
> + { "exynos850-acpm-clk", (kernel_ulong_t)&acpm_clk_exynos850 },
> { "gs101-acpm-clk", (kernel_ulong_t)&acpm_clk_gs101 },
> {}
> };
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-05-18 11:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-12 20:40 [PATCH 0/2] Initial support for Exynos850 SoC in ACPM clk driver Alexey Klimov
2026-05-12 20:40 ` [PATCH 1/2] clk: samsung: acpm: introduce driver data for SoC-specific clocks Alexey Klimov
2026-05-18 10:57 ` Tudor Ambarus
2026-05-12 20:40 ` [PATCH 2/2] clk: samsung: acpm: add initial Exynos850 support Alexey Klimov
2026-05-18 11:03 ` Tudor Ambarus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®