From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (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 A442124E4A1 for ; Wed, 17 Jun 2026 05:56:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781675810; cv=none; b=mLN7O6yxkMIUfaXTMTMA93TSftkbP6VOl4dYcOSdhfhsqG2oGQp9FCR3jQDA+jhiBdPYo0L1BqtUcau5IYK41JNZPHGUwWKWhoxPJC/zpHTE5hu8nRaI51cqNRDmycI2BNg1EKqMBbEfW3xTjzLMq6sX2FtIVVIWUoYtF2ZhzM8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781675810; c=relaxed/simple; bh=U4jb1XEnfVj/10uymo5MpBUZyQ6pA2zJ8zU684ftx+c=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cesCdG9JtJcOafFGUKP/Mgvcz5Yvup2O9QEEJqD44yOTrUZzFayhhmvPLH/ZptgH09MfpsoEpcQOCjACIWz0sq8HdBKmOA/x3hBDAEnydHlL9F4Q61W5ZPbcFF/8RwfVY7jmqxaLm0rJb6WhzRizzOAvrxTjC8JhrkNH4cMZylA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gZDQfNqS; arc=none smtp.client-ip=209.85.167.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gZDQfNqS" Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-5aa68d9d4a3so6083692e87.2 for ; Tue, 16 Jun 2026 22:56:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781675806; x=1782280606; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=fZAGUj+0EAl5ib1P7hbkGJIeLUQqhxo3UG278FtSsv8=; b=gZDQfNqSiBnlo6rLr7XiUn3jOb6HpRoCzbGZXX2HgXlljePUCKSjZR5i0r3wikIwiI 7/oRNgOVW0feLEk+ylHc84xF611pPUHgRrPh5dV5QgAy1neHms0UbPORq+o6v+D/or8B crWimb3Gd7c8bbCYgj+nfcZe1/2Cm5OBMtYeX3SPNlnAlFF8bT4Y5/PBgc2iQyCxjupA IDDGJjlkcgEqY9xN2/YsPEMHpXuCbHuKD4eZvR/X92aHT6CZtnTdPrz/bSpx1t1rWBV9 IcbsfqnUNtI5bxayqE0+Twm59pIKEEauRSsV6cHpVso4qBJMYZfBoOpNO81d+ZsyiXdh tlHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781675806; x=1782280606; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fZAGUj+0EAl5ib1P7hbkGJIeLUQqhxo3UG278FtSsv8=; b=MSqH1NYbkZDXwXsJsyd5o/5LGjB8d5KodpQyRwEpH7XACWDG9eFB+DFsQCol12QLoI 1MhwbT3Wev2WtBFYWfHtPfvg+njupV6cW3qpMevKrWMEaAGW4f9XbFL4TCopoMwUBlNW bfC9tL7Fhsq8tH2f3sG9PGIdC2obXsNik9Z8rwVyYE7WneffFT25fCoidpbYaIuB5s60 w4eVtg2bYJ7xJS/9fzCx0HczJJWK2X9lbYAH4Y1+qdRz81385t++AM20Dxp3N5nINc0P FaZS8Dpofj0EFMnhcHLuugWKTBtz6VfLe2BZkNqCA/UdjD0ghkrBJscNXJreP8WFMO+i euSw== X-Forwarded-Encrypted: i=1; AFNElJ+1WxBOaHUlC2UITUWvt6w6+9bv6GGH0dpHbckkVtxxItMBMBz5lNOplJObTZjbCKNrj0hSYABuj3RxZ8Y=@vger.kernel.org X-Gm-Message-State: AOJu0Yx01Dgr1w0bZHYxl93rxKAgEu2Aohex6QKXBcHIyPjQSKEj7TVY nEXtF7iDmLmCkmASt8YqrC/S4IsEWdHhs29ZlVYQJ2aJ1k+WYu85/NLd X-Gm-Gg: Acq92OHb5Pd9U62B5nVsAWNMlb9rP5rPBwmIksgUcNJ+UyIarf61+oiWvFUFTMGdP5E lCKWecmxKTs6Hdxrug+RGsoEF9VMV4wHNN/Qirf2R0e4csKzIyCX3X9BoTTTPwmSr/ttl40tUpy Q4ODIX1MPndG+LJz+H6VkDQb3Tgd0VDJQ4u2u48H7iHI4c9aAH1jaqNly5C7sidGSA9Tjd4pcAY 8FrNWm44TbWNDCFIc+EyKuDJvYkMBCn5g06nEujv0h7uAHMoAknHgQ6CmKNAMupgmyU9ZhLY8EJ ltZx62pfURkvpFaBv5byyWLIqCd8nJ2oyXQaHwSGEAlvLTygDuJ/MUT8Mu2h5z9BOzWWzcpYt7R bttbxcc4/0xzsZS5FL3ZVz3oSTpIZi9tJkWfF5XsxnxBIOGgCk23sljg78n3M6isanCJbHW7++l JQI12TWEtcJfTV81jQOmmyNzLw8odykKIuB0m+8EPT/WaavYKe4lkfACsGv8Vh2Jc5JmWnqg== X-Received: by 2002:a05:6512:3d87:b0:5ad:3035:c2be with SMTP id 2adb3069b0e04-5ad470250fdmr678739e87.51.1781675805782; Tue, 16 Jun 2026 22:56:45 -0700 (PDT) Received: from ?IPV6:2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703? ([2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5ad2e162222sm4195880e87.17.2026.06.16.22.56.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Jun 2026 22:56:45 -0700 (PDT) Message-ID: <7e430392-1b27-4c3d-bfc7-1311b9838156@gmail.com> Date: Wed, 17 Jun 2026 08:56:44 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 6/7] hwmon: adm1275: Support ROHM BD12790 To: Guenter Roeck , Matti Vaittinen , Matti Vaittinen Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Corbet , Shuah Khan , Wensheng Wang , Ashish Yadav , Kim Seer Paller , Cedric Encarnacion , Chris Packham , Yuxi Wang , Charles Hsu , ChiShih Tsai , linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org References: <8ca875d21f2d9a4d53a87b47a5e6efab48266178.1781591132.git.mazziesaccount@gmail.com> Content-Language: en-US, en-AU, en-GB, en-BW From: Matti Vaittinen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 16/06/2026 17:08, Guenter Roeck wrote: > On 6/15/26 23:44, Matti Vaittinen wrote: >> From: Matti Vaittinen >> >> Add support for ROHM BD12790 hot-swap controller which is largely >> similar to Analog Devices adm1272. >> >> The BD12790 uses the same selectable 60V/100V voltage ranges and >> 15mV/30mV current-sense ranges as the ADM1272, and the same VRANGE >> (bit 5) and IRANGE (bit 0) layout in PMON_CONFIG. It therefore uses >> a dedicated coefficient table that mirrors adm1272_coefficients, with >> the following differences derived from BD12790 datasheet Table 1 (p.18): >> - power 60V/30mV: m=17560 (vs. 17561) >> - power 100V/30mV: m=10536 (vs. 10535) >> - temperature: b=31880 (vs. 31871, reflecting T[11:0] = 4.2*T + 3188) >> >> Signed-off-by: Matti Vaittinen >> Assisted-by: GitHub Copilot:claude-sonnet-4.6 >> >> --- >> Originally this patch was AI-generated. I did pretty much re-write the >> probe changes by hand, and also fixed some of the coefficient math >> afterwards :/ But yeah, this one was AI "assisted". :) >> >>   drivers/hwmon/pmbus/Kconfig   |  4 +-- >>   drivers/hwmon/pmbus/adm1275.c | 53 +++++++++++++++++++++++++++++------ >>   2 files changed, 47 insertions(+), 10 deletions(-) // snip >> @@ -655,12 +681,23 @@ static int adm1275_probe(struct i2c_client *client) >>           break; >>       case adm1272: >>       case adm1273: >> +    case bd12790: > > Please don't overload the existing case statements. > Just add separate case statements for the new chips. > Hmm. Ok, although, here, same as with the BD12780, I would like the code to clearly show that the BD12790 is very very similar to another IC (adm1272). When we have own case for it, this information gets kind of lost as these cases are a tad too long to easily spot the differences. If there are any ideas how to ease spotting this while having own cases - I am keen to hear. Yours, -- Matti -- Matti Vaittinen Linux kernel developer at ROHM Semiconductors Oulu Finland ~~ When things go utterly wrong vim users can always type :help! ~~