diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-11-08 07:11:29 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-12-07 10:05:58 -0500 |
commit | 09e82ba7011d6e94bf1eeb3f1cd0b7d441263132 (patch) | |
tree | 99b64e287830f6ccb9b68ec1bbe6efe953bed94f /drivers/video/omap2 | |
parent | 8b09551338dbe1882d3d52dcc5d34ef933adbccf (diff) |
OMAPDSS: move display sysfs init to compat layer
Move creation of the sysfs files for displays to the compat layer.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r-- | drivers/video/omap2/dss/apply.c | 14 | ||||
-rw-r--r-- | drivers/video/omap2/dss/core.c | 7 | ||||
-rw-r--r-- | drivers/video/omap2/dss/display.c | 20 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss.h | 5 |
4 files changed, 14 insertions, 32 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index 29e11434b7d..d446bdfc4c8 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c | |||
@@ -1562,6 +1562,7 @@ static DEFINE_MUTEX(compat_init_lock); | |||
1562 | int omapdss_compat_init(void) | 1562 | int omapdss_compat_init(void) |
1563 | { | 1563 | { |
1564 | struct platform_device *pdev = dss_get_core_pdev(); | 1564 | struct platform_device *pdev = dss_get_core_pdev(); |
1565 | struct omap_dss_device *dssdev = NULL; | ||
1565 | int i, r; | 1566 | int i, r; |
1566 | 1567 | ||
1567 | mutex_lock(&compat_init_lock); | 1568 | mutex_lock(&compat_init_lock); |
@@ -1607,6 +1608,13 @@ int omapdss_compat_init(void) | |||
1607 | if (r) | 1608 | if (r) |
1608 | goto err_mgr_ops; | 1609 | goto err_mgr_ops; |
1609 | 1610 | ||
1611 | for_each_dss_dev(dssdev) { | ||
1612 | r = display_init_sysfs(pdev, dssdev); | ||
1613 | /* XXX uninit sysfs files on error */ | ||
1614 | if (r) | ||
1615 | goto err_disp_sysfs; | ||
1616 | } | ||
1617 | |||
1610 | dispc_runtime_get(); | 1618 | dispc_runtime_get(); |
1611 | 1619 | ||
1612 | r = dss_dispc_initialize_irq(); | 1620 | r = dss_dispc_initialize_irq(); |
@@ -1622,6 +1630,8 @@ out: | |||
1622 | 1630 | ||
1623 | err_init_irq: | 1631 | err_init_irq: |
1624 | dispc_runtime_put(); | 1632 | dispc_runtime_put(); |
1633 | |||
1634 | err_disp_sysfs: | ||
1625 | dss_uninstall_mgr_ops(); | 1635 | dss_uninstall_mgr_ops(); |
1626 | 1636 | ||
1627 | err_mgr_ops: | 1637 | err_mgr_ops: |
@@ -1639,6 +1649,7 @@ EXPORT_SYMBOL(omapdss_compat_init); | |||
1639 | void omapdss_compat_uninit(void) | 1649 | void omapdss_compat_uninit(void) |
1640 | { | 1650 | { |
1641 | struct platform_device *pdev = dss_get_core_pdev(); | 1651 | struct platform_device *pdev = dss_get_core_pdev(); |
1652 | struct omap_dss_device *dssdev = NULL; | ||
1642 | 1653 | ||
1643 | mutex_lock(&compat_init_lock); | 1654 | mutex_lock(&compat_init_lock); |
1644 | 1655 | ||
@@ -1647,6 +1658,9 @@ void omapdss_compat_uninit(void) | |||
1647 | 1658 | ||
1648 | dss_dispc_uninitialize_irq(); | 1659 | dss_dispc_uninitialize_irq(); |
1649 | 1660 | ||
1661 | for_each_dss_dev(dssdev) | ||
1662 | display_uninit_sysfs(pdev, dssdev); | ||
1663 | |||
1650 | dss_uninstall_mgr_ops(); | 1664 | dss_uninstall_mgr_ops(); |
1651 | 1665 | ||
1652 | dss_uninit_overlay_managers(pdev); | 1666 | dss_uninit_overlay_managers(pdev); |
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 1751c1f511a..50817fe18cf 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c | |||
@@ -347,15 +347,10 @@ static int dss_driver_probe(struct device *dev) | |||
347 | dev_name(dev), dssdev->driver_name, | 347 | dev_name(dev), dssdev->driver_name, |
348 | dssdrv->driver.name); | 348 | dssdrv->driver.name); |
349 | 349 | ||
350 | r = dss_init_device(core.pdev, dssdev); | ||
351 | if (r) | ||
352 | return r; | ||
353 | |||
354 | r = dssdrv->probe(dssdev); | 350 | r = dssdrv->probe(dssdev); |
355 | 351 | ||
356 | if (r) { | 352 | if (r) { |
357 | DSSERR("driver probe failed: %d\n", r); | 353 | DSSERR("driver probe failed: %d\n", r); |
358 | dss_uninit_device(core.pdev, dssdev); | ||
359 | return r; | 354 | return r; |
360 | } | 355 | } |
361 | 356 | ||
@@ -376,8 +371,6 @@ static int dss_driver_remove(struct device *dev) | |||
376 | 371 | ||
377 | dssdrv->remove(dssdev); | 372 | dssdrv->remove(dssdev); |
378 | 373 | ||
379 | dss_uninit_device(core.pdev, dssdev); | ||
380 | |||
381 | dssdev->driver = NULL; | 374 | dssdev->driver = NULL; |
382 | 375 | ||
383 | return 0; | 376 | return 0; |
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c index 05f21b6231b..0aa8ad8f966 100644 --- a/drivers/video/omap2/dss/display.c +++ b/drivers/video/omap2/dss/display.c | |||
@@ -76,26 +76,6 @@ void omapdss_default_get_timings(struct omap_dss_device *dssdev, | |||
76 | } | 76 | } |
77 | EXPORT_SYMBOL(omapdss_default_get_timings); | 77 | EXPORT_SYMBOL(omapdss_default_get_timings); |
78 | 78 | ||
79 | int dss_init_device(struct platform_device *pdev, | ||
80 | struct omap_dss_device *dssdev) | ||
81 | { | ||
82 | int r; | ||
83 | |||
84 | r = display_init_sysfs(pdev, dssdev); | ||
85 | if (r) { | ||
86 | omapdss_output_unset_device(dssdev->output); | ||
87 | return r; | ||
88 | } | ||
89 | |||
90 | return 0; | ||
91 | } | ||
92 | |||
93 | void dss_uninit_device(struct platform_device *pdev, | ||
94 | struct omap_dss_device *dssdev) | ||
95 | { | ||
96 | display_uninit_sysfs(pdev, dssdev); | ||
97 | } | ||
98 | |||
99 | static int dss_suspend_device(struct device *dev, void *data) | 79 | static int dss_suspend_device(struct device *dev, void *data) |
100 | { | 80 | { |
101 | struct omap_dss_device *dssdev = to_dss_device(dev); | 81 | struct omap_dss_device *dssdev = to_dss_device(dev); |
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 180b381fd12..8c89cdda96d 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h | |||
@@ -201,11 +201,6 @@ int dss_suspend_all_devices(void); | |||
201 | int dss_resume_all_devices(void); | 201 | int dss_resume_all_devices(void); |
202 | void dss_disable_all_devices(void); | 202 | void dss_disable_all_devices(void); |
203 | 203 | ||
204 | int dss_init_device(struct platform_device *pdev, | ||
205 | struct omap_dss_device *dssdev); | ||
206 | void dss_uninit_device(struct platform_device *pdev, | ||
207 | struct omap_dss_device *dssdev); | ||
208 | |||
209 | int display_init_sysfs(struct platform_device *pdev, | 204 | int display_init_sysfs(struct platform_device *pdev, |
210 | struct omap_dss_device *dssdev); | 205 | struct omap_dss_device *dssdev); |
211 | void display_uninit_sysfs(struct platform_device *pdev, | 206 | void display_uninit_sysfs(struct platform_device *pdev, |