From patchwork Tue Aug 5 10:47:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 4677651 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 645F69F373 for ; Tue, 5 Aug 2014 10:53:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A13AC20166 for ; Tue, 5 Aug 2014 10:53:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BB91020160 for ; Tue, 5 Aug 2014 10:53:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XEcKm-0002AP-0D; Tue, 05 Aug 2014 10:51:12 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XEcIx-0007Zj-7U for linux-arm-kernel@lists.infradead.org; Tue, 05 Aug 2014 10:49:20 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N9T008BJY1DA700@mailout3.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 05 Aug 2014 11:48:49 +0100 (BST) X-AuditID: cbfec7f4-b7f156d0000063c7-9c-53e0b692c947 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 87.0C.25543.296B0E35; Tue, 05 Aug 2014 11:48:50 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N9T0057MY17SE80@eusync3.samsung.com>; Tue, 05 Aug 2014 11:48:50 +0100 (BST) From: Marek Szyprowski To: iommu@lists.linux-foundation.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/29] ARM: Exynos: bind power domains earlier, on device creation Date: Tue, 05 Aug 2014 12:47:30 +0200 Message-id: <1407235677-26324-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1407235677-26324-1-git-send-email-m.szyprowski@samsung.com> References: <1407235677-26324-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBLMWRmVeSWpSXmKPExsVy+t/xq7qTtj0INtj6R83i76Rj7BbNi9ez WUy6P4HFYsF+a4vO2RvYLXoXXGWzONv0ht2ic+ISdosvVx4yWWx6fI3V4vKuOWwWM87vY7JY e+Quu8Wp65/ZLP71HmS0OHP6EqvF/z072C0Ov2lntTjycDe7xapdfxgtbv/mcxD1eHJwHpPH 71+TGD12zrrL7jG7Yyarx6ZVnWwe++euYffYvKTe4/a/x8wek28sZ/S4cqKJ1aO3+R2bx5ar 7SwefVtWMXp83iQXwBfFZZOSmpNZllqkb5fAlfFnxX2mgj6eipdrfzE2MHZydTFyckgImEi8 2HiMDcIWk7hwbz2QzcUhJLCUUWLOvhtQTh+TxLJnH5lAqtgEDCW63naBJUQEehkl+pt+MIE4 zALrWCX2915nAakSFgiRmLewEWwui4CqxL2l01lBbF4BD4m+Q/NYIfbJSfx/uQJsKqeAp8Th mwfA4kJANT83rGGfwMi7gJFhFaNoamlyQXFSeq6hXnFibnFpXrpecn7uJkZI7HzZwbj4mNUh RgEORiUeXoPTd4OFWBPLiitzDzFKcDArifBKrHkQLMSbklhZlVqUH19UmpNafIiRiYNTqoHR cYF+5PZTlt3G+/r0H7hFhkQ3l+tcbL8W7tky+1m/bY5a60+9aTM9cy7J+j/y3vZq9fZbaSlh C4X1Py+paXJ5N1dDKHP5pj2zqrarl2cbKi41nO/34/mfq+pdV56Zr3syxfTbn7plERd/8wUs Sv+/ceaNmT8+X538qHDK37mapyP86wM0n970VmIpzkg01GIuKk4EAMYdoxF7AgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140805_034919_654319_9288442C X-CRM114-Status: GOOD ( 11.59 ) X-Spam-Score: -5.7 (-----) Cc: Rob Herring , Thierry Reding , Shaik Ameer Basha , Arnd Bergmann , Inki Dae , Greg Kroah-Hartman , Joerg Roedel , "Rafael J. Wysocki" , Tomasz Figa , linaro-mm-sig@lists.linaro.org, Kyungmin Park , Kukjin Kim , Laurent Pinchart , Sylwester Nawrocki , Olof Johansson , Cho KyongHo , Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patches change initialization time of power domain driver from client device driver bind to device creation. This lets other core drivers to register power domain notifiers before client driver is bound. Signed-off-by: Marek Szyprowski --- arch/arm/mach-exynos/pm_domains.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c index fd76e1b..1d368a2 100644 --- a/arch/arm/mach-exynos/pm_domains.c +++ b/arch/arm/mach-exynos/pm_domains.c @@ -159,13 +159,13 @@ static int exynos_pm_notifier_call(struct notifier_block *nb, struct device *dev = data; switch (event) { - case BUS_NOTIFY_BIND_DRIVER: + case BUS_NOTIFY_ADD_DEVICE: if (dev->of_node) exynos_read_domain_from_dt(dev); break; - case BUS_NOTIFY_UNBOUND_DRIVER: + case BUS_NOTIFY_DEL_DEVICE: exynos_remove_device_from_domain(dev); break; @@ -177,6 +177,13 @@ static struct notifier_block platform_nb = { .notifier_call = exynos_pm_notifier_call, }; +static int exynos_pm_domain_add(struct device *dev, void *priv) +{ + if (dev->of_node) + exynos_read_domain_from_dt(dev); + return 0; +} + static __init int exynos4_pm_init_power_domain(void) { struct platform_device *pdev; @@ -236,6 +243,7 @@ no_clk: } bus_register_notifier(&platform_bus_type, &platform_nb); + bus_for_each_dev(&platform_bus_type, NULL, NULL, exynos_pm_domain_add); return 0; }