Skip to content

Commit 7a24829

Browse files
Wer-Wolfij-intel
authored andcommitted
platform/x86: dell-ddv: Fix temperature calculation
On the Dell Inspiron 3505 the battery temperature is always 0.1 degrees larger than the temperature show inside the OEM application. Emulate this behaviour to avoid showing strange looking values like 29.1 degrees. Fixes: 0331b1b ("platform/x86: dell-ddv: Fix temperature scaling") Signed-off-by: Armin Wolf <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent e57eabe commit 7a24829

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/platform/x86/dell/dell-wmi-ddv.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,8 +665,10 @@ static ssize_t temp_show(struct device *dev, struct device_attribute *attr, char
665665
if (ret < 0)
666666
return ret;
667667

668-
/* Use 2731 instead of 2731.5 to avoid unnecessary rounding */
669-
return sysfs_emit(buf, "%d\n", value - 2731);
668+
/* Use 2732 instead of 2731.5 to avoid unnecessary rounding and to emulate
669+
* the behaviour of the OEM application which seems to round down the result.
670+
*/
671+
return sysfs_emit(buf, "%d\n", value - 2732);
670672
}
671673

672674
static ssize_t eppid_show(struct device *dev, struct device_attribute *attr, char *buf)

0 commit comments

Comments
 (0)