RE: Where to update regulator register with initial voltage set by HW

From: Bartholomae, Thomas
Date: Fri Jun 30 2017 - 08:29:50 EST


Hi Mark,

The problem is that our used regulator TPS65273V from TI do not have the possibility to read the current voltage defined by the HW, means by the circuit of the regulator.
In this case the register holding the voltage to be set later by software has a reset value which is normally the min value the regulator can support. This value can be out of the range of the supported rail. Therefore before the regulator gets registered this register needs to be set with a 'good' value.
I assume the only practicable solution will be that we initialize this voltage register in the boot code where we also set the CPU frequency.
BR Thomas

-----Original Message-----
From: Mark Brown [mailto:broonie@xxxxxxxxxx]
Sent: Friday, June 30, 2017 14:15
To: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@xxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx; Liam Girdwood <lgirdwood@xxxxxxxxx>; Bartholomae, Thomas <t.bartholomae@xxxxxxxxx>
Subject: Re: Where to update regulator register with initial voltage set by HW

On Fri, Jun 30, 2017 at 01:37:32PM +0200, Waldemar Rymarkiewicz wrote:

> I am not sure if I understand. Do you mean, a regulator should
> determine a voltage and update a register with a right selector when
> system boots, so the regulator framework reading reg register knows
> actual voltage?

Just don't provide a default value for the cache, regmap will do a physical read if there's nothing in the cache for that register and everything will work transparently.