]> git.hungrycats.org Git - linux/commitdiff
drm/panel: Use drm_of_get_panel_orientation()
authorThierry Reding <treding@nvidia.com>
Wed, 1 Jul 2026 12:03:20 +0000 (14:03 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Wed, 8 Jul 2026 11:54:58 +0000 (13:54 +0200)
The old of_drm_get_panel_orientation() function was replaced by the
drm_of_get_panel_orientation() in the core DRM OF helpers. Replace all
uses of the old helper and remove it.

Changes in v5:
- also convert r63419 panel
Changes in v4:
- also convert anbernic, chipone and ili9488 panels
Changes in v2:
- include drm_of.h in all drivers to make sure the new symbol is defined

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patch.msgid.link/20260701121055.192475-4-tzimmermann@suse.de
24 files changed:
drivers/gpu/drm/drm_panel.c
drivers/gpu/drm/panel/panel-anbernic-td4310.c
drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c
drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
drivers/gpu/drm/panel/panel-chipone-icna35xx.c
drivers/gpu/drm/panel/panel-chipwealth-ch13726a.c
drivers/gpu/drm/panel/panel-edp.c
drivers/gpu/drm/panel/panel-elida-kd35t133.c
drivers/gpu/drm/panel/panel-focaltech-ota7290b.c
drivers/gpu/drm/panel/panel-himax-hx83102.c
drivers/gpu/drm/panel/panel-himax-hx8394.c
drivers/gpu/drm/panel/panel-ilitek-ili9488.c
drivers/gpu/drm/panel/panel-ilitek-ili9806e-dsi.c
drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
drivers/gpu/drm/panel/panel-ilitek-ili9882t.c
drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c
drivers/gpu/drm/panel/panel-lvds.c
drivers/gpu/drm/panel/panel-novatek-nt36523.c
drivers/gpu/drm/panel/panel-renesas-r63419.c
drivers/gpu/drm/panel/panel-simple.c
drivers/gpu/drm/panel/panel-sitronix-st7701.c
drivers/gpu/drm/panel/panel-sitronix-st7703.c
drivers/gpu/drm/panel/panel-sitronix-st7789v.c
include/drm/drm_panel.h

index eddd13a34c030242f4729f3340247dad4392af36..d7c6f4824b2deefb46f20ad6b978555b63e21238 100644 (file)
@@ -492,26 +492,6 @@ struct drm_panel *of_drm_find_panel(const struct device_node *np)
        return ERR_PTR(-EPROBE_DEFER);
 }
 EXPORT_SYMBOL(of_drm_find_panel);
-
-/**
- * of_drm_get_panel_orientation - look up the orientation of the panel through
- * the "rotation" binding from a device tree node
- * @np: device tree node of the panel
- * @orientation: orientation enum to be filled in
- *
- * Looks up the rotation of a panel in the device tree. The orientation of the
- * panel is expressed as a property name "rotation" in the device tree. The
- * rotation in the device tree is counter clockwise.
- *
- * Return: 0 when a valid rotation value (0, 90, 180, or 270) is read or the
- * rotation property doesn't exist. Return a negative error code on failure.
- */
-int of_drm_get_panel_orientation(const struct device_node *np,
-                                enum drm_panel_orientation *orientation)
-{
-       return drm_of_get_panel_orientation(np, orientation);
-}
-EXPORT_SYMBOL(of_drm_get_panel_orientation);
 #endif
 
 /* Find panel by fwnode. This should be identical to of_drm_find_panel(). */
index 9a1b4525423c46f37347f3046ffbd694e661ec19..3b6de1b2fbc64cbfd5d2c84596b7ae3050d949f4 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/regulator/consumer.h>
 
 #include <drm/drm_mipi_dsi.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 #include <drm/drm_probe_helper.h>
 
@@ -165,7 +166,7 @@ static int panel_anbernic_td4310_probe(struct mipi_dsi_device *dsi)
        if (!ctx->panel_info)
                return -EINVAL;
 
