aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2016-09-13 10:39:33 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-22 09:16:17 -0400
commit056c61eb0da4d7181fc7072567dc1931cb0e1cbb (patch)
treec52d0add80a59207770356bff223974ffe2dd5ff
parentcb47b415fd5cda7c9ef8f9d158e59f8af5bcb094 (diff)
[media] exynos4-is: Clear isp-i2c adapter power.ignore_children flag
Since commit 04f59143b571161d25315dd52d7a2ecc022cb71a ("i2c: let I2C masters ignore their children for PM") the power.ignore_children flag is set when registering an I2C adapter. Since I2C transfers are not managed by the fimc-isp-i2c driver its clients use pm_runtime_* calls directly to communicate required power state of the bus controller. However, when the power.ignore_children flag is set that doesn't work, so clear that flag back after registering the adapter. While at it drop pm_runtime_enable() call on the i2c_adapter as it is already done by the I2C subsystem when registering I2C adapter. This patch is meant as a minimal change to fix the regression, eventually the I2C_ISPx clock handling will be moved to the top level fimc-is driver and whole runtime PM code is going to be dropped from the fimc-is-i2c module. Cc: <stable@vger.kernel.org> # 4.7+ Reported-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--drivers/media/platform/exynos4-is/fimc-is-i2c.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/media/platform/exynos4-is/fimc-is-i2c.c b/drivers/media/platform/exynos4-is/fimc-is-i2c.c
index fd888ef447a9..6bba4ca022be 100644
--- a/drivers/media/platform/exynos4-is/fimc-is-i2c.c
+++ b/drivers/media/platform/exynos4-is/fimc-is-i2c.c
@@ -55,23 +55,33 @@ static int fimc_is_i2c_probe(struct platform_device *pdev)
55 i2c_adap->algo = &fimc_is_i2c_algorithm; 55 i2c_adap->algo = &fimc_is_i2c_algorithm;
56 i2c_adap->class = I2C_CLASS_SPD; 56 i2c_adap->class = I2C_CLASS_SPD;
57 57
58 ret = i2c_add_adapter(i2c_adap);
59 if (ret < 0)
60 return ret;
61
62 platform_set_drvdata(pdev, isp_i2c); 58 platform_set_drvdata(pdev, isp_i2c);
63
64 pm_runtime_enable(&pdev->dev); 59 pm_runtime_enable(&pdev->dev);
65 pm_runtime_enable(&i2c_adap->dev);
66 60
61 ret = i2c_add_adapter(i2c_adap);
62 if (ret < 0)
63 goto err_pm_dis;
64 /*
65 * Client drivers of this adapter don't do any I2C transfers as that
66 * is handled by the ISP firmware. But we rely on the runtime PM
67 * state propagation from the clients up to the adapter driver so
68 * clear the ignore_children flags here. PM rutnime calls are not
69 * used in probe() handler of clients of this adapter so there is
70 * no issues with clearing the flag right after registering the I2C
71 * adapter.
72 */
73 pm_suspend_ignore_children(&i2c_adap->dev, false);
67 return 0; 74 return 0;
75
76err_pm_dis:
77 pm_runtime_disable(&pdev->dev);
78 return ret;
68} 79}
69 80
70static int fimc_is_i2c_remove(struct platform_device *pdev) 81static int fimc_is_i2c_remove(struct platform_device *pdev)
71{ 82{
72 struct fimc_is_i2c *isp_i2c = platform_get_drvdata(pdev); 83 struct fimc_is_i2c *isp_i2c = platform_get_drvdata(pdev);
73 84
74 pm_runtime_disable(&isp_i2c->adapter.dev);
75 pm_runtime_disable(&pdev->dev); 85 pm_runtime_disable(&pdev->dev);
76 i2c_del_adapter(&isp_i2c->adapter); 86 i2c_del_adapter(&isp_i2c->adapter);
77 87