aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/exynos
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2012-05-09 01:33:28 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2012-05-13 09:08:22 -0400
commitb89e1399bab8bf72762948d251e69df50a9d6d85 (patch)
tree2a8cb3ec8bb0cffe49813367b9941c17556e4b3f /drivers/video/exynos
parent3bfc9b835a8729f8a44de56930c1652293cfbf57 (diff)
video: exynos mipi dsi: Avoid races in probe()
Make sure all resources are initialized before interrupt handler is registered. Pass full platform device name to request_irq() so it can be distinguished which device has requested an interrupt in cases there are multiple instances in the system. Also enable voltage regulators regardless of they have been enabled by bootloader or not, to make sure other drivers using same regulators don't disable them unexpectedly. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Donghwa Lee <dh09.lee@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/exynos')
-rw-r--r--drivers/video/exynos/exynos_mipi_dsi.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/video/exynos/exynos_mipi_dsi.c b/drivers/video/exynos/exynos_mipi_dsi.c
index ed0bacc435e3..6c1f5c314a42 100644
--- a/drivers/video/exynos/exynos_mipi_dsi.c
+++ b/drivers/video/exynos/exynos_mipi_dsi.c
@@ -415,27 +415,30 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev)
415 goto err_platform_get_irq; 415 goto err_platform_get_irq;
416 } 416 }
417 417
418 init_completion(&dsim_wr_comp);
419 init_completion(&dsim_rd_comp);
420 platform_set_drvdata(pdev, dsim);
421
418 ret = request_irq(dsim->irq, exynos_mipi_dsi_interrupt_handler, 422 ret = request_irq(dsim->irq, exynos_mipi_dsi_interrupt_handler,
419 IRQF_SHARED, pdev->name, dsim); 423 IRQF_SHARED, dev_name(&pdev->dev), dsim);
420 if (ret != 0) { 424 if (ret != 0) {
421 dev_err(&pdev->dev, "failed to request dsim irq\n"); 425 dev_err(&pdev->dev, "failed to request dsim irq\n");
422 ret = -EINVAL; 426 ret = -EINVAL;
423 goto err_bind; 427 goto err_bind;
424 } 428 }
425 429
426 init_completion(&dsim_wr_comp); 430 /* enable interrupts */
427 init_completion(&dsim_rd_comp);
428
429 /* enable interrupt */
430 exynos_mipi_dsi_init_interrupt(dsim); 431 exynos_mipi_dsi_init_interrupt(dsim);
431 432
432 /* initialize mipi-dsi client(lcd panel). */ 433 /* initialize mipi-dsi client(lcd panel). */
433 if (dsim_ddi->dsim_lcd_drv && dsim_ddi->dsim_lcd_drv->probe) 434 if (dsim_ddi->dsim_lcd_drv && dsim_ddi->dsim_lcd_drv->probe)
434 dsim_ddi->dsim_lcd_drv->probe(dsim_ddi->dsim_lcd_dev); 435 dsim_ddi->dsim_lcd_drv->probe(dsim_ddi->dsim_lcd_dev);
435 436
436 /* in case that mipi got enabled at bootloader. */ 437 /* in case mipi-dsi has been enabled by bootloader */
437 if (dsim_pd->enabled) 438 if (dsim_pd->enabled) {
438 goto out; 439 exynos_mipi_regulator_enable(dsim);
440 goto done;
441 }
439 442
440 /* lcd panel power on. */ 443 /* lcd panel power on. */
441 if (dsim_ddi->dsim_lcd_drv && dsim_ddi->dsim_lcd_drv->power_on) 444 if (dsim_ddi->dsim_lcd_drv && dsim_ddi->dsim_lcd_drv->power_on)
@@ -455,12 +458,11 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev)
455 458
456 dsim->suspended = false; 459 dsim->suspended = false;
457 460
458out: 461done:
459 platform_set_drvdata(pdev, dsim); 462 platform_set_drvdata(pdev, dsim);
460 463
461 dev_dbg(&pdev->dev, "mipi-dsi driver(%s mode) has been probed.\n", 464 dev_dbg(&pdev->dev, "%s() completed sucessfuly (%s mode)\n", __func__,
462 (dsim_config->e_interface == DSIM_COMMAND) ? 465 dsim_config->e_interface == DSIM_COMMAND ? "CPU" : "RGB");
463 "CPU" : "RGB");
464 466
465 return 0; 467 return 0;
466 468