From patchwork Tue Sep 1 15:10:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 310399 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A51CC433E2 for ; Tue, 1 Sep 2020 16:02:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 78CB420866 for ; Tue, 1 Sep 2020 16:02:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598976174; bh=h68ZEXTEgHOBmJRPT4W4AKNXN5F2l6HFFOywB0QBYrs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=kf+vmYmxvjz/v1+L4g+PvVBXHFGQoC4LuNQu4AdJCTgKcfBQQbE72fQ3j2rdzngOJ hRVOZZ+mea4/tfJ40aIQWbTJpnFJ6WbcjgHPLGuqYMXswV/xemUQ2FKzxLMG5tN03l xyMsJaJpBF6p/3k2hRsBzkKIjQW6QHvNe3K1RG6s= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726979AbgIAQCw (ORCPT ); Tue, 1 Sep 2020 12:02:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:56978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731446AbgIAPnL (ORCPT ); Tue, 1 Sep 2020 11:43:11 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D8A9E2064B; Tue, 1 Sep 2020 15:43:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974991; bh=h68ZEXTEgHOBmJRPT4W4AKNXN5F2l6HFFOywB0QBYrs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EVXP+rFgGbvpzeHPpjSwMC+dOc+4P2FztW4rCbbo/IgLhQwNEYM2+Dw3ujLVWRCjM Dlrug6QSU3eAn0HLQK9g7vjlqPOn95ILqwrcbCpOvcER3byDCLxHG279Vu9s12q4or RzUODZMYglBcjhlw74jbON0+r9tq1+4naTwSqfdo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tim Harvey , Guenter Roeck Subject: [PATCH 5.8 167/255] hwmon: (gsc-hwmon) Scale temperature to millidegrees Date: Tue, 1 Sep 2020 17:10:23 +0200 Message-Id: <20200901151008.696784793@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200901151000.800754757@linuxfoundation.org> References: <20200901151000.800754757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tim Harvey commit c1ae18d313e24bc7833e1749dd36dba5d47f259c upstream. The GSC registers report temperature in decidegrees celcius so we need to scale it to represent the hwmon sysfs API of millidegrees. Cc: stable@vger.kernel.org Fixes: 3bce5377ef66 ("hwmon: Add Gateworks System Controller support") Signed-off-by: Tim Harvey Link: https://lore.kernel.org/r/1598548824-16898-1-git-send-email-tharvey@gateworks.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- drivers/hwmon/gsc-hwmon.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/hwmon/gsc-hwmon.c +++ b/drivers/hwmon/gsc-hwmon.c @@ -172,6 +172,7 @@ gsc_hwmon_read(struct device *dev, enum case mode_temperature: if (tmp > 0x8000) tmp -= 0xffff; + tmp *= 100; /* convert to millidegrees celsius */ break; case mode_voltage_raw: tmp = clamp_val(tmp, 0, BIT(GSC_HWMON_RESOLUTION));