-       ret = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation);
+       ret = drm_of_get_panel_orientation(dev->of_node, &ctx->orientation);
        if (ret < 0)
                return dev_err_probe(dev, ret, "Failed to get panel orientation\n");
 
index 01b4458e55ad9b27fa138e3becadb904317f98e7..a70a2e58f88c151f00d060b8d7cb447c0ab62302 100644 (file)
@@ -15,6 +15,7 @@
 #include <drm/drm_connector.h>
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_modes.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 #include <drm/drm_probe_helper.h>
 
@@ -380,7 +381,7 @@ static int boe_th101mb31ig002_dsi_probe(struct mipi_dsi_device *dsi)
                return dev_err_probe(&dsi->dev, PTR_ERR(ctx->reset),
                                     "Failed to get reset GPIO\n");
 
-       ret = of_drm_get_panel_orientation(dsi->dev.of_node,
+       ret = drm_of_get_panel_orientation(dsi->dev.of_node,
                                           &ctx->orientation);
        if (ret)
                return dev_err_probe(&dsi->dev, ret,
index 658ce64c71eb2bac5616bbefdc8ec52140ec546b..150dff3ab6c3e0c5efe89bd05c445750efc0a08e 100644 (file)
@@ -13,6 +13,7 @@
 #include <drm/drm_connector.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_mipi_dsi.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 
 #include <video/mipi_display.h>
@@ -1722,7 +1723,7 @@ static int boe_panel_add(struct boe_panel *boe)
 
        boe->base.prepare_prev_first = true;
 
-       err = of_drm_get_panel_orientation(dev->of_node, &boe->orientation);
+       err = drm_of_get_panel_orientation(dev->of_node, &boe->orientation);
        if (err < 0) {
                dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err);
                return err;
index 86d096455caa1c6f999784b39c0ee56b3cf79457..2cc16494a4cefd5dbbece464d197710e586dab44 100644 (file)
@@ -21,6 +21,7 @@
 #include <drm/drm_crtc.h>
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_modes.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 #include <drm/drm_probe_helper.h>
 
@@ -374,7 +375,7 @@ static int icna35xx_probe(struct mipi_dsi_device *dsi)
        pinfo->dsi = dsi;
        mipi_dsi_set_drvdata(dsi, pinfo);
 
-       ret = of_drm_get_panel_orientation(dev->of_node, &pinfo->orientation);
+       ret = drm_of_get_panel_orientation(dev->of_node, &pinfo->orientation);
        if (ret < 0) {
                dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret);
                return ret;
index be76bc825c3fd250a21b7fd052f11f4f53ef926b..562dc573528dd1559e852e3096a7a03499660a0d 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_modes.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 
 #include <video/mipi_display.h>
@@ -268,7 +269,7 @@ static int ch13726a_probe(struct mipi_dsi_device *dsi)
                return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
                                     "Failed to get reset-gpios\n");
 
-       ret = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation);
+       ret = drm_of_get_panel_orientation(dev->of_node, &ctx->orientation);
        if (ret < 0) {
                dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret);
                return ret;
index bd7acc31b292a2b8af06f5bd3b98893f09103ab1..f66474d3ef65eda8fa6944889be4e59d86e9dd54 100644 (file)
@@ -40,6 +40,7 @@
 #include <drm/drm_crtc.h>
 #include <drm/drm_device.h>
 #include <drm/drm_edid.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 
 /**
@@ -865,7 +866,7 @@ static int panel_edp_probe(struct device *dev, const struct panel_desc *desc,
                return dev_err_probe(dev, PTR_ERR(panel->enable_gpio),
                                     "failed to request GPIO\n");
 
-       err = of_drm_get_panel_orientation(dev->of_node, &panel->orientation);
+       err = drm_of_get_panel_orientation(dev->of_node, &panel->orientation);
        if (err) {
                dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err);
                return err;
index 1f177834d62986679830b15b960fb7299ca65cfa..d23002b5a2d788a0bd96ac0068e883a95167e53d 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_modes.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 
 /* Manufacturer specific Commands send via DSI */
