提交 cc1876ce 编写于 作者: J Jyri Sarha 提交者: Tomi Valkeinen

drm/omap: dss: Move platform_device_register from core.c to dss.c probe

Register the omapdrm device when we know that dss device probe going
to succeed. This avoids DSS6 and DSS2 omapdrm device registration from
colliding with each other.
Signed-off-by: NJyri Sarha <jsarha@ti.com>
Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
上级 f13e97cf
...@@ -45,36 +45,14 @@ static struct platform_driver * const omap_dss_drivers[] = { ...@@ -45,36 +45,14 @@ static struct platform_driver * const omap_dss_drivers[] = {
#endif #endif
}; };
static struct platform_device *omap_drm_device;
static int __init omap_dss_init(void) static int __init omap_dss_init(void)
{ {
int r; return platform_register_drivers(omap_dss_drivers,
ARRAY_SIZE(omap_dss_drivers));
r = platform_register_drivers(omap_dss_drivers,
ARRAY_SIZE(omap_dss_drivers));
if (r)
goto err_reg;
omap_drm_device = platform_device_register_simple("omapdrm", 0, NULL, 0);
if (IS_ERR(omap_drm_device)) {
r = PTR_ERR(omap_drm_device);
goto err_reg;
}
return 0;
err_reg:
platform_unregister_drivers(omap_dss_drivers,
ARRAY_SIZE(omap_dss_drivers));
return r;
} }
static void __exit omap_dss_exit(void) static void __exit omap_dss_exit(void)
{ {
platform_device_unregister(omap_drm_device);
platform_unregister_drivers(omap_dss_drivers, platform_unregister_drivers(omap_dss_drivers,
ARRAY_SIZE(omap_dss_drivers)); ARRAY_SIZE(omap_dss_drivers));
} }
......
...@@ -1315,6 +1315,7 @@ static const struct soc_device_attribute dss_soc_devices[] = { ...@@ -1315,6 +1315,7 @@ static const struct soc_device_attribute dss_soc_devices[] = {
static int dss_bind(struct device *dev) static int dss_bind(struct device *dev)
{ {
struct dss_device *dss = dev_get_drvdata(dev); struct dss_device *dss = dev_get_drvdata(dev);
struct platform_device *drm_pdev;
int r; int r;
r = component_bind_all(dev, NULL); r = component_bind_all(dev, NULL);
...@@ -1325,11 +1326,23 @@ static int dss_bind(struct device *dev) ...@@ -1325,11 +1326,23 @@ static int dss_bind(struct device *dev)
omapdss_set_dss(dss); omapdss_set_dss(dss);
drm_pdev = platform_device_register_simple("omapdrm", 0, NULL, 0);
if (IS_ERR(drm_pdev)) {
component_unbind_all(dev, NULL);
return PTR_ERR(drm_pdev);
}
dss->drm_pdev = drm_pdev;
return 0; return 0;
} }
static void dss_unbind(struct device *dev) static void dss_unbind(struct device *dev)
{ {
struct dss_device *dss = dev_get_drvdata(dev);
platform_device_unregister(dss->drm_pdev);
omapdss_set_dss(NULL); omapdss_set_dss(NULL);
component_unbind_all(dev, NULL); component_unbind_all(dev, NULL);
......
...@@ -238,6 +238,8 @@ struct dss_device { ...@@ -238,6 +238,8 @@ struct dss_device {
struct regmap *syscon_pll_ctrl; struct regmap *syscon_pll_ctrl;
u32 syscon_pll_ctrl_offset; u32 syscon_pll_ctrl_offset;
struct platform_device *drm_pdev;
struct clk *parent_clk; struct clk *parent_clk;
struct clk *dss_clk; struct clk *dss_clk;
unsigned long dss_clk_rate; unsigned long dss_clk_rate;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册