Skip to content

Commit 3955803

Browse files
spandruvadadlezcano
authored andcommitted
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: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20200915223650.406046-2-srinivas.pandruvada@linux.intel.com
1 parent df3e647 commit 3955803

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

drivers/thermal/intel/int340x_thermal/int3400_thermal.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -349,30 +349,30 @@ static void int3400_notify(acpi_handle handle,
349349
{
350350
struct int3400_thermal_priv *priv = data;
351351
char *thermal_prop[5];
352+
int therm_event;
352353

353354
if (!priv)
354355
return;
355356

356357
switch (event) {
357358
case INT3400_THERMAL_TABLE_CHANGED:
358-
thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s",
359-
priv->thermal->type);
360-
thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d",
361-
priv->thermal->temperature);
362-
thermal_prop[2] = kasprintf(GFP_KERNEL, "TRIP=");
363-
thermal_prop[3] = kasprintf(GFP_KERNEL, "EVENT=%d",
364-
THERMAL_TABLE_CHANGED);
365-
thermal_prop[4] = NULL;
366-
kobject_uevent_env(&priv->thermal->device.kobj, KOBJ_CHANGE,
367-
thermal_prop);
359+
therm_event = THERMAL_TABLE_CHANGED;
368360
break;
369361
case INT3400_ODVP_CHANGED:
370362
evaluate_odvp(priv);
363+
therm_event = THERMAL_DEVICE_POWER_CAPABILITY_CHANGED;
371364
break;
372365
default:
373366
/* Ignore unknown notification codes sent to INT3400 device */
374-
break;
367+
return;
375368
}
369+
370+
thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", priv->thermal->type);
371+
thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d", priv->thermal->temperature);
372+
thermal_prop[2] = kasprintf(GFP_KERNEL, "TRIP=");
373+
thermal_prop[3] = kasprintf(GFP_KERNEL, "EVENT=%d", therm_event);
374+
thermal_prop[4] = NULL;
375+
kobject_uevent_env(&priv->thermal->device.kobj, KOBJ_CHANGE, thermal_prop);
376376
}
377377

378378
static int int3400_thermal_get_temp(struct thermal_zone_device *thermal,

0 commit comments

Comments
 (0)