From patchwork Fri Sep 16 09:02:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 9335273 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C97C4601C2 for ; Fri, 16 Sep 2016 09:02:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B647129F00 for ; Fri, 16 Sep 2016 09:02:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A88A229BB7; Fri, 16 Sep 2016 09:02:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63C0929BB7 for ; Fri, 16 Sep 2016 09:02:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752032AbcIPJCg (ORCPT ); Fri, 16 Sep 2016 05:02:36 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:50332 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751257AbcIPJCf (ORCPT ); Fri, 16 Sep 2016 05:02:35 -0400 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0ODL00AP7AG6ZU80@mailout4.samsung.com>; Fri, 16 Sep 2016 18:02:33 +0900 (KST) X-AuditID: cbfee61a-f78ff6d000001462-48-57dbb5289c9b Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 3C.4D.05218.825BBD75; Fri, 16 Sep 2016 18:02:32 +0900 (KST) Received: from AMDC1344.digital.local ([106.116.147.32]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ODL008M0AG0ZD80@mmp2.samsung.com>; Fri, 16 Sep 2016 18:02:32 +0900 (KST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: m.szyprowski@samsung.com, b.zolnierkie@samsung.com, linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki Subject: [PATCH] exynos4-is: add of_platform_populate() call for FIMC-IS child devices Date: Fri, 16 Sep 2016 11:02:16 +0200 Message-id: <1474016536-29766-1-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrGJMWRmVeSWpSXmKPExsVy+t9jQV2NrbfDDab/srbYOGM9q0XPhq2s FjPO72OyWHvkLrvF4TftrA6sHn1bVjF6fN4kF8AUxWWTkpqTWZZapG+XwJXxc88LpoJ5AhUf D9xmb2C8ytvFyMEhIWAi8eMgcxcjJ5ApJnHh3nq2LkYuDiGBWYwSjXNvs0M4vxglXu05D1bF JmAo0Xu0jxHEFhGQl3jSewOsg1mgg1Gi/focdpCEsECExMY1U9lAbBYBVYnF27aBNfMKuEms 2LKKCWKdnMTJY5NZJzByL2BkWMUokVqQXFCclJ5rmJdarlecmFtcmpeul5yfu4kR7PtnUjsY D+5yP8QowMGoxMNrkX47XIg1say4MvcQowQHs5II75tNQCHelMTKqtSi/Pii0pzU4kOM0hws SuK8j/+vCxMSSE8sSc1OTS1ILYLJMnFwSjUwTvKsFUsMfLmeuYzB0qq3zZ736ZmtidtW6X8S 3sJwmLc08o9kJvOE7I2NK1m4vAq0pblP+NpEhdg9W7nCst72fgrXLR8R1rKu68ryL+50zDv3 y7ZBkPl77d1dEqXzvB4va0kIm/anSsDfaerr/jk2LjdYq4TbMzYrrPngyNzu68gkZGlz7qwS S3FGoqEWc1FxIgBVJc5z+QEAAA== Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of relying on the "simple-bus" compatible and the driver core populating FIMC-IS child devices make the fimc-is driver populating its child devices. This prevents issues related to accessing ISP_I2C clock registers with corresponding power domain switched off, which happens after applying some pending Exynos IOMMU driver patches improving runtime PM. Now the I2C_ISP child devices will be instantiated only when required parent device drivers are initialized and ready. Signed-off-by: Marek Szyprowski Signed-off-by: Sylwester Nawrocki --- drivers/media/platform/exynos4-is/fimc-is.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/exynos4-is/fimc-is.c b/drivers/media/platform/exynos4-is/fimc-is.c index 313ab10..518ad34 100644 --- a/drivers/media/platform/exynos4-is/fimc-is.c +++ b/drivers/media/platform/exynos4-is/fimc-is.c @@ -852,13 +852,18 @@ static int fimc_is_probe(struct platform_device *pdev) goto err_pm; vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32)); + + ret = of_platform_populate(dev->of_node, NULL, NULL, dev); + if (ret < 0) + goto err_pm; + /* * Register FIMC-IS V4L2 subdevs to this driver. The video nodes * will be created within the subdev's registered() callback. */ ret = fimc_is_register_subdevs(is); if (ret < 0) - goto err_pm; + goto err_of_dep; ret = fimc_is_debugfs_create(is); if (ret < 0) @@ -877,6 +882,8 @@ err_dfs: fimc_is_debugfs_remove(is); err_sd: fimc_is_unregister_subdevs(is); +err_of_dep: + of_platform_depopulate(dev); err_pm: if (!pm_runtime_enabled(dev)) fimc_is_runtime_suspend(dev); @@ -936,6 +943,7 @@ static int fimc_is_remove(struct platform_device *pdev) if (!pm_runtime_status_suspended(dev)) fimc_is_runtime_suspend(dev); free_irq(is->irq, is); + of_platform_depopulate(dev); fimc_is_unregister_subdevs(is); vb2_dma_contig_clear_max_seg_size(dev); fimc_is_put_clocks(is);