From patchwork Thu Oct 20 21:03:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 444 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp323323wrr; Thu, 20 Oct 2022 14:06:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5bAVFrS8RM1Bwu3Yni1Cn54Q5gC2/n67wNKZu7SBjLPHazxEkHMF1jPC4A7yUJIECkNgVG X-Received: by 2002:a05:6402:d75:b0:459:fad8:fbf with SMTP id ec53-20020a0564020d7500b00459fad80fbfmr13811704edb.0.1666299999146; Thu, 20 Oct 2022 14:06:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666299999; cv=none; d=google.com; s=arc-20160816; b=q3FrK6yVwuIgKtTa2nA0ti+l56B0g+TaZlF4zGX1KYH9jWbwql1S6g1OMvl31jLXo5 bd/YMojVd2u43PENgu8toqiiDUX+ewAkQIX+yYDU0YGYc70XGKmVlZDIIeNCJSIgd5Nl T73Z/UfGKtHTfHAdKnQqNP0Ctx9eDM7kqkyVASHTHT+o7m4u3RTN5ZYCCYj/ZbSt+FT8 JqOkofuTFIyYTtcqjcsTPK2dvCx6UXr3yaI1agXudNQU2oM6UqLAWpJBSE9/uzzT85fF GJl6G7i9Db4QaBdwlp2HGtxUIJZN9WEmyIZijO8N4D/jdqbgEjAaGuqqTYLq+LhXDKZz Qwjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=IGFCobZRK7q8Le6wQKMOqtMW4v64gOHn4YBe4dY8Rdo=; b=fSe4NRJ2mQkz1EK3YEzeUrX6vikC1emgCi3sMrUxwbrZ/s/pwdHwgzavIEjMYkGlDy n1pQZuR5k+g8V/fx/2bhANOr6at3S0F0QzdHUbueEeDb9xvWrCyF2E2Z56qTkAa2z0KY N8319PYGRNLgTYoljP7+Fakl9ywok23HdBjiWcZKFff6dX2A2jx8SlxHjneNfh8o+DmG xbgUoxka8JUuSDFXHXkR4BHoQY5w9k2dXpKwfSyN0IYiDU2xHE4mhxPkkRGuQr/xMQIQ XnbBgjMXzkR88v/lOnkS3F1SmTfgJmepNenUoL1Br3OU4pD8t26kn+20p1CrzHOmwnpP +mqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20210112 header.b=XPZK2WYu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ka14-20020a170907990e00b0078358970513si15046367ejc.367.2022.10.20.14.06.14; Thu, 20 Oct 2022 14:06:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20210112 header.b=XPZK2WYu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229930AbiJTVDq (ORCPT + 99 others); Thu, 20 Oct 2022 17:03:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229823AbiJTVDo (ORCPT ); Thu, 20 Oct 2022 17:03:44 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6FEB220FBD; Thu, 20 Oct 2022 14:03:43 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id e18so1425199edj.3; Thu, 20 Oct 2022 14:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=IGFCobZRK7q8Le6wQKMOqtMW4v64gOHn4YBe4dY8Rdo=; b=XPZK2WYue5gnubN05fUFxAcbiuJgDs85JHmdo5kUvk5/+vh72a9xG7RXtlsyBU3YgL xknfLOF9ziAvdpW8IxovNRQGAx1zNxqJqWFbRMPEOcBD1lb3p1tDQQATeGTX2sCIEdSp c7uIAp6fjgPfEZIrcDXFK+BxZz/3yuL41NR6Xj5JzZC477GLcdfgjHWjDqsHd212eMDX OkvlrL7RyVVDA0W+czNBQHP0KKjBpErc9MTElGozmNrirLeiCA03OtWkrdlpqYKYlyPw TAy0dN2LIX5pHEGiKLdrnfvtwEOj9DtmZINKSAyW2qWv9R+QWJ7AdYasFSkDQgctOVGH BMjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IGFCobZRK7q8Le6wQKMOqtMW4v64gOHn4YBe4dY8Rdo=; b=zCxJS61M+qfIOyLBek8T0LRa03yWHfm5R4rCThnvHmd6KdOiN2Xni0WrvuwAg3EOgj 8SogHAMCr2TKFKyNnAnuWtXUBOu4Y2hJtr6vCFUdkaqJBpVPTBj33Q9Q8O6ZquWz/EIh Di6JbKYsWWONKKJZ25fDEsWHPuH2lsrLbqRYmRLWwQ6ldg3JHuy7tlKm11SFJtOoT6/A quldqosK/fCVXcWyjKq4JjBcaHEa3yrZxCAI9bensNJ00jkROMSz0O7Wdf6lmeqcHPwM D5yS9NEhvsI8k+CV3QqllI4nUCG+H+jEWPOxupbAuzTn1EgjsfNttQ8gHhONdPmbSnVg EjuQ== X-Gm-Message-State: ACrzQf3e7wOhee0j/ic/Mc7T7EpmzDlastwKMORgZ2SUBBXyAZnIjvF7 wADoohqK9tH4hJq+HO64xymCQiCKglw= X-Received: by 2002:a05:6402:350f:b0:45d:1d86:9ec9 with SMTP id b15-20020a056402350f00b0045d1d869ec9mr14264393edd.266.1666299821799; Thu, 20 Oct 2022 14:03:41 -0700 (PDT) Received: from localhost.localdomain (dynamic-2a01-0c23-c046-3500-0000-0000-0000-0e63.c23.pool.telefonica.de. [2a01:c23:c046:3500::e63]) by smtp.googlemail.com with ESMTPSA id 18-20020a170906211200b00779cde476e4sm10748721ejt.62.2022.10.20.14.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 14:03:41 -0700 (PDT) From: Martin Blumenstingl To: linux@roeck-us.net, linux-hwmon@vger.kernel.org Cc: jdelvare@suse.com, linux-kernel@vger.kernel.org, Martin Blumenstingl Subject: [RFC PATCH v2 0/4] hwmon: (jc42) regmap conversion and resume fix Date: Thu, 20 Oct 2022 23:03:16 +0200 Message-Id: <20221020210320.1624617-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747242187797599494?= X-GMAIL-MSGID: =?utf-8?q?1747242187797599494?= Hello, this is a follow-up to the comments I got from Guenter on v1 of my patch from [0] titled: "hwmon: (jc42) Restore the min/max/critical temperatures on resume" There Guenter suggested: "The best solution would probably be to convert the driver to use regmap and let regmap handle the caching". That's the goal of this series - in addition to fixing the original resume issue (see patch #3 - which was the reason for v1 of this series). Changes since v1 at [0]: - marked as RFC - added patches for regmap (patch #1) and regcache (patch #2) conversion - patch #3 has been updated to use regcache for restoring the register values during system resume (this was originally patch 1/1) - added another patch to remove caching of the temperature register [0] https://lore.kernel.org/linux-hwmon/20221019214108.220319-1-martin.blumenstingl@googlemail.com/ Martin Blumenstingl (4): hwmon: (jc42) Convert register access to use an I2C regmap hwmon: (jc42) Convert to regmap's built-in caching hwmon: (jc42) Restore the min/max/critical temperatures on resume hwmon: (jc42) Don't cache the temperature register drivers/hwmon/Kconfig | 1 + drivers/hwmon/jc42.c | 224 +++++++++++++++++++++++------------------- 2 files changed, 125 insertions(+), 100 deletions(-)