From patchwork Tue Jul 2 11:52:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Vdovydchenko X-Patchwork-Id: 13719533 Received: from sonic306-46.consmr.mail.ir2.yahoo.com (sonic306-46.consmr.mail.ir2.yahoo.com [77.238.176.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96CB516C6BD for ; Tue, 2 Jul 2024 12:15:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=77.238.176.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719922517; cv=none; b=eBkAVu7XbaDw77jf83Ub7v/+ia1pgUKcJI1FAxCyI3RTaIizYTnn/3tHlfcLnbkyA8iQbwKWupT/q3rEGIjTsIDcXytXYf/N9lE/SQq4pNDW3Fe+lPqc1tgusScM6OVkPCldcgAXhqm6VYrUEK7CvbRT2KBDt2txcVCYyiaqtrI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719922517; c=relaxed/simple; bh=czYlFkR7gACaffEBBYkZYMloku7B869PLgAxG+uGO7Q=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: References; b=PHnLz4oASP9M3PqtYunWQRq9qrHqjDmzzCSnhd1TDX/FTjNDBn2yU2dEACBcO/UFGlI9rNOq6QTINUX6l7H9KfhdOsBeeVjVP4nUo7wt4qhZHtzZhSUt5+5m4bWCTrg2/Z0v3SqzKQlkhF77+e75kk+iPdh4yVzeReWy6dvtSsE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=yahoo.com; spf=pass smtp.mailfrom=yahoo.com; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.b=Uim+6NUL; arc=none smtp.client-ip=77.238.176.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=yahoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yahoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.b="Uim+6NUL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1719922513; bh=J8LVgZXsBn/SKy0ON6Xyfp/jRyWWH2Gsbog4fAcslz4=; h=From:To:Cc:Subject:Date:References:From:Subject:Reply-To; b=Uim+6NULkjR/R1kvM2cmMifMLwjDbtp0hhFtn1jVS22RifS4z3rNxbJc/ecXN8s6T+BOmLzYqQUIkgJlwoCBJS98maUlfl5+lJxoEVmwACqt33/hnEvjfvdxxMbOziNIKLRjkOqW/M3jwd22YIpYcnzZX1eZpOv/zgEqFjEUCeH3IQxNZnZ7llj0bsd+HQCfEoCvMEctTx5SiO/JtIj+Y1KCdty/Gh6pMgyYICtkJ/9j16udOoOkVhEhAXmq+6hmDsP/1GF77lpDm5zKsiQ6mVvp2URdduoxpkd6uF4Av1JDlP2dKHim5Zv3M3sv3xdIngSgTHdFpKbQlCJRng4QpQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1719922513; bh=3Hi2HUNxMUYDMwmw9pGuhipNp9UYufOr4TTQ3w0Dp4q=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=Pk37z50o054jMWFCuUeIf26lQ7jdAVoduRhhPrFVY3Pi+gTWuvfymv+5SvILtVcDC1HRn3HEMuJlcjdC6Xh7Ar14aG0qv6hm/sznAMA9SdYxz173mLFvbnIxCi5SANDmIHeJnRg4bUmc/Y2y8AV/kFxx8JtBf5fPlrvcQsMv+kHXdVzDNbc0OAXISamsc1nfJVH+TSJLLCnda6ZewoBet/UJb2abME3cu9HEaSSmHUdzmHhAUBCEn6OxcBosLEajWTkoCWJcej2H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FQnjWtjvgSI45zi1kt58OLLxOoH0s9wjdHRCWx3Zd6GMrpBE3z5zwYV08YN.UgdNk6UPg E3Ik49m7izLziYezWdonBe4OJf3z8yuPGwy3uED77zpFK4fr.PDwDg_xtZURZoRpfDkW.edw- X-Sonic-MF: X-Sonic-ID: 22345d43-bb8b-4137-a272-4ea238d35601 Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ir2.yahoo.com with HTTP; Tue, 2 Jul 2024 12:15:13 +0000 Received: by hermes--production-ir2-85cf877599-mvt7h (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 0dd9cec1d13f3a8113ebc66190b2d374; Tue, 02 Jul 2024 11:52:55 +0000 (UTC) From: Alex Vdovydchenko To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sean Anderson , Guenter Roeck , Jean Delvare , Jonathan Corbet , Delphine CC Chiu Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org, linux-i2c@vger.kernel.org, Alex Vdovydchenko Subject: [PATCH v4 0/2] Add MPS MP5920 Host-Swap controller Date: Tue, 2 Jul 2024 14:52:49 +0300 Message-ID: <20240702115252.981416-1-xzeol@yahoo.com> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240702115252.981416-1-xzeol.ref@yahoo.com> This series of patches adds the MP5920 Host-swap controller, which is used as a protection and control IC for devices that are being inserted into a live backplane. MP5920 acts as a voltage regulator (MP5911 etc) supervisor. IC utilizes pmbus and provides monitoring, statistics and limits to electrical and thermal characteristics such as: - input and output voltage - output current - output power - IC temperature One must take into account the nonlinear character of readings, so there will be a statistical error in the range 5–10 percents, depending on current passing through. In order to use the IC, make sure to specify a valid I2C address (consult to datasheet and dts-bindings) MP5920 datasheet: https://www.monolithicpower.com/en/mp5920.html Changes in v2: - fixed typos Changes in v3: - removed unnecessary license blob - removed unnecessary headers - edited device tables style - added chip name checking in probing - fixed typos in pmbus_driver_info struct initialization Changes in v4: - added i2c_check_functionality in probing - refactored usage of dev_err_probe insted of dev_err - edited chip name string handling while printing - restored .driver.of_match_table, keeping i2c_driver "old" style Alex Vdovydchenko (2): dt-bindings: hwmon: Add MPS mp5920 hwmon: add MP5920 driver .../devicetree/bindings/trivial-devices.yaml | 2 + Documentation/hwmon/index.rst | 1 + Documentation/hwmon/mp5920.rst | 91 ++++++++++++++++++ drivers/hwmon/pmbus/Kconfig | 9 ++ drivers/hwmon/pmbus/Makefile | 1 + drivers/hwmon/pmbus/mp5920.c | 93 +++++++++++++++++++ 6 files changed, 197 insertions(+) create mode 100644 Documentation/hwmon/mp5920.rst create mode 100644 drivers/hwmon/pmbus/mp5920.c