Page MenuHomeFreeBSD

regulator_fixed: Do not disable fixed regulator at probe
ClosedPublic

Authored by manu on Nov 13 2018, 6:09 PM.

Details

Summary

If the regulator is unused it will be disabled by the regulator_shutdown sysinit.

Test Plan

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.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

manu created this revision.Nov 13 2018, 6:09 PM
mmel added inline comments.Nov 15 2018, 6:19 AM
sys/dev/extres/regulator/regulator_fixed.c
165 ↗(On Diff #50371)

This test doesn't works for regulators with active low enable.
Imho, right (and more readable) way is something like:

if (sc->param->boot_on || sc->param->always_on) {
         rv = GPIO_PIN_SET(pin->dev, pin->pin, sc->param->enable_active_high);

then, enable variable can be deleted completely.

manu updated this revision to Diff 50996.Nov 23 2018, 2:50 PM
This revision was not accepted when it landed; it landed in state Needs Review.Nov 26 2018, 6:46 PM
This revision was automatically updated to reflect the committed changes.