Commit 39558030 authored by Srinivas Pandruvada's avatar Srinivas Pandruvada Committed by Daniel Lezcano

thermal: int340x: Provide notification for OEM variable change

When we receive ACPI notification for OEM variable change pass the
notification to user space handler. This will avoid polling for
OEM variable change from user space.
Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200915223650.406046-2-srinivas.pandruvada@linux.intel.com
parent df3e647d
...@@ -349,30 +349,30 @@ static void int3400_notify(acpi_handle handle, ...@@ -349,30 +349,30 @@ static void int3400_notify(acpi_handle handle,
{ {
struct int3400_thermal_priv *priv = data; struct int3400_thermal_priv *priv = data;
char *thermal_prop[5]; char *thermal_prop[5];
int therm_event;
if (!priv) if (!priv)
return; return;
switch (event) { switch (event) {
case INT3400_THERMAL_TABLE_CHANGED: case INT3400_THERMAL_TABLE_CHANGED:
thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", therm_event = THERMAL_TABLE_CHANGED;
priv->thermal->type);
thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d",
priv->thermal->temperature);
thermal_prop[2] = kasprintf(GFP_KERNEL, "TRIP=");
thermal_prop[3] = kasprintf(GFP_KERNEL, "EVENT=%d",
THERMAL_TABLE_CHANGED);
thermal_prop[4] = NULL;
kobject_uevent_env(&priv->thermal->device.kobj, KOBJ_CHANGE,
thermal_prop);
break; break;
case INT3400_ODVP_CHANGED: case INT3400_ODVP_CHANGED:
evaluate_odvp(priv); evaluate_odvp(priv);
therm_event = THERMAL_DEVICE_POWER_CAPABILITY_CHANGED;
break; break;
default: default:
/* Ignore unknown notification codes sent to INT3400 device */ /* Ignore unknown notification codes sent to INT3400 device */
break; return;
} }
thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", priv->thermal->type);
thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d", priv->thermal->temperature);
thermal_prop[2] = kasprintf(GFP_KERNEL, "TRIP=");
thermal_prop[3] = kasprintf(GFP_KERNEL, "EVENT=%d", therm_event);
thermal_prop[4] = NULL;
kobject_uevent_env(&priv->thermal->device.kobj, KOBJ_CHANGE, thermal_prop);
} }
static int int3400_thermal_get_temp(struct thermal_zone_device *thermal, static int int3400_thermal_get_temp(struct thermal_zone_device *thermal,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment