Skip to content

Commit c8c1ab2

Browse files
fschrempfbroonie
authored andcommitted
regulator: 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. Signed-off-by: Frieder Schrempf <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 1455f0b commit c8c1ab2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/regulator/pca9450-regulator.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ struct pca9450 {
3636
enum pca9450_chip_type type;
3737
unsigned int rcnt;
3838
int irq;
39+
bool sd_vsel_fixed_low;
3940
};
4041

4142
static const struct regmap_range pca9450_status_range = {
@@ -102,6 +103,9 @@ static unsigned int pca9450_ldo5_get_reg_voltage_sel(struct regulator_dev *rdev)
102103
{
103104
struct pca9450 *pca9450 = rdev_get_drvdata(rdev);
104105

106+
if (pca9450->sd_vsel_fixed_low)
107+
return PCA9450_REG_LDO5CTRL_L;
108+
105109
if (pca9450->sd_vsel_gpio && !gpiod_get_value(pca9450->sd_vsel_gpio))
106110
return PCA9450_REG_LDO5CTRL_L;
107111

@@ -1100,6 +1104,9 @@ static int pca9450_i2c_probe(struct i2c_client *i2c)
11001104
return ret;
11011105
}
11021106

1107+
pca9450->sd_vsel_fixed_low =
1108+
of_property_read_bool(ldo5->dev.of_node, "nxp,sd-vsel-fixed-low");
1109+
11031110
dev_info(&i2c->dev, "%s probed.\n",
11041111
type == PCA9450_TYPE_PCA9450A ? "pca9450a" :
11051112
(type == PCA9450_TYPE_PCA9451A ? "pca9451a" : "pca9450bc"));

0 commit comments

Comments
 (0)