From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (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 B7AB8378D92 for ; Wed, 17 Jun 2026 05:56:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781675809; cv=none; b=Yw0w+/sbH5aRImjFdRrJ8dA0OdEvByC5qC+Lyt41UTUqTXWA0HQfzrpd3vyODTK5FkQPuYcQjiFbDc6dl5TRPCgaIi8dlwq7jB9bLSQ1BBFZInfwfmW+gRojidaVZkDVQ5udZr1ueSoui9xLgXXTBueNJKGJdxV/GzI4Fq0vibs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781675809; c=relaxed/simple; bh=U4jb1XEnfVj/10uymo5MpBUZyQ6pA2zJ8zU684ftx+c=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=dhqQVG55BD8InPhCD4QGd82lBei7NZPHsiz4HehEVQHj5uRFdjup4J4cMvVnmdU3Vr38zwGVk8ia9IdedJJiYS7R6Qf7A+PehoFfZ1nWTHRdeFirDOk32pxeE/pLrBxFXluX/54G5kuYkfnPq3BKwJP9dl/21tkRb3SBFgxF7IQ= 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.42 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-f42.google.com with SMTP id 2adb3069b0e04-5aa68d9d4a3so6083690e87.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=LHmgZ1Ca7dWUEqSklq5GDszhLArhtLt3u59HPQ0d2ZoP3DUeofGTqsSBMnfQB6i3p3 8vSxfiytBxv5sw6zzP4T7Nnhop6IDsVbjHwda6KnGPmV+ZIJT52pAnTXXOduQxt58S4F oNG8y9Wgqk2dXc0e0IOxUi7JFY/6oCp+lRr9HKlxOAFLeo+A64n5khjBAybTDPo9Mzpw MS50a09svTzib8hPN/brzSIpi+ZSSsa864QdgkRBTN47dWuY/2xKytmVO7XblaCMHcrK FVxWFnhl7j3xfcTN8TPGue3WxSYzQtXFyhKn2xoty2gJFEfMhpul14HjxOXL1v2tH2IP xMYw== X-Forwarded-Encrypted: i=1; AFNElJ9Aby3bDZsVYoNHVi3M6uyKtv8PVfuNchurbMPbm8wJpdbd8ahYGnA+zYxVdXckEG6yXvH0+VmCThw=@vger.kernel.org X-Gm-Message-State: AOJu0YzsU7tACkmoPlsuS/GMYCsmc3IhBjizSlIevMYyLQ4I4BsT8VF2 zqD+Oy9tmCZlrkxd18bODPx7d/XGbOr7OvrsHxhkWuUMjREkASv5U5cA X-Gm-Gg: Acq92OHV1MXojJ1zNEY8/rShQMDNxwgzviPs0SK5UPhZthGN2IETMdpkTJlPWgXVJMV qf8s65X6nYZGGA9hpfvjIjKQp5icDFaaEL4Ia53s+0Ykrq0ZCMuzICdaqNTG1ksENMEc/MQlHHH nF8woi+dbarLRVfjlnMxW6JENA1CQy3ZJHHuW1gov/vcleclHvZ1WvdfNqfsSYhkXaI/LwljDYE soN97I7cr4452G7+ECVMgp3W8CmrZod5nppD9YqioBwCqG6AMKAqGepsLExrdQl7O8iASJINK8Z LxBEkK/mvicJaVFEackyhpQlSYqOw84omeSAj1b+aSMAk/wReYVvFvHWlfeURoSqB/pUwin8uC3 eYM61/Z+RQF/h4PYyfGDHaS/yWxX6jrXiSVjulAEN80tDmokMVw9TvA56+/E8nwwlBnbz1VqZdX Tq9nD9/DleuGJbbCj4o7sYf4rMgDolWXzt9sT+DkTnWOY51WQpdJpHkp8RmHrE/u0ta2xDwA== 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-doc@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! ~~