* [PATCH 0/1] boe-tv101wum-n16 seperate the panel power control
@ 2019-11-06 8:17 ` Jitao Shi
0 siblings, 0 replies; 11+ messages in thread
From: Jitao Shi @ 2019-11-06 8:17 UTC (permalink / raw)
To: Thierry Reding, Sam Ravnborg, David Airlie, Daniel Vetter,
Maarten Lankhorst, dri-devel, linux-kernel
Cc: linux-mediatek, srv_heupstream, yingjoe.chen, eddie.huang,
cawa.cheng, bibby.hsieh, ck.hu, stonea168, Jitao Shi
This patch is based on v5.4-rc6 and these patches:
https://patchwork.kernel.org/patch/11229375/
https://patchwork.kernel.org/patch/11229609/
https://patchwork.kernel.org/patch/11186565/
https://patchwork.kernel.org/patch/11186569/
https://patchwork.kernel.org/patch/11186571/
https://patchwork.kernel.org/patch/11186577/
https://patchwork.kernel.org/patch/11186581/
https://patchwork.kernel.org/patch/11186585/
https://patchwork.kernel.org/patch/11186589/
https://patchwork.kernel.org/patch/11186595/
Jitao Shi (1):
drm/panel: boe-tv101wum-n16 seperate the panel power control
.../gpu/drm/panel/panel-boe-tv101wum-nl6.c | 69 +++++++++++++------
1 file changed, 49 insertions(+), 20 deletions(-)
--
2.21.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 0/1] boe-tv101wum-n16 seperate the panel power control
@ 2019-11-06 8:17 ` Jitao Shi
0 siblings, 0 replies; 11+ messages in thread
From: Jitao Shi @ 2019-11-06 8:17 UTC (permalink / raw)
To: Thierry Reding, Sam Ravnborg, David Airlie, Daniel Vetter,
Maarten Lankhorst, dri-devel, linux-kernel
Cc: Jitao Shi, srv_heupstream, stonea168, cawa.cheng, linux-mediatek,
bibby.hsieh, ck.hu, yingjoe.chen, eddie.huang
This patch is based on v5.4-rc6 and these patches:
https://patchwork.kernel.org/patch/11229375/
https://patchwork.kernel.org/patch/11229609/
https://patchwork.kernel.org/patch/11186565/
https://patchwork.kernel.org/patch/11186569/
https://patchwork.kernel.org/patch/11186571/
https://patchwork.kernel.org/patch/11186577/
https://patchwork.kernel.org/patch/11186581/
https://patchwork.kernel.org/patch/11186585/
https://patchwork.kernel.org/patch/11186589/
https://patchwork.kernel.org/patch/11186595/
Jitao Shi (1):
drm/panel: boe-tv101wum-n16 seperate the panel power control
.../gpu/drm/panel/panel-boe-tv101wum-nl6.c | 69 +++++++++++++------
1 file changed, 49 insertions(+), 20 deletions(-)
--
2.21.0
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 0/1] boe-tv101wum-n16 seperate the panel power control
@ 2019-11-06 8:17 ` Jitao Shi
0 siblings, 0 replies; 11+ messages in thread
From: Jitao Shi @ 2019-11-06 8:17 UTC (permalink / raw)
To: Thierry Reding, Sam Ravnborg, David Airlie, Daniel Vetter,
Maarten Lankhorst, dri-devel, linux-kernel
Cc: Jitao Shi, srv_heupstream, stonea168, cawa.cheng, linux-mediatek,
yingjoe.chen, eddie.huang
This patch is based on v5.4-rc6 and these patches:
https://patchwork.kernel.org/patch/11229375/
https://patchwork.kernel.org/patch/11229609/
https://patchwork.kernel.org/patch/11186565/
https://patchwork.kernel.org/patch/11186569/
https://patchwork.kernel.org/patch/11186571/
https://patchwork.kernel.org/patch/11186577/
https://patchwork.kernel.org/patch/11186581/
https://patchwork.kernel.org/patch/11186585/
https://patchwork.kernel.org/patch/11186589/
https://patchwork.kernel.org/patch/11186595/
Jitao Shi (1):
drm/panel: boe-tv101wum-n16 seperate the panel power control
.../gpu/drm/panel/panel-boe-tv101wum-nl6.c | 69 +++++++++++++------
1 file changed, 49 insertions(+), 20 deletions(-)
--
2.21.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 0/1] boe-tv101wum-n16 seperate the panel power control
@ 2019-11-06 8:17 ` Jitao Shi
0 siblings, 0 replies; 11+ messages in thread
From: Jitao Shi @ 2019-11-06 8:17 UTC (permalink / raw)
To: Thierry Reding, Sam Ravnborg, David Airlie, Daniel Vetter,
Maarten Lankhorst, dri-devel, linux-kernel
Cc: Jitao Shi, srv_heupstream, stonea168, cawa.cheng, linux-mediatek,
yingjoe.chen, eddie.huang
This patch is based on v5.4-rc6 and these patches:
https://patchwork.kernel.org/patch/11229375/
https://patchwork.kernel.org/patch/11229609/
https://patchwork.kernel.org/patch/11186565/
https://patchwork.kernel.org/patch/11186569/
https://patchwork.kernel.org/patch/11186571/
https://patchwork.kernel.org/patch/11186577/
https://patchwork.kernel.org/patch/11186581/
https://patchwork.kernel.org/patch/11186585/
https://patchwork.kernel.org/patch/11186589/
https://patchwork.kernel.org/patch/11186595/
Jitao Shi (1):
drm/panel: boe-tv101wum-n16 seperate the panel power control
.../gpu/drm/panel/panel-boe-tv101wum-nl6.c | 69 +++++++++++++------
1 file changed, 49 insertions(+), 20 deletions(-)
--
2.21.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/1] drm/panel: boe-tv101wum-n16 seperate the panel power control
2019-11-06 8:17 ` Jitao Shi
(?)
(?)
@ 2019-11-06 8:17 ` Jitao Shi
-1 siblings, 0 replies; 11+ messages in thread
From: Jitao Shi @ 2019-11-06 8:17 UTC (permalink / raw)
To: Thierry Reding, Sam Ravnborg, David Airlie, Daniel Vetter,
Maarten Lankhorst, dri-devel, linux-kernel
Cc: linux-mediatek, srv_heupstream, yingjoe.chen, eddie.huang,
cawa.cheng, bibby.hsieh, ck.hu, stonea168, Jitao Shi
Seperate the panel power control from prepare/unprepare.
Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>
---
.../gpu/drm/panel/panel-boe-tv101wum-nl6.c | 69 +++++++++++++------
1 file changed, 49 insertions(+), 20 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index e2496a334ab6..5b1b285a2194 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -50,6 +50,7 @@ struct boe_panel {
struct regulator *avdd;
struct gpio_desc *enable_gpio;
+ bool prepared_power;
bool prepared;
bool enabled;
@@ -501,12 +502,11 @@ static int boe_panel_disable(struct drm_panel *panel)
return 0;
}
-static int boe_panel_unprepare(struct drm_panel *panel)
+static int boe_panel_unprepare_power(struct drm_panel *panel)
{
struct boe_panel *boe = to_boe_panel(panel);
- int ret;
- if (!boe->prepared)
+ if (!boe->prepared_power)
return 0;
if (boe->desc->discharge_on_disable) {
@@ -518,12 +518,6 @@ static int boe_panel_unprepare(struct drm_panel *panel)
usleep_range(5000, 7000);
regulator_disable(boe->pp1800);
} else {
- ret = boe_panel_off(boe);
- if (ret < 0) {
- dev_err(panel->dev, "failed to set panel off: %d\n",
- ret);
- return ret;
- }
msleep(150);
gpiod_set_value(boe->enable_gpio, 0);
usleep_range(500, 1000);
@@ -533,17 +527,39 @@ static int boe_panel_unprepare(struct drm_panel *panel)
regulator_disable(boe->pp1800);
}
+ boe->prepared_power = false;
+
+ return 0;
+}
+
+static int boe_panel_unprepare(struct drm_panel *panel)
+{
+ struct boe_panel *boe = to_boe_panel(panel);
+ int ret;
+
+ if (!boe->prepared)
+ return 0;
+
+ if (!boe->desc->discharge_on_disable) {
+ ret = boe_panel_off(boe);
+ if (ret < 0) {
+ dev_err(panel->dev, "failed to set panel off: %d\n",
+ ret);
+ return ret;
+ }
+ }
+
boe->prepared = false;
return 0;
}
-static int boe_panel_prepare(struct drm_panel *panel)
+static int boe_panel_prepare_power(struct drm_panel *panel)
{
struct boe_panel *boe = to_boe_panel(panel);
int ret;
- if (boe->prepared)
+ if (boe->prepared_power)
return 0;
gpiod_set_value(boe->enable_gpio, 0);
@@ -571,18 +587,10 @@ static int boe_panel_prepare(struct drm_panel *panel)
gpiod_set_value(boe->enable_gpio, 1);
usleep_range(6000, 10000);
- ret = boe_panel_init(boe);
- if (ret < 0) {
- dev_err(panel->dev, "failed to init panel: %d\n", ret);
- goto poweroff;
- }
-
- boe->prepared = true;
+ boe->prepared_power = true;
return 0;
-poweroff:
- regulator_disable(boe->avee);
poweroffavdd:
regulator_disable(boe->avdd);
poweroff1v8:
@@ -593,6 +601,25 @@ static int boe_panel_prepare(struct drm_panel *panel)
return ret;
}
+static int boe_panel_prepare(struct drm_panel *panel)
+{
+ struct boe_panel *boe = to_boe_panel(panel);
+ int ret;
+
+ if (boe->prepared)
+ return 0;
+
+ ret = boe_panel_init(boe);
+ if (ret < 0) {
+ dev_err(panel->dev, "failed to init panel: %d\n", ret);
+ return ret;
+ }
+
+ boe->prepared = true;
+
+ return 0;
+}
+
static int boe_panel_enable(struct drm_panel *panel)
{
struct boe_panel *boe = to_boe_panel(panel);
@@ -754,7 +781,9 @@ static int boe_panel_get_modes(struct drm_panel *panel)
static const struct drm_panel_funcs boe_panel_funcs = {
.disable = boe_panel_disable,
.unprepare = boe_panel_unprepare,
+ .unprepare_power = boe_panel_unprepare_power,
.prepare = boe_panel_prepare,
+ .prepare_power = boe_panel_prepare_power,
.enable = boe_panel_enable,
.get_modes = boe_panel_get_modes,
};
--
2.21.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 1/1] drm/panel: boe-tv101wum-n16 seperate the panel power control
@ 2019-11-06 8:17 ` Jitao Shi
0 siblings, 0 replies; 11+ messages in thread
From: Jitao Shi @ 2019-11-06 8:17 UTC (permalink / raw)
To: Thierry Reding, Sam Ravnborg, David Airlie, Daniel Vetter,
Maarten Lankhorst, dri-devel, linux-kernel
Cc: Jitao Shi, srv_heupstream, stonea168, cawa.cheng, linux-mediatek,
bibby.hsieh, ck.hu, yingjoe.chen, eddie.huang
Seperate the panel power control from prepare/unprepare.
Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>
---
.../gpu/drm/panel/panel-boe-tv101wum-nl6.c | 69 +++++++++++++------
1 file changed, 49 insertions(+), 20 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index e2496a334ab6..5b1b285a2194 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -50,6 +50,7 @@ struct boe_panel {
struct regulator *avdd;
struct gpio_desc *enable_gpio;
+ bool prepared_power;
bool prepared;
bool enabled;
@@ -501,12 +502,11 @@ static int boe_panel_disable(struct drm_panel *panel)
return 0;
}
-static int boe_panel_unprepare(struct drm_panel *panel)
+static int boe_panel_unprepare_power(struct drm_panel *panel)
{
struct boe_panel *boe = to_boe_panel(panel);
- int ret;
- if (!boe->prepared)
+ if (!boe->prepared_power)
return 0;
if (boe->desc->discharge_on_disable) {
@@ -518,12 +518,6 @@ static int boe_panel_unprepare(struct drm_panel *panel)
usleep_range(5000, 7000);
regulator_disable(boe->pp1800);
} else {
- ret = boe_panel_off(boe);
- if (ret < 0) {
- dev_err(panel->dev, "failed to set panel off: %d\n",
- ret);
- return ret;
- }
msleep(150);
gpiod_set_value(boe->enable_gpio, 0);
usleep_range(500, 1000);
@@ -533,17 +527,39 @@ static int boe_panel_unprepare(struct drm_panel *panel)
regulator_disable(boe->pp1800);
}
+ boe->prepared_power = false;
+
+ return 0;
+}
+
+static int boe_panel_unprepare(struct drm_panel *panel)
+{
+ struct boe_panel *boe = to_boe_panel(panel);
+ int ret;
+
+ if (!boe->prepared)
+ return 0;
+
+ if (!boe->desc->discharge_on_disable) {
+ ret = boe_panel_off(boe);
+ if (ret < 0) {
+ dev_err(panel->dev, "failed to set panel off: %d\n",
+ ret);
+ return ret;
+ }
+ }
+
boe->prepared = false;
return 0;
}
-static int boe_panel_prepare(struct drm_panel *panel)
+static int boe_panel_prepare_power(struct drm_panel *panel)
{
struct boe_panel *boe = to_boe_panel(panel);
int ret;
- if (boe->prepared)
+ if (boe->prepared_power)
return 0;
gpiod_set_value(boe->enable_gpio, 0);
@@ -571,18 +587,10 @@ static int boe_panel_prepare(struct drm_panel *panel)
gpiod_set_value(boe->enable_gpio, 1);
usleep_range(6000, 10000);
- ret = boe_panel_init(boe);
- if (ret < 0) {
- dev_err(panel->dev, "failed to init panel: %d\n", ret);
- goto poweroff;
- }
-
- boe->prepared = true;
+ boe->prepared_power = true;
return 0;
-poweroff:
- regulator_disable(boe->avee);
poweroffavdd:
regulator_disable(boe->avdd);
poweroff1v8:
@@ -593,6 +601,25 @@ static int boe_panel_prepare(struct drm_panel *panel)
return ret;
}
+static int boe_panel_prepare(struct drm_panel *panel)
+{
+ struct boe_panel *boe = to_boe_panel(panel);
+ int ret;
+
+ if (boe->prepared)
+ return 0;
+
+ ret = boe_panel_init(boe);
+ if (ret < 0) {
+ dev_err(panel->dev, "failed to init panel: %d\n", ret);
+ return ret;
+ }
+
+ boe->prepared = true;
+
+ return 0;
+}
+
static int boe_panel_enable(struct drm_panel *panel)
{
struct boe_panel *boe = to_boe_panel(panel);
@@ -754,7 +781,9 @@ static int boe_panel_get_modes(struct drm_panel *panel)
static const struct drm_panel_funcs boe_panel_funcs = {
.disable = boe_panel_disable,
.unprepare = boe_panel_unprepare,
+ .unprepare_power = boe_panel_unprepare_power,
.prepare = boe_panel_prepare,
+ .prepare_power = boe_panel_prepare_power,
.enable = boe_panel_enable,
.get_modes = boe_panel_get_modes,
};
--
2.21.0
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 1/1] drm/panel: boe-tv101wum-n16 seperate the panel power control
@ 2019-11-06 8:17 ` Jitao Shi
0 siblings, 0 replies; 11+ messages in thread
From: Jitao Shi @ 2019-11-06 8:17 UTC (permalink / raw)
To: Thierry Reding, Sam Ravnborg, David Airlie, Daniel Vetter,
Maarten Lankhorst, dri-devel, linux-kernel
Cc: Jitao Shi, srv_heupstream, stonea168, cawa.cheng, linux-mediatek,
yingjoe.chen, eddie.huang
Seperate the panel power control from prepare/unprepare.
Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>
---
.../gpu/drm/panel/panel-boe-tv101wum-nl6.c | 69 +++++++++++++------
1 file changed, 49 insertions(+), 20 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index e2496a334ab6..5b1b285a2194 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -50,6 +50,7 @@ struct boe_panel {
struct regulator *avdd;
struct gpio_desc *enable_gpio;
+ bool prepared_power;
bool prepared;
bool enabled;
@@ -501,12 +502,11 @@ static int boe_panel_disable(struct drm_panel *panel)
return 0;
}
-static int boe_panel_unprepare(struct drm_panel *panel)
+static int boe_panel_unprepare_power(struct drm_panel *panel)
{
struct boe_panel *boe = to_boe_panel(panel);
- int ret;
- if (!boe->prepared)
+ if (!boe->prepared_power)
return 0;
if (boe->desc->discharge_on_disable) {
@@ -518,12 +518,6 @@ static int boe_panel_unprepare(struct drm_panel *panel)
usleep_range(5000, 7000);
regulator_disable(boe->pp1800);
} else {
- ret = boe_panel_off(boe);
- if (ret < 0) {
- dev_err(panel->dev, "failed to set panel off: %d\n",
- ret);
- return ret;
- }
msleep(150);
gpiod_set_value(boe->enable_gpio, 0);
usleep_range(500, 1000);
@@ -533,17 +527,39 @@ static int boe_panel_unprepare(struct drm_panel *panel)
regulator_disable(boe->pp1800);
}
+ boe->prepared_power = false;
+
+ return 0;
+}
+
+static int boe_panel_unprepare(struct drm_panel *panel)
+{
+ struct boe_panel *boe = to_boe_panel(panel);
+ int ret;
+
+ if (!boe->prepared)
+ return 0;
+
+ if (!boe->desc->discharge_on_disable) {
+ ret = boe_panel_off(boe);
+ if (ret < 0) {
+ dev_err(panel->dev, "failed to set panel off: %d\n",
+ ret);
+ return ret;
+ }
+ }
+
boe->prepared = false;
return 0;
}
-static int boe_panel_prepare(struct drm_panel *panel)
+static int boe_panel_prepare_power(struct drm_panel *panel)
{
struct boe_panel *boe = to_boe_panel(panel);
int ret;
- if (boe->prepared)
+ if (boe->prepared_power)
return 0;
gpiod_set_value(boe->enable_gpio, 0);
@@ -571,18 +587,10 @@ static int boe_panel_prepare(struct drm_panel *panel)
gpiod_set_value(boe->enable_gpio, 1);
usleep_range(6000, 10000);
- ret = boe_panel_init(boe);
- if (ret < 0) {
- dev_err(panel->dev, "failed to init panel: %d\n", ret);
- goto poweroff;
- }
-
- boe->prepared = true;
+ boe->prepared_power = true;
return 0;
-poweroff:
- regulator_disable(boe->avee);
poweroffavdd:
regulator_disable(boe->avdd);
poweroff1v8:
@@ -593,6 +601,25 @@ static int boe_panel_prepare(struct drm_panel *panel)
return ret;
}
+static int boe_panel_prepare(struct drm_panel *panel)
+{
+ struct boe_panel *boe = to_boe_panel(panel);
+ int ret;
+
+ if (boe->prepared)
+ return 0;
+
+ ret = boe_panel_init(boe);
+ if (ret < 0) {
+ dev_err(panel->dev, "failed to init panel: %d\n", ret);
+ return ret;
+ }
+
+ boe->prepared = true;
+
+ return 0;
+}
+
static int boe_panel_enable(struct drm_panel *panel)
{
struct boe_panel *boe = to_boe_panel(panel);
@@ -754,7 +781,9 @@ static int boe_panel_get_modes(struct drm_panel *panel)
static const struct drm_panel_funcs boe_panel_funcs = {
.disable = boe_panel_disable,
.unprepare = boe_panel_unprepare,
+ .unprepare_power = boe_panel_unprepare_power,
.prepare = boe_panel_prepare,
+ .prepare_power = boe_panel_prepare_power,
.enable = boe_panel_enable,
.get_modes = boe_panel_get_modes,
};
--
2.21.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 1/1] drm/panel: boe-tv101wum-n16 seperate the panel power control
@ 2019-11-06 8:17 ` Jitao Shi
0 siblings, 0 replies; 11+ messages in thread
From: Jitao Shi @ 2019-11-06 8:17 UTC (permalink / raw)
To: Thierry Reding, Sam Ravnborg, David Airlie, Daniel Vetter,
Maarten Lankhorst, dri-devel, linux-kernel
Cc: Jitao Shi, srv_heupstream, stonea168, cawa.cheng, linux-mediatek,
yingjoe.chen, eddie.huang
Seperate the panel power control from prepare/unprepare.
Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>
---
.../gpu/drm/panel/panel-boe-tv101wum-nl6.c | 69 +++++++++++++------
1 file changed, 49 insertions(+), 20 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index e2496a334ab6..5b1b285a2194 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -50,6 +50,7 @@ struct boe_panel {
struct regulator *avdd;
struct gpio_desc *enable_gpio;
+ bool prepared_power;
bool prepared;
bool enabled;
@@ -501,12 +502,11 @@ static int boe_panel_disable(struct drm_panel *panel)
return 0;
}
-static int boe_panel_unprepare(struct drm_panel *panel)
+static int boe_panel_unprepare_power(struct drm_panel *panel)
{
struct boe_panel *boe = to_boe_panel(panel);
- int ret;
- if (!boe->prepared)
+ if (!boe->prepared_power)
return 0;
if (boe->desc->discharge_on_disable) {
@@ -518,12 +518,6 @@ static int boe_panel_unprepare(struct drm_panel *panel)
usleep_range(5000, 7000);
regulator_disable(boe->pp1800);
} else {
- ret = boe_panel_off(boe);
- if (ret < 0) {
- dev_err(panel->dev, "failed to set panel off: %d\n",
- ret);
- return ret;
- }
msleep(150);
gpiod_set_value(boe->enable_gpio, 0);
usleep_range(500, 1000);
@@ -533,17 +527,39 @@ static int boe_panel_unprepare(struct drm_panel *panel)
regulator_disable(boe->pp1800);
}
+ boe->prepared_power = false;
+
+ return 0;
+}
+
+static int boe_panel_unprepare(struct drm_panel *panel)
+{
+ struct boe_panel *boe = to_boe_panel(panel);
+ int ret;
+
+ if (!boe->prepared)
+ return 0;
+
+ if (!boe->desc->discharge_on_disable) {
+ ret = boe_panel_off(boe);
+ if (ret < 0) {
+ dev_err(panel->dev, "failed to set panel off: %d\n",
+ ret);
+ return ret;
+ }
+ }
+
boe->prepared = false;
return 0;
}
-static int boe_panel_prepare(struct drm_panel *panel)
+static int boe_panel_prepare_power(struct drm_panel *panel)
{
struct boe_panel *boe = to_boe_panel(panel);
int ret;
- if (boe->prepared)
+ if (boe->prepared_power)
return 0;
gpiod_set_value(boe->enable_gpio, 0);
@@ -571,18 +587,10 @@ static int boe_panel_prepare(struct drm_panel *panel)
gpiod_set_value(boe->enable_gpio, 1);
usleep_range(6000, 10000);
- ret = boe_panel_init(boe);
- if (ret < 0) {
- dev_err(panel->dev, "failed to init panel: %d\n", ret);
- goto poweroff;
- }
-
- boe->prepared = true;
+ boe->prepared_power = true;
return 0;
-poweroff:
- regulator_disable(boe->avee);
poweroffavdd:
regulator_disable(boe->avdd);
poweroff1v8:
@@ -593,6 +601,25 @@ static int boe_panel_prepare(struct drm_panel *panel)
return ret;
}
+static int boe_panel_prepare(struct drm_panel *panel)
+{
+ struct boe_panel *boe = to_boe_panel(panel);
+ int ret;
+
+ if (boe->prepared)
+ return 0;
+
+ ret = boe_panel_init(boe);
+ if (ret < 0) {
+ dev_err(panel->dev, "failed to init panel: %d\n", ret);
+ return ret;
+ }
+
+ boe->prepared = true;
+
+ return 0;
+}
+
static int boe_panel_enable(struct drm_panel *panel)
{
struct boe_panel *boe = to_boe_panel(panel);
@@ -754,7 +781,9 @@ static int boe_panel_get_modes(struct drm_panel *panel)
static const struct drm_panel_funcs boe_panel_funcs = {
.disable = boe_panel_disable,
.unprepare = boe_panel_unprepare,
+ .unprepare_power = boe_panel_unprepare_power,
.prepare = boe_panel_prepare,
+ .prepare_power = boe_panel_prepare_power,
.enable = boe_panel_enable,
.get_modes = boe_panel_get_modes,
};
--
2.21.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 1/1] drm/panel: boe-tv101wum-n16 seperate the panel power control
2019-11-06 8:17 ` Jitao Shi
(?)
@ 2019-11-06 10:00 ` Daniel Vetter
-1 siblings, 0 replies; 11+ messages in thread
From: Daniel Vetter @ 2019-11-06 10:00 UTC (permalink / raw)
To: Jitao Shi
Cc: Thierry Reding, Sam Ravnborg, David Airlie, Daniel Vetter,
Maarten Lankhorst, dri-devel, linux-kernel, linux-mediatek,
srv_heupstream, yingjoe.chen, eddie.huang, cawa.cheng,
bibby.hsieh, ck.hu, stonea168
On Wed, Nov 06, 2019 at 04:17:52PM +0800, Jitao Shi wrote:
> Seperate the panel power control from prepare/unprepare.
>
> Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>
Your patch series is all kinds of split up. Can you pls resend, with the
entire thing all in one go?
Thanks, Daniel
> ---
> .../gpu/drm/panel/panel-boe-tv101wum-nl6.c | 69 +++++++++++++------
> 1 file changed, 49 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> index e2496a334ab6..5b1b285a2194 100644
> --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> @@ -50,6 +50,7 @@ struct boe_panel {
> struct regulator *avdd;
> struct gpio_desc *enable_gpio;
>
> + bool prepared_power;
> bool prepared;
> bool enabled;
>
> @@ -501,12 +502,11 @@ static int boe_panel_disable(struct drm_panel *panel)
> return 0;
> }
>
> -static int boe_panel_unprepare(struct drm_panel *panel)
> +static int boe_panel_unprepare_power(struct drm_panel *panel)
> {
> struct boe_panel *boe = to_boe_panel(panel);
> - int ret;
>
> - if (!boe->prepared)
> + if (!boe->prepared_power)
> return 0;
>
> if (boe->desc->discharge_on_disable) {
> @@ -518,12 +518,6 @@ static int boe_panel_unprepare(struct drm_panel *panel)
> usleep_range(5000, 7000);
> regulator_disable(boe->pp1800);
> } else {
> - ret = boe_panel_off(boe);
> - if (ret < 0) {
> - dev_err(panel->dev, "failed to set panel off: %d\n",
> - ret);
> - return ret;
> - }
> msleep(150);
> gpiod_set_value(boe->enable_gpio, 0);
> usleep_range(500, 1000);
> @@ -533,17 +527,39 @@ static int boe_panel_unprepare(struct drm_panel *panel)
> regulator_disable(boe->pp1800);
> }
>
> + boe->prepared_power = false;
> +
> + return 0;
> +}
> +
> +static int boe_panel_unprepare(struct drm_panel *panel)
> +{
> + struct boe_panel *boe = to_boe_panel(panel);
> + int ret;
> +
> + if (!boe->prepared)
> + return 0;
> +
> + if (!boe->desc->discharge_on_disable) {
> + ret = boe_panel_off(boe);
> + if (ret < 0) {
> + dev_err(panel->dev, "failed to set panel off: %d\n",
> + ret);
> + return ret;
> + }
> + }
> +
> boe->prepared = false;
>
> return 0;
> }
>
> -static int boe_panel_prepare(struct drm_panel *panel)
> +static int boe_panel_prepare_power(struct drm_panel *panel)
> {
> struct boe_panel *boe = to_boe_panel(panel);
> int ret;
>
> - if (boe->prepared)
> + if (boe->prepared_power)
> return 0;
>
> gpiod_set_value(boe->enable_gpio, 0);
> @@ -571,18 +587,10 @@ static int boe_panel_prepare(struct drm_panel *panel)
> gpiod_set_value(boe->enable_gpio, 1);
> usleep_range(6000, 10000);
>
> - ret = boe_panel_init(boe);
> - if (ret < 0) {
> - dev_err(panel->dev, "failed to init panel: %d\n", ret);
> - goto poweroff;
> - }
> -
> - boe->prepared = true;
> + boe->prepared_power = true;
>
> return 0;
>
> -poweroff:
> - regulator_disable(boe->avee);
> poweroffavdd:
> regulator_disable(boe->avdd);
> poweroff1v8:
> @@ -593,6 +601,25 @@ static int boe_panel_prepare(struct drm_panel *panel)
> return ret;
> }
>
> +static int boe_panel_prepare(struct drm_panel *panel)
> +{
> + struct boe_panel *boe = to_boe_panel(panel);
> + int ret;
> +
> + if (boe->prepared)
> + return 0;
> +
> + ret = boe_panel_init(boe);
> + if (ret < 0) {
> + dev_err(panel->dev, "failed to init panel: %d\n", ret);
> + return ret;
> + }
> +
> + boe->prepared = true;
> +
> + return 0;
> +}
> +
> static int boe_panel_enable(struct drm_panel *panel)
> {
> struct boe_panel *boe = to_boe_panel(panel);
> @@ -754,7 +781,9 @@ static int boe_panel_get_modes(struct drm_panel *panel)
> static const struct drm_panel_funcs boe_panel_funcs = {
> .disable = boe_panel_disable,
> .unprepare = boe_panel_unprepare,
> + .unprepare_power = boe_panel_unprepare_power,
> .prepare = boe_panel_prepare,
> + .prepare_power = boe_panel_prepare_power,
> .enable = boe_panel_enable,
> .get_modes = boe_panel_get_modes,
> };
> --
> 2.21.0
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/1] drm/panel: boe-tv101wum-n16 seperate the panel power control
@ 2019-11-06 10:00 ` Daniel Vetter
0 siblings, 0 replies; 11+ messages in thread
From: Daniel Vetter @ 2019-11-06 10:00 UTC (permalink / raw)
To: Jitao Shi
Cc: bibby.hsieh, srv_heupstream, David Airlie, stonea168,
Maarten Lankhorst, linux-kernel, dri-devel, cawa.cheng,
Thierry Reding, linux-mediatek, Daniel Vetter, ck.hu,
yingjoe.chen, eddie.huang, Sam Ravnborg
On Wed, Nov 06, 2019 at 04:17:52PM +0800, Jitao Shi wrote:
> Seperate the panel power control from prepare/unprepare.
>
> Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>
Your patch series is all kinds of split up. Can you pls resend, with the
entire thing all in one go?
Thanks, Daniel
> ---
> .../gpu/drm/panel/panel-boe-tv101wum-nl6.c | 69 +++++++++++++------
> 1 file changed, 49 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> index e2496a334ab6..5b1b285a2194 100644
> --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> @@ -50,6 +50,7 @@ struct boe_panel {
> struct regulator *avdd;
> struct gpio_desc *enable_gpio;
>
> + bool prepared_power;
> bool prepared;
> bool enabled;
>
> @@ -501,12 +502,11 @@ static int boe_panel_disable(struct drm_panel *panel)
> return 0;
> }
>
> -static int boe_panel_unprepare(struct drm_panel *panel)
> +static int boe_panel_unprepare_power(struct drm_panel *panel)
> {
> struct boe_panel *boe = to_boe_panel(panel);
> - int ret;
>
> - if (!boe->prepared)
> + if (!boe->prepared_power)
> return 0;
>
> if (boe->desc->discharge_on_disable) {
> @@ -518,12 +518,6 @@ static int boe_panel_unprepare(struct drm_panel *panel)
> usleep_range(5000, 7000);
> regulator_disable(boe->pp1800);
> } else {
> - ret = boe_panel_off(boe);
> - if (ret < 0) {
> - dev_err(panel->dev, "failed to set panel off: %d\n",
> - ret);
> - return ret;
> - }
> msleep(150);
> gpiod_set_value(boe->enable_gpio, 0);
> usleep_range(500, 1000);
> @@ -533,17 +527,39 @@ static int boe_panel_unprepare(struct drm_panel *panel)
> regulator_disable(boe->pp1800);
> }
>
> + boe->prepared_power = false;
> +
> + return 0;
> +}
> +
> +static int boe_panel_unprepare(struct drm_panel *panel)
> +{
> + struct boe_panel *boe = to_boe_panel(panel);
> + int ret;
> +
> + if (!boe->prepared)
> + return 0;
> +
> + if (!boe->desc->discharge_on_disable) {
> + ret = boe_panel_off(boe);
> + if (ret < 0) {
> + dev_err(panel->dev, "failed to set panel off: %d\n",
> + ret);
> + return ret;
> + }
> + }
> +
> boe->prepared = false;
>
> return 0;
> }
>
> -static int boe_panel_prepare(struct drm_panel *panel)
> +static int boe_panel_prepare_power(struct drm_panel *panel)
> {
> struct boe_panel *boe = to_boe_panel(panel);
> int ret;
>
> - if (boe->prepared)
> + if (boe->prepared_power)
> return 0;
>
> gpiod_set_value(boe->enable_gpio, 0);
> @@ -571,18 +587,10 @@ static int boe_panel_prepare(struct drm_panel *panel)
> gpiod_set_value(boe->enable_gpio, 1);
> usleep_range(6000, 10000);
>
> - ret = boe_panel_init(boe);
> - if (ret < 0) {
> - dev_err(panel->dev, "failed to init panel: %d\n", ret);
> - goto poweroff;
> - }
> -
> - boe->prepared = true;
> + boe->prepared_power = true;
>
> return 0;
>
> -poweroff:
> - regulator_disable(boe->avee);
> poweroffavdd:
> regulator_disable(boe->avdd);
> poweroff1v8:
> @@ -593,6 +601,25 @@ static int boe_panel_prepare(struct drm_panel *panel)
> return ret;
> }
>
> +static int boe_panel_prepare(struct drm_panel *panel)
> +{
> + struct boe_panel *boe = to_boe_panel(panel);
> + int ret;
> +
> + if (boe->prepared)
> + return 0;
> +
> + ret = boe_panel_init(boe);
> + if (ret < 0) {
> + dev_err(panel->dev, "failed to init panel: %d\n", ret);
> + return ret;
> + }
> +
> + boe->prepared = true;
> +
> + return 0;
> +}
> +
> static int boe_panel_enable(struct drm_panel *panel)
> {
> struct boe_panel *boe = to_boe_panel(panel);
> @@ -754,7 +781,9 @@ static int boe_panel_get_modes(struct drm_panel *panel)
> static const struct drm_panel_funcs boe_panel_funcs = {
> .disable = boe_panel_disable,
> .unprepare = boe_panel_unprepare,
> + .unprepare_power = boe_panel_unprepare_power,
> .prepare = boe_panel_prepare,
> + .prepare_power = boe_panel_prepare_power,
> .enable = boe_panel_enable,
> .get_modes = boe_panel_get_modes,
> };
> --
> 2.21.0
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/1] drm/panel: boe-tv101wum-n16 seperate the panel power control
@ 2019-11-06 10:00 ` Daniel Vetter
0 siblings, 0 replies; 11+ messages in thread
From: Daniel Vetter @ 2019-11-06 10:00 UTC (permalink / raw)
To: Jitao Shi
Cc: srv_heupstream, David Airlie, stonea168, linux-kernel, dri-devel,
cawa.cheng, Thierry Reding, linux-mediatek, yingjoe.chen,
eddie.huang, Sam Ravnborg
On Wed, Nov 06, 2019 at 04:17:52PM +0800, Jitao Shi wrote:
> Seperate the panel power control from prepare/unprepare.
>
> Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>
Your patch series is all kinds of split up. Can you pls resend, with the
entire thing all in one go?
Thanks, Daniel
> ---
> .../gpu/drm/panel/panel-boe-tv101wum-nl6.c | 69 +++++++++++++------
> 1 file changed, 49 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> index e2496a334ab6..5b1b285a2194 100644
> --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> @@ -50,6 +50,7 @@ struct boe_panel {
> struct regulator *avdd;
> struct gpio_desc *enable_gpio;
>
> + bool prepared_power;
> bool prepared;
> bool enabled;
>
> @@ -501,12 +502,11 @@ static int boe_panel_disable(struct drm_panel *panel)
> return 0;
> }
>
> -static int boe_panel_unprepare(struct drm_panel *panel)
> +static int boe_panel_unprepare_power(struct drm_panel *panel)
> {
> struct boe_panel *boe = to_boe_panel(panel);
> - int ret;
>
> - if (!boe->prepared)
> + if (!boe->prepared_power)
> return 0;
>
> if (boe->desc->discharge_on_disable) {
> @@ -518,12 +518,6 @@ static int boe_panel_unprepare(struct drm_panel *panel)
> usleep_range(5000, 7000);
> regulator_disable(boe->pp1800);
> } else {
> - ret = boe_panel_off(boe);
> - if (ret < 0) {
> - dev_err(panel->dev, "failed to set panel off: %d\n",
> - ret);
> - return ret;
> - }
> msleep(150);
> gpiod_set_value(boe->enable_gpio, 0);
> usleep_range(500, 1000);
> @@ -533,17 +527,39 @@ static int boe_panel_unprepare(struct drm_panel *panel)
> regulator_disable(boe->pp1800);
> }
>
> + boe->prepared_power = false;
> +
> + return 0;
> +}
> +
> +static int boe_panel_unprepare(struct drm_panel *panel)
> +{
> + struct boe_panel *boe = to_boe_panel(panel);
> + int ret;
> +
> + if (!boe->prepared)
> + return 0;
> +
> + if (!boe->desc->discharge_on_disable) {
> + ret = boe_panel_off(boe);
> + if (ret < 0) {
> + dev_err(panel->dev, "failed to set panel off: %d\n",
> + ret);
> + return ret;
> + }
> + }
> +
> boe->prepared = false;
>
> return 0;
> }
>
> -static int boe_panel_prepare(struct drm_panel *panel)
> +static int boe_panel_prepare_power(struct drm_panel *panel)
> {
> struct boe_panel *boe = to_boe_panel(panel);
> int ret;
>
> - if (boe->prepared)
> + if (boe->prepared_power)
> return 0;
>
> gpiod_set_value(boe->enable_gpio, 0);
> @@ -571,18 +587,10 @@ static int boe_panel_prepare(struct drm_panel *panel)
> gpiod_set_value(boe->enable_gpio, 1);
> usleep_range(6000, 10000);
>
> - ret = boe_panel_init(boe);
> - if (ret < 0) {
> - dev_err(panel->dev, "failed to init panel: %d\n", ret);
> - goto poweroff;
> - }
> -
> - boe->prepared = true;
> + boe->prepared_power = true;
>
> return 0;
>
> -poweroff:
> - regulator_disable(boe->avee);
> poweroffavdd:
> regulator_disable(boe->avdd);
> poweroff1v8:
> @@ -593,6 +601,25 @@ static int boe_panel_prepare(struct drm_panel *panel)
> return ret;
> }
>
> +static int boe_panel_prepare(struct drm_panel *panel)
> +{
> + struct boe_panel *boe = to_boe_panel(panel);
> + int ret;
> +
> + if (boe->prepared)
> + return 0;
> +
> + ret = boe_panel_init(boe);
> + if (ret < 0) {
> + dev_err(panel->dev, "failed to init panel: %d\n", ret);
> + return ret;
> + }
> +
> + boe->prepared = true;
> +
> + return 0;
> +}
> +
> static int boe_panel_enable(struct drm_panel *panel)
> {
> struct boe_panel *boe = to_boe_panel(panel);
> @@ -754,7 +781,9 @@ static int boe_panel_get_modes(struct drm_panel *panel)
> static const struct drm_panel_funcs boe_panel_funcs = {
> .disable = boe_panel_disable,
> .unprepare = boe_panel_unprepare,
> + .unprepare_power = boe_panel_unprepare_power,
> .prepare = boe_panel_prepare,
> + .prepare_power = boe_panel_prepare_power,
> .enable = boe_panel_enable,
> .get_modes = boe_panel_get_modes,
> };
> --
> 2.21.0
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2019-11-06 10:00 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06 8:17 [PATCH 0/1] boe-tv101wum-n16 seperate the panel power control Jitao Shi
2019-11-06 8:17 ` Jitao Shi
2019-11-06 8:17 ` Jitao Shi
2019-11-06 8:17 ` Jitao Shi
2019-11-06 8:17 ` [PATCH 1/1] drm/panel: " Jitao Shi
2019-11-06 8:17 ` Jitao Shi
2019-11-06 8:17 ` Jitao Shi
2019-11-06 8:17 ` Jitao Shi
2019-11-06 10:00 ` Daniel Vetter
2019-11-06 10:00 ` Daniel Vetter
2019-11-06 10:00 ` Daniel Vetter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.