* [PATCH 01/10] OMAPDSS: Makefile: move omapfb after panels
2013-04-29 10:22 [PATCH 00/10] OMAPDSS: Basic deferred probe support Tomi Valkeinen
@ 2013-04-29 10:22 ` Tomi Valkeinen
2013-04-29 10:22 ` [PATCH 02/10] OMAPFB: use module_platform_driver() Tomi Valkeinen
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Tomi Valkeinen @ 2013-04-29 10:22 UTC (permalink / raw)
To: linux-fbdev, linux-omap
Cc: Tony Lindgren, grygorii.strashko, chf.fritz, Archit Taneja,
Tomi Valkeinen
omapfb requires the panels to have been probed before omapfb's probe. We
currently manage that by having omapfb in late initcall level. However,
a much simpler way is to just change the makefile so that omapfb is
after the panel drivers.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/omap2/Makefile b/drivers/video/omap2/Makefile
index 5ea7cb9..296e5c5 100644
--- a/drivers/video/omap2/Makefile
+++ b/drivers/video/omap2/Makefile
@@ -1,5 +1,5 @@
obj-$(CONFIG_OMAP2_VRFB) += vrfb.o
obj-$(CONFIG_OMAP2_DSS) += dss/
-obj-$(CONFIG_FB_OMAP2) += omapfb/
obj-y += displays/
+obj-$(CONFIG_FB_OMAP2) += omapfb/
--
1.7.10.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 02/10] OMAPFB: use module_platform_driver()
2013-04-29 10:22 [PATCH 00/10] OMAPDSS: Basic deferred probe support Tomi Valkeinen
2013-04-29 10:22 ` [PATCH 01/10] OMAPDSS: Makefile: move omapfb after panels Tomi Valkeinen
@ 2013-04-29 10:22 ` Tomi Valkeinen
2013-04-29 10:22 ` [PATCH 03/10] OMAPFB: defer probe if no displays Tomi Valkeinen
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Tomi Valkeinen @ 2013-04-29 10:22 UTC (permalink / raw)
To: linux-fbdev, linux-omap
Cc: Tony Lindgren, grygorii.strashko, chf.fritz, Archit Taneja,
Tomi Valkeinen
Instead of using platform_driver_probe(), use module_platform_driver()
so that we can support deferred probing.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/omapfb/omapfb-main.c | 28 +++-------------------------
1 file changed, 3 insertions(+), 25 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index f38348e..808f6af 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2422,7 +2422,7 @@ static int omapfb_init_connections(struct omapfb2_device *fbdev,
return 0;
}
-static int __init omapfb_probe(struct platform_device *pdev)
+static int omapfb_probe(struct platform_device *pdev)
{
struct omapfb2_device *fbdev = NULL;
int r = 0;
@@ -2595,6 +2595,7 @@ static int __exit omapfb_remove(struct platform_device *pdev)
}
static struct platform_driver omapfb_driver = {
+ .probe = omapfb_probe,
.remove = __exit_p(omapfb_remove),
.driver = {
.name = "omapfb",
@@ -2602,36 +2603,13 @@ static struct platform_driver omapfb_driver = {
},
};
-static int __init omapfb_init(void)
-{
- DBG("omapfb_init\n");
-
- if (platform_driver_probe(&omapfb_driver, omapfb_probe)) {
- printk(KERN_ERR "failed to register omapfb driver\n");
- return -ENODEV;
- }
-
- return 0;
-}
-
-static void __exit omapfb_exit(void)
-{
- DBG("omapfb_exit\n");
- platform_driver_unregister(&omapfb_driver);
-}
-
module_param_named(mode, def_mode, charp, 0);
module_param_named(vram, def_vram, charp, 0);
module_param_named(rotate, def_rotate, int, 0);
module_param_named(vrfb, def_vrfb, bool, 0);
module_param_named(mirror, def_mirror, bool, 0);
-/* late_initcall to let panel/ctrl drivers loaded first.
- * I guess better option would be a more dynamic approach,
- * so that omapfb reacts to new panels when they are loaded */
-late_initcall(omapfb_init);
-/*module_init(omapfb_init);*/
-module_exit(omapfb_exit);
+module_platform_driver(omapfb_driver);
MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@nokia.com>");
MODULE_DESCRIPTION("OMAP2/3 Framebuffer");
--
1.7.10.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 03/10] OMAPFB: defer probe if no displays
2013-04-29 10:22 [PATCH 00/10] OMAPDSS: Basic deferred probe support Tomi Valkeinen
2013-04-29 10:22 ` [PATCH 01/10] OMAPDSS: Makefile: move omapfb after panels Tomi Valkeinen
2013-04-29 10:22 ` [PATCH 02/10] OMAPFB: use module_platform_driver() Tomi Valkeinen
@ 2013-04-29 10:22 ` Tomi Valkeinen
2013-04-29 10:22 ` [PATCH 04/10] OMAPDSS: DSI: use platform_driver_register() Tomi Valkeinen
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Tomi Valkeinen @ 2013-04-29 10:22 UTC (permalink / raw)
To: linux-fbdev, linux-omap
Cc: Tony Lindgren, grygorii.strashko, chf.fritz, Archit Taneja,
Tomi Valkeinen
omapfb requires the panel drivers to have been probed when omapfb is
initialized. omapfb does not support insertion of new panels after its
probe. This causes a problem in case omapdss or the panel probes have
been deferred due to EPROBE_DEFER error, as omapfb won't find any
displays.
As a quick fix, this patch changes the omapfb probe so that if omapfb
does not find any displays, it'll return EPROBE_DEFER. This is not
perfect, as with a board with no displays, omapfb will get deferred
forever. Also, if the board has multiple displays, but only some of them
have been probed, omapfb will start and leave the unprobed displays out.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/omapfb/omapfb-main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 808f6af..ff00d1d 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2484,7 +2484,7 @@ static int omapfb_probe(struct platform_device *pdev)
if (fbdev->num_displays = 0) {
dev_err(&pdev->dev, "no displays\n");
- r = -EINVAL;
+ r = -EPROBE_DEFER;
goto cleanup;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 04/10] OMAPDSS: DSI: use platform_driver_register()
2013-04-29 10:22 [PATCH 00/10] OMAPDSS: Basic deferred probe support Tomi Valkeinen
` (2 preceding siblings ...)
2013-04-29 10:22 ` [PATCH 03/10] OMAPFB: defer probe if no displays Tomi Valkeinen
@ 2013-04-29 10:22 ` Tomi Valkeinen
2013-04-29 10:22 ` [PATCH 05/10] OMAPDSS: DSI: Add error handling for dsi_probe_pdata Tomi Valkeinen
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Tomi Valkeinen @ 2013-04-29 10:22 UTC (permalink / raw)
To: linux-fbdev, linux-omap
Cc: Tony Lindgren, grygorii.strashko, chf.fritz, Archit Taneja,
Tomi Valkeinen
Use platform_driver_register() instead of platform_driver_probe() so
that we can support EPROBE_DEFER.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/dsi.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 9b1c5ec..55fc0d4 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -5225,7 +5225,7 @@ static enum omap_channel dsi_get_channel(int module_id)
}
}
-static int __init dsi_init_display(struct omap_dss_device *dssdev)
+static int dsi_init_display(struct omap_dss_device *dssdev)
{
struct platform_device *dsidev dsi_get_dsidev_from_id(dssdev->phy.dsi.module);
@@ -5366,7 +5366,7 @@ static int dsi_get_clocks(struct platform_device *dsidev)
return 0;
}
-static struct omap_dss_device * __init dsi_find_dssdev(struct platform_device *pdev)
+static struct omap_dss_device *dsi_find_dssdev(struct platform_device *pdev)
{
struct omap_dss_board_info *pdata = pdev->dev.platform_data;
struct dsi_data *dsi = dsi_get_dsidrv_data(pdev);
@@ -5398,7 +5398,7 @@ static struct omap_dss_device * __init dsi_find_dssdev(struct platform_device *p
return def_dssdev;
}
-static void __init dsi_probe_pdata(struct platform_device *dsidev)
+static void dsi_probe_pdata(struct platform_device *dsidev)
{
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
struct omap_dss_device *plat_dssdev;
@@ -5436,11 +5436,13 @@ static void __init dsi_probe_pdata(struct platform_device *dsidev)
DSSERR("device %s register failed: %d\n", dssdev->name, r);
omapdss_output_unset_device(&dsi->output);
dss_put_device(dssdev);
- return;
+ return r;
}
+
+ return 0;
}
-static void __init dsi_init_output(struct platform_device *dsidev)
+static void dsi_init_output(struct platform_device *dsidev)
{
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
struct omap_dss_output *out = &dsi->output;
@@ -5465,7 +5467,7 @@ static void __exit dsi_uninit_output(struct platform_device *dsidev)
}
/* DSI1 HW IP initialisation */
-static int __init omap_dsihw_probe(struct platform_device *dsidev)
+static int omap_dsihw_probe(struct platform_device *dsidev)
{
u32 rev;
int r, i;
@@ -5632,6 +5634,7 @@ static const struct dev_pm_ops dsi_pm_ops = {
};
static struct platform_driver omap_dsihw_driver = {
+ .probe = omap_dsihw_probe,
.remove = __exit_p(omap_dsihw_remove),
.driver = {
.name = "omapdss_dsi",
@@ -5642,7 +5645,7 @@ static struct platform_driver omap_dsihw_driver = {
int __init dsi_init_platform_driver(void)
{
- return platform_driver_probe(&omap_dsihw_driver, omap_dsihw_probe);
+ return platform_driver_register(&omap_dsihw_driver);
}
void __exit dsi_uninit_platform_driver(void)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 05/10] OMAPDSS: DSI: Add error handling for dsi_probe_pdata
2013-04-29 10:22 [PATCH 00/10] OMAPDSS: Basic deferred probe support Tomi Valkeinen
` (3 preceding siblings ...)
2013-04-29 10:22 ` [PATCH 04/10] OMAPDSS: DSI: use platform_driver_register() Tomi Valkeinen
@ 2013-04-29 10:22 ` Tomi Valkeinen
2013-04-29 10:22 ` [PATCH 06/10] OMAPDSS: DPI: use platform_driver_register() Tomi Valkeinen
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Tomi Valkeinen @ 2013-04-29 10:22 UTC (permalink / raw)
To: linux-fbdev, linux-omap
Cc: Tony Lindgren, grygorii.strashko, chf.fritz, Archit Taneja,
Tomi Valkeinen
Add proper error handling for dsi_probe_pdata(). This will cause
EPROBE_DEFER to be properly passed upwards, causing the DSI driver to be
probed again later if a resource was missing.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/dsi.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 55fc0d4..a73dedc 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -5398,7 +5398,7 @@ static struct omap_dss_device *dsi_find_dssdev(struct platform_device *pdev)
return def_dssdev;
}
-static void dsi_probe_pdata(struct platform_device *dsidev)
+static int dsi_probe_pdata(struct platform_device *dsidev)
{
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
struct omap_dss_device *plat_dssdev;
@@ -5408,11 +5408,11 @@ static void dsi_probe_pdata(struct platform_device *dsidev)
plat_dssdev = dsi_find_dssdev(dsidev);
if (!plat_dssdev)
- return;
+ return 0;
dssdev = dss_alloc_and_init_device(&dsidev->dev);
if (!dssdev)
- return;
+ return -ENOMEM;
dss_copy_device_pdata(dssdev, plat_dssdev);
@@ -5420,7 +5420,7 @@ static void dsi_probe_pdata(struct platform_device *dsidev)
if (r) {
DSSERR("device %s init failed: %d\n", dssdev->name, r);
dss_put_device(dssdev);
- return;
+ return r;
}
r = omapdss_output_set_device(&dsi->output, dssdev);
@@ -5428,7 +5428,7 @@ static void dsi_probe_pdata(struct platform_device *dsidev)
DSSERR("failed to connect output to new device: %s\n",
dssdev->name);
dss_put_device(dssdev);
- return;
+ return r;
}
r = dss_add_device(dssdev);
@@ -5458,7 +5458,7 @@ static void dsi_init_output(struct platform_device *dsidev)
dss_register_output(out);
}
-static void __exit dsi_uninit_output(struct platform_device *dsidev)
+static void dsi_uninit_output(struct platform_device *dsidev)
{
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
struct omap_dss_output *out = &dsi->output;
@@ -5563,7 +5563,13 @@ static int omap_dsihw_probe(struct platform_device *dsidev)
dsi_init_output(dsidev);
- dsi_probe_pdata(dsidev);
+ r = dsi_probe_pdata(dsidev);
+ if (r) {
+ dsi_runtime_put(dsidev);
+ dsi_uninit_output(dsidev);
+ pm_runtime_disable(&dsidev->dev);
+ return r;
+ }
dsi_runtime_put(dsidev);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 06/10] OMAPDSS: DPI: use platform_driver_register()
2013-04-29 10:22 [PATCH 00/10] OMAPDSS: Basic deferred probe support Tomi Valkeinen
` (4 preceding siblings ...)
2013-04-29 10:22 ` [PATCH 05/10] OMAPDSS: DSI: Add error handling for dsi_probe_pdata Tomi Valkeinen
@ 2013-04-29 10:22 ` Tomi Valkeinen
2013-04-29 10:22 ` [PATCH 07/10] OMAPDSS: DPI: Add error handling for dpi_probe_pdata Tomi Valkeinen
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Tomi Valkeinen @ 2013-04-29 10:22 UTC (permalink / raw)
To: linux-fbdev, linux-omap
Cc: Tony Lindgren, grygorii.strashko, chf.fritz, Archit Taneja,
Tomi Valkeinen
Use platform_driver_register() instead of platform_driver_probe() so
that we can support EPROBE_DEFER.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/dpi.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index e93c4de..2024787 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -520,7 +520,7 @@ void omapdss_dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines)
}
EXPORT_SYMBOL(omapdss_dpi_set_data_lines);
-static int __init dpi_verify_dsi_pll(struct platform_device *dsidev)
+static int dpi_verify_dsi_pll(struct platform_device *dsidev)
{
int r;
@@ -572,7 +572,7 @@ static enum omap_channel dpi_get_channel(void)
}
}
-static int __init dpi_init_display(struct omap_dss_device *dssdev)
+static int dpi_init_display(struct omap_dss_device *dssdev)
{
struct platform_device *dsidev;
@@ -607,7 +607,7 @@ static int __init dpi_init_display(struct omap_dss_device *dssdev)
return 0;
}
-static struct omap_dss_device * __init dpi_find_dssdev(struct platform_device *pdev)
+static struct omap_dss_device *dpi_find_dssdev(struct platform_device *pdev)
{
struct omap_dss_board_info *pdata = pdev->dev.platform_data;
const char *def_disp_name = omapdss_get_default_display_name();
@@ -635,7 +635,7 @@ static struct omap_dss_device * __init dpi_find_dssdev(struct platform_device *p
return def_dssdev;
}
-static void __init dpi_probe_pdata(struct platform_device *dpidev)
+static void dpi_probe_pdata(struct platform_device *dpidev)
{
struct omap_dss_device *plat_dssdev;
struct omap_dss_device *dssdev;
@@ -676,7 +676,7 @@ static void __init dpi_probe_pdata(struct platform_device *dpidev)
}
}
-static void __init dpi_init_output(struct platform_device *pdev)
+static void dpi_init_output(struct platform_device *pdev)
{
struct omap_dss_output *out = &dpi.output;
@@ -696,7 +696,7 @@ static void __exit dpi_uninit_output(struct platform_device *pdev)
dss_unregister_output(out);
}
-static int __init omap_dpi_probe(struct platform_device *pdev)
+static int omap_dpi_probe(struct platform_device *pdev)
{
mutex_init(&dpi.lock);
@@ -717,6 +717,7 @@ static int __exit omap_dpi_remove(struct platform_device *pdev)
}
static struct platform_driver omap_dpi_driver = {
+ .probe = omap_dpi_probe,
.remove = __exit_p(omap_dpi_remove),
.driver = {
.name = "omapdss_dpi",
@@ -726,7 +727,7 @@ static struct platform_driver omap_dpi_driver = {
int __init dpi_init_platform_driver(void)
{
- return platform_driver_probe(&omap_dpi_driver, omap_dpi_probe);
+ return platform_driver_register(&omap_dpi_driver);
}
void __exit dpi_uninit_platform_driver(void)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 07/10] OMAPDSS: DPI: Add error handling for dpi_probe_pdata
2013-04-29 10:22 [PATCH 00/10] OMAPDSS: Basic deferred probe support Tomi Valkeinen
` (5 preceding siblings ...)
2013-04-29 10:22 ` [PATCH 06/10] OMAPDSS: DPI: use platform_driver_register() Tomi Valkeinen
@ 2013-04-29 10:22 ` Tomi Valkeinen
2013-04-29 10:22 ` [PATCH 08/10] OMAPDSS: HDMI: use platform_driver_register() Tomi Valkeinen
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Tomi Valkeinen @ 2013-04-29 10:22 UTC (permalink / raw)
To: linux-fbdev, linux-omap
Cc: Tony Lindgren, grygorii.strashko, chf.fritz, Archit Taneja,
Tomi Valkeinen
Add proper error handling for dpi_probe_pdata(). This will cause
EPROBE_DEFER to be properly passed upwards, causing the DPI driver to be
probed again later if a resource was missing.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/dpi.c | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 2024787..757b57f 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -635,7 +635,7 @@ static struct omap_dss_device *dpi_find_dssdev(struct platform_device *pdev)
return def_dssdev;
}
-static void dpi_probe_pdata(struct platform_device *dpidev)
+static int dpi_probe_pdata(struct platform_device *dpidev)
{
struct omap_dss_device *plat_dssdev;
struct omap_dss_device *dssdev;
@@ -644,11 +644,11 @@ static void dpi_probe_pdata(struct platform_device *dpidev)
plat_dssdev = dpi_find_dssdev(dpidev);
if (!plat_dssdev)
- return;
+ return 0;
dssdev = dss_alloc_and_init_device(&dpidev->dev);
if (!dssdev)
- return;
+ return -ENOMEM;
dss_copy_device_pdata(dssdev, plat_dssdev);
@@ -656,7 +656,7 @@ static void dpi_probe_pdata(struct platform_device *dpidev)
if (r) {
DSSERR("device %s init failed: %d\n", dssdev->name, r);
dss_put_device(dssdev);
- return;
+ return r;
}
r = omapdss_output_set_device(&dpi.output, dssdev);
@@ -664,7 +664,7 @@ static void dpi_probe_pdata(struct platform_device *dpidev)
DSSERR("failed to connect output to new device: %s\n",
dssdev->name);
dss_put_device(dssdev);
- return;
+ return r;
}
r = dss_add_device(dssdev);
@@ -672,8 +672,10 @@ static void dpi_probe_pdata(struct platform_device *dpidev)
DSSERR("device %s register failed: %d\n", dssdev->name, r);
omapdss_output_unset_device(&dpi.output);
dss_put_device(dssdev);
- return;
+ return r;
}
+
+ return 0;
}
static void dpi_init_output(struct platform_device *pdev)
@@ -698,11 +700,17 @@ static void __exit dpi_uninit_output(struct platform_device *pdev)
static int omap_dpi_probe(struct platform_device *pdev)
{
+ int r;
+
mutex_init(&dpi.lock);
dpi_init_output(pdev);
- dpi_probe_pdata(pdev);
+ r = dpi_probe_pdata(pdev);
+ if (r) {
+ dpi_uninit_output(pdev);
+ return r;
+ }
return 0;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 08/10] OMAPDSS: HDMI: use platform_driver_register()
2013-04-29 10:22 [PATCH 00/10] OMAPDSS: Basic deferred probe support Tomi Valkeinen
` (6 preceding siblings ...)
2013-04-29 10:22 ` [PATCH 07/10] OMAPDSS: DPI: Add error handling for dpi_probe_pdata Tomi Valkeinen
@ 2013-04-29 10:22 ` Tomi Valkeinen
2013-04-29 10:22 ` [PATCH 09/10] OMAPDSS: HDMI: Add error handling for hdmi_probe_pdata Tomi Valkeinen
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Tomi Valkeinen @ 2013-04-29 10:22 UTC (permalink / raw)
To: linux-fbdev, linux-omap
Cc: Tony Lindgren, grygorii.strashko, chf.fritz, Archit Taneja,
Tomi Valkeinen
Use platform_driver_register() instead of platform_driver_probe() so
that we can support EPROBE_DEFER.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/hdmi.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 7939309..9aefe60 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -328,7 +328,7 @@ static void hdmi_runtime_put(void)
WARN_ON(r < 0 && r != -ENOSYS);
}
-static int __init hdmi_init_display(struct omap_dss_device *dssdev)
+static int hdmi_init_display(struct omap_dss_device *dssdev)
{
int r;
@@ -954,7 +954,7 @@ int hdmi_audio_config(struct omap_dss_audio *audio)
#endif
-static struct omap_dss_device * __init hdmi_find_dssdev(struct platform_device *pdev)
+static struct omap_dss_device *hdmi_find_dssdev(struct platform_device *pdev)
{
struct omap_dss_board_info *pdata = pdev->dev.platform_data;
const char *def_disp_name = omapdss_get_default_display_name();
@@ -982,7 +982,7 @@ static struct omap_dss_device * __init hdmi_find_dssdev(struct platform_device *
return def_dssdev;
}
-static void __init hdmi_probe_pdata(struct platform_device *pdev)
+static void hdmi_probe_pdata(struct platform_device *pdev)
{
struct omap_dss_device *plat_dssdev;
struct omap_dss_device *dssdev;
@@ -1031,7 +1031,7 @@ static void __init hdmi_probe_pdata(struct platform_device *pdev)
}
}
-static void __init hdmi_init_output(struct platform_device *pdev)
+static void hdmi_init_output(struct platform_device *pdev)
{
struct omap_dss_output *out = &hdmi.output;
@@ -1052,7 +1052,7 @@ static void __exit hdmi_uninit_output(struct platform_device *pdev)
}
/* HDMI HW IP initialisation */
-static int __init omapdss_hdmihw_probe(struct platform_device *pdev)
+static int omapdss_hdmihw_probe(struct platform_device *pdev)
{
struct resource *res;
int r;
@@ -1151,6 +1151,7 @@ static const struct dev_pm_ops hdmi_pm_ops = {
};
static struct platform_driver omapdss_hdmihw_driver = {
+ .probe = omapdss_hdmihw_probe,
.remove = __exit_p(omapdss_hdmihw_remove),
.driver = {
.name = "omapdss_hdmi",
@@ -1161,7 +1162,7 @@ static struct platform_driver omapdss_hdmihw_driver = {
int __init hdmi_init_platform_driver(void)
{
- return platform_driver_probe(&omapdss_hdmihw_driver, omapdss_hdmihw_probe);
+ return platform_driver_register(&omapdss_hdmihw_driver);
}
void __exit hdmi_uninit_platform_driver(void)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 09/10] OMAPDSS: HDMI: Add error handling for hdmi_probe_pdata
2013-04-29 10:22 [PATCH 00/10] OMAPDSS: Basic deferred probe support Tomi Valkeinen
` (7 preceding siblings ...)
2013-04-29 10:22 ` [PATCH 08/10] OMAPDSS: HDMI: use platform_driver_register() Tomi Valkeinen
@ 2013-04-29 10:22 ` Tomi Valkeinen
2013-04-29 10:22 ` [PATCH 10/10] OMAPDSS: TFP410: return EPROBE_DEFER if the i2c adapter not found Tomi Valkeinen
2013-05-01 16:55 ` [PATCH 00/10] OMAPDSS: Basic deferred probe support Tony Lindgren
10 siblings, 0 replies; 12+ messages in thread
From: Tomi Valkeinen @ 2013-04-29 10:22 UTC (permalink / raw)
To: linux-fbdev, linux-omap
Cc: Tony Lindgren, grygorii.strashko, chf.fritz, Archit Taneja,
Tomi Valkeinen
Add proper error handling for hdmi_probe_pdata(). This will cause
EPROBE_DEFER to be properly passed upwards, causing the HDMI driver to be
probed again later if a resource was missing.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/hdmi.c | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 9aefe60..17f4d55 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -982,7 +982,7 @@ static struct omap_dss_device *hdmi_find_dssdev(struct platform_device *pdev)
return def_dssdev;
}
-static void hdmi_probe_pdata(struct platform_device *pdev)
+static int hdmi_probe_pdata(struct platform_device *pdev)
{
struct omap_dss_device *plat_dssdev;
struct omap_dss_device *dssdev;
@@ -992,11 +992,11 @@ static void hdmi_probe_pdata(struct platform_device *pdev)
plat_dssdev = hdmi_find_dssdev(pdev);
if (!plat_dssdev)
- return;
+ return 0;
dssdev = dss_alloc_and_init_device(&pdev->dev);
if (!dssdev)
- return;
+ return -ENOMEM;
dss_copy_device_pdata(dssdev, plat_dssdev);
@@ -1010,7 +1010,7 @@ static void hdmi_probe_pdata(struct platform_device *pdev)
if (r) {
DSSERR("device %s init failed: %d\n", dssdev->name, r);
dss_put_device(dssdev);
- return;
+ return r;
}
r = omapdss_output_set_device(&hdmi.output, dssdev);
@@ -1018,7 +1018,7 @@ static void hdmi_probe_pdata(struct platform_device *pdev)
DSSERR("failed to connect output to new device: %s\n",
dssdev->name);
dss_put_device(dssdev);
- return;
+ return r;
}
r = dss_add_device(dssdev);
@@ -1027,8 +1027,10 @@ static void hdmi_probe_pdata(struct platform_device *pdev)
omapdss_output_unset_device(&hdmi.output);
hdmi_uninit_display(dssdev);
dss_put_device(dssdev);
- return;
+ return r;
}
+
+ return 0;
}
static void hdmi_init_output(struct platform_device *pdev)
@@ -1096,7 +1098,13 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
dss_debugfs_create_file("hdmi", hdmi_dump_regs);
- hdmi_probe_pdata(pdev);
+ r = hdmi_probe_pdata(pdev);
+ if (r) {
+ hdmi_panel_exit();
+ hdmi_uninit_output(pdev);
+ pm_runtime_disable(&pdev->dev);
+ return r;
+ }
return 0;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 10/10] OMAPDSS: TFP410: return EPROBE_DEFER if the i2c adapter not found
2013-04-29 10:22 [PATCH 00/10] OMAPDSS: Basic deferred probe support Tomi Valkeinen
` (8 preceding siblings ...)
2013-04-29 10:22 ` [PATCH 09/10] OMAPDSS: HDMI: Add error handling for hdmi_probe_pdata Tomi Valkeinen
@ 2013-04-29 10:22 ` Tomi Valkeinen
2013-05-01 16:55 ` [PATCH 00/10] OMAPDSS: Basic deferred probe support Tony Lindgren
10 siblings, 0 replies; 12+ messages in thread
From: Tomi Valkeinen @ 2013-04-29 10:22 UTC (permalink / raw)
To: linux-fbdev, linux-omap
Cc: Tony Lindgren, grygorii.strashko, chf.fritz, Archit Taneja,
Tomi Valkeinen
If the I2C adapter needed by the TFP410 device is not available yet,
return EPROBE_DEFER so that the device will get probed again.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/displays/panel-tfp410.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/omap2/displays/panel-tfp410.c b/drivers/video/omap2/displays/panel-tfp410.c
index a1dba868..46039c4 100644
--- a/drivers/video/omap2/displays/panel-tfp410.c
+++ b/drivers/video/omap2/displays/panel-tfp410.c
@@ -135,7 +135,7 @@ static int tfp410_probe(struct omap_dss_device *dssdev)
if (!adapter) {
dev_err(&dssdev->dev, "Failed to get I2C adapter, bus %d\n",
i2c_bus_num);
- return -EINVAL;
+ return -EPROBE_DEFER;
}
ddata->i2c_adapter = adapter;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 00/10] OMAPDSS: Basic deferred probe support
2013-04-29 10:22 [PATCH 00/10] OMAPDSS: Basic deferred probe support Tomi Valkeinen
` (9 preceding siblings ...)
2013-04-29 10:22 ` [PATCH 10/10] OMAPDSS: TFP410: return EPROBE_DEFER if the i2c adapter not found Tomi Valkeinen
@ 2013-05-01 16:55 ` Tony Lindgren
10 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2013-05-01 16:55 UTC (permalink / raw)
To: Tomi Valkeinen
Cc: linux-fbdev, linux-omap, grygorii.strashko, chf.fritz,
Archit Taneja
* Tomi Valkeinen <tomi.valkeinen@ti.com> [130429 03:28]:
> Hi,
>
> omapdss, omapfb and the panel drivers do not currently support deferred probe,
> which is causing the display drivers fail when booting with DT.
>
> This series adds very basic support for deferred probing, which hopefully fixes
> the issues for omap4 panda and sdp boards with the current kernel.
>
> Limitations:
>
> * Deferred probe support for omap_vout and omapdrm is still totally missing.
> * If it so happens that at omapfb probe time one panel has been probed, but
> another has been deferred, only the probed one will be used.
> * Only DPI, DSI and HDMI outputs have been fixed.
> * Some panel drivers may need modifications to support EPROBE_DEFER
>
> Patches based on linux-next, i.e. the latest omapdss stuff.
Great, these fix the issues at least for panda booted with DT.
Regards,
Tony
^ permalink raw reply [flat|nested] 12+ messages in thread