Skip to content

Commit 6f75dc2

Browse files
singhomeleeasus-leslieyu
authored andcommitted
mipi-panel: powertip: avoid the flicker when rebooting.
Change-Id: I61f571982ce6b607fe4903159a1fa85d2600beaf
1 parent 731d8cd commit 6f75dc2

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

drivers/gpu/drm/panel/panel-asus-ili9881c.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,8 @@ static const struct ili9881c_instr ili9881c_init_1[] = {//5-inch
672672

673673
extern struct backlight_device * tinker_mcu_ili9881c_get_backlightdev(void);
674674
extern int tinker_mcu_ili9881c_set_bright(int bright);
675-
extern void tinker_mcu_ili9881c_screen_power_up(void);
675+
extern int tinker_mcu_ili9881c_screen_power_up(void);
676+
extern int tinker_mcu_ili9881c_screen_power_off(void);
676677
extern void tinker_ft5406_start_polling(void);
677678

678679
static inline struct ili9881c *panel_to_ili9881c(struct drm_panel *panel)
@@ -1013,6 +1014,15 @@ int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
10131014
return 0;
10141015
}
10151016

1017+
void ili9881c_dsi_shutdown(struct mipi_dsi_device *dsi)
1018+
{
1019+
struct ili9881c *ctx = mipi_dsi_get_drvdata(dsi);
1020+
pr_info("%s\n", __func__);
1021+
1022+
ili9881c_disable(&ctx->panel);
1023+
tinker_mcu_ili9881c_screen_power_off();
1024+
}
1025+
10161026
static const struct of_device_id ili9881c_of_match[] = {
10171027
{ .compatible = "asus,ili9881c" },
10181028
{ }
@@ -1022,6 +1032,7 @@ MODULE_DEVICE_TABLE(of, ili9881c_of_match);
10221032
static struct mipi_dsi_driver ili9881c_dsi_driver = {
10231033
.probe = ili9881c_dsi_probe,
10241034
.remove = ili9881c_dsi_remove,
1035+
.shutdown = ili9881c_dsi_shutdown,
10251036
.driver = {
10261037
.name = "ili9881c-dsi",
10271038
.of_match_table = ili9881c_of_match,

drivers/gpu/drm/panel/panel-asus.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <video/of_videomode.h>
2424
#include <video/videomode.h>
2525

26-
2726
extern int tinker_mcu_ili9881c_is_connected(void);
2827
extern int tinker_mcu_is_connected(void);
2928

@@ -33,7 +32,8 @@ extern int tc358762_dsi_shutdown(struct mipi_dsi_device *dsi);
3332

3433
extern int ili9881c_dsi_probe(struct mipi_dsi_device *dsi);
3534
extern int ili9881c_dsi_remove(struct mipi_dsi_device *dsi);
36-
35+
extern int ili9881c_dsi_shutdown(struct mipi_dsi_device *dsi);
36+
3737
static int asus_dsi_probe(struct mipi_dsi_device *dsi)
3838
{
3939
int ret = 0;
@@ -43,7 +43,7 @@ static int asus_dsi_probe(struct mipi_dsi_device *dsi)
4343
else
4444
ret = ili9881c_dsi_probe(dsi);
4545
printk("asus_dsi_probe -\n");
46-
46+
4747
return ret;
4848
}
4949

@@ -65,6 +65,8 @@ void asus_dsi_shutdown(struct mipi_dsi_device *dsi)
6565
printk("asus_dsi_shutdown+\n");
6666
if (tinker_mcu_is_connected())
6767
tc358762_dsi_shutdown(dsi);
68+
else
69+
ili9881c_dsi_shutdown(dsi);
6870
printk("asus_dsi_shutdown-\n");
6971

7072
return;

drivers/misc/tinker_mcu_ili9881c.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,18 @@ static int init_cmd_check(struct tinker_mcu_data *mcu_data)
144144
return ret;
145145
}
146146

147+
int tinker_mcu_ili9881c_screen_power_off(void)
148+
{
149+
if (!connected)
150+
return -ENODEV;
151+
152+
send_cmds(g_mcu_ili9881c_data->client, "0500");
153+
msleep(20);
154+
155+
return 0;
156+
}
157+
EXPORT_SYMBOL_GPL(tinker_mcu_ili9881c_screen_power_off);
158+
147159
int tinker_mcu_ili9881c_screen_power_up(void)
148160
{
149161
if (!connected)

0 commit comments

Comments
 (0)