Skip to content

Commit 7fdb98e

Browse files
ajitkupandeybebarino
authored andcommitted
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 <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 3663f26 commit 7fdb98e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

drivers/acpi/acpi_apd.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ static int fch_misc_setup(struct apd_private_data *pdata)
8787
if (ret < 0)
8888
return -ENOENT;
8989

90+
if (!acpi_dev_get_property(adev, "clk-name", ACPI_TYPE_STRING, &obj)) {
91+
clk_data->name = devm_kzalloc(&adev->dev, obj->string.length,
92+
GFP_KERNEL);
93+
94+
strcpy(clk_data->name, obj->string.pointer);
95+
} else {
96+
/* Set default name to mclk if entry missing in firmware */
97+
clk_data->name = "mclk";
98+
}
99+
90100
list_for_each_entry(rentry, &resource_list, node) {
91101
clk_data->base = devm_ioremap(&adev->dev, rentry->res->start,
92102
resource_size(rentry->res));

include/linux/platform_data/clk-fch.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
struct fch_clk_data {
1414
void __iomem *base;
15+
char *name;
1516
};
1617

1718
#endif /* __CLK_FCH_H */

0 commit comments

Comments
 (0)