Re: [PATCH] power: supply: bd71828: add input current limit property

From: Matti Vaittinen

Date: Tue Apr 07 2026 - 01:48:31 EST


On 07/04/2026 08:34, Matti Vaittinen wrote:
On 02/04/2026 00:17, Andreas Kemnade wrote:

// snip

+    .ilim_stat = BD71828_REG_ILIM_STAT,
      .btemp_vth = BD71828_REG_VM_BTMP_U,
      .chg_state = BD71828_REG_CHG_STATE,
      .bat_temp = BD71828_REG_BAT_TEMP,
+    .dcin_set = BD71828_REG_DCIN_SET,

Hi Andreas / Sebastian,

Sorry for belated review (although, I don't think this did float on the list quite THAT long...)

I believe this is the ILIM_STAT register in the data sheet, at address 0x6d, right? (The bit field is named as: LIM_DCIN_STAT[5:0]). If so, then I have a follow-up question in the setter...

// snip

+        return regmap_update_bits(pwr->regmap, pwr->regs->dcin_set,
+                      BD7182x_MASK_ILIM,
+                      val->intval / 50000 - 1);

The "burning question" I have is - how well this has been verified? I ask because the data-sheet version which I read (rev 0p17, DS2 draft) marks this register as a read-only. I know my data-sheet, targeting the design-sample 2 of bd71828 (not bd71879) is ancient. It may be this is an error in the data-sheet but I had to ask anyways...

Please, ignore this bit. I somehow misread the patch. It is the DCIN_SET which is used here, not the ILIM_STAT. Logic seems correct!

I would still prefer the linear-ranges, especially if other variants support this. But the logic seems correct. Sorry for the noise.

Yours,
-- Matti

---
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~