UPSTREAM: drm/rockchip: remove rockchip_drm_encoder_get_mux_id
authorPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 24 Feb 2015 10:42:08 +0000 (11:42 +0100)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 28 Jun 2016 10:40:46 +0000 (18:40 +0800)
It is replaced by drm_of_encoder_active_endpoint_id.

Change-Id: I0d09b768951192cd781d0b5c3e5652f66dc4cdaa
Suggested-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Yakir Yang <ykk@rock-chips.com>
[for dw_hdmi-rockchip]
Acked-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
(cherry-pick from commit 16450616790af5ef5dda79e3081916af723756da)

drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
drivers/gpu/drm/rockchip/dw-mipi-dsi.c
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
drivers/gpu/drm/rockchip/rockchip_drm_drv.c
drivers/gpu/drm/rockchip/rockchip_drm_drv.h

index 26303b649564c9b3b312374a80456a5f3739e669..c5b87d470010f8643501d8b4ef0f0bebfd3b4eda 100644 (file)
@@ -141,7 +141,7 @@ static void rockchip_dp_drm_encoder_enable(struct drm_encoder *encoder)
        int ret;
        u32 val;
 
-       ret = rockchip_drm_encoder_get_mux_id(dp->dev->of_node, encoder);
+       ret = drm_of_encoder_active_endpoint_id(dp->dev->of_node, encoder);
        if (ret < 0)
                return;
 
@@ -181,7 +181,7 @@ rockchip_dp_drm_encoder_atomic_check(struct drm_encoder *encoder,
         * to RGA10 here.
         */
 
-       ret = rockchip_drm_encoder_get_mux_id(dp->dev->of_node, encoder);
+       ret = drm_of_encoder_active_endpoint_id(dp->dev->of_node, encoder);
        if (ret < 0)
                return true;
 
index 610025a78e1f14e09b2740fc5e3ab4ffada0d94c..4e1cb20a6741b7bcbc817464322f77c1c33b0710 100644 (file)
@@ -909,7 +909,7 @@ static void dw_mipi_dsi_encoder_commit(struct drm_encoder *encoder)
 {
        struct dw_mipi_dsi *dsi = encoder_to_dsi(encoder);
        const struct dw_mipi_dsi_plat_data *pdata = dsi->pdata;
-       int mux  = rockchip_drm_encoder_get_mux_id(dsi->dev->of_node, encoder);
+       int mux = drm_of_encoder_active_endpoint_id(dsi->dev->of_node, encoder);
        u32 val;
 
        if (clk_prepare_enable(dsi->pclk)) {
index dca61c8e73e3e9b10acd75d07edae03756a9419e..801110f65a63896004aea13587b39edec4ceaab4 100644 (file)
@@ -201,7 +201,7 @@ static void dw_hdmi_rockchip_encoder_enable(struct drm_encoder *encoder)
        u32 val;
        int mux;
 
-       mux = rockchip_drm_encoder_get_mux_id(hdmi->dev->of_node, encoder);
+       mux = drm_of_encoder_active_endpoint_id(hdmi->dev->of_node, encoder);
        if (mux)
                val = HDMI_SEL_VOP_LIT | (HDMI_SEL_VOP_LIT << 16);
        else
index 73745ef7722b0cd4cb883a8ec387c6beee8a24f4..47bee4884e1f1e1b1397d53e305bf77f02dac8ad 100644 (file)
@@ -566,36 +566,6 @@ static const struct dev_pm_ops rockchip_drm_pm_ops = {
                                rockchip_drm_sys_resume)
 };
 
-/*
- * @node: device tree node containing encoder input ports
- * @encoder: drm_encoder
- */
-int rockchip_drm_encoder_get_mux_id(struct device_node *node,
-                                   struct drm_encoder *encoder)
-{
-       struct device_node *ep;
-       struct drm_crtc *crtc = encoder->crtc;
-       struct of_endpoint endpoint;
-       struct device_node *port;
-       int ret;
-
-       if (!node || !crtc)
-               return -EINVAL;
-
-       for_each_endpoint_of_node(node, ep) {
-               port = of_graph_get_remote_port(ep);
-               of_node_put(port);
-               if (port == crtc->port) {
-                       ret = of_graph_parse_endpoint(ep, &endpoint);
-                       of_node_put(ep);
-                       return ret ?: endpoint.id;
-               }
-       }
-
-       return -EINVAL;
-}
-EXPORT_SYMBOL_GPL(rockchip_drm_encoder_get_mux_id);
-
 static int compare_of(struct device *dev, void *data)
 {
        struct device_node *np = data;
index 7eb8187c1dd5559885838f1c0046625be09f6b6a..aaa97dbad5e71b1f133c4cc8d60e502e62d17ee1 100644 (file)
@@ -106,8 +106,6 @@ void rockchip_drm_atomic_work(struct work_struct *work);
 int rockchip_register_crtc_funcs(struct drm_crtc *crtc,
                                 const struct rockchip_crtc_funcs *crtc_funcs);
 void rockchip_unregister_crtc_funcs(struct drm_crtc *crtc);
-int rockchip_drm_encoder_get_mux_id(struct device_node *node,
-                                   struct drm_encoder *encoder);
 int rockchip_drm_dma_attach_device(struct drm_device *drm_dev,
                                   struct device *dev);
 void rockchip_drm_dma_detach_device(struct drm_device *drm_dev,