drm/imx: remove imx_drm_encoder_get_mux_id
authorPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 24 Feb 2015 10:41:28 +0000 (11:41 +0100)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 1 Mar 2016 07:33:38 +0000 (08:33 +0100)
It is replaced by drm_of_encoder_active_port_id.

Suggested-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/gpu/drm/imx/dw_hdmi-imx.c
drivers/gpu/drm/imx/imx-drm-core.c
drivers/gpu/drm/imx/imx-drm.h
drivers/gpu/drm/imx/imx-ldb.c

index 063825fecbe2983b4eabbf35a9ce60e7e799dc16..38d9c85a7a1cad5a81a5f34b926602a32f224ed9 100644 (file)
@@ -125,7 +125,7 @@ static void dw_hdmi_imx_encoder_mode_set(struct drm_encoder *encoder,
 static void dw_hdmi_imx_encoder_commit(struct drm_encoder *encoder)
 {
        struct imx_hdmi *hdmi = container_of(encoder, struct imx_hdmi, encoder);
-       int mux = imx_drm_encoder_get_mux_id(hdmi->dev->of_node, encoder);
+       int mux = drm_of_encoder_active_port_id(hdmi->dev->of_node, encoder);
 
        regmap_update_bits(hdmi->regmap, IOMUXC_GPR3,
                           IMX6Q_GPR3_HDMI_MUX_CTL_MASK,
index 7c4d1250e0710cfd67a6ea65f1ce56662bb30987..9876e0f0c3e1833592308f1a8a38de5c3e44f2b0 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/device.h>
 #include <linux/fb.h>
 #include <linux/module.h>
-#include <linux/of_graph.h>
 #include <linux/platform_device.h>
 #include <drm/drmP.h>
 #include <drm/drm_fb_helper.h>
@@ -412,36 +411,6 @@ int imx_drm_encoder_parse_of(struct drm_device *drm,
 }
 EXPORT_SYMBOL_GPL(imx_drm_encoder_parse_of);
 
-/*
- * @node: device tree node containing encoder input ports
- * @encoder: drm_encoder
- */
-int imx_drm_encoder_get_mux_id(struct device_node *node,
-                              struct drm_encoder *encoder)
-{
-       struct imx_drm_crtc *imx_crtc = imx_drm_find_crtc(encoder->crtc);
-       struct device_node *ep;
-       struct of_endpoint endpoint;
-       struct device_node *port;
-       int ret;
-
-       if (!node || !imx_crtc)
-               return -EINVAL;
-
-       for_each_endpoint_of_node(node, ep) {
-               port = of_graph_get_remote_port(ep);
-               of_node_put(port);
-               if (port == imx_crtc->crtc->port) {
-                       ret = of_graph_parse_endpoint(ep, &endpoint);
-                       of_node_put(ep);
-                       return ret ? ret : endpoint.port;
-               }
-       }
-
-       return -EINVAL;
-}
-EXPORT_SYMBOL_GPL(imx_drm_encoder_get_mux_id);
-
 static const struct drm_ioctl_desc imx_drm_ioctls[] = {
        /* none so far */
 };
index 71cf6d9c714f51a57b00377a7c5d172c5014d898..b0241b9d13342f516d01cb2e3b53f6afb9dbf47a 100644 (file)
@@ -46,8 +46,6 @@ int imx_drm_set_bus_format_pins(struct drm_encoder *encoder,
 int imx_drm_set_bus_format(struct drm_encoder *encoder,
                u32 bus_format);
 
-int imx_drm_encoder_get_mux_id(struct device_node *node,
-               struct drm_encoder *encoder);
 int imx_drm_encoder_parse_of(struct drm_device *drm,
        struct drm_encoder *encoder, struct device_node *np);
 
index 22ac482231ed5c2e2a5ecfac95bf8ac683e76250..0ec3b1d560808c01c268387f0ceba5c048116811 100644 (file)
@@ -19,6 +19,7 @@
 #include <drm/drmP.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 #include <linux/mfd/syscon.h>
 #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
@@ -215,7 +216,7 @@ static void imx_ldb_encoder_commit(struct drm_encoder *encoder)
        struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
        struct imx_ldb *ldb = imx_ldb_ch->ldb;
        int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN;
-       int mux = imx_drm_encoder_get_mux_id(imx_ldb_ch->child, encoder);
+       int mux = drm_of_encoder_active_port_id(imx_ldb_ch->child, encoder);
 
        drm_panel_prepare(imx_ldb_ch->panel);
 
@@ -265,7 +266,7 @@ static void imx_ldb_encoder_mode_set(struct drm_encoder *encoder,
        int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN;
        unsigned long serial_clk;
        unsigned long di_clk = mode->clock * 1000;
-       int mux = imx_drm_encoder_get_mux_id(imx_ldb_ch->child, encoder);
+       int mux = drm_of_encoder_active_port_id(imx_ldb_ch->child, encoder);
 
        if (mode->clock > 170000) {
                dev_warn(ldb->dev,