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)
Feb 8 2024, 10:16 AM
Unknown Object (File)
Jan 13 2024, 11:25 AM
Unknown Object (File)
Jan 10 2024, 12:20 AM
Unknown Object (File)
Dec 20 2023, 2:26 AM
Unknown Object (File)
Dec 18 2023, 4:35 PM
Unknown Object (File)
Nov 28 2023, 10:21 PM
Unknown Object (File)
Nov 27 2023, 7:49 AM
Unknown Object (File)
Nov 25 2023, 8:20 PM
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.