ACPI: APD: Add a fmw property clk-name

Add a new device property to fetch clk-name from firmware.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Mario Limonciello <Mario.Limonciello@amd.com>
Link: https://lore.kernel.org/r/20211212180527.1641362-4-AjitKumar.Pandey@amd.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
Ajit Kumar Pandey 2021-12-12 23:35:25 +05:30 committed by Stephen Boyd
parent 3663f26b38
commit 7fdb98e8a7
2 changed files with 11 additions and 0 deletions

View File

@ -87,6 +87,16 @@ static int fch_misc_setup(struct apd_private_data *pdata)
if (ret < 0)
return -ENOENT;
if (!acpi_dev_get_property(adev, "clk-name", ACPI_TYPE_STRING, &obj)) {
clk_data->name = devm_kzalloc(&adev->dev, obj->string.length,
GFP_KERNEL);
strcpy(clk_data->name, obj->string.pointer);
} else {
/* Set default name to mclk if entry missing in firmware */
clk_data->name = "mclk";
}
list_for_each_entry(rentry, &resource_list, node) {
clk_data->base = devm_ioremap(&adev->dev, rentry->res->start,
resource_size(rentry->res));

View File

@ -12,6 +12,7 @@
struct fch_clk_data {
void __iomem *base;
char *name;
};
#endif /* __CLK_FCH_H */