1
0
Fork 0
Commit Graph

13 Commits (c3c91540de6736f980361106eaed2bf6f48ce39c)

Author SHA1 Message Date
Lars Ivar Miljeteig c3c91540de regulator: sy7636a: Remove unused mutex
The reglock mutex is now only used in the regulator code,
and the built-in mutexes in the regulator framework does
the same thing.
2021-03-12 11:14:00 +01:00
Lars Ivar Miljeteig 79ca032001 sy7636a: Clean up license info 2020-10-08 20:41:29 +02:00
Lars Ivar Miljeteig 2c8b8ef501 sy7636a regulator: Add mutex lock for is_enabled
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.
2020-10-08 20:41:28 +02:00
Lars Ivar Miljeteig edf194bbe9 sy7636a: Delay after disable regulator
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
2020-10-08 20:41:27 +02:00
Lars Ivar Miljeteig 15da38e5b2 sy7636a: VCOM sysfs attributes and fix vcom read
- 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)
2020-10-08 20:41:25 +02:00
Lars Ivar Miljeteig 95219396d6 sy7636a-regulator: Set on delay times 0ms 2020-10-08 20:41:24 +02:00
Lars Ivar Miljeteig 7876084d33 sy7636a-regulator: Add mutex, remove i2c-pgood, reduce timeout
- 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
2020-10-08 20:41:24 +02:00
Lars Ivar Miljeteig 29e61876d2 sy7636-regulator: PGOOD gpio wait loop in regulator_enable
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.
2020-10-08 20:41:24 +02:00
Steinar Bakkemo d222246bc0 sy7636a regulator: add wait loop in enable op checking pwr_good before returning
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.
2020-10-08 20:41:24 +02:00
Lars Ivar Miljeteig 00766882cb sy7636a regulator: Use dev_pm_ops 2020-10-08 20:41:19 +02:00
Lars Ivar Miljeteig fc8d4cb0e1 sy7636a: Remember vcom value after deep sleep
Store vcom value when suspending, and restore
value when resuming.
2020-10-08 20:41:18 +02:00
Lars Ivar Miljeteig 3926af7dca sy7636a-regulator: Make regulator searchable 2020-10-08 20:07:14 +02:00
Lars Ivar Miljeteig 26f5dca610 sy7636a EPD PMIC driver initial commit
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
2020-10-08 20:07:13 +02:00