From patchwork Thu Aug 12 01:39:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 12432171 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,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 D5EF6C4320A for ; Thu, 12 Aug 2021 01:40:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A932460EE5 for ; Thu, 12 Aug 2021 01:40:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233400AbhHLBk3 (ORCPT ); Wed, 11 Aug 2021 21:40:29 -0400 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]:54313 "EHLO gate2.alliedtelesis.co.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233336AbhHLBk2 (ORCPT ); Wed, 11 Aug 2021 21:40:28 -0400 Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 19360891B0; Thu, 12 Aug 2021 13:40:02 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1628732402; bh=0WP7JrE2n6pBRB3mxnojqVyrztEUucpnuivW8lNRDXs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YoKcpSVwNFMYZmDZ6TG1LL4eLA5DgzXUgBeb7IrCvJkART4eaR4JAWjPgA1sqpxhP m326KOpCkysFvB/j1wCvnhCLPOS66iygCjLaTDYFervffa2HIHhC+poysxtsxvO4xa AGXf1O0iOtkSzsahGamEZ2fOTiGvU0hVIVdKTJwn5ZePGRJcUG7TMyDiELiR2f+B/R f/ubnXidn1uZoLQ89MFIbT5bfp85VSde+p8++mjKhbSnOP5iF/6xrmZSTkAlEILhaw XCf22jxj7eb/EFw1Z/NzBy719/yXQRpoaOS/nbi8PnYSO4hSupLvaeynKmAe1CtXt4 uKNfZYEkBm1gA== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Thu, 12 Aug 2021 13:40:01 +1200 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.20]) by pat.atlnz.lc (Postfix) with ESMTP id E59F213EE8E; Thu, 12 Aug 2021 13:40:01 +1200 (NZST) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id EBC38280E9D; Thu, 12 Aug 2021 13:40:01 +1200 (NZST) From: Chris Packham To: linux@roeck-us.net, jdelvare@suse.com Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Chris Packham Subject: [PATCH v2 1/2] hwmon: (pmbus/bpa-rs600) Don't use rated limits as warn limits Date: Thu, 12 Aug 2021 13:39:59 +1200 Message-Id: <20210812014000.26293-2-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210812014000.26293-1-chris.packham@alliedtelesis.co.nz> References: <20210812014000.26293-1-chris.packham@alliedtelesis.co.nz> MIME-Version: 1.0 X-SEG-SpamProfiler-Analysis: v=2.3 cv=aqTM9hRV c=1 sm=1 tr=0 a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=MhDmnRu9jo8A:10 a=jUjP_tmKNjQU_ALbfCsA:9 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org In the initial implementation a number of PMBUS_x_WARN_LIMITs were mapped to MFR fields. This was incorrect as these MFR limits reflect the rated limit as opposed to a limit which will generate warning. Instead return -ENXIO like we were already doing for other WARN_LIMITs. Subsequently these rated limits have been exposed generically as new fields in the sysfs ABI so the values are still available. Fixes: 15b2703e5e02 ("hwmon: (pmbus) Add driver for BluTek BPA-RS600") Signed-off-by: Chris Packham --- Notes: Changes in v2: - Reworked to remove the mapping of warning limits to rated limits. drivers/hwmon/pmbus/bpa-rs600.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/drivers/hwmon/pmbus/bpa-rs600.c b/drivers/hwmon/pmbus/bpa-rs600.c index d205b41540ce..84dee86399cb 100644 --- a/drivers/hwmon/pmbus/bpa-rs600.c +++ b/drivers/hwmon/pmbus/bpa-rs600.c @@ -12,15 +12,6 @@ #include #include "pmbus.h" -#define BPARS600_MFR_VIN_MIN 0xa0 -#define BPARS600_MFR_VIN_MAX 0xa1 -#define BPARS600_MFR_IIN_MAX 0xa2 -#define BPARS600_MFR_PIN_MAX 0xa3 -#define BPARS600_MFR_VOUT_MIN 0xa4 -#define BPARS600_MFR_VOUT_MAX 0xa5 -#define BPARS600_MFR_IOUT_MAX 0xa6 -#define BPARS600_MFR_POUT_MAX 0xa7 - enum chips { bpa_rs600, bpd_rs600 }; static int bpa_rs600_read_byte_data(struct i2c_client *client, int page, int reg) @@ -83,29 +74,13 @@ static int bpa_rs600_read_word_data(struct i2c_client *client, int page, int pha switch (reg) { case PMBUS_VIN_UV_WARN_LIMIT: - ret = pmbus_read_word_data(client, 0, 0xff, BPARS600_MFR_VIN_MIN); - break; case PMBUS_VIN_OV_WARN_LIMIT: - ret = pmbus_read_word_data(client, 0, 0xff, BPARS600_MFR_VIN_MAX); - break; case PMBUS_VOUT_UV_WARN_LIMIT: - ret = pmbus_read_word_data(client, 0, 0xff, BPARS600_MFR_VOUT_MIN); - break; case PMBUS_VOUT_OV_WARN_LIMIT: - ret = pmbus_read_word_data(client, 0, 0xff, BPARS600_MFR_VOUT_MAX); - break; case PMBUS_IIN_OC_WARN_LIMIT: - ret = pmbus_read_word_data(client, 0, 0xff, BPARS600_MFR_IIN_MAX); - break; case PMBUS_IOUT_OC_WARN_LIMIT: - ret = pmbus_read_word_data(client, 0, 0xff, BPARS600_MFR_IOUT_MAX); - break; case PMBUS_PIN_OP_WARN_LIMIT: - ret = pmbus_read_word_data(client, 0, 0xff, BPARS600_MFR_PIN_MAX); - break; case PMBUS_POUT_OP_WARN_LIMIT: - ret = pmbus_read_word_data(client, 0, 0xff, BPARS600_MFR_POUT_MAX); - break; case PMBUS_VIN_UV_FAULT_LIMIT: case PMBUS_VIN_OV_FAULT_LIMIT: case PMBUS_VOUT_UV_FAULT_LIMIT: