Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp526593rdf; Fri, 3 Nov 2023 07:36:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQAkM756NaMbPzc70FUJpHddPfpac12dlC8gp0sskutMdqWl6Sb4oKPmBWwI6eD7jiWzdP X-Received: by 2002:a05:6a20:4401:b0:179:faa1:46ba with SMTP id ce1-20020a056a20440100b00179faa146bamr24093507pzb.35.1699022191066; Fri, 03 Nov 2023 07:36:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699022191; cv=none; d=google.com; s=arc-20160816; b=SMKchRDsstTgtNJ5jJ9QjQofFefq3s5twNQvay7IDki2BG302TJYjCyuV5AKHNInK7 rX37S0J/wDVSjKSMdq+rppzcvpX5sQwXuuHq6uG2LRr1X1A1XxV2HvN0PI3rYLQX2zSg CgAX2aokbLOelMRzaSWYAWxsxpXGzXR+8maPsjVJeJf0ZMhC2xH1A+Rb+f3bIz4QUjSu d/BDuQ7D1MdjgvUFnCMYGVakat7K7zPVYJ4Fe/uYZrU1Dp9IbYa380JE3D27X3f3IA5l uBXLPZGh4Phm0SHFn0gqy6pQEzpiiWKv5MMaOWh/PjgBr4YrDY8ilu9f8NrFgT8UHbjI RBvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=761s3ZSOYqOl5OlbDmAC3O99DhhGiHJQ6guQs2cNdZI=; fh=sHQxO2oNtpYdQ+4pCnWZwPpXXbgx5R5A5ks/fDQ4WKo=; b=ZN+6ns9OOC1RNIYQJHdmICU1wUU8DEUGSS0FSooCAf830u9WaPARuAk0Af2buBd4PL 3u7TyaHSx4z3ktGfcU7ZzQGJFJ02kUMpxkoZggQr4dOGMiCu5ri+cahlOCiFkN01MAEW oXoJH73a67KKbDv/ByzfYasbwTcA3M3qqBYG5ZOPzMku/CcuDmd3gbao4oto0bwwvgT1 5ilAUAPWqdnBytB+lqOdF7+VYCiVa4kDMphI3y+NFB9mLaAKLZkCgDqkGMl71mhhaNgq fBMi73GTUI/GuUbDXSsv+jhsENrx3stfbG6bTVLSOTO2MYOCr4uObkwTz4dlvmhSJYv1 Az/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=P5dOTNJH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id o7-20020a656a47000000b00577fc59373fsi1590045pgu.296.2023.11.03.07.36.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 07:36:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=P5dOTNJH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5BCCE8288CAB; Fri, 3 Nov 2023 07:36:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377768AbjKCOgB (ORCPT + 99 others); Fri, 3 Nov 2023 10:36:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233010AbjKCOgA (ORCPT ); Fri, 3 Nov 2023 10:36:00 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8213CCA; Fri, 3 Nov 2023 07:35:54 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-5a9bc2ec556so2265693a12.0; Fri, 03 Nov 2023 07:35:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699022154; x=1699626954; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=761s3ZSOYqOl5OlbDmAC3O99DhhGiHJQ6guQs2cNdZI=; b=P5dOTNJHCbWFDzRjj+4ecrnV6oPo1jfBpl3H1pgcr9Sn+S2fWX1T6xfi8BKU+Gu4Po 1d9+OynI6VGlEf2BQlJaXXOXS50NyEB9qShFU/ZeuA7QRB1Pvx7Tl8PtV8eNQvORc+jw QX2l0Fjs0Zb5yO7NJOudROPvSsoCitkN2GzF/+X5tCDFhXDOlXuI/1KYiR4pkRqmly27 IvYqKKH3PFsY/KrPOoZm//yVP8zhEYFz4dKwOd7uovP6HKm/1adfzWrTKyS4f0dIwbcU Z7in1BZstFBE/T9RNCz5P5+a6ZTVGdVt8kjSlegMOWFmvWATfk7HyCly00KS5vucRaUC 2Jag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699022154; x=1699626954; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=761s3ZSOYqOl5OlbDmAC3O99DhhGiHJQ6guQs2cNdZI=; b=SZFt7Hve77Cx2AZoAFnQItMGW+9Ie93r1N+/DVAVMrbWQXSH3P34oCESN05zvxFk7U T6YVgpW9jTlY+Vd95mI7F0qVWxAPzasmbppeM+qkYHTu+wPiW7sF3WLwHifTkGpGnbzL wkHVmlcFoUsLgBKVEzWdiydqoOkVbfPSK5DgcB2ePBFQbMLPEHAeOMJdljvqgZxdEHMy JuDaFQ+tm32USHfYhdLRDTW/pJJs7C79SxAUAnzHEfuk1J0fHRkP5+JJ9YO+EweLeiiE IyDL3hb3pCyrDq/AHTAsrkImDuXjOASpRZvR+6j55bLrvqS34p+NYCXUwku4kdDOaVSd /ZEg== X-Gm-Message-State: AOJu0Yw7jabClUMbfgDSVtm7iQ7fKZNF5vl5IKoaDrtPHvW0qThmQkTy 3wuNv+QuaGE7maZGNWF5whU= X-Received: by 2002:a05:6a21:4983:b0:180:5965:a772 with SMTP id ax3-20020a056a21498300b001805965a772mr2055886pzc.28.1699022153805; Fri, 03 Nov 2023 07:35:53 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id n4-20020a056a000d4400b006934a1c69f8sm1532704pfv.24.2023.11.03.07.35.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Nov 2023 07:35:52 -0700 (PDT) Sender: Guenter Roeck Message-ID: Date: Fri, 3 Nov 2023 07:35:51 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 2/2] hwmon: (pmbus) Add support for MPS Multi-phase mp5990 Content-Language: en-US To: Peter Yin , patrick@stwcx.xyz, Jean Delvare , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Corbet , linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org References: <20231103080128.1204218-1-peteryin.openbmc@gmail.com> <20231103080128.1204218-3-peteryin.openbmc@gmail.com> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jI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YlYcRQWOUGY HhQ5eqTRZjm9z+qQe/T0HQpmiPTqQcIaG/edgKVTUjITfA7AJMKLQHgp04Vylb+G6jocnQQX JqvvP09whbqrABEBAAHCwWUEGAECAA8CGwwFAlVcpi8FCRmg08MACgkQyx8mb86fmYHNRQ/+ J0OZsBYP4leJvQF8lx9zif+v4ZY/6C9tTcUv/KNAE5leyrD4IKbnV4PnbrVhjq861it/zRQW cFpWQszZyWRwNPWUUz7ejmm9lAwPbr8xWT4qMSA43VKQ7ZCeTQJ4TC8kjqtcbw41SjkjrcTG wF52zFO4bOWyovVAPncvV9eGA/vtnd3xEZXQiSt91kBSqK28yjxAqK/c3G6i7IX2rg6pzgqh hiH3/1qM2M/LSuqAv0Rwrt/k+pZXE+B4Ud42hwmMr0TfhNxG+X7YKvjKC+SjPjqp0CaztQ0H nsDLSLElVROxCd9m8CAUuHplgmR3seYCOrT4jriMFBtKNPtj2EE4DNV4s7k0Zy+6iRQ8G8ng QjsSqYJx8iAR8JRB7Gm2rQOMv8lSRdjva++GT0VLXtHULdlzg8VjDnFZ3lfz5PWEOeIMk7Rj trjv82EZtrhLuLjHRCaG50OOm0hwPSk1J64R8O3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: <20231103080128.1204218-3-peteryin.openbmc@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 03 Nov 2023 07:36:12 -0700 (PDT) On 11/3/23 01:01, Peter Yin wrote: > Add support for mp5990 device from Monolithic Power Systems, Inc. (MPS) > vendor. This is a Hot-Swap Controller. > > Signed-off-by: Peter Yin > --- > Documentation/hwmon/index.rst | 1 + > Documentation/hwmon/mp5990.rst | 84 +++++++++++++++++++++++++++++++ > drivers/hwmon/pmbus/Kconfig | 9 ++++ > drivers/hwmon/pmbus/Makefile | 1 + > drivers/hwmon/pmbus/mp5990.c | 90 ++++++++++++++++++++++++++++++++++ > 5 files changed, 185 insertions(+) > create mode 100644 Documentation/hwmon/mp5990.rst > create mode 100644 drivers/hwmon/pmbus/mp5990.c > > diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst > index 042e1cf9501b..8c70e10fc795 100644 > --- a/Documentation/hwmon/index.rst > +++ b/Documentation/hwmon/index.rst > @@ -157,6 +157,7 @@ Hardware Monitoring Kernel Drivers > mp2888 > mp2975 > mp5023 > + mp5990 > nct6683 > nct6775 > nct7802 > diff --git a/Documentation/hwmon/mp5990.rst b/Documentation/hwmon/mp5990.rst > new file mode 100644 > index 000000000000..8fc4e388ff7b > --- /dev/null > +++ b/Documentation/hwmon/mp5990.rst > @@ -0,0 +1,84 @@ > +.. SPDX-License-Identifier: GPL-2.0 > + > +Kernel driver mp5990 > +==================== > + > +Supported chips: > + > + * MPS MP5990 > + > + Prefix: 'mp5990' > + > + * Datasheet > + > + Publicly available at the MPS website : https://www.monolithicpower.com/en/mp5990.html > + > +Author: > + > + Peter Yin > + > +Description > +----------- > + > +This driver implements support for Monolithic Power Systems, Inc. (MPS) > +MP5990 Hot-Swap Controller. > + > +Device complaint with: compliant > + > +- PMBus rev 1.3 interface. > + > +Device supports direct format for reading input voltage, output voltage, > +output current, input power and temperature. > + > +The driver exports the following attributes via the 'sysfs' files > +for input voltage: > + > +**in1_input** > + > +**in1_label** > + > +**in1_max** > + > +**in1_max_alarm** > + > +**in1_min** > + > +**in1_min_alarm** > + > +The driver provides the following attributes for output voltage: > + > +**in2_input** > + > +**in2_label** > + > +**in2_alarm** > + > +The driver provides the following attributes for output current: > + > +**curr1_input** > + > +**curr1_label** > + > +**curr1_alarm** > + > +**curr1_max** > + > +The driver provides the following attributes for input power: > + > +**power1_input** > + > +**power1_label** > + > +**power1_alarm** > + > +The driver provides the following attributes for temperature: > + > +**temp1_input** > + > +**temp1_max** > + > +**temp1_max_alarm** > + > +**temp1_crit** > + > +**temp1_crit_alarm** > diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig > index 270b6336b76d..65a116f7744d 100644 > --- a/drivers/hwmon/pmbus/Kconfig > +++ b/drivers/hwmon/pmbus/Kconfig > @@ -326,6 +326,15 @@ config SENSORS_MP5023 > This driver can also be built as a module. If so, the module will > be called mp5023. > > +config SENSORS_MP5990 > + tristate "MPS MP5990" > + help > + If you say yes here you get hardware monitoring support for MPS > + MP5990. > + > + This driver can also be built as a module. If so, the module will > + be called mp5990. > + > config SENSORS_MPQ7932_REGULATOR > bool "Regulator support for MPQ7932" > depends on SENSORS_MPQ7932 && REGULATOR > diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile > index 84ee960a6c2d..212d9ca0acc9 100644 > --- a/drivers/hwmon/pmbus/Makefile > +++ b/drivers/hwmon/pmbus/Makefile > @@ -35,6 +35,7 @@ obj-$(CONFIG_SENSORS_MAX8688) += max8688.o > obj-$(CONFIG_SENSORS_MP2888) += mp2888.o > obj-$(CONFIG_SENSORS_MP2975) += mp2975.o > obj-$(CONFIG_SENSORS_MP5023) += mp5023.o > +obj-$(CONFIG_SENSORS_MP5990) += mp5990.o > obj-$(CONFIG_SENSORS_MPQ7932) += mpq7932.o > obj-$(CONFIG_SENSORS_PLI1209BC) += pli1209bc.o > obj-$(CONFIG_SENSORS_PM6764TR) += pm6764tr.o > diff --git a/drivers/hwmon/pmbus/mp5990.c b/drivers/hwmon/pmbus/mp5990.c > new file mode 100644 > index 000000000000..c3b31af9f750 > --- /dev/null > +++ b/drivers/hwmon/pmbus/mp5990.c > @@ -0,0 +1,90 @@ > +// SPDX-License-Identifier: GPL-2.0-or-later > +/* > + * Driver for MPS MP5990 Hot-Swap Controller > + */ > + > +#include > +#include > +#include > +#include > +#include "pmbus.h" > + > +static int mp5990_read_byte_data(struct i2c_client *client, int page, int reg) > +{ > + switch (reg) { > + case PMBUS_VOUT_MODE: > + /* > + Enforce VOUT direct format, C4h reg BIT9 > + default val is not match vout format > + */ /* * Please use proper multi-line comments. Also, the problem here is that the * chip does not support the VOUT_MODE command, which should be mentioned. * * On top of that, overwriting PMBUS_VOUT_MODE result from the chip is only * necessary if the chip does not return an error when reading the value. * If that is the case, it should be mentioned in the comment. The above * does not explain why this would be needed, even if the command is not * (officially) supported by the chip. What does it return that requires * an overwrite ? */ > + return PB_VOUT_MODE_DIRECT; > + default: > + return -ENODATA; > + } > +} > + > +static struct pmbus_driver_info mp5990_info = { > + .pages = 1, > + .format[PSC_VOLTAGE_IN] = direct, > + .format[PSC_VOLTAGE_OUT] = direct, > + .format[PSC_CURRENT_OUT] = direct, > + .format[PSC_POWER] = direct, > + .format[PSC_TEMPERATURE] = direct, > + .m[PSC_VOLTAGE_IN] = 32, > + .b[PSC_VOLTAGE_IN] = 0, > + .R[PSC_VOLTAGE_IN] = 0, > + .m[PSC_VOLTAGE_OUT] = 32, > + .b[PSC_VOLTAGE_OUT] = 0, > + .R[PSC_VOLTAGE_OUT] = 0, > + .m[PSC_CURRENT_OUT] = 16, > + .b[PSC_CURRENT_OUT] = 0, > + .R[PSC_CURRENT_OUT] = 0, > + .m[PSC_POWER] = 1, > + .b[PSC_POWER] = 0, > + .R[PSC_POWER] = 0, > + .m[PSC_TEMPERATURE] = 1, > + .b[PSC_TEMPERATURE] = 0, > + .R[PSC_TEMPERATURE] = 0, > + .func[0] = > + PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_PIN | > + PMBUS_HAVE_TEMP | PMBUS_HAVE_IOUT | > + PMBUS_HAVE_STATUS_INPUT | PMBUS_HAVE_STATUS_TEMP, > + .read_byte_data = mp5990_read_byte_data, > +}; > + > +static int mp5990_probe(struct i2c_client *client) > +{ > + int ret; > + > + ret = i2c_smbus_write_byte_data(client, PMBUS_VOUT_MODE, > + PB_VOUT_MODE_DIRECT); According to the datasheet, the chip does not support the VOUT_MODE command. Supposedly, direct vs. linear mode is selected with bit 9 of EFUSE_CFG. Even if the chip happens to "silently" support the command, the official command should be used to select the chip mode. Next question: Why use direct mode ? Linear mode is supported and would be much more flexible. > + if (ret < 0) > + return ret; > + return pmbus_do_probe(client, &mp5990_info); > +} > + > +static const struct of_device_id mp5990_of_match[] = { > + { .compatible = "mps,mp5990" }, > + {} > +}; > + > +static const struct i2c_device_id mp5990_id[] = { > + {"mp5990", 0}, > + { } > +}; > +MODULE_DEVICE_TABLE(i2c, mp5990_id); > + > +static struct i2c_driver mp5990_driver = { > + .driver = { > + .name = "mp5990", > + .of_match_table = of_match_ptr(mp5990_of_match), Using of_match_ptr() will result in a build failure if CONFIG_OF=n. > + }, > + .probe = mp5990_probe, > + .id_table = mp5990_id, > +}; > +module_i2c_driver(mp5990_driver); > + > +MODULE_AUTHOR("Peter Yin "); > +MODULE_DESCRIPTION("PMBus driver for MP5990 HSC"); > +MODULE_LICENSE("GPL"); > +MODULE_IMPORT_NS(PMBUS);