]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/panel: jd9365da: Add the function of adjusting orientation
authorZhaoxiong Lv <lvzhaoxiong@huaqin.corp-partner.google.com>
Mon, 24 Jun 2024 14:19:26 +0000 (22:19 +0800)
committerNeil Armstrong <neil.armstrong@linaro.org>
Fri, 28 Jun 2024 08:33:24 +0000 (10:33 +0200)
This driver does not have the function to adjust the orientation,
so this function is added.

Signed-off-by: Zhaoxiong Lv <lvzhaoxiong@huaqin.corp-partner.google.com>
Reviewed-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Link: https://lore.kernel.org/r/20240624141926.5250-6-lvzhaoxiong@huaqin.corp-partner.google.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240624141926.5250-6-lvzhaoxiong@huaqin.corp-partner.google.com
drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c

index 593e12b31ebd47210d23995e140f132ab281bb9b..c6b669866fed1083497960a1a6019dd30551b557 100644 (file)
@@ -42,7 +42,7 @@ struct jadard {
        struct drm_panel panel;
        struct mipi_dsi_device *dsi;
        const struct jadard_panel_desc *desc;
-
+       enum drm_panel_orientation orientation;
        struct regulator *vdd;
        struct regulator *vccio;
        struct gpio_desc *reset;
@@ -178,12 +178,20 @@ static int jadard_get_modes(struct drm_panel *panel,
        return 1;
 }
 
+static enum drm_panel_orientation jadard_panel_get_orientation(struct drm_panel *panel)
+{
+       struct jadard *jadard = panel_to_jadard(panel);
+
+       return jadard->orientation;
+}
+
 static const struct drm_panel_funcs jadard_funcs = {
        .disable = jadard_disable,
        .unprepare = jadard_unprepare,
        .prepare = jadard_prepare,
        .enable = jadard_enable,
        .get_modes = jadard_get_modes,
+       .get_orientation = jadard_panel_get_orientation,
 };
 
 static int radxa_display_8hd_ad002_init_cmds(struct jadard *jadard)
@@ -880,6 +888,10 @@ static int jadard_dsi_probe(struct mipi_dsi_device *dsi)
        drm_panel_init(&jadard->panel, dev, &jadard_funcs,
                       DRM_MODE_CONNECTOR_DSI);
 
+       ret = of_drm_get_panel_orientation(dev->of_node, &jadard->orientation);
+       if (ret < 0)
+               return dev_err_probe(dev, ret, "failed to get orientation\n");
+
        ret = drm_panel_of_backlight(&jadard->panel);
        if (ret)
                return ret;