This prevents a screen freeze bug.
If the regulator checks the on-off bit at the same
time as the thermal driver, the regulator_enable
call will conclude that the regulator is already
active.
Then, when the thermal driver is done checking the
temperature, it will set the PMIC back to the state
it was when it started, which is off.
In this state, the regulator driver believes the
PMIC is on, and the thermal has turned it off.
This can be considered a bit of a quick fix, to make
minimal changes to the kernel at this point. The
correct way to solve this would be to make the
sy7636a_thermal driver use the regulator network, or
moving all register access code into the sy7636a mfd
and use a mutex from there.
Delay for ~35ms after disabling the regulator,
to allow power ramp down to go undisturbed
Also prolong timeout of enable function to
500ms, in an attempt to recover from a bad
state where the PMIC does not report pgood
- Remove duplicate code for reading and writing vcom voltage
- Don't interrupt resume command if vcom not set
- Add sysfs attribute for setting vcom runtime (HACK)
- Make regulator microvolts return microvolts (was millivolts)
- Remove i2c based PGOOD usage to simplify code
- Reduce timeout value to 100ms
- Add mutex locking for enable/disable, so they don't confuse each other
- Register GPIO before regulator, to avoid race
In order to reduce the overhead as much as possible in the wait loop, the
PGOOD GPIO is used if given in devicetree. If not, the wait loop reads the
FAULT FLAG register to obtain the PGOOD status.
In order to make sure that all the rails are valid from the EPD PMIC when
sending new frames to the EPD, a wait loop has been introduced in the
regulator enable op waiting max 500 ms for PWR GOOD signal from EPD PMIC
before returning from the enable op.
The lcdif driver can then check the return code from the regulator_enable
call and if good, all the EPD power rails are ready.
Add multi-function device to interface the
sy7636a EPD PMIC chip from Silergy.
- Regulator driver for VCOM
- Hwmon driver for thermistor temperature
- MFD driver for i2c regmap