Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/sun4i: tcon-top: Remove mux configuration at probe time

Now that R40 TCON migrated to runtime mux configuration, old code can be
removed.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180710203511.18454-18-jernej.skrabec@siol.net

authored by

Jernej Skrabec and committed by
Maxime Ripard
5e496566 05db311a

+1 -75
+1 -75
drivers/gpu/drm/sun4i/sun8i_tcon_top.c
··· 87 87 } 88 88 EXPORT_SYMBOL(sun8i_tcon_top_de_config); 89 89 90 - static int sun8i_tcon_top_get_connected_ep_id(struct device_node *node, 91 - int port_id) 92 - { 93 - struct device_node *ep, *remote, *port; 94 - struct of_endpoint endpoint; 95 - 96 - port = of_graph_get_port_by_id(node, port_id); 97 - if (!port) 98 - return -ENOENT; 99 - 100 - for_each_available_child_of_node(port, ep) { 101 - remote = of_graph_get_remote_port_parent(ep); 102 - if (!remote) 103 - continue; 104 - 105 - if (of_device_is_available(remote)) { 106 - of_graph_parse_endpoint(ep, &endpoint); 107 - 108 - of_node_put(remote); 109 - 110 - return endpoint.id; 111 - } 112 - 113 - of_node_put(remote); 114 - } 115 - 116 - return -ENOENT; 117 - } 118 90 119 91 static struct clk_hw *sun8i_tcon_top_register_gate(struct device *dev, 120 92 const char *parent, ··· 121 149 struct platform_device *pdev = to_platform_device(dev); 122 150 struct clk_hw_onecell_data *clk_data; 123 151 struct sun8i_tcon_top *tcon_top; 124 - bool mixer0_unused = false; 125 152 struct resource *res; 126 153 void __iomem *regs; 127 - int ret, i, id; 128 - u32 val; 154 + int ret, i; 129 155 130 156 tcon_top = devm_kzalloc(dev, sizeof(*tcon_top), GFP_KERNEL); 131 157 if (!tcon_top) ··· 167 197 dev_err(dev, "Could not enable bus clock\n"); 168 198 goto err_assert_reset; 169 199 } 170 - 171 - val = 0; 172 - 173 - /* check if HDMI mux output is connected */ 174 - if (sun8i_tcon_top_get_connected_ep_id(dev->of_node, 5) >= 0) { 175 - /* find HDMI input endpoint id, if it is connected at all*/ 176 - id = sun8i_tcon_top_get_connected_ep_id(dev->of_node, 4); 177 - if (id >= 0) 178 - val = FIELD_PREP(TCON_TOP_HDMI_SRC_MSK, id + 1); 179 - else 180 - DRM_DEBUG_DRIVER("TCON TOP HDMI input is not connected\n"); 181 - } else { 182 - DRM_DEBUG_DRIVER("TCON TOP HDMI output is not connected\n"); 183 - } 184 - 185 - writel(val, regs + TCON_TOP_GATE_SRC_REG); 186 - 187 - val = 0; 188 - 189 - /* process mixer0 mux output */ 190 - id = sun8i_tcon_top_get_connected_ep_id(dev->of_node, 1); 191 - if (id >= 0) { 192 - val = FIELD_PREP(TCON_TOP_PORT_DE0_MSK, id); 193 - } else { 194 - DRM_DEBUG_DRIVER("TCON TOP mixer0 output is not connected\n"); 195 - mixer0_unused = true; 196 - } 197 - 198 - /* process mixer1 mux output */ 199 - id = sun8i_tcon_top_get_connected_ep_id(dev->of_node, 3); 200 - if (id >= 0) { 201 - val |= FIELD_PREP(TCON_TOP_PORT_DE1_MSK, id); 202 - 203 - /* 204 - * mixer0 mux has priority over mixer1 mux. We have to 205 - * make sure mixer0 doesn't overtake TCON from mixer1. 206 - */ 207 - if (mixer0_unused && id == 0) 208 - val |= FIELD_PREP(TCON_TOP_PORT_DE0_MSK, 1); 209 - } else { 210 - DRM_DEBUG_DRIVER("TCON TOP mixer1 output is not connected\n"); 211 - } 212 - 213 - writel(val, regs + TCON_TOP_PORT_SEL_REG); 214 200 215 201 /* 216 202 * TCON TOP has two muxes, which select parent clock for each TCON TV