From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 F10203F5BEC for ; Mon, 17 Aug 2026 10:15:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786961706; cv=none; b=g6nZLs06XWrj7ISJRMRgA4tGLi3M1adlxyxxEemJKRJ3sn3a0GfSl5g/lCpToP2w3X+efV5QpUG42VUfCbaFgjkFJg+vMkNnHRwR2x0kWNZGlImG0LFpZhNdDuFw4OUXC/tGOGzfTlq0WuxIJMXh1bh/3DmNDoNbRCyanC9xdhE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786961706; c=relaxed/simple; bh=/07Z0NPAnj9CzoCCLg6q4N1CEswLr8QmR5/5BsgGcW0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=RiCTX35+DjdIDjEXosKPPBS5IATA1drZ5EQPjtrgacRLe/8Zc39+6dSqedmVvZq3HXG+ZYFDeDzxgDDQ2B5DHOu447F/eJattBrFe+13JUty3XcEjokuHz3T5hvZXEWXLYd77AkiVQ6X1okCBWCYT9v5ZKN8ZmpLO05eOpvS/3c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=ZzGgzF+W; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="ZzGgzF+W" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4998590d392so34293245e9.0 for ; Mon, 17 Aug 2026 03:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1786961701; x=1787566501; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=yFns77KTWZWOI24gl45GxSfmFCwAF7espPxpg5+yrlI=; b=ZzGgzF+WHx2UOROSyIyaiDAfcz54V1Kf1g3YMIhhO8L9v0jiLWMuChm86oiChOgZAy C3R8hrPxePSyskglAGbhp4sBjtvosAaGTH5S3NxTC1BMbUmOF8X05TcREf/b4HjQA/L7 4h589tnK2w0Rc4I32q5LB3NYefb4nbvXRJGoKSLh06q9faWlBYxu8yO1ieJNnpetlW/c EpDEp8Nq56CcLKBWfgP2pFeUGA+uY0EawOiDS2M6n0na2FLQwhp3HsflPcg40KqD3F7H PE4gSO6ZYW/QS6RzMfABL21pG/UwWfLDwNG69IqBd7ydRnnY8W4FWFtHd87M+WHMj/5y 0itQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786961701; x=1787566501; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=yFns77KTWZWOI24gl45GxSfmFCwAF7espPxpg5+yrlI=; b=OImaoxNa/cmlseu4x7WPI19/nqMeYtzA0ygeeKito57fVtu85zMGedEXXZ6Uj6P+0+ 827c4LBKndF/gcveo6r7nS7n1Hk51lh0PhoXdZ7/VXo4uySRVzeaXIjTUBo++U4i9JqB R1zOnSGdIzY+S71eaxXte7FuIG7NljaCKjCrv6GdZyhrwBfodhYo8NoXGXn374539J32 4VF1PrZRfGfL3yfSZzdFdVNUfSEZV51SrYD3Sk+ZxD5i8xc60GH9G6sPKpkbcuYIaxtL zTUJU16fykG+nLI7ivELZg4dRpPXwG3BcEAu11exSz3tmvRpVfI5AUSz5tkZdcrXxZoH W2RQ== X-Forwarded-Encrypted: i=1; AHgh+RrfaTrCnKTPumDuiyuBgkz1Kek4QFoSN/Ai0opx+Veuzlht/KBSTUsa8kM9S2jmt7kVbgCxOizaW8ehtXg=@vger.kernel.org X-Gm-Message-State: AOJu0Yz+U7KQ+NowrsgFb8jaxr1LRUqKwb2bcxsup6thVWTlDLUv0yue Bwv986hCYtWMChJ5Z5QS3K/AAmpLqKalblfMU/JiMVx8rJ4G3sBcWUSINr0cG+gRYB0= X-Gm-Gg: AR+sD12mK4KG8jw6+U/nbgrOYg6J0jIgXtOu2tlU4rNugmiSbk2myNdCFaRIDa3i360 X6Iul6onTTbA70A+AEIviMqqlZ5tUyfovvQ9rtElOtQQzScMJyHUYdUx7wHC29vl4CsshfIveei tlnkP4W1TVcqHfMj9ftq3s3IlPXLQv3UkS/gytBbsQK9pVCSyqt/klJiYVdOJrkdCYo+J5KR8ne 4FC7QHTjyiLFcjZZEKkjxKuFjy/J65ppVE6wvJAXbN5FKczb88DC39E2rU19mXjmSO2xIlKMi4G jLF3g3rw5fbdLt7XwPSQtzH7+C9Fgg8yoo9yzvMU7VKzZdWG5T5NlxPBulbj69EhFNhouJww2Li faFQ4l41j9sPyuLZI+LH2kFU+ubtmkEUcravC1tfgibdMLIIHYsOPp1DCBTIGZZ6sYy1AdFXJrJ I90bXQiT5vNYSV7GuvLYe0j/iZUVXIgDrS4xot6xWIXdMzVDJddzurrq4OFUTa+ekx6nuaAEtx1 FB4FUHTfmgPQ7pYXwwQ8B0D81aoG6aq6fl/sSg67bofoe+5h2edZsLhibuAIgA+4Fv7iy+VPi3p V1JHgduWu6et5MAg1foNB3j8pAqodg== X-Received: by 2002:a05:600c:6c4d:b0:496:c06b:9fb4 with SMTP id 5b1f17b1804b1-4998799df10mr235578415e9.14.1786961700897; Mon, 17 Aug 2026 03:15:00 -0700 (PDT) Received: from silence.. ([46.10.240.40]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4999d06167csm29542255e9.3.2026.08.17.03.14.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2026 03:15:00 -0700 (PDT) From: Stoyan Bogdanov To: jbrunet@baylibre.com, linux@roeck-us.net, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Stoyan Bogdanov Subject: [PATCH v7 0/3] Rework TPS25990 direct conversions and add TPS1689 support Date: Mon, 17 Aug 2026 13:14:42 +0300 Message-ID: <20260817101455.3526260-1-sbogdanov@baylibre.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series reworks the TPS25990 PMBus driver and adds TPS1689 support. Both devices share most internal functionality, differing mainly in supported voltage and current operating ranges. Link to V6 at [4] V7 - Reject negative values (-EINVAL) in tps25990_write_word_data() for PMBUS_VIN_OV_FAULT_LIMIT and PMBUS_IIN_OC_FAULT_LIMIT before offset arithmetic - Fix unsigned underflow in the same paths: subtract the offset in a signed intermediate and clamp before scaling - Fix tps1689 VIN_OV_FAULT_LIMIT write encoding: widen rng_idx/ov_set to u32 and clamp against FIELD_MAX() of their register fields - Clamp the 8-bit WARN/FAULT limit group to 0 before the 8-bit shift - Add PSC_CURRENT_OUT scaling with rimon in tps25990_probe() - Minor: split the read-side VIN_OV_FAULT_LIMIT calc into rng/vov, fix continuation-line alignment, drop unused tmp_scaled_value Link to V5 at [3] v6: - Remove special-case conditioning for IIN_OCF so both TPS25990 and TPS1689 use the same logic. - Add scaling for TPS1689 VIN_OV_FAULT according to the datasheet VIN_OV_FLT table, keep the existing behavior for TPS25990. - Fix incorrect PMBus Direct format conversion coefficients (m, b, R) for TPS1689 PSC_VOLTAGE_IN in struct pmbus_driver_info. - Add missing PMBUS_HAVE_IOUT flag in pmbus_driver_info .func for TPS1689 - Restore the const qualifier on struct pmbus_driver_info, which was removed unintentionally. - Update i2c_device_id to follow I2C subsystem coding style by using the .name and .driver_data initializers. Link to V4 at [2] v5: - Simplify implementation and remove calculations from the driver, as they are not needed and were implemented incorrectly. Thanks Guenter for taking the time to explain. - Drop pmbus API changes, as they are not actually needed. - Add conditioning to separate TPS1689 and TPS25990 by chip_id in tps25990_read_word_data() and tps25990_write_word_data() for PMBUS_VIN_OV_FAULT_LIMIT and PMBUS_IIN_OC_FAULT_LIMIT. The TPS1689 value is not 4-bit, so it does not need adjusting. Keep the current adjustment logic only for TPS25990. Link to V3 at [1] v4: - Fix non-devicetree support as reported by Guenter Roeck - Rework direct conversion handling to use exported PMBus core helpers instead of driver-local implementations - Update dt-bindings commit message and ti,tps25990.yaml - Clarify commit messages to better reflect the final implementation - Add and export direct conversion helpers from pmbus_core - Eliminate duplicated conversion code in the driver V3: - Fix error detected from kernel test bot regarding division Tests: - Test builds for x86_64, arm64, i386 - Retest driver on arm64 - Validate driver direct conversion functions manualy V2: - Fix error detected from kernel test bot - Add Acked-by to dt-bindings commit - Drop "support" from dt-bindings commit subject [1] https://lore.kernel.org/all/20260217081203.1792025-1-sbogdanov@baylibre.com/ [2] https://lore.kernel.org/all/20260522082349.2749970-1-sbogdanov@baylibre.com/ [3] https://lore.kernel.org/all/20260728015857.193890-1-sbogdanov@baylibre.com/ [4] https://lore.kernel.org/all/20260805090400.2059006-1-sbogdanov@baylibre.com/ Stoyan Bogdanov (3): hwmon: (pmbus/tps25990): Rework driver for multi-device support dt-bindings: hwmon: pmbus/tps25990: Add TPS1689 hwmon: (pmbus/tps25990): Add TPS1689 support .../bindings/hwmon/pmbus/ti,tps25990.yaml | 8 +- Documentation/hwmon/tps25990.rst | 15 +- drivers/hwmon/pmbus/tps25990.c | 233 +++++++++++++----- 3 files changed, 186 insertions(+), 70 deletions(-) -- 2.43.0