Skip to content

Commit 90fbd30

Browse files
committed
drm/panel: samsung-s6e88a0-ams427ap24: Add flip option
The way of implementing a flip option follows the existing panel-samsung-s6e8aa0.c [1][2][3]. The value to flip the screen is taken from a downstream kernel panel file of a simular but older device. The downstream code is rather confusing. The mipi clock [4] for the panel is 461 MHz and a hardware read-out of the 0xcb values corresponds to revision R01 [5], although in non-flipped state. Further up there is a hint [6] basically saying for revision R01 to change the first word of the 0xcb command from 0x06 to 0x0e, which is actually setting BIT(3) of that word. This causes a horizontal flip. - [1] https://github.com/torvalds/linux/blob/v6.11/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c#L103 - [2] https://github.com/torvalds/linux/blob/v6.11/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c#L207-L211 - [3] https://github.com/torvalds/linux/blob/v6.11/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c#L954-L974 - [4] https://github.com/LineageOS/android_kernel_samsung_msm8930-common/blob/lineage-15.1/drivers/video/msm/mipi_samsung_oled_video_qhd_pt-8930.c#L2027-L2028 - [5] https://github.com/LineageOS/android_kernel_samsung_msm8930-common/blob/lineage-15.1/drivers/video/msm/mipi_samsung_oled_video_qhd_pt-8930.c#L137-L151 - [6] https://github.com/LineageOS/android_kernel_samsung_msm8930-common/blob/lineage-15.1/drivers/video/msm/mipi_samsung_oled_video_qhd_pt-8930.c#L66-L74 Signed-off-by: Jakob Hauser <[email protected]>
1 parent 51caab0 commit 90fbd30

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/gpu/drm/panel/msm8916-generated/panel-samsung-s6e88a0-ams427ap24.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ struct s6e88a0_ams427ap24 {
3030
struct mipi_dsi_device *dsi;
3131
struct regulator_bulk_data supplies[2];
3232
struct gpio_desc *reset_gpio;
33+
bool flip_horizontal;
3334
bool prepared;
3435
};
3536

@@ -526,6 +527,10 @@ static int s6e88a0_ams427ap24_on(struct s6e88a0_ams427ap24 *ctx)
526527
mipi_dsi_dcs_write_seq(dsi, 0xcc, 0x4c);
527528
mipi_dsi_dcs_write_seq(dsi, 0xf2, 0x03, 0x0d);
528529
mipi_dsi_dcs_write_seq(dsi, 0xf1, 0xa5, 0xa5);
530+
531+
if (ctx->flip_horizontal)
532+
mipi_dsi_dcs_write_seq(dsi, 0xcb, 0x0e);
533+
529534
mipi_dsi_dcs_write_seq(dsi, 0xf0, 0xa5, 0xa5);
530535
mipi_dsi_dcs_write_seq(dsi, 0xfc, 0xa5, 0xa5);
531536

@@ -682,6 +687,15 @@ static int s6e88a0_ams427ap24_register_backlight(struct s6e88a0_ams427ap24 *ctx)
682687
return ret;
683688
}
684689

690+
static void s6e88a0_ams427ap24_parse_dt(struct s6e88a0_ams427ap24 *ctx)
691+
{
692+
struct mipi_dsi_device *dsi = ctx->dsi;
693+
struct device *dev = &dsi->dev;
694+
struct device_node *np = dev->of_node;
695+
696+
ctx->flip_horizontal = of_property_read_bool(np, "flip-horizontal");
697+
}
698+
685699
static int s6e88a0_ams427ap24_probe(struct mipi_dsi_device *dsi)
686700
{
687701
struct device *dev = &dsi->dev;
@@ -716,6 +730,8 @@ static int s6e88a0_ams427ap24_probe(struct mipi_dsi_device *dsi)
716730
DRM_MODE_CONNECTOR_DSI);
717731
ctx->panel.prepare_prev_first = true;
718732

733+
s6e88a0_ams427ap24_parse_dt(ctx);
734+
719735
ret = s6e88a0_ams427ap24_register_backlight(ctx);
720736
if (ret < 0)
721737
return ret;

0 commit comments

Comments
 (0)