mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-12-21 17:32:09 +01:00
pmic: pca9450: Handle hardware with fixed SD_VSEL for LDO5
There are two ways to set the output voltage of the LD05
regulator. First by writing to the voltage selection registers
and second by toggling the SD_VSEL signal.
Usually board designers connect SD_VSEL to the VSELECT signal
controlled by the USDHC controller, but in some cases the
signal is hardwired to a fixed low level (therefore selecting
3.3V as initial value for allowing to boot from the SD card).
In these cases, the voltage is only determined by the value
of the LDO5CTRL_L register. Introduce a property
nxp,sd-vsel-fixed-low to let the driver know that SD_VSEL
is low and there is no GPIO to actually get that
information from dynamically.
This is equivalent to the following change in Linux:
c8c1ab2c5cb7 ("regulator: pca9450: Handle hardware with fixed SD_VSEL for LDO5")
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
parent
addfe45446
commit
281829f5ca
@ -56,6 +56,7 @@ struct pca9450_plat {
|
||||
struct pca9450_vrange *ranges;
|
||||
unsigned int numranges;
|
||||
struct gpio_desc *sd_vsel_gpio;
|
||||
bool sd_vsel_fixed_low;
|
||||
};
|
||||
|
||||
#define PCA_RANGE(_min, _vstep, _sel_low, _sel_hi) \
|
||||
@ -229,7 +230,8 @@ static int pca9450_set_enable(struct udevice *dev, bool enable)
|
||||
static u8 pca9450_get_vsel_reg(struct pca9450_plat *plat)
|
||||
{
|
||||
if (!strcmp(plat->name, "LDO5") &&
|
||||
(plat->sd_vsel_gpio && !dm_gpio_get_value(plat->sd_vsel_gpio)) {
|
||||
((plat->sd_vsel_gpio && !dm_gpio_get_value(plat->sd_vsel_gpio)) ||
|
||||
plat->sd_vsel_fixed_low)) {
|
||||
return PCA9450_LDO5CTRL_L;
|
||||
}
|
||||
|
||||
@ -360,6 +362,8 @@ static int pca9450_regulator_probe(struct udevice *dev)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
plat->sd_vsel_fixed_low = dev_read_bool(dev, "nxp,sd-vsel-fixed-low");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user