HomeFreeBSD

MFC r353917-r353919, r354396-r354397

Description

MFC r353917-r353919, r354396-r354397

r353917:
regulator: Add a regnode_method_init

This is a default init method for regulator that don't really
need one.

r353918:
axp81x: Use the default regnode_init method

r353919:
regulator: Add a regnode_set_constraint function

This method check that boot_on or always_on is set to 1 and if it
is it will try to enable the regulator.
The binding docs aren't clear on what to do but Linux enable the regulator
if any of those properties is set so we want to do the same.
The function first check the status to see if the regulator is
already enabled it then get the voltage to check if it is in a acceptable
range and then enables it.
This will be either called from the regnode_init method (if it's needed by the platform)
or by a SYSINIT at SI_SUB_LAST

Reviewed by: mmel
Differential Revision: https://reviews.freebsd.org/D22106

r354396:
regulator: Add regulator_check_voltage function

This function will call the regnode_check_voltage method for a given regulator
and check if the desired voltage in reachable by it.
Also adds a default method that check the std_param and which should be enough
for most regulators and add it as the method for axp* rk805 and fixed regulators.

Reviewed by: mmel
Differential Revision: https://reviews.freebsd.org/D22260

r354397:
arm: allwinner: aw_mmc: Check if the regulator support the voltage

Don't blindy say that we support both 3.3V and 1.8V.
If we have a regulator for the data lines, check that the voltage is
supported before adding the signaling caps.
If we don't have a regulator, just assume that the data lines are 3.3V
This unbreak eMMC on some allwinner boards.

Reported by: ganbold
X-MFC-With: r354396

Details

Provenance
manuAuthored on
Reviewer
mmel
Differential Revision
D22106: regulator: Add a regnode_set_constraint function
Parents
rS355182: Fix use-after-free in case of L2ARC prefetch failure.
Branches
Unknown
Tags
Unknown