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

Matti Vaittinen
2026-04-07T05:48:26Z

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.