From patchwork Mon Nov 5 20:48:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 10669111 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2EBF813BF for ; Mon, 5 Nov 2018 20:48:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1749D29501 for ; Mon, 5 Nov 2018 20:48:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B12A29506; Mon, 5 Nov 2018 20:48:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E845E29501 for ; Mon, 5 Nov 2018 20:48:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727526AbeKFGKV (ORCPT ); Tue, 6 Nov 2018 01:10:21 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:39367 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726902AbeKFGKV (ORCPT ); Tue, 6 Nov 2018 01:10:21 -0500 Received: by mail-pf1-f194.google.com with SMTP id n11-v6so4994515pfb.6; Mon, 05 Nov 2018 12:48:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=2hAN83NtA82k3ZKtyQ/6UV5vP7+Qs2sTSY0JdZixZco=; b=Co8Z6i0D2scjAfvwjle27v+R1cJBL/zno/OT2VkgrvdEwUisxySO4iW6Jg4aOzREaV yrwuwiOWH+S7t3RK0HrKrMZQMcLgrhiv7p8r3Tb5Q5t56saCMJkp8ew2bGSgeYnX7VAC KqAEqk+l+2XSl4HGlsL5qd3MNOjRMl9k15UIefvueZG+0WWZgT+qxpQekgMsH/R2J82I cYv/XPjG1K7eOc2uYqVsKLW3sDg6oJ9PCp3vxe1oOWiQRjW/kK1VF9xfz4sDWgRq3bXZ rF7GJgndUZiwjoICi0nxKmmRCPhb76mvitzJouVLRnos4botJ6QMQ53g8wWl1N1Wj7U0 dGqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2hAN83NtA82k3ZKtyQ/6UV5vP7+Qs2sTSY0JdZixZco=; b=g3q5RP9Q9Uk3bHlDV7kSlDy1IhMXxobP0buyw4HSPbfNkTIuogh2m1Hvh9AjelQuhS 8QIttfODygR66L/yI810MDdC/rkKeXJlhJJz/qbkww+dst4qSE9N9ubyR8kYYm+0j2oZ 9bJ5pqNriLaZznJaAgzxtDW/W3ss/ddtAhLoUCClky3Iz1jSOgPRQNb0vjKFhxfs5ykv vuAXMA8oEUML6708AHIhktMaCRsiu0i1b7y6hnQ6647endfnj+ri2FCDbF4X+AOUvAC6 GmhaY961b0IUfoXbU0XvxMoWNYFoddbVFOmpGhr6PXL6cZB050iTPSPYeBE2sCLYjth3 kNjw== X-Gm-Message-State: AGRZ1gJHIxvbhdulqoLIPJd+oBXeixApa93VkwhaMbU3Uo6bpllmfUlH p+cKo7den4x8f6YUzGDYiOY= X-Google-Smtp-Source: AJdET5eMtqgg5oRwLza/7Lb1HWt+vnQWzxbEKT9ixI0cEA/tqhDTL1hw++u+MYn5AVCMGp5XqH0ZgQ== X-Received: by 2002:a63:d757:: with SMTP id w23-v6mr21074400pgi.415.1541450930346; Mon, 05 Nov 2018 12:48:50 -0800 (PST) Received: from Asurada-Nvidia.nvidia.com (thunderhill.nvidia.com. [216.228.112.22]) by smtp.gmail.com with ESMTPSA id q1sm25569257pgs.14.2018.11.05.12.48.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 12:48:49 -0800 (PST) From: Nicolin Chen To: jdelvare@suse.com, linux@roeck-us.net Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 0/4] hwmon: (ina3221) Implement PM runtime to save power Date: Mon, 5 Nov 2018 12:48:39 -0800 Message-Id: <20181105204843.4081-1-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This series patches implement PM runtime feature in the ina3221 hwmon driver (PATCH-4). However, PATCH-[1:3] are required to make sure that the PM runtime feature would be functional and safe. Changelog v4->v5: * Dropped the change for hwmon core; Shifted all the patch indexes * Used i2c_client dev pointer for pm runtime callbacks (PATCH-4) v3->v4: * Added generic pm runtime functions to hwmon class (PATCH-1) * Updated to pass pm pointer via _with_info API (PATCH-5) v2->v3: * Dropped timeout dev_err messages as it's indicated in errno (PATCH-4) * Improved a dev_err message and comments (PATCH-5) v1->v2: * Added device pointer check (PATCH-1) * Returned 0 for alert flags (PATCH-2) * Moved CVRF polling to data read routine (PATCH-4) * Bypassed i2c_client->dev in suspend/resume() (PATCH-5) Nicolin Chen (4): hwmon: (ina3221) Check channel status for alarms attribute read hwmon: (ina3221) Serialize sysfs ABI accesses hwmon: (ina3221) Make sure data is ready before reading hwmon: (ina3221) Add PM runtime support drivers/hwmon/ina3221.c | 190 +++++++++++++++++++++++++++++++++++----- 1 file changed, 166 insertions(+), 24 deletions(-)