Commit ff71c2cf authored by Chen-Yu Tsai's avatar Chen-Yu Tsai Committed by Maxime Ripard

drm/sun4i: use sun4i_tcon_of_table to check if a device node is a TCON

The sun4i DRM driver maintains a list of compatible strings it uses to
check if a device node within the display component graph is a TCON.
The TCON driver also has this list, used to bind the TCON driver to
the device. These two lists are identical.

Instead of maintaining two identical lists, export the list from the
TCON driver for the DRM driver to use.
Suggested-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171127084632.25511-1-wens@csie.org
parent 2f51be09
...@@ -187,13 +187,7 @@ static bool sun4i_drv_node_is_frontend(struct device_node *node) ...@@ -187,13 +187,7 @@ static bool sun4i_drv_node_is_frontend(struct device_node *node)
static bool sun4i_drv_node_is_tcon(struct device_node *node) static bool sun4i_drv_node_is_tcon(struct device_node *node)
{ {
return of_device_is_compatible(node, "allwinner,sun4i-a10-tcon") || return !!of_match_node(sun4i_tcon_of_table, node);
of_device_is_compatible(node, "allwinner,sun5i-a13-tcon") ||
of_device_is_compatible(node, "allwinner,sun6i-a31-tcon") ||
of_device_is_compatible(node, "allwinner,sun6i-a31s-tcon") ||
of_device_is_compatible(node, "allwinner,sun7i-a20-tcon") ||
of_device_is_compatible(node, "allwinner,sun8i-a33-tcon") ||
of_device_is_compatible(node, "allwinner,sun8i-v3s-tcon");
} }
static int compare_of(struct device *dev, void *data) static int compare_of(struct device *dev, void *data)
......
...@@ -900,7 +900,8 @@ static const struct sun4i_tcon_quirks sun8i_v3s_quirks = { ...@@ -900,7 +900,8 @@ static const struct sun4i_tcon_quirks sun8i_v3s_quirks = {
/* nothing is supported */ /* nothing is supported */
}; };
static const struct of_device_id sun4i_tcon_of_table[] = { /* sun4i_drv uses this list to check if a device node is a TCON */
const struct of_device_id sun4i_tcon_of_table[] = {
{ .compatible = "allwinner,sun4i-a10-tcon", .data = &sun4i_a10_quirks }, { .compatible = "allwinner,sun4i-a10-tcon", .data = &sun4i_a10_quirks },
{ .compatible = "allwinner,sun5i-a13-tcon", .data = &sun5i_a13_quirks }, { .compatible = "allwinner,sun5i-a13-tcon", .data = &sun5i_a13_quirks },
{ .compatible = "allwinner,sun6i-a31-tcon", .data = &sun6i_a31_quirks }, { .compatible = "allwinner,sun6i-a31-tcon", .data = &sun6i_a31_quirks },
...@@ -911,6 +912,7 @@ static const struct of_device_id sun4i_tcon_of_table[] = { ...@@ -911,6 +912,7 @@ static const struct of_device_id sun4i_tcon_of_table[] = {
{ } { }
}; };
MODULE_DEVICE_TABLE(of, sun4i_tcon_of_table); MODULE_DEVICE_TABLE(of, sun4i_tcon_of_table);
EXPORT_SYMBOL(sun4i_tcon_of_table);
static struct platform_driver sun4i_tcon_platform_driver = { static struct platform_driver sun4i_tcon_platform_driver = {
.probe = sun4i_tcon_probe, .probe = sun4i_tcon_probe,
......
...@@ -197,4 +197,6 @@ void sun4i_tcon_mode_set(struct sun4i_tcon *tcon, ...@@ -197,4 +197,6 @@ void sun4i_tcon_mode_set(struct sun4i_tcon *tcon,
void sun4i_tcon_set_status(struct sun4i_tcon *crtc, void sun4i_tcon_set_status(struct sun4i_tcon *crtc,
const struct drm_encoder *encoder, bool enable); const struct drm_encoder *encoder, bool enable);
extern const struct of_device_id sun4i_tcon_of_table[];
#endif /* __SUN4I_TCON_H__ */ #endif /* __SUN4I_TCON_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment