Skip to content

Commit f1b07a1

Browse files
sumeetpawnikardlezcano
authored andcommitted
thermal/drivers/int340x: Use IMOK independently
Some chrome platform requires IMOK method in coreboot. But these platforms don't use GDDV data vault in coreboot. As per current code flow, to enable and use IMOK only, we need to have GDDV support as well in coreboot. This patch removes the dependency for IMOK from GDDV to enable and use IMOK independently. Signed-off-by: Sumeet Pawnikar <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Acked-by: Zhang Rui <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b5f7912 commit f1b07a1

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

drivers/thermal/intel/int340x_thermal/int3400_thermal.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,12 @@ static struct attribute *imok_attr[] = {
108108
NULL
109109
};
110110

111+
static const struct attribute_group imok_attribute_group = {
112+
.attrs = imok_attr,
113+
};
114+
111115
static const struct attribute_group data_attribute_group = {
112116
.bin_attrs = data_attributes,
113-
.attrs = imok_attr,
114117
};
115118

116119
static ssize_t available_uuids_show(struct device *dev,
@@ -522,6 +525,12 @@ static int int3400_thermal_probe(struct platform_device *pdev)
522525
if (result)
523526
goto free_rel_misc;
524527

528+
if (acpi_has_method(priv->adev->handle, "IMOK")) {
529+
result = sysfs_create_group(&pdev->dev.kobj, &imok_attribute_group);
530+
if (result)
531+
goto free_imok;
532+
}
533+
525534
if (priv->data_vault) {
526535
result = sysfs_create_group(&pdev->dev.kobj,
527536
&data_attribute_group);
@@ -545,6 +554,8 @@ static int int3400_thermal_probe(struct platform_device *pdev)
545554
}
546555
free_uuid:
547556
sysfs_remove_group(&pdev->dev.kobj, &uuid_attribute_group);
557+
free_imok:
558+
sysfs_remove_group(&pdev->dev.kobj, &imok_attribute_group);
548559
free_rel_misc:
549560
if (!priv->rel_misc_dev_res)
550561
acpi_thermal_rel_misc_device_remove(priv->adev->handle);
@@ -573,6 +584,7 @@ static int int3400_thermal_remove(struct platform_device *pdev)
573584
if (priv->data_vault)
574585
sysfs_remove_group(&pdev->dev.kobj, &data_attribute_group);
575586
sysfs_remove_group(&pdev->dev.kobj, &uuid_attribute_group);
587+
sysfs_remove_group(&pdev->dev.kobj, &imok_attribute_group);
576588
thermal_zone_device_unregister(priv->thermal);
577589
kfree(priv->data_vault);
578590
kfree(priv->trts);

0 commit comments

Comments
 (0)