mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
drm/panel: simple: fix regulator reference count be set to 2
when power invert and power on:
->loader_protect[on]->disable regulator(ref count is 0)
-> panel_simple_prepare[on]->disable regulator(ref count is 0)
->loader_protect[off]->enable regulator(ref count is 1)
->suspend->enable regulator(ref count is 2)
->resume->disable regulator faild(ref count is 1)
Fixes: 7a91ba36d80 ("drm/panel: panel: add power-invert for some special hardwre")
Change-Id: I43f1cef2410316faec24238cd3f8d2bc1fe38335
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
This commit is contained in:
@@ -362,11 +362,13 @@ static int panel_simple_regulator_disable(struct drm_panel *panel)
|
||||
int err = 0;
|
||||
|
||||
if (p->power_invert) {
|
||||
err = regulator_enable(p->supply);
|
||||
if (err < 0) {
|
||||
dev_err(panel->dev, "failed to enable supply: %d\n",
|
||||
err);
|
||||
return err;
|
||||
if (!regulator_is_enabled(p->supply)) {
|
||||
err = regulator_enable(p->supply);
|
||||
if (err < 0) {
|
||||
dev_err(panel->dev, "failed to enable supply: %d\n",
|
||||
err);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
regulator_disable(p->supply);
|
||||
|
||||
Reference in New Issue
Block a user