@@ -42,6 +42,7 @@ struct ili9881c_desc {
42
42
const size_t init_length ;
43
43
const struct drm_display_mode * mode ;
44
44
const unsigned long mode_flags ;
45
+ u8 default_address_mode ;
45
46
};
46
47
47
48
struct ili9881c {
@@ -53,6 +54,7 @@ struct ili9881c {
53
54
struct gpio_desc * reset ;
54
55
55
56
enum drm_panel_orientation orientation ;
57
+ u8 address_mode ;
56
58
};
57
59
58
60
#define ILI9881C_SWITCH_PAGE_INSTR (_page ) \
@@ -815,8 +817,6 @@ static const struct ili9881c_instr tl050hdv35_init[] = {
815
817
ILI9881C_COMMAND_INSTR (0xd1 , 0x4b ),
816
818
ILI9881C_COMMAND_INSTR (0xd2 , 0x60 ),
817
819
ILI9881C_COMMAND_INSTR (0xd3 , 0x39 ),
818
- ILI9881C_SWITCH_PAGE_INSTR (0 ),
819
- ILI9881C_COMMAND_INSTR (0x36 , 0x03 ),
820
820
};
821
821
822
822
static const struct ili9881c_instr w552946ab_init [] = {
@@ -1299,6 +1299,14 @@ static int ili9881c_prepare(struct drm_panel *panel)
1299
1299
if (ret )
1300
1300
return ret ;
1301
1301
1302
+ if (ctx -> address_mode ) {
1303
+ ret = mipi_dsi_dcs_write (ctx -> dsi , MIPI_DCS_SET_ADDRESS_MODE ,
1304
+ & ctx -> address_mode ,
1305
+ sizeof (ctx -> address_mode ));
1306
+ if (ret < 0 )
1307
+ return ret ;
1308
+ }
1309
+
1302
1310
ret = mipi_dsi_dcs_set_tear_on (ctx -> dsi , MIPI_DSI_DCS_TEAR_MODE_VBLANK );
1303
1311
if (ret )
1304
1312
return ret ;
@@ -1521,6 +1529,12 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
1521
1529
return ret ;
1522
1530
}
1523
1531
1532
+ ctx -> address_mode = ctx -> desc -> default_address_mode ;
1533
+ if (ctx -> orientation == DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP ) {
1534
+ ctx -> address_mode ^= 0x03 ;
1535
+ ctx -> orientation = DRM_MODE_PANEL_ORIENTATION_NORMAL ;
1536
+ }
1537
+
1524
1538
ctx -> panel .prepare_prev_first = true;
1525
1539
1526
1540
ret = drm_panel_of_backlight (& ctx -> panel );
@@ -1572,6 +1586,7 @@ static const struct ili9881c_desc tl050hdv35_desc = {
1572
1586
.mode = & tl050hdv35_default_mode ,
1573
1587
.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
1574
1588
MIPI_DSI_MODE_LPM ,
1589
+ .default_address_mode = 0x03 ,
1575
1590
};
1576
1591
1577
1592
static const struct ili9881c_desc w552946aba_desc = {
0 commit comments