Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

firmware: exynos-acpm: register ACPM clocks pdev

Register by hand a platform device for the ACPM clocks.
The ACPM clocks are not modeled as a DT child of ACPM because:
1/ they don't have their own resources.
2/ they are not a block that can be reused. The clock identifying
data is reduced (clock ID, clock name and mailbox channel ID)
and may differ from a SoC to another.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Tested-by: Peter Griffin <peter.griffin@linaro.org> # on gs101-oriole
Link: https://patch.msgid.link/20251010-acpm-clk-v6-3-321ee8826fd4@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

authored by

Tudor Ambarus and committed by
Krzysztof Kozlowski
bad0d126 84a222d1

+21
+21
drivers/firmware/samsung/exynos-acpm.c
··· 177 177 /** 178 178 * struct acpm_match_data - of_device_id data. 179 179 * @initdata_base: offset in SRAM where the channels configuration resides. 180 + * @acpm_clk_dev_name: base name for the ACPM clocks device that we're registering. 180 181 */ 181 182 struct acpm_match_data { 182 183 loff_t initdata_base; 184 + const char *acpm_clk_dev_name; 183 185 }; 184 186 185 187 #define client_to_acpm_chan(c) container_of(c, struct acpm_chan, cl) ··· 606 604 pmic_ops->update_reg = acpm_pmic_update_reg; 607 605 } 608 606 607 + static void acpm_clk_pdev_unregister(void *data) 608 + { 609 + platform_device_unregister(data); 610 + } 611 + 609 612 static int acpm_probe(struct platform_device *pdev) 610 613 { 611 614 const struct acpm_match_data *match_data; 615 + struct platform_device *acpm_clk_pdev; 612 616 struct device *dev = &pdev->dev; 613 617 struct device_node *shmem; 614 618 struct acpm_info *acpm; ··· 654 646 acpm_setup_ops(acpm); 655 647 656 648 platform_set_drvdata(pdev, acpm); 649 + 650 + acpm_clk_pdev = platform_device_register_data(dev, 651 + match_data->acpm_clk_dev_name, 652 + PLATFORM_DEVID_NONE, NULL, 0); 653 + if (IS_ERR(acpm_clk_pdev)) 654 + return dev_err_probe(dev, PTR_ERR(acpm_clk_pdev), 655 + "Failed to register ACPM clocks device.\n"); 656 + 657 + ret = devm_add_action_or_reset(dev, acpm_clk_pdev_unregister, 658 + acpm_clk_pdev); 659 + if (ret) 660 + return dev_err_probe(dev, ret, "Failed to add devm action.\n"); 657 661 658 662 return devm_of_platform_populate(dev); 659 663 } ··· 766 746 767 747 static const struct acpm_match_data acpm_gs101 = { 768 748 .initdata_base = ACPM_GS101_INITDATA_BASE, 749 + .acpm_clk_dev_name = "gs101-acpm-clk", 769 750 }; 770 751 771 752 static const struct of_device_id acpm_match[] = {