@@ -233,7 +234,7 @@ static int kd35t133_probe(struct mipi_dsi_device *dsi)
                return ret;
        }
 
-       ret = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation);
+       ret = drm_of_get_panel_orientation(dev->of_node, &ctx->orientation);
        if (ret < 0) {
                dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret);
                return ret;
index ed02a8daf96f917974a3806921dd2da693a540e1..bbc870b8fda8ef0fd58bf41b21decdcc8eb4eea7 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_modes.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 #include <drm/drm_probe_helper.h>
 
@@ -181,7 +182,7 @@ static int ota7290b_probe(struct mipi_dsi_device *dsi)
                return dev_err_probe(&dsi->dev, PTR_ERR(ctx->vdd),
                                        "Couldn't get our VDD supply\n");
 
-       ret = of_drm_get_panel_orientation(dsi->dev.of_node, &ctx->orientation);
+       ret = drm_of_get_panel_orientation(dsi->dev.of_node, &ctx->orientation);
        if (ret) {
                dev_err(&dsi->dev, "%pOF: failed to get orientation: %d\n",
                        dsi->dev.of_node, ret);
index d7e5664a5838a56e6a20aada0f899b85a7034956..6a0851ccf9bb0c714962bdb3386b89fbedc584e8 100644 (file)
@@ -17,6 +17,7 @@
 #include <drm/drm_connector.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_mipi_dsi.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 
 #include <video/mipi_display.h>
@@ -1264,7 +1265,7 @@ static int hx83102_panel_add(struct hx83102 *ctx)
 
        ctx->base.prepare_prev_first = true;
 
-       err = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation);
+       err = drm_of_get_panel_orientation(dev->of_node, &ctx->orientation);
        if (err < 0)
                return dev_err_probe(dev, err, "failed to get orientation\n");
 
index 416203da2f45f6729c36d8b22cb4adb6449bca60..09124610fdc867a6685e3c0c9cbbba760fe5e46b 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_modes.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 
 #define DRV_NAME "panel-himax-hx8394"
@@ -991,7 +992,7 @@ static int hx8394_probe(struct mipi_dsi_device *dsi)
                return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
                                     "Failed to get reset gpio\n");
 
-       ret = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation);
+       ret = drm_of_get_panel_orientation(dev->of_node, &ctx->orientation);
        if (ret < 0) {
                dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret);
                return ret;
index 7302766034fc941a8c3f790c54a43e8a2b7604ad..6ab8ae72abbfa3334344569c74d1043d301f873c 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_modes.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 #include <drm/drm_probe_helper.h>
 
@@ -237,7 +238,7 @@ static int ili9488_dsi_probe(struct mipi_dsi_device *dsi)
        if (ret < 0)
                return dev_err_probe(dev, ret, "failed to get regulators\n");
 
-       ret = of_drm_get_panel_orientation(dev->of_node, &ili->orientation);
+       ret = drm_of_get_panel_orientation(dev->of_node, &ili->orientation);
        if (ret)
                return dev_err_probe(dev, ret, "failed to get orientation\n");
 
index ad33414719fc1891b67f4aac83f37f640fa7c6f1..0fb06c42554512dde2a7f3a5d47030b5b4240615 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_modes.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 #include <drm/drm_probe_helper.h>
 
@@ -131,7 +132,7 @@ static int ili9806e_dsi_probe(struct mipi_dsi_device *dsi)
        dsi->format = ctx->desc->format;
        dsi->lanes = ctx->desc->lanes;
 
-       ret = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation);
+       ret = drm_of_get_panel_orientation(dev->of_node, &ctx->orientation);
        if (ret)
                return dev_err_probe(dev, ret, "Failed to get orientation\n");
 
index 0652cdb57d1129a20190e459fd03b2430274fdcc..3abdd0870e831dfb5f9464d96bd5dc4db52a395e 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_modes.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 
 #include <video/mipi_display.h>
