Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933221AbeAHVKZ (ORCPT + 1 other); Mon, 8 Jan 2018 16:10:25 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:35070 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933118AbeAHVKW (ORCPT ); Mon, 8 Jan 2018 16:10:22 -0500 From: Eddie James To: linux-hwmon@vger.kernel.org Cc: linux@roeck-us.net, linux-kernel@vger.kernel.org, joel@jms.id.au, eajames@linux.vnet.ibm.com Subject: [PATCH] hwmon (pmbus): cffps: Add PMBUS_SKIP_STATUS_CHECK Date: Mon, 8 Jan 2018 15:10:09 -0600 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 x-cbid: 18010821-0016-0000-0000-000008153219 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008343; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000245; SDB=6.00972174; UDB=6.00492484; IPR=6.00752124; BA=6.00005767; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00018930; XFM=3.00000015; UTC=2018-01-08 21:10:13 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18010821-0017-0000-0000-00003CF57513 Message-Id: <1515445809-19856-1-git-send-email-eajames@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-08_13:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801080300 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: This power supply device regularly fails to read VOUT_MODE due to the CML bit going high. This results in an incorrect exponent used for the voltage data, and therefore the power supply reports incorrect voltage. Work around this by setting the pmbus flag to skip the CML check. Signed-off-by: Eddie James --- drivers/hwmon/pmbus/ibm-cffps.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/hwmon/pmbus/ibm-cffps.c b/drivers/hwmon/pmbus/ibm-cffps.c index de254747..2d6f4f4 100644 --- a/drivers/hwmon/pmbus/ibm-cffps.c +++ b/drivers/hwmon/pmbus/ibm-cffps.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "pmbus.h" @@ -268,6 +269,10 @@ static int ibm_cffps_read_word_data(struct i2c_client *client, int page, .read_word_data = ibm_cffps_read_word_data, }; +static struct pmbus_platform_data ibm_cffps_pdata = { + .flags = PMBUS_SKIP_STATUS_CHECK, +}; + static int ibm_cffps_probe(struct i2c_client *client, const struct i2c_device_id *id) { @@ -276,6 +281,7 @@ static int ibm_cffps_probe(struct i2c_client *client, struct dentry *ibm_cffps_dir; struct ibm_cffps *psu; + client->dev.platform_data = &ibm_cffps_pdata; rc = pmbus_do_probe(client, id, &ibm_cffps_info); if (rc) return rc; -- 1.8.3.1