spi: spi-s3c64xx: Decrease autosuspend timeout for FIMC-IS
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Thu, 19 Apr 2018 13:37:52 +0000 (15:37 +0200)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 27 Apr 2018 08:25:07 +0000 (10:25 +0200)
This a workaround to avoid errors in SPI transfer when camera devices
are closed and shortly after re-opened.

Change-Id: I239463f6eefe56a644ec63c42daedb455cf91202
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
drivers/spi/spi-s3c64xx.c

index f1efe1e6bee0caa1f5a218a22fa6b7cbeef6d4f3..4fdc592423d7ac8acbea07dd168e0156b7e760ec 100644 (file)
@@ -1204,7 +1204,15 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
                }
        }
 
-       pm_runtime_set_autosuspend_delay(&pdev->dev, AUTOSUSPEND_TIMEOUT);
+       /*
+        * A workaround for FIMC-IS, to make sure the ISP SPI controller is
+        * reconfigured properly in each camera device close/open cycle.
+        */
+       if (sdd->port_conf->quirks & S3C64XX_SPI_QUIRK_SW_RESET)
+               pm_runtime_set_autosuspend_delay(&pdev->dev, 100);
+       else
+               pm_runtime_set_autosuspend_delay(&pdev->dev, AUTOSUSPEND_TIMEOUT);
+
        pm_runtime_use_autosuspend(&pdev->dev);
        pm_runtime_set_active(&pdev->dev);
        pm_runtime_enable(&pdev->dev);