@@ -2571,7 +2572,7 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
                return dev_err_probe(&dsi->dev, PTR_ERR(ctx->reset),
                                     "Couldn't get our reset GPIO\n");
 
-       ret = of_drm_get_panel_orientation(dsi->dev.of_node, &ctx->orientation);
+       ret = drm_of_get_panel_orientation(dsi->dev.of_node, &ctx->orientation);
        if (ret) {
                dev_err(&dsi->dev, "%pOF: failed to get orientation: %d\n",
                        dsi->dev.of_node, ret);
index 5f4e0d82ee67380a6227d0143cc2d7d1396fcc7f..6d07fe901357eb633184d55b17adf3e3d3c3932a 100644 (file)
@@ -13,6 +13,7 @@
 #include <drm/drm_connector.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_mipi_dsi.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 
 #include <video/mipi_display.h>
@@ -795,7 +796,7 @@ static int ili9882t_add(struct ili9882t *ili)
 
        gpiod_set_value_cansleep(ili->enable_gpio, 0);
 
-       err = of_drm_get_panel_orientation(dev->of_node, &ili->orientation);
+       err = drm_of_get_panel_orientation(dev->of_node, &ili->orientation);
        if (err < 0) {
                dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err);
                return err;
index f6b04de1182e33db4504694ecebfaa388875ab8d..67ef9e0fea03c78b182ec73911543de0918b2039 100644 (file)
@@ -2992,7 +2992,7 @@ static int jadard_dsi_probe(struct mipi_dsi_device *dsi)
                return dev_err_probe(&dsi->dev, PTR_ERR(jadard->vccio),
                                "failed to get vccio regulator\n");
 
-       ret = of_drm_get_panel_orientation(dev->of_node, &jadard->orientation);
+       ret = drm_of_get_panel_orientation(dev->of_node, &jadard->orientation);
        if (ret < 0)
                return dev_err_probe(dev, ret, "failed to get orientation\n");
 
index 46b07f38559f35aa3b0a41662cc29480e53e885f..37f7498449ec2201ddbc13d10308f178f117feb3 100644 (file)
@@ -126,7 +126,7 @@ static int panel_lvds_parse_dt(struct panel_lvds *lvds)
        struct device_node *np = lvds->dev->of_node;
        int ret;
 
-       ret = of_drm_get_panel_orientation(np, &lvds->orientation);
+       ret = drm_of_get_panel_orientation(np, &lvds->orientation);
        if (ret < 0) {
                dev_err(lvds->dev, "%pOF: failed to get orientation %d\n", np, ret);
                return ret;
index 226d91daf8c792eee972f2b5c49c2ccf4aaf809d..34b9123d3fd758047f7216627dba6c6ed58a0a9d 100644 (file)
@@ -19,6 +19,7 @@
 #include <drm/drm_crtc.h>
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_modes.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 
 #define DSI_NUM_MIN 1
@@ -1206,7 +1207,7 @@ static int nt36523_probe(struct mipi_dsi_device *dsi)
        pinfo->dsi[0] = dsi;
        mipi_dsi_set_drvdata(dsi, pinfo);
 
-       ret = of_drm_get_panel_orientation(dev->of_node, &pinfo->orientation);
+       ret = drm_of_get_panel_orientation(dev->of_node, &pinfo->orientation);
        if (ret < 0) {
                dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret);
                return ret;
index 59ac323f5276b37d376e2d835a5064ac2cf5e923..ff3846d574e587898b38e8dd489611b6edf162ff 100644 (file)
@@ -20,6 +20,7 @@
 #include <drm/drm_connector.h>
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_modes.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 #include <drm/drm_probe_helper.h>
 
@@ -292,7 +293,7 @@ static int renesas_r63419_probe(struct mipi_dsi_device *dsi)
        mipi_dsi_set_drvdata(dsi, ctx);
 
        /* Get panel orientation */
-       ret = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation);
+       ret = drm_of_get_panel_orientation(dev->of_node, &ctx->orientation);
        if (ret < 0 && ret != -ENODEV)
                return dev_err_probe(dev, ret,
                                     "Failed to get panel orientation\n");
index c09bf3db5e78a91d28f8a5a2d717edea37e83724..5c169fdf265c1e0643cc0be0799a699d15870298 100644 (file)
@@ -693,7 +693,7 @@ static struct panel_simple *panel_simple_probe(struct device *dev)
                return dev_err_cast_probe(dev, panel->enable_gpio,
                                          "failed to request GPIO\n");
 
-       err = of_drm_get_panel_orientation(dev->of_node, &panel->orientation);
+       err = drm_of_get_panel_orientation(dev->of_node, &panel->orientation);
        if (err) {
                dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err);
                return ERR_PTR(err);
index 2f79ec4a206324cdc14268b54976c735b6f67aee..f16e0de1ea60626961a140133f3405021cd239a7 100644 (file)
@@ -7,6 +7,7 @@
 #include <drm/drm_mipi_dbi.h>
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_modes.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 
 #include <linux/bitfield.h>
@@ -1296,7 +1297,7 @@ static int st7701_probe(struct device *dev, int connector_type)
                return PTR_ERR(st7701->reset);
        }
 
