From 989c79a8c9c609b0051ceb19cddf6e06442d33c2 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 18 Apr 2013 12:16:39 +0300 Subject: OMAPDSS: DPI: fix compilation if DSI not compiled in Commit 100c826235793345efe06b3558cc9d36166b1e26 (OMAPDSS: DPI: use new clock calculation code) breaks dpi.c compilation if DSI is not enabled in the kernel configuration. Fix compilation by adding dummy inline functions for the ones that dpi.c references. The functions will never be called, as dpi.c knows that there is no DSI device available. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dss.h | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index faaf35857b0e..84758936429d 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -277,6 +277,12 @@ int sdi_init_platform_driver(void) __init; void sdi_uninit_platform_driver(void) __exit; /* DSI */ + +typedef bool (*dsi_pll_calc_func)(int regn, int regm, unsigned long fint, + unsigned long pll, void *data); +typedef bool (*dsi_hsdiv_calc_func)(int regm_dispc, unsigned long dispc, + void *data); + #ifdef CONFIG_OMAP2_DSS_DSI struct dentry; @@ -295,10 +301,6 @@ u8 dsi_get_pixel_size(enum omap_dss_dsi_pixel_format fmt); unsigned long dsi_get_pll_clkin(struct platform_device *dsidev); -typedef bool (*dsi_pll_calc_func)(int regn, int regm, unsigned long fint, - unsigned long pll, void *data); -typedef bool (*dsi_hsdiv_calc_func)(int regm_dispc, unsigned long dispc, - void *data); bool dsi_hsdiv_calc(struct platform_device *dsidev, unsigned long pll, unsigned long out_min, dsi_hsdiv_calc_func func, void *data); bool dsi_pll_calc(struct platform_device *dsidev, unsigned long clkin, @@ -358,6 +360,27 @@ static inline struct platform_device *dsi_get_dsidev_from_id(int module) { return NULL; } + +static inline unsigned long dsi_get_pll_clkin(struct platform_device *dsidev) +{ + return 0; +} + +static inline bool dsi_hsdiv_calc(struct platform_device *dsidev, + unsigned long pll, unsigned long out_min, + dsi_hsdiv_calc_func func, void *data) +{ + return false; +} + +static inline bool dsi_pll_calc(struct platform_device *dsidev, + unsigned long clkin, + unsigned long pll_min, unsigned long pll_max, + dsi_pll_calc_func func, void *data) +{ + return false; +} + #endif /* DPI */ -- cgit v1.2.3 From ca96e201ffe55dd240940518633b3599071c74e8 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 26 Apr 2013 13:35:50 +0300 Subject: OMAPDSS: Makefile: move omapfb after panels 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 --- 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 5ea7cb9aed17..296e5c5281c5 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/ -- cgit v1.2.3 From af56fe3ca6b034685d8a7da4088637fc4fb1a6e7 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 26 Apr 2013 13:40:25 +0300 Subject: OMAPFB: use module_platform_driver() Instead of using platform_driver_probe(), use module_platform_driver() so that we can support deferred probing. Signed-off-by: Tomi Valkeinen --- 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 f38348ea3375..808f6af83b15 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 "); MODULE_DESCRIPTION("OMAP2/3 Framebuffer"); -- cgit v1.2.3 From dfbc32316c6991010328c21e6046b05bac57eb84 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 26 Apr 2013 13:40:36 +0300 Subject: OMAPFB: defer probe if no displays 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 --- 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 808f6af83b15..ff00d1d8bd26 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; } -- cgit v1.2.3 From 94cf394b15f94090c8ebd874b29725d35eb54663 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 26 Apr 2013 14:27:44 +0300 Subject: OMAPDSS: DPI: use platform_driver_register() Use platform_driver_register() instead of platform_driver_probe() so that we can support EPROBE_DEFER. Signed-off-by: Tomi Valkeinen --- 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 e93c4debea7f..202478795c1b 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) -- cgit v1.2.3 From d23b3357a3beab8ab0f3248f8b4b04dee1fb142b Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 2 May 2013 11:56:35 +0300 Subject: OMAPDSS: SDI: use platform_driver_register() Use platform_driver_register() instead of platform_driver_probe() so that we can support EPROBE_DEFER. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/sdi.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c index e6baee2e84f8..af7d6aefe423 100644 --- a/drivers/video/omap2/dss/sdi.c +++ b/drivers/video/omap2/dss/sdi.c @@ -248,7 +248,7 @@ void omapdss_sdi_set_datapairs(struct omap_dss_device *dssdev, int datapairs) } EXPORT_SYMBOL(omapdss_sdi_set_datapairs); -static int __init sdi_init_display(struct omap_dss_device *dssdev) +static int sdi_init_display(struct omap_dss_device *dssdev) { DSSDBG("SDI init\n"); @@ -268,7 +268,7 @@ static int __init sdi_init_display(struct omap_dss_device *dssdev) return 0; } -static struct omap_dss_device * __init sdi_find_dssdev(struct platform_device *pdev) +static struct omap_dss_device *sdi_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(); @@ -296,7 +296,7 @@ static struct omap_dss_device * __init sdi_find_dssdev(struct platform_device *p return def_dssdev; } -static void __init sdi_probe_pdata(struct platform_device *sdidev) +static void sdi_probe_pdata(struct platform_device *sdidev) { struct omap_dss_device *plat_dssdev; struct omap_dss_device *dssdev; @@ -337,7 +337,7 @@ static void __init sdi_probe_pdata(struct platform_device *sdidev) } } -static void __init sdi_init_output(struct platform_device *pdev) +static void sdi_init_output(struct platform_device *pdev) { struct omap_dss_output *out = &sdi.output; @@ -357,7 +357,7 @@ static void __exit sdi_uninit_output(struct platform_device *pdev) dss_unregister_output(out); } -static int __init omap_sdi_probe(struct platform_device *pdev) +static int omap_sdi_probe(struct platform_device *pdev) { sdi_init_output(pdev); @@ -376,6 +376,7 @@ static int __exit omap_sdi_remove(struct platform_device *pdev) } static struct platform_driver omap_sdi_driver = { + .probe = omap_sdi_probe, .remove = __exit_p(omap_sdi_remove), .driver = { .name = "omapdss_sdi", @@ -385,7 +386,7 @@ static struct platform_driver omap_sdi_driver = { int __init sdi_init_platform_driver(void) { - return platform_driver_probe(&omap_sdi_driver, omap_sdi_probe); + return platform_driver_register(&omap_sdi_driver); } void __exit sdi_uninit_platform_driver(void) -- cgit v1.2.3 From ee4a24e2fdfa6dd141cf4a02f8112935e361396b Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 26 Apr 2013 13:47:06 +0300 Subject: OMAPDSS: DSI: use platform_driver_register() Use platform_driver_register() instead of platform_driver_probe() so that we can support EPROBE_DEFER. Signed-off-by: Tomi Valkeinen --- 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 9b1c5ecee115..55fc0d48b5ed 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) -- cgit v1.2.3 From 9abf7de1b1b173eebeae9ed07fb7a30fb2788681 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 2 May 2013 12:11:56 +0300 Subject: OMAPDSS: RFBI: use platform_driver_register() Use platform_driver_register() instead of platform_driver_probe() so that we can support EPROBE_DEFER. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/rfbi.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c index 1a691bb27547..e55e411054d7 100644 --- a/drivers/video/omap2/dss/rfbi.c +++ b/drivers/video/omap2/dss/rfbi.c @@ -943,13 +943,13 @@ void omapdss_rfbi_display_disable(struct omap_dss_device *dssdev) } EXPORT_SYMBOL(omapdss_rfbi_display_disable); -static int __init rfbi_init_display(struct omap_dss_device *dssdev) +static int rfbi_init_display(struct omap_dss_device *dssdev) { rfbi.dssdev[dssdev->phy.rfbi.channel] = dssdev; return 0; } -static struct omap_dss_device * __init rfbi_find_dssdev(struct platform_device *pdev) +static struct omap_dss_device *rfbi_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(); @@ -977,7 +977,7 @@ static struct omap_dss_device * __init rfbi_find_dssdev(struct platform_device * return def_dssdev; } -static void __init rfbi_probe_pdata(struct platform_device *rfbidev) +static void rfbi_probe_pdata(struct platform_device *rfbidev) { struct omap_dss_device *plat_dssdev; struct omap_dss_device *dssdev; @@ -1018,7 +1018,7 @@ static void __init rfbi_probe_pdata(struct platform_device *rfbidev) } } -static void __init rfbi_init_output(struct platform_device *pdev) +static void rfbi_init_output(struct platform_device *pdev) { struct omap_dss_output *out = &rfbi.output; @@ -1039,7 +1039,7 @@ static void __exit rfbi_uninit_output(struct platform_device *pdev) } /* RFBI HW IP initialisation */ -static int __init omap_rfbihw_probe(struct platform_device *pdev) +static int omap_rfbihw_probe(struct platform_device *pdev) { u32 rev; struct resource *rfbi_mem; @@ -1135,6 +1135,7 @@ static const struct dev_pm_ops rfbi_pm_ops = { }; static struct platform_driver omap_rfbihw_driver = { + .probe = omap_rfbihw_probe, .remove = __exit_p(omap_rfbihw_remove), .driver = { .name = "omapdss_rfbi", @@ -1145,7 +1146,7 @@ static struct platform_driver omap_rfbihw_driver = { int __init rfbi_init_platform_driver(void) { - return platform_driver_probe(&omap_rfbihw_driver, omap_rfbihw_probe); + return platform_driver_register(&omap_rfbihw_driver); } void __exit rfbi_uninit_platform_driver(void) -- cgit v1.2.3 From 17ae4e8c5a604fb0812b727e646d31735bd4d396 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 26 Apr 2013 14:48:43 +0300 Subject: OMAPDSS: HDMI: use platform_driver_register() Use platform_driver_register() instead of platform_driver_probe() so that we can support EPROBE_DEFER. Signed-off-by: Tomi Valkeinen --- 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 79393099d505..9aefe60800f2 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) -- cgit v1.2.3 From b5a99c2626a4ace340a535775342e2a75fbe60e7 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 2 May 2013 12:18:20 +0300 Subject: OMAPDSS: VENC: use platform_driver_register() Use platform_driver_register() instead of platform_driver_probe() so that we can support EPROBE_DEFER. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/venc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c index 17764d136398..62ba53b2e574 100644 --- a/drivers/video/omap2/dss/venc.c +++ b/drivers/video/omap2/dss/venc.c @@ -633,7 +633,7 @@ void omapdss_venc_invert_vid_out_polarity(struct omap_dss_device *dssdev, mutex_unlock(&venc.venc_lock); } -static int __init venc_init_display(struct omap_dss_device *dssdev) +static int venc_init_display(struct omap_dss_device *dssdev) { DSSDBG("init_display\n"); @@ -726,7 +726,7 @@ static int venc_get_clocks(struct platform_device *pdev) return 0; } -static struct omap_dss_device * __init venc_find_dssdev(struct platform_device *pdev) +static struct omap_dss_device *venc_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(); @@ -754,7 +754,7 @@ static struct omap_dss_device * __init venc_find_dssdev(struct platform_device * return def_dssdev; } -static void __init venc_probe_pdata(struct platform_device *vencdev) +static void venc_probe_pdata(struct platform_device *vencdev) { struct omap_dss_device *plat_dssdev; struct omap_dss_device *dssdev; @@ -795,7 +795,7 @@ static void __init venc_probe_pdata(struct platform_device *vencdev) } } -static void __init venc_init_output(struct platform_device *pdev) +static void venc_init_output(struct platform_device *pdev) { struct omap_dss_output *out = &venc.output; @@ -816,7 +816,7 @@ static void __exit venc_uninit_output(struct platform_device *pdev) } /* VENC HW IP initialisation */ -static int __init omap_venchw_probe(struct platform_device *pdev) +static int omap_venchw_probe(struct platform_device *pdev) { u8 rev_id; struct resource *venc_mem; @@ -922,6 +922,7 @@ static const struct dev_pm_ops venc_pm_ops = { }; static struct platform_driver omap_venchw_driver = { + .probe = omap_venchw_probe, .remove = __exit_p(omap_venchw_remove), .driver = { .name = "omapdss_venc", @@ -932,7 +933,7 @@ static struct platform_driver omap_venchw_driver = { int __init venc_init_platform_driver(void) { - return platform_driver_probe(&omap_venchw_driver, omap_venchw_probe); + return platform_driver_register(&omap_venchw_driver); } void __exit venc_uninit_platform_driver(void) -- cgit v1.2.3 From bcb734d2a1ef1b40fd7600b0f4f9225484572c67 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 26 Apr 2013 14:33:05 +0300 Subject: OMAPDSS: DPI: Add error handling for dpi_probe_pdata 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 --- 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 202478795c1b..757b57f7275a 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; } -- cgit v1.2.3 From e1086278e9ab7c75edb6a9c0cdbdc452be25eb8d Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 2 May 2013 12:10:37 +0300 Subject: OMAPDSS: SDI: Add error handling for sdi_probe_pdata Add proper error handling for sdi_probe_pdata(). This will cause EPROBE_DEFER to be properly passed upwards, causing the SDI driver to be probed again later if a resource was missing. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/sdi.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c index af7d6aefe423..0bcd30272f69 100644 --- a/drivers/video/omap2/dss/sdi.c +++ b/drivers/video/omap2/dss/sdi.c @@ -296,7 +296,7 @@ static struct omap_dss_device *sdi_find_dssdev(struct platform_device *pdev) return def_dssdev; } -static void sdi_probe_pdata(struct platform_device *sdidev) +static int sdi_probe_pdata(struct platform_device *sdidev) { struct omap_dss_device *plat_dssdev; struct omap_dss_device *dssdev; @@ -305,11 +305,11 @@ static void sdi_probe_pdata(struct platform_device *sdidev) plat_dssdev = sdi_find_dssdev(sdidev); if (!plat_dssdev) - return; + return 0; dssdev = dss_alloc_and_init_device(&sdidev->dev); if (!dssdev) - return; + return -ENOMEM; dss_copy_device_pdata(dssdev, plat_dssdev); @@ -317,7 +317,7 @@ static void sdi_probe_pdata(struct platform_device *sdidev) if (r) { DSSERR("device %s init failed: %d\n", dssdev->name, r); dss_put_device(dssdev); - return; + return r; } r = omapdss_output_set_device(&sdi.output, dssdev); @@ -325,7 +325,7 @@ static void sdi_probe_pdata(struct platform_device *sdidev) DSSERR("failed to connect output to new device: %s\n", dssdev->name); dss_put_device(dssdev); - return; + return r; } r = dss_add_device(dssdev); @@ -333,8 +333,10 @@ static void sdi_probe_pdata(struct platform_device *sdidev) DSSERR("device %s register failed: %d\n", dssdev->name, r); omapdss_output_unset_device(&sdi.output); dss_put_device(dssdev); - return; + return r; } + + return 0; } static void sdi_init_output(struct platform_device *pdev) @@ -359,9 +361,15 @@ static void __exit sdi_uninit_output(struct platform_device *pdev) static int omap_sdi_probe(struct platform_device *pdev) { + int r; + sdi_init_output(pdev); - sdi_probe_pdata(pdev); + r = sdi_probe_pdata(pdev); + if (r) { + sdi_uninit_output(pdev); + return r; + } return 0; } -- cgit v1.2.3 From d1890a680e439e1b284faca6e8eaa330c599f99f Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 26 Apr 2013 13:47:41 +0300 Subject: OMAPDSS: DSI: Add error handling for dsi_probe_pdata 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 --- 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 55fc0d48b5ed..a73dedc33101 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); -- cgit v1.2.3 From f60a32fd9e3461dc33d44cca74db18fa09a0fa47 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 2 May 2013 12:15:31 +0300 Subject: OMAPDSS: RFBI: Add error handling for rfbi_probe_pdata Add proper error handling for rfbi_probe_pdata(). This will cause EPROBE_DEFER to be properly passed upwards, causing the RFBI driver to be probed again later if a resource was missing. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/rfbi.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c index e55e411054d7..1a17dd1447dc 100644 --- a/drivers/video/omap2/dss/rfbi.c +++ b/drivers/video/omap2/dss/rfbi.c @@ -977,7 +977,7 @@ static struct omap_dss_device *rfbi_find_dssdev(struct platform_device *pdev) return def_dssdev; } -static void rfbi_probe_pdata(struct platform_device *rfbidev) +static int rfbi_probe_pdata(struct platform_device *rfbidev) { struct omap_dss_device *plat_dssdev; struct omap_dss_device *dssdev; @@ -986,11 +986,11 @@ static void rfbi_probe_pdata(struct platform_device *rfbidev) plat_dssdev = rfbi_find_dssdev(rfbidev); if (!plat_dssdev) - return; + return 0; dssdev = dss_alloc_and_init_device(&rfbidev->dev); if (!dssdev) - return; + return -ENOMEM; dss_copy_device_pdata(dssdev, plat_dssdev); @@ -998,7 +998,7 @@ static void rfbi_probe_pdata(struct platform_device *rfbidev) if (r) { DSSERR("device %s init failed: %d\n", dssdev->name, r); dss_put_device(dssdev); - return; + return r; } r = omapdss_output_set_device(&rfbi.output, dssdev); @@ -1006,7 +1006,7 @@ static void rfbi_probe_pdata(struct platform_device *rfbidev) DSSERR("failed to connect output to new device: %s\n", dssdev->name); dss_put_device(dssdev); - return; + return r; } r = dss_add_device(dssdev); @@ -1014,8 +1014,10 @@ static void rfbi_probe_pdata(struct platform_device *rfbidev) DSSERR("device %s register failed: %d\n", dssdev->name, r); omapdss_output_unset_device(&rfbi.output); dss_put_device(dssdev); - return; + return r; } + + return 0; } static void rfbi_init_output(struct platform_device *pdev) @@ -1091,7 +1093,12 @@ static int omap_rfbihw_probe(struct platform_device *pdev) rfbi_init_output(pdev); - rfbi_probe_pdata(pdev); + r = rfbi_probe_pdata(pdev); + if (r) { + rfbi_uninit_output(pdev); + pm_runtime_disable(&pdev->dev); + return r; + } return 0; -- cgit v1.2.3 From c0980297ff8f8184778258a7f544525e483fbd85 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 26 Apr 2013 14:52:23 +0300 Subject: OMAPDSS: HDMI: Add error handling for hdmi_probe_pdata 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 --- 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 9aefe60800f2..17f4d55c621c 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; } -- cgit v1.2.3 From 6aa66f5c01f1f0063b14bd529b24723fb8e58075 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 2 May 2013 12:19:54 +0300 Subject: OMAPDSS: VENC: Add error handling for venc_probe_pdata Add proper error handling for venc_probe_pdata(). This will cause EPROBE_DEFER to be properly passed upwards, causing the VENC driver to be probed again later if a resource was missing. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/venc.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c index 62ba53b2e574..74fdb3ee209e 100644 --- a/drivers/video/omap2/dss/venc.c +++ b/drivers/video/omap2/dss/venc.c @@ -754,7 +754,7 @@ static struct omap_dss_device *venc_find_dssdev(struct platform_device *pdev) return def_dssdev; } -static void venc_probe_pdata(struct platform_device *vencdev) +static int venc_probe_pdata(struct platform_device *vencdev) { struct omap_dss_device *plat_dssdev; struct omap_dss_device *dssdev; @@ -763,11 +763,11 @@ static void venc_probe_pdata(struct platform_device *vencdev) plat_dssdev = venc_find_dssdev(vencdev); if (!plat_dssdev) - return; + return 0; dssdev = dss_alloc_and_init_device(&vencdev->dev); if (!dssdev) - return; + return -ENOMEM; dss_copy_device_pdata(dssdev, plat_dssdev); @@ -775,7 +775,7 @@ static void venc_probe_pdata(struct platform_device *vencdev) if (r) { DSSERR("device %s init failed: %d\n", dssdev->name, r); dss_put_device(dssdev); - return; + return r; } r = omapdss_output_set_device(&venc.output, dssdev); @@ -783,7 +783,7 @@ static void venc_probe_pdata(struct platform_device *vencdev) DSSERR("failed to connect output to new device: %s\n", dssdev->name); dss_put_device(dssdev); - return; + return r; } r = dss_add_device(dssdev); @@ -791,8 +791,10 @@ static void venc_probe_pdata(struct platform_device *vencdev) DSSERR("device %s register failed: %d\n", dssdev->name, r); omapdss_output_unset_device(&venc.output); dss_put_device(dssdev); - return; + return r; } + + return 0; } static void venc_init_output(struct platform_device *pdev) @@ -864,7 +866,13 @@ static int omap_venchw_probe(struct platform_device *pdev) venc_init_output(pdev); - venc_probe_pdata(pdev); + r = venc_probe_pdata(pdev); + if (r) { + venc_panel_exit(); + venc_uninit_output(pdev); + pm_runtime_disable(&pdev->dev); + return r; + } return 0; -- cgit v1.2.3 From bca3913034ef99c9cc028d054273a3b271ed62b9 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 29 Apr 2013 13:08:32 +0300 Subject: OMAPDSS: TFP410: return EPROBE_DEFER if the i2c adapter not found 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 --- 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 a1dba868cef1..46039c4bf1ed 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; -- cgit v1.2.3