From patchwork Sat Mar 18 08:05:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Crawford X-Patchwork-Id: 13179685 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3139C61DA4 for ; Sat, 18 Mar 2023 08:06:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229848AbjCRIGJ (ORCPT ); Sat, 18 Mar 2023 04:06:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229888AbjCRIGH (ORCPT ); Sat, 18 Mar 2023 04:06:07 -0400 Received: from ipmail06.adl3.internode.on.net (ipmail06.adl3.internode.on.net [150.101.137.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9F02119F27 for ; Sat, 18 Mar 2023 01:06:03 -0700 (PDT) IronPort-SDR: 641570ea_Zn9il6C0LMUm9ibvJPEZuUqr38CqZEiFDrDwCIX1pRE+stx JeNjFrXl9QWmr4fcO5/Z9h51uxApEsnxYZFvYEQ== X-SMTP-MATCH: 0 X-IPAS-Result: A2DYAgB4bxVkjPQc8jxaHgEBCxIMSYE7C4Iugk+zWIF+DwEPAQFEBAEBhQUChTUmNQgOAQIEAQEBAQMCAwEBAQEBAQMBAQYBAQEBAQEGBBQBAQEBQEWFaA2GVgIBAycLAQ0BATcBDxk4VwYBEoJ+gl21YTOBAYIIAQEGgmKaaIFeCYFAi26BFoM2ekI/gU6BFYJ6boQLLIZMmRcKgTR2gSAOSnOBBAIJAhFrgRIIa4F9QQINZQsOdoFMAoISAwkDBwVJQAMLGA0WOhMsNRQhXmwtEhIFAwsVKkcECDkGHDQRAggPEg8sQw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g cJI7epPeanAGipImJICCq6ezqY1ZC2fAW5zXsFa46ICGF/DdAGI2TShL167fuVPLafo9XCUJ tNPJMUVcTiDzweL8y4mAJATL49OnPIG4MQIfpXpLzUkt5qdtj9Yj4LCxBPhhWMEQ8RcruhlE 9n/Lwm9K223gWdYv0Tvr8MeY2qxXoQiVT3Gheuw9L0EKoIHvORSanoN67qTvUvEFCt8/hmRg hHPWL+O8cxm1rZXvtXNFodtOlyKDO3dBcWyzRCLktVRbNnwH9/EmCELp3LGYQlHH7sjdO5mt LaKse/y2BvOres0WGX3wKuERrh7zpi2VtpqL8vIFWRrrRaDfOTO4BIz3X+yBrIUsdFa5+ihH xCZbunpf/Eret5t/l9nQAkALAQ4FILMcbbGpwmxi9+uGyot+1XLA/3//EC4cFwBUDEDPqPPL zPdutGs14h+l5tNDhpVPMNWKcZ0D3G7UJR3auCrkyeTC1SppVawurHCsx4EwhOTA1mmFPfK2 770diLcRj+T5p6RlMp4trZstCI5FHx+2Ok8XnwM8u5M1gyVMjQ0EvQ/A74nVLdkyyD87cStL nWFJm4vEj70Ujl4YA3xqoarFBuWAusVfMz1PHo19keTcD27H56EHKAnzCp7/nNqYXH2+YlL8 z3FFqHYZXBdGq1UeNs= IronPort-HdrOrdr: A9a23:hcu2lqwM5mIzLV699RYAKrPw9r1zdoMgy1knxilNoHxuGPBwWf rOoB19726MtN5yMEtMpTnkAsW9qBznhP1ICOUqUotKGTOW3FdAT7sSi7cKvQeQeREWn9Q1vc xdmupFebrN5DNB7foSjjPXLz6ureP3iJxA/d2uqkuFVTsaF52I8T0JdzpzzXcGPzWv1PICZe Ch2vY= X-IronPort-Anti-Spam-Filtered: true Received: from 60-242-28-244.static.tpgi.com.au (HELO bits.crawford.emu.id.au) ([60.242.28.244]) by ipmail06.adl3.internode.on.net with ESMTP; 18 Mar 2023 18:36:02 +1030 Received: from agc.crawford.emu.id.au (agc.crawford.emu.id.au [IPv6:fdd2:7aad:d478:1:0:0:cb10:cc07]) (authenticated bits=0) by bits.crawford.emu.id.au (8.17.1/8.17.1) with ESMTPSA id 32I85iJZ2991191 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 18 Mar 2023 19:05:58 +1100 Authentication-Results: bits.crawford.emu.id.au; arc=none smtp.remote-ip=fdd2:7aad:d478:1::cb10:cc07 DKIM-Filter: OpenDKIM Filter v2.11.0 bits.crawford.emu.id.au 32I85iJZ2991191 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crawford.emu.id.au; s=s1; t=1679126758; bh=kIFYBqrfAvOh5cAF9JdOqZwAcJ73eKRXusAW6HIbx7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fdcj+zrHD0xFHEOF+kt0BBYPO9ViGmgewmotMzVteX1rIN/fU2asuPfZl1SBW0JG5 iRTWWqbt6PtRqp3xcLFf53j+FdmM2idWU7qiIWAmkQBQJQsFbW0ISi2DbIREtEg+Ce Xb7cdWkLTRS2w8t0YYyFeqCFY3sZcqqQOEOVIKM/pry9AUTX9k66nUyMd86VDFI2UX pUY64SIbSHG/quaBjGb6ctj8UfWniak+m/P0Gb+9tEwgo7pBfRT8rrx5tTAwbeABI5 eglgjetq+ZIt+5ZzPduiuTlhSDAXOImP/yXjQsFAiiWlTCj7AUMj645G/LjHsWiW95 m3GRXDAgb96fQ== From: Frank Crawford To: Jean Delvare , Guenter Roeck Cc: linux-hwmon@vger.kernel.org, Frank Crawford Subject: [PATCH v2 1/2] hwmon (it87): Add scaling macro for recent ADC voltages Date: Sat, 18 Mar 2023 19:05:42 +1100 Message-Id: <20230318080543.1226700-2-frank@crawford.emu.id.au> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318080543.1226700-1-frank@crawford.emu.id.au> References: <20230318080543.1226700-1-frank@crawford.emu.id.au> MIME-Version: 1.0 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (bits.crawford.emu.id.au [IPv6:fdd2:7aad:d478:1:0:0:cb10:cc01]); Sat, 18 Mar 2023 19:05:58 +1100 (AEDT) X-Virus-Scanned: clamav-milter 0.103.8 at bits.crawford.emu.id.au X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Generalise scaling to include all recent ADC values. This includes correction of an existing error for voltage scaling for chips that have 10.9mV ADCs, where scaling was not performed. Signed-off-by: Frank Crawford --- v2: * Split out the change to the scaling in a separate patch. --- drivers/hwmon/it87.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 66f7ceaa7c3f..e9614eb557d4 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -515,6 +515,8 @@ static const struct it87_devices it87_devices[] = { #define has_six_temp(data) ((data)->features & FEAT_SIX_TEMP) #define has_vin3_5v(data) ((data)->features & FEAT_VIN3_5V) #define has_conf_noexit(data) ((data)->features & FEAT_CONF_NOEXIT) +#define has_scaling(data) ((data)->features & (FEAT_12MV_ADC | \ + FEAT_10_9MV_ADC)) struct it87_sio_data { int sioaddr; @@ -3134,7 +3136,7 @@ static int it87_probe(struct platform_device *pdev) "Detected broken BIOS defaults, disabling PWM interface\n"); /* Starting with IT8721F, we handle scaling of internal voltages */ - if (has_12mv_adc(data)) { + if (has_scaling(data)) { if (sio_data->internal & BIT(0)) data->in_scaled |= BIT(3); /* in3 is AVCC */ if (sio_data->internal & BIT(1)) From patchwork Sat Mar 18 08:05:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Crawford X-Patchwork-Id: 13179686 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D4B5C74A5B for ; Sat, 18 Mar 2023 08:06:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229533AbjCRIGh (ORCPT ); Sat, 18 Mar 2023 04:06:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbjCRIGg (ORCPT ); Sat, 18 Mar 2023 04:06:36 -0400 Received: from ipmail06.adl3.internode.on.net (ipmail06.adl3.internode.on.net [150.101.137.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CAB591205A for ; Sat, 18 Mar 2023 01:06:34 -0700 (PDT) IronPort-SDR: 641570ee_wks+GBu8FazlWHN8+pIZ109Id7DnrmTR1xIm4lyy2ATzDVv /XQS9uRDWIHeoYi45hdW1Sf507g3D502ZLIfyuA== X-SMTP-MATCH: 0 Received: from 60-242-28-244.static.tpgi.com.au (HELO bits.crawford.emu.id.au) ([60.242.28.244]) by ipmail06.adl3.internode.on.net with ESMTP; 18 Mar 2023 18:36:06 +1030 Received: from agc.crawford.emu.id.au (agc.crawford.emu.id.au [IPv6:fdd2:7aad:d478:1:0:0:cb10:cc07]) (authenticated bits=0) by bits.crawford.emu.id.au (8.17.1/8.17.1) with ESMTPSA id 32I85iJa2991191 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 18 Mar 2023 19:06:01 +1100 Authentication-Results: bits.crawford.emu.id.au; arc=none smtp.remote-ip=fdd2:7aad:d478:1::cb10:cc07 DKIM-Filter: OpenDKIM Filter v2.11.0 bits.crawford.emu.id.au 32I85iJa2991191 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crawford.emu.id.au; s=s1; t=1679126762; bh=5KnocM6tvyAOQmZTCDe5S8EqWUci3Y4pOhixi3kI3BY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TJqp2aUCOy8+U0vZomCPwjHVtIP1rQIEzBErt1VpfBaC7C5lWUvVtzcq5j0UT8KWF 3WLXVInCK2oWsni4F/TflDoMZPS2taJ+zRxDvuXvKB4l0i78ND+w92CUP8EbUj5whz +K+4lM7AsKaRgWVkv+cNOzUFO0ZTBY2lalvnRN58sSL+YMR+cSl5z1Ly1BJHiInko1 5BscVCWU8Mu20XduRyoOXHL9aiJsO0kDTX2wR7h5ldv9uLBr7qRIVOHyt3q3IYT0vN +9VQINY+o4tRrfCwV4oijF5Sc1eVRWlvcMJg30s/RhGTL6Ngugnqvw2LgY9khoFOfm rTzdBQrDbq+bg== From: Frank Crawford To: Jean Delvare , Guenter Roeck Cc: linux-hwmon@vger.kernel.org, Frank Crawford Subject: [PATCH v2 2/2] hwmon (it87): Generalise matching labels Date: Sat, 18 Mar 2023 19:05:43 +1100 Message-Id: <20230318080543.1226700-3-frank@crawford.emu.id.au> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318080543.1226700-1-frank@crawford.emu.id.au> References: <20230318080543.1226700-1-frank@crawford.emu.id.au> MIME-Version: 1.0 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (bits.crawford.emu.id.au [IPv6:fdd2:7aad:d478:1:0:0:cb10:cc01]); Sat, 18 Mar 2023 19:06:02 +1100 (AEDT) X-Virus-Scanned: clamav-milter 0.103.8 at bits.crawford.emu.id.au X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Apply scaling macro to match the labels for internal voltage sensors. Signed-off-by: Frank Crawford --- v2: * Split out the change to match labels to a separate patch. --- drivers/hwmon/it87.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index e9614eb557d4..f774a0732a7c 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -2004,7 +2004,7 @@ static ssize_t show_label(struct device *dev, struct device_attribute *attr, if (has_vin3_5v(data) && nr == 0) label = labels[0]; - else if (has_12mv_adc(data) || has_10_9mv_adc(data)) + else if (has_scaling(data)) label = labels_it8721[nr]; else label = labels[nr];