From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 2CBB7288D6 for ; Mon, 2 Mar 2026 10:56:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772448973; cv=none; b=H9ZhFRvPGIVNMDtVLvM0G518W1Q2fjMN1u1UwLNb9L03IH2hSGascDD21utHZQge0dCYPAV9AfDiAoqpUvTgSrwAkRFmKFWv7grblEXa2cZPjGE86d5lRf/ZXsmJGIfBUb1P/u8aoNf94Hi4JU2tWBDj8D80naioFp+dBAvoCpU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772448973; c=relaxed/simple; bh=4HSKZzGhBURWAag1eSLNRfotJ7fSctcWyvc0D54FZuI=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=e5tE3XVyJP3vRV2ynK9bbzYteQrzWbXRFRaEFyKs/jZm0ZYejhneNdZRmWO9QzGLSODT6bMpbkoVwyUn0bX9SZLLQGWlxPcROp51KOvBinuF6zvTH97FtKV8bGD5sUocbLsAQF86alFA/zDfPlkHgYXikCSe+4DUKqvVXVYPBK4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=flipper.net; spf=pass smtp.mailfrom=flipper.net; dkim=pass (2048-bit key) header.d=flipper.net header.i=@flipper.net header.b=vMrOXNLw; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=flipper.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flipper.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=flipper.net header.i=@flipper.net header.b="vMrOXNLw" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4837584120eso30448845e9.1 for ; Mon, 02 Mar 2026 02:56:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flipper.net; s=google; t=1772448968; x=1773053768; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=b/u8LOKf6Nlm4OlaRu+tmbKm1RfDAT6qwhKI1+hf3Ts=; b=vMrOXNLwmaOMICBSAEuSaAOCvPqiPLJ0xkn9wBxNlgbu20uY/2pkNvCBduE0v/iaH9 iwk/wTDFEqCYA3/f6P9ygmQN7Es4SLIBE1wjCs5l9k2TFmACFihoZ8tvFYMPYFfkOST1 C7JvK9HVjoIJOTiKvaBhW8FCn1FFDL6+36/Oxa6OBMMuUJ2Mpt7LRpcBxK3G5IzFLe8S 6Gz+DPyOHu2p/KvspjNMtDXIZmXbB7bb6XRYKSpgSD9CiswMSfLqFF9mXZJ+2DRWIy5E WJGseIOpcFgkN/gixPqt+t6cYeajeMK45OfYdrf/t7I8A1lwbxTT7g/yPIKKmiSCYzQK Vr1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772448968; x=1773053768; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=b/u8LOKf6Nlm4OlaRu+tmbKm1RfDAT6qwhKI1+hf3Ts=; b=ug46kN7q4XO2sCTOBeLxwrnQBQ3Xo6t5kTL/H5qcjlxr1RoDEApYJn/FW/3yMkXm+f S2GYU8WwTMHVecQd/bEzMR+bhhDZpIHYN5kGlcEbU1wZYImKDZY7n0rukda7Gb0mhqF5 CIQBMXdaJROdJ/BjXIql5UzbIFZ8kzFzr8M1m8M5h0eQJA1Xup1kRQDvX1DSYyTSeRbU mo4m3BxLamvWAVdJ1MyFIk4y/qnlhWf8AWQmbcseeseepNBot/y+1b76Sdi6Fs6zjsqf Zp0Ft2NTHvDBLIbUKcCnowJDgzkKMTVyPJ2CYU5xSXDT9vHQ+mEj5KjyMShsQSmmkjwT xpCg== X-Forwarded-Encrypted: i=1; AJvYcCVpbBGqpS3ZXZNFU+t/m1nNaODhi3tCiW2l7FS0o1BXFOnDp63jUTy7Zuiw0H2Tr8iDvceVf41OKSEblxI=@vger.kernel.org X-Gm-Message-State: AOJu0YxunxNRKx9HMIeLzymnjLI0Afqg8yQKxHlFtR/4Dq6zoWvPdPS8 aKxPJH7wQ2cEFJWvJzbXinqi1mC8W5+IfpXMuSZrI9E1wCo2i15Hl7l6iaMhHyPRK4wfKUZtJEY O5QDO X-Gm-Gg: ATEYQzx9pO1m97GWydlkSji7fQP4CrbEZvz4EF/xM35rpiEbMRd0wvHg8eTXUBIbu7J rlSxMclmdv1aJ8aL4Q+ckGhpCaEN1DCWvh8DVhPFvBJIDGR1OlTZmA3651zYOcovRyT11wfoZ4Z JOshWMyduzdnF9UTY8CGeEf7UeLcSXqZPbPIP8wffHr/nXZdZE60hJprdy8+kJT7hZnX//Vysm0 SZ+wMVLgO3HUhoWNgFZwS+E4pCJCX0JsO5eHsExcI5c4Z1UtGsNrBS5Xb0Y+RsO1IV7Ab4oH/X+ 1PGI/u9vvBf+74XDLRzE9IZ4RseZgKVueIutyFBwirgg8zgZciY/2Sdvc6xhi7+eNK7jwpwllmA QFRwxWYw7EzHO45pvxRK19Q3sEY+rGORxqGFOBStSluY0khDxEntvdvAW2IRKdpZM+U/tzRR6LC P5JCX6ABj+G3gvMvMX4Wclhr+wtXeYp9H19h7424wrG1yokhyEQX/fXkNphnktkzlOIK5nK1c4y lw= X-Received: by 2002:a05:600c:46cd:b0:483:702f:4633 with SMTP id 5b1f17b1804b1-483c9b9433bmr202932855e9.4.1772448968314; Mon, 02 Mar 2026 02:56:08 -0800 (PST) Received: from alchark-surface.localdomain (bba-94-59-44-101.alshamil.net.ae. [94.59.44.101]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bfccff00sm133263075e9.25.2026.03.02.02.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2026 02:56:08 -0800 (PST) From: Alexey Charkov Subject: [PATCH v2 0/2] Add support for Texas Instruments INA4230 power monitor Date: Mon, 02 Mar 2026 14:55:54 +0400 Message-Id: <20260302-ina4230-v2-0-55b49d19d2ab@flipper.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIALpspWkC/z3MQQrCMBCF4auUWRtJpmk1XXkP6SKaqR2QNCQlK CV3NxZx+T8e3waJIlOCodkgUubEi6+Bhwbus/UPEuxqA0rsJSoj2FuNrRQnbSVqaVTXOqjvEGn i1y5dx9ozp3WJ7x3O6rv+DOz+RlZCCoM35cicldP9ZXpyCBSPnlYYSykfKjU4eaAAAAA= X-Change-ID: 20260219-ina4230-74a02409153d To: Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Charkov , Krzysztof Kozlowski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2422; i=alchark@flipper.net; h=from:subject:message-id; bh=4HSKZzGhBURWAag1eSLNRfotJ7fSctcWyvc0D54FZuI=; b=owGbwMvMwCW2adGNfoHIK0sZT6slMWQuzTlZocIoy6BXIjYnnVHlgaT2WYUH75zZhIo6efrMX h7Lu1HcMZGFQYyLwVJMkWXutyW2U434Zu3y8PgKM4eVCWSItEgDAxCwMPDlJuaVGukY6ZlqG+oZ GuoY6xgxcHEKwFR/dmRkePZp010BxwKBp13p986fmFv6q6/F8pJofNt8T65lDRETbzH8FVgouCF xNYvT2nNBn/dHGP1tPqZYPmn3o6685WllbhW/mAA= X-Developer-Key: i=alchark@flipper.net; a=openpgp; fpr=9DF6A43D95320E9ABA4848F5B2A2D88F1059D4A5 TI INA4230 is a 4-channel power monitor with I2C interface, similar in operation to INA3221 (3-channel) and INA219 (single-channel) but with a different register layout, different alerting mechanism and slightly different support for directly reading calculated current/power/energy values (pre-multiplied by the device itself and needing only to be scaled by the driver depending on its selected LSB unit values). In this initial implementation, the driver supports reading voltage, current, power and energy values, but does not yet support alerts, which can be added separately if needed. Also the overflows during hardware calculations are not yet handled, nor is the support for the device's internal 32-bit energy counter reset. An example device tree using this binding and driver is available at [1] (not currently upstreamed, as the device in question is in engineering phase and not yet publicly available) [1] https://github.com/flipperdevices/flipper-linux-kernel/blob/flipper-devel/arch/arm64/boot/dts/rockchip/rk3576-flipper-one-rev-f0b0c1.dts Signed-off-by: Alexey Charkov --- Changes in v2: - Replace u64/u64 division with do_div() (kernel test robot) - Add an example with ti,maximum-expected-current-microamp property in bindings (Krzysztof Kozlowski) - Include the newly added binding in MAINTAINERS file (Krzysztof Kozlowski) - Use dev_err_probe() where appropriate in the driver (Krzysztof Kozlowski) - Switch to devm_regmap_field_bulk_alloc() instead of an open-coded loop - Add a bounds check for the calculated calibration value, and a corresponding error message - Link to v1: https://lore.kernel.org/r/20260225-ina4230-v1-0-92b1de981d46@flipper.net --- Alexey Charkov (2): dt-bindings: hwmon: Add TI INA4230 4-channel I2C power monitor hwmon: Add support for TI INA4230 power monitor .../devicetree/bindings/hwmon/ti,ina4230.yaml | 130 +++ MAINTAINERS | 7 + drivers/hwmon/Kconfig | 11 + drivers/hwmon/Makefile | 1 + drivers/hwmon/ina4230.c | 1006 ++++++++++++++++++++ 5 files changed, 1155 insertions(+) --- base-commit: 3ef088b0c5772a6f75634e54aa34f5fc0a2c041c change-id: 20260219-ina4230-74a02409153d Best regards, -- Alexey Charkov