mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-15 06:42:51 +01:00
regulator_fixed: Do not disable fixed regulator at probe
If the regulator is unused it will be disabled by the regulator_shutdown sysinit. Tested on pinebook where the backlight is controlled by a fixed-regulator. The regulator doesn't have a regulator-boot-on param (I'm gonna upstream this) and so we disable it at probe. We later enable it but this cause the screen to go black. Linux doesn't disable regulator at boot (at least for fixed-regulator) so better match this to have the same UX. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D17978
This commit is contained in:
parent
72bce9fff6
commit
3cb36739ce
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=340989
@ -145,7 +145,6 @@ regnode_fixed_init(struct regnode *regnode)
|
||||
struct regnode_fixed_sc *sc;
|
||||
struct gpiobus_pin *pin;
|
||||
uint32_t flags;
|
||||
bool enable;
|
||||
int rv;
|
||||
|
||||
sc = regnode_get_softc(regnode);
|
||||
@ -158,14 +157,15 @@ regnode_fixed_init(struct regnode *regnode)
|
||||
flags = GPIO_PIN_OUTPUT;
|
||||
if (sc->gpio_open_drain)
|
||||
flags |= GPIO_PIN_OPENDRAIN;
|
||||
enable = sc->param->boot_on || sc->param->always_on;
|
||||
if (!sc->param->enable_active_high)
|
||||
enable = !enable;
|
||||
rv = GPIO_PIN_SET(pin->dev, pin->pin, enable);
|
||||
if (rv != 0) {
|
||||
device_printf(dev, "Cannot set GPIO pin: %d\n", pin->pin);
|
||||
return (rv);
|
||||
if (sc->param->boot_on || sc->param->always_on) {
|
||||
rv = GPIO_PIN_SET(pin->dev, pin->pin, sc->param->enable_active_high);
|
||||
if (rv != 0) {
|
||||
device_printf(dev, "Cannot set GPIO pin: %d\n",
|
||||
pin->pin);
|
||||
return (rv);
|
||||
}
|
||||
}
|
||||
|
||||
rv = GPIO_PIN_SETFLAGS(pin->dev, pin->pin, flags);
|
||||
if (rv != 0) {
|
||||
device_printf(dev, "Cannot configure GPIO pin: %d\n", pin->pin);
|
||||
|
Loading…
Reference in New Issue
Block a user