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
Unknown Object (File)
Thu, Apr 17, 6:45 AM
Unknown Object (File)
Wed, Apr 16, 12:29 AM
Unknown Object (File)
Tue, Apr 15, 9:08 AM
Unknown Object (File)
Tue, Apr 15, 6:39 AM
Unknown Object (File)
Mon, Apr 14, 10:30 AM
Unknown Object (File)
Mon, Apr 14, 9:29 AM
Unknown Object (File)
Mon, Apr 14, 9:03 AM
Unknown Object (File)
Mon, Apr 14, 3:54 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 Skipped
Unit
Tests Skipped

Event Timeline

sys/dev/extres/regulator/regulator_fixed.c
161

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.