Page MenuHomeFreeBSD

regulator_fixed: Do not disable fixed regulator at probe
ClosedPublic

Authored by manu on Nov 13 2018, 6:09 PM.
Tags
None
Referenced Files
F133260949: D17978.id50996.diff
Fri, Oct 24, 10:43 AM
F133260944: D17978.id.diff
Fri, Oct 24, 10:43 AM
F133260941: D17978.id50371.diff
Fri, Oct 24, 10:43 AM
F133260936: D17978.id51129.diff
Fri, Oct 24, 10:43 AM
F133215094: D17978.diff
Fri, Oct 24, 1:18 AM
Unknown Object (File)
Wed, Oct 22, 11:46 PM
Unknown Object (File)
Mon, Oct 20, 2:44 AM
Unknown Object (File)
Sat, Oct 18, 5:08 AM
Subscribers

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 - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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.

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.