From patchwork Mon Oct 28 23:49:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tao Ren X-Patchwork-Id: 11216781 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C4319913 for ; Mon, 28 Oct 2019 23:49:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 96F6D20578 for ; Mon, 28 Oct 2019 23:49:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gvCOXy/A" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727935AbfJ1XtY (ORCPT ); Mon, 28 Oct 2019 19:49:24 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:43868 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725829AbfJ1XtY (ORCPT ); Mon, 28 Oct 2019 19:49:24 -0400 Received: by mail-pg1-f195.google.com with SMTP id l24so8112934pgh.10; Mon, 28 Oct 2019 16:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KUGQ/r655QOzhF8y8PZXKFFUJNm6vbuBEcIikKPosIk=; b=gvCOXy/AmjPJG9Au95pDstcxJyiVgdnOiM7g6r9Mvoc7HQKAXyPdIcDaDZVNhbNMTu aeDUOQgXB/9BSiKMiDyFBQ8gei9wo1w34Il1GIcW0XX8VpojdcznlZzOC/Ucv+EfhMo2 9NbmGKfhduldh/Gf3Xw4+Sm/uHGa/pFyesLWBbWwipUsE1cw9ohIi3JxJYc1gGnRiGT5 67bYqTImcYLNOu9pasOq5qLNGOBYKt3VEKq0RHADaRlWNFPtJ5/KjOVg6iHRNknFqTGr MFsGlXwPr8Y/81bIATvsNgwkpoJvaaE+TjUA7a41c9e5MgN2pjNAVfyiIdaLdd0SG1wh 4oTg== 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:in-reply-to :references; bh=KUGQ/r655QOzhF8y8PZXKFFUJNm6vbuBEcIikKPosIk=; b=tj2gWLY+DEsTjHRdhlOyY3U42hV/4mDKr4kTs/6Xruk0znf7jCn7C8Gx/ePISD6ECz I5oIzZIxDsmr2rzX2I115K47LMFA+6vuws1qp0Pui8X4IsIwstd0CDf3aDec/K+T895N xx46cY5jlLFCB3Q+nhwehVBc96mHrHo2OIEgcj4S+mdYYR9Cugh01qjCAgiEWpnGbLa8 6jrLuw7PGQI/b0v1Vzo2nz5bl/GsxRfPABPthRC4rGTc6UhJT7RnmnRzwnJuWyiCXQ2w JLkthwpRC2PFoTGToi8K+bnjpp4orOEpYB6gSvDtrzHFlro1Nwl1YhZbYsFw/u1wU1nB D+yg== X-Gm-Message-State: APjAAAU5Wqs0+1XsiVBrShCasYJdpsloY8iAPMWsLKrmu8xJDOFwRDbV /6ajRw7FZcNKt9zou02KYRo= X-Google-Smtp-Source: APXvYqyB/VIWUUD6euIc1wIAj7+Kw8nEW24WdP9LBMqAwLPwyQpm/OUafznT7RjIrvuNsjxE/Wnw0A== X-Received: by 2002:a17:90a:7bcc:: with SMTP id d12mr2429491pjl.63.1572306563244; Mon, 28 Oct 2019 16:49:23 -0700 (PDT) Received: from taoren-ubuntu-R90MNF91.thefacebook.com ([2620:10d:c090:200::2:c0c7]) by smtp.gmail.com with ESMTPSA id d4sm597119pjs.9.2019.10.28.16.49.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 16:49:22 -0700 (PDT) From: rentao.bupt@gmail.com To: Guenter Roeck , Jean Delvare , Jonathan Corbet , linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, taoren@fb.com Cc: Tao Ren Subject: [PATCH 1/3] hwmon: (pmbus) add BEL PFE1100 power supply driver Date: Mon, 28 Oct 2019 16:49:02 -0700 Message-Id: <20191028234904.12441-2-rentao.bupt@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191028234904.12441-1-rentao.bupt@gmail.com> References: <20191028234904.12441-1-rentao.bupt@gmail.com> Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Tao Ren Add the driver to support BEL PFE1100 which is 1100 Wat AC to DC power supply. The chip has only 1 page. Signed-off-by: Tao Ren --- drivers/hwmon/pmbus/Kconfig | 9 +++++ drivers/hwmon/pmbus/Makefile | 1 + drivers/hwmon/pmbus/bel-pfe.c | 68 +++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 drivers/hwmon/pmbus/bel-pfe.c diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig index d62d69bb7e49..59859979571d 100644 --- a/drivers/hwmon/pmbus/Kconfig +++ b/drivers/hwmon/pmbus/Kconfig @@ -36,6 +36,15 @@ config SENSORS_ADM1275 This driver can also be built as a module. If so, the module will be called adm1275. +config SENSORS_BEL_PFE + tristate "Bel PFE Compatible Power Supplies" + help + If you say yes here you get hardware monitoring support for BEL + PFE1100 and PFE3000 Power Supplies. + + This driver can also be built as a module. If so, the module will + be called bel-pfe. + config SENSORS_IBM_CFFPS tristate "IBM Common Form Factor Power Supply" depends on LEDS_CLASS diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile index 03bacfcfd660..3f8c1014938b 100644 --- a/drivers/hwmon/pmbus/Makefile +++ b/drivers/hwmon/pmbus/Makefile @@ -6,6 +6,7 @@ obj-$(CONFIG_PMBUS) += pmbus_core.o obj-$(CONFIG_SENSORS_PMBUS) += pmbus.o obj-$(CONFIG_SENSORS_ADM1275) += adm1275.o +obj-$(CONFIG_SENSORS_BEL_PFE) += bel-pfe.o obj-$(CONFIG_SENSORS_IBM_CFFPS) += ibm-cffps.o obj-$(CONFIG_SENSORS_INSPUR_IPSPS) += inspur-ipsps.o obj-$(CONFIG_SENSORS_IR35221) += ir35221.o diff --git a/drivers/hwmon/pmbus/bel-pfe.c b/drivers/hwmon/pmbus/bel-pfe.c new file mode 100644 index 000000000000..117f9af21bf3 --- /dev/null +++ b/drivers/hwmon/pmbus/bel-pfe.c @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Hardware monitoring driver for BEL PFE family power supplies. + * + * Copyright (c) 2019 Facebook Inc. + */ + +#include +#include +#include +#include +#include +#include "pmbus.h" + +enum chips {pfe1100}; + +static struct pmbus_driver_info pfe_driver_info[] = { + [pfe1100] = { + .pages = 1, + .format[PSC_VOLTAGE_IN] = linear, + .format[PSC_VOLTAGE_OUT] = linear, + .format[PSC_CURRENT_IN] = linear, + .format[PSC_CURRENT_OUT] = linear, + .format[PSC_POWER] = linear, + .format[PSC_TEMPERATURE] = linear, + .format[PSC_FAN] = linear, + + .func[0] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | + PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | + PMBUS_HAVE_POUT | + PMBUS_HAVE_VIN | PMBUS_HAVE_IIN | + PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT | + PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP2 | + PMBUS_HAVE_STATUS_TEMP | + PMBUS_HAVE_FAN12, + }, +}; + +static int pfe_pmbus_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + int model; + + model = (int)id->driver_data; + return pmbus_do_probe(client, id, &pfe_driver_info[model]); +} + +static const struct i2c_device_id pfe_device_id[] = { + {"pfe1100", pfe1100}, + {} +}; + +MODULE_DEVICE_TABLE(i2c, pfe_device_id); + +static struct i2c_driver pfe_pmbus_driver = { + .driver = { + .name = "bel-pfe", + }, + .probe = pfe_pmbus_probe, + .remove = pmbus_do_remove, + .id_table = pfe_device_id, +}; + +module_i2c_driver(pfe_pmbus_driver); + +MODULE_AUTHOR("Tao Ren "); +MODULE_DESCRIPTION("PMBus driver for BEL PFE Family Power Supplies"); +MODULE_LICENSE("GPL"); From patchwork Mon Oct 28 23:49:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tao Ren X-Patchwork-Id: 11216785 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 16696112B for ; Mon, 28 Oct 2019 23:49:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E76DB21835 for ; Mon, 28 Oct 2019 23:49:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sQNTSRDs" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728202AbfJ1XtZ (ORCPT ); Mon, 28 Oct 2019 19:49:25 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:34231 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728059AbfJ1XtZ (ORCPT ); Mon, 28 Oct 2019 19:49:25 -0400 Received: by mail-pg1-f194.google.com with SMTP id e4so3836543pgs.1; Mon, 28 Oct 2019 16:49:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sDVKctYQFPQQhndxFna9vtm7wSyOf2hUQLavep1crp4=; b=sQNTSRDsXZpa47r1mRwPnfJ/BlGNsD34hfuusH+Yr0xkBhZh0VRjQhIWl8hJwtheyG Gx1X7Uv+3Q4vgAC32/wwAmh52D564MMfAICCAk1FvUZpfTZqiAAnv0ylDhw1gj8ulPft psaa6COHOGy5HZyH2124EqIjdehs+b29LIKRVpEQ5bJOSjp1pjRGD/5g5T+1mYpWMX7T 6vMJsw3qV7TaIXVCOuAbGSwo6bq+WvxFchucWVNTrkfMIP2H7o39DHEkrE7OaHHc2FpQ PkBCUBuyu2JyItPrmV2qUfwm0lWb36Llj+N2RPomWix5gpE2qdlfuvIk5RfgJd4JCRbs 7vnA== 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:in-reply-to :references; bh=sDVKctYQFPQQhndxFna9vtm7wSyOf2hUQLavep1crp4=; b=E8031P5DTBqt6lJN705mJ3WEUp1XqgFa19tgWAihIO8FhNfPwhxq9whdETuBUHxE+f jnJetqGkcw7EyX6mCaTinK6VCHvFJSCCmo/wKQneKcKDIXZWeumA2IeMi89r1nw0jfpt ybQ5bcKN4De/n49XwFUCmNRU+PQ4eF1L02y178IuKb+V71CdfIbnpBBwgXD6tbWK9kwy Vc+X+LG0SCg84f0byqyGd5BCu7qtJaNl6LufQNQhvxVBKA6lTUO9EH90diHzMK0o1fBg JJPkhNhJ2Vd35meileW5e0vRRWv3zQOYZJH0UmVodM4Z17euPRONb21N7EOHyfvkl0Bc GDBw== X-Gm-Message-State: APjAAAWAcfZ/Qu1YVjJSSH9+dTO5e/8xu73zUJ/BeIHfXuAzK8FIFYBC iBMLwYAAtjfvWwQQzayRK6m6GiXv4qk= X-Google-Smtp-Source: APXvYqwy/8Fn5H0ZgY1iNeuIidNJTniA7Oj3ADDkqWaznlUkhLyG/mH7kmTYIfVVrbAwiBkj7bPLwg== X-Received: by 2002:a17:90a:d149:: with SMTP id t9mr2403813pjw.108.1572306564400; Mon, 28 Oct 2019 16:49:24 -0700 (PDT) Received: from taoren-ubuntu-R90MNF91.thefacebook.com ([2620:10d:c090:200::2:c0c7]) by smtp.gmail.com with ESMTPSA id d4sm597119pjs.9.2019.10.28.16.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 16:49:23 -0700 (PDT) From: rentao.bupt@gmail.com To: Guenter Roeck , Jean Delvare , Jonathan Corbet , linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, taoren@fb.com Cc: Tao Ren Subject: [PATCH 2/3] hwmon: (pmbus) add BEL PFE3000 power supply driver Date: Mon, 28 Oct 2019 16:49:03 -0700 Message-Id: <20191028234904.12441-3-rentao.bupt@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191028234904.12441-1-rentao.bupt@gmail.com> References: <20191028234904.12441-1-rentao.bupt@gmail.com> Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Tao Ren Add the driver to support BEL PFE3000 which is 3000 Wat AC to DC power supply. The chip has 8 pages. Signed-off-by: Tao Ren --- drivers/hwmon/pmbus/bel-pfe.c | 65 ++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/pmbus/bel-pfe.c b/drivers/hwmon/pmbus/bel-pfe.c index 117f9af21bf3..7b6c90b056c9 100644 --- a/drivers/hwmon/pmbus/bel-pfe.c +++ b/drivers/hwmon/pmbus/bel-pfe.c @@ -10,9 +10,21 @@ #include #include #include +#include + #include "pmbus.h" -enum chips {pfe1100}; +enum chips {pfe1100, pfe3000}; + +/* + * Disable status check for pfe3000 devices, because some devices report + * communication error (invalid command) for VOUT_MODE command (0x20) + * although correct VOUT_MODE (0x16) is returned: it leads to incorrect + * exponent in linear mode. + */ +static struct pmbus_platform_data pfe3000_plat_data = { + .flags = PMBUS_SKIP_STATUS_CHECK, +}; static struct pmbus_driver_info pfe_driver_info[] = { [pfe1100] = { @@ -34,6 +46,45 @@ static struct pmbus_driver_info pfe_driver_info[] = { PMBUS_HAVE_STATUS_TEMP | PMBUS_HAVE_FAN12, }, + + [pfe3000] = { + .pages = 8, + .format[PSC_VOLTAGE_IN] = linear, + .format[PSC_VOLTAGE_OUT] = linear, + .format[PSC_CURRENT_IN] = linear, + .format[PSC_CURRENT_OUT] = linear, + .format[PSC_POWER] = linear, + .format[PSC_TEMPERATURE] = linear, + .format[PSC_FAN] = linear, + + /* Page 0: V1. */ + .func[0] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | + PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | + PMBUS_HAVE_POUT | PMBUS_HAVE_FAN12 | + PMBUS_HAVE_VIN | PMBUS_HAVE_IIN | + PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT | + PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP2 | + PMBUS_HAVE_TEMP3 | PMBUS_HAVE_STATUS_TEMP | + PMBUS_HAVE_VCAP, + + /* Page 1: Vsb. */ + .func[1] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | + PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | + PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT | + PMBUS_HAVE_POUT, + + /* + * Page 2: V1 Ishare. + * Page 4: V1 Cathode. + * Page 5: Vsb Cathode. + * Page 6: V1 Sense. + * Page 3 and 7 are reserved. + */ + .func[2] = PMBUS_HAVE_VOUT, + .func[4] = PMBUS_HAVE_VOUT, + .func[5] = PMBUS_HAVE_VOUT, + .func[6] = PMBUS_HAVE_VOUT, + }, }; static int pfe_pmbus_probe(struct i2c_client *client, @@ -42,11 +93,23 @@ static int pfe_pmbus_probe(struct i2c_client *client, int model; model = (int)id->driver_data; + + /* + * PFE3000-12-069RA devices may not stay in page 0 during device + * probe which leads to probe failure (read status word failed). + * So let's set the device to page 0 at the beginning. + */ + if (model == pfe3000) { + client->dev.platform_data = &pfe3000_plat_data; + i2c_smbus_write_byte_data(client, PMBUS_PAGE, 0); + } + return pmbus_do_probe(client, id, &pfe_driver_info[model]); } static const struct i2c_device_id pfe_device_id[] = { {"pfe1100", pfe1100}, + {"pfe3000", pfe3000}, {} }; From patchwork Mon Oct 28 23:49:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tao Ren X-Patchwork-Id: 11216783 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A1D75112B for ; Mon, 28 Oct 2019 23:49:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 759A521920 for ; Mon, 28 Oct 2019 23:49:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jmgrSRXQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728704AbfJ1Xt2 (ORCPT ); Mon, 28 Oct 2019 19:49:28 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:42792 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728379AbfJ1Xt0 (ORCPT ); Mon, 28 Oct 2019 19:49:26 -0400 Received: by mail-pl1-f194.google.com with SMTP id c16so6549792plz.9; Mon, 28 Oct 2019 16:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NeObGC1EVOm6spx2L51L+hiPcYQEKVP788D+xQH3iTs=; b=jmgrSRXQFYNKQm1hb2rj6HrFWqHgWaQ39FpQ0UpBcCmGfMxW781W8EHKBZmZpa/JGQ J099MviYtme/JO9ZJyJRpjURYu/lXNzYg4LS4XHB0n0ihf8uzWH6kN6NVxLeCOLGaDiH hXc9xQ+UQqBFzaRovTZkJD2Vucrz4mAJ/DwW0fsBEnFX8IhsNc1TPVRnT03M4fFMQoLv jTJFkoTLYF38ia2JARE2xqu3VP4Mq23QN9wN6SLsHUR+UpwnzeF/bbNAx6nH+n0FWYS2 U982G55vfGV+doZpsXO5pCN4tB/R2dpCpzsws24HnRpFHbEhZZuwb9KUwgFSvEyFq6dY 9oUA== 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:in-reply-to :references; bh=NeObGC1EVOm6spx2L51L+hiPcYQEKVP788D+xQH3iTs=; b=KsMRn/eHEW7jpOhFCQ8e35NFWOIBvM3LaS/vhM7CVNuKhdUOl+xbpJeBpSq34GnsaO QffB1FlUOIYQ9OTy+WJAirn3rhYeLB2KN4BTXzYtInpgH7mJEoxdyDnLr+/RkZUyl4hp vcq+pcZI8xJZccOAdgXm8/xR0U/uyp5e4QIup9/mNNUONDMMGPp5CgG9LOsJmpkbXQet m1GXQ5ecGlTLJpdjt2Mr2kpXe7I/fbsdvfooDKEozmrfxWI9YQ4SP0Qg266xFAe0kL4c Lma2yBmIP6SLBW+YcNG4K0RfHCISTVShcI0xndvNMLfkgBQsrCm4ef8y8yPRL4so3aWx B/Qw== X-Gm-Message-State: APjAAAU3R0kz5d15d/1GIge7eDXPJuhK9/KBBo7AF2ydSoab00KKPhuN IgvwgDrtd0ELqyiHAhKRj1o= X-Google-Smtp-Source: APXvYqyXhcsYcTw+hWCPyqQEdoxc4SNoZS1I6wVveEcHdz3y6Xf26+c4UD09iS+BSoFx40pyATYn4A== X-Received: by 2002:a17:902:a714:: with SMTP id w20mr753018plq.116.1572306565426; Mon, 28 Oct 2019 16:49:25 -0700 (PDT) Received: from taoren-ubuntu-R90MNF91.thefacebook.com ([2620:10d:c090:200::2:c0c7]) by smtp.gmail.com with ESMTPSA id d4sm597119pjs.9.2019.10.28.16.49.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 16:49:24 -0700 (PDT) From: rentao.bupt@gmail.com To: Guenter Roeck , Jean Delvare , Jonathan Corbet , linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, taoren@fb.com Cc: Tao Ren Subject: [PATCH 3/3] docs: hwmon: Document bel-pfe pmbus driver Date: Mon, 28 Oct 2019 16:49:04 -0700 Message-Id: <20191028234904.12441-4-rentao.bupt@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191028234904.12441-1-rentao.bupt@gmail.com> References: <20191028234904.12441-1-rentao.bupt@gmail.com> Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Tao Ren Add documentation for bel-pfe pmbus driver which supports BEL PFE1100 and PFE3000 power supplies. Signed-off-by: Tao Ren --- Documentation/hwmon/bel-pfe.rst | 112 ++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 Documentation/hwmon/bel-pfe.rst diff --git a/Documentation/hwmon/bel-pfe.rst b/Documentation/hwmon/bel-pfe.rst new file mode 100644 index 000000000000..4b4a7d67854c --- /dev/null +++ b/Documentation/hwmon/bel-pfe.rst @@ -0,0 +1,112 @@ +Kernel driver bel-pfe +====================== + +Supported chips: + + * BEL PFE1100 + + Prefixes: 'pfe1100' + + Addresses scanned: - + + Datasheet: https://www.belfuse.com/resources/datasheets/powersolutions/ds-bps-pfe1100-12-054xa.pdf + + * BEL PFE3000 + + Prefixes: 'pfe3000' + + Addresses scanned: - + + Datasheet: https://www.belfuse.com/resources/datasheets/powersolutions/ds-bps-pfe3000-series.pdf + +Author: Tao Ren + + +Description +----------- + +This driver supports hardware monitoring for below power supply devices +which support PMBus Protocol: + + * BEL PFE1100 + + 1100 Watt AC to DC power-factor-corrected (PFC) power supply. + PMBus Communication Manual is not publicly available. + + * BEL PFE3000 + + 3000 Watt AC/DC power-factor-corrected (PFC) and DC-DC power supply. + PMBus Communication Manual is not publicly available. + +The driver is a client driver to the core PMBus driver. Please see +Documentation/hwmon/pmbus.rst for details on PMBus client drivers. + + +Usage Notes +----------- + +This driver does not auto-detect devices. You will have to instantiate the +devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for +details. + +Example: the following will load the driver for an PFE3000 at address 0x20 +on I2C bus #1:: + + $ modprobe bel-pfe + $ echo pfe3000 0x20 > /sys/bus/i2c/devices/i2c-1/new_device + + +Platform data support +--------------------- + +The driver supports standard PMBus driver platform data. + + +Sysfs entries +------------- + +======================= ======================================================= +curr1_label "iin" +curr1_input Measured input current +curr1_max Input current max value +curr1_max_alarm Input current max alarm + +curr[2-3]_label "iout[1-2]" +curr[2-3]_input Measured output current +curr[2-3]_max Output current max value +curr[2-3]_max_alarm Output current max alarm + +fan[1-2]_input Fan 1 and 2 speed in RPM +fan1_target Set fan speed reference for both fans + +in1_label "vin" +in1_input Measured input voltage +in1_crit Input voltage critical max value +in1_crit_alarm Input voltage critical max alarm +in1_lcrit Input voltage critical min value +in1_lcrit_alarm Input voltage critical min alarm +in1_max Input voltage max value +in1_max_alarm Input voltage max alarm + +in2_label "vcap" +in2_input Hold up capacitor voltage + +in[3-8]_label "vout[1-3,5-7]" +in[3-8]_input Measured output voltage +in[3-4]_alarm vout[1-2] output voltage alarm + +power[1-2]_label "pin[1-2]" +power[1-2]_input Measured input power +power[1-2]_alarm Input power high alarm + +power[3-4]_label "pout[1-2]" +power[3-4]_input Measured output power + +temp[1-3]_input Measured temperature +temp[1-3]_alarm Temperature alarm +======================= ======================================================= + +.. note:: + + - curr3, fan2, vout[2-7], vcap, pin2, pout2 and temp3 attributes only + exist for PFE3000.