-       ret = of_drm_get_panel_orientation(dev->of_node, &st7701->orientation);
+       ret = drm_of_get_panel_orientation(dev->of_node, &st7701->orientation);
        if (ret < 0)
                return dev_err_probe(dev, ret, "Failed to get orientation\n");
 
index f1641c9c7d132a191b49bd9ffcb53ee6a11d053c..fcbb0b7d50e4b324f9f8cbc2de04290c3aae0394 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_modes.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 
 #define DRV_NAME "panel-sitronix-st7703"
@@ -873,7 +874,7 @@ static int st7703_probe(struct mipi_dsi_device *dsi)
                return dev_err_probe(dev, PTR_ERR(ctx->iovcc),
                                     "Failed to request iovcc regulator\n");
 
-       ret = of_drm_get_panel_orientation(dsi->dev.of_node, &ctx->orientation);
+       ret = drm_of_get_panel_orientation(dsi->dev.of_node, &ctx->orientation);
        if (ret < 0)
                return dev_err_probe(&dsi->dev, ret, "Failed to get orientation\n");
 
index d5f821d6b23cb19dc01312e4eb3ed3fcfb254d42..da6ed31d151e0885d1e5c5768604165a0696fa27 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <drm/drm_device.h>
 #include <drm/drm_modes.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 
 #define ST7789V_RAMCTRL_CMD            0xb0
@@ -646,7 +647,7 @@ static int st7789v_probe(struct spi_device *spi)
        if (ret)
                return dev_err_probe(dev, ret, "Failed to get backlight\n");
 
-       ret = of_drm_get_panel_orientation(spi->dev.of_node, &ctx->orientation);
+       ret = drm_of_get_panel_orientation(spi->dev.of_node, &ctx->orientation);
        if (ret)
                return dev_err_probe(&spi->dev, ret, "Failed to get orientation\n");
 
index 86b3f9c65c926f480a4742ab9797681e2b6fc7ea..b87323443f49c9aaa2f8f24526f327849801750a 100644 (file)
@@ -337,19 +337,11 @@ int drm_panel_get_modes(struct drm_panel *panel, struct drm_connector *connector
 
 #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL)
 struct drm_panel *of_drm_find_panel(const struct device_node *np);
-int of_drm_get_panel_orientation(const struct device_node *np,
-                                enum drm_panel_orientation *orientation);
 #else
 static inline struct drm_panel *of_drm_find_panel(const struct device_node *np)
 {
        return ERR_PTR(-ENODEV);
 }
-
-static inline int of_drm_get_panel_orientation(const struct device_node *np,
-                                              enum drm_panel_orientation *orientation)
-{
-       return -ENODEV;
-}
 #endif
 
 #if defined(CONFIG_DRM_PANEL)