From patchwork Tue Sep 16 11:54:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 4917111 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 7A07B9F2EC for ; Tue, 16 Sep 2014 11:52:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F02F20253 for ; Tue, 16 Sep 2014 11:55:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 61693201DD for ; Tue, 16 Sep 2014 11:55:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754323AbaIPLzA (ORCPT ); Tue, 16 Sep 2014 07:55:00 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:62696 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753206AbaIPLy6 (ORCPT ); Tue, 16 Sep 2014 07:54:58 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NBZ006F0T86GHB0@mailout4.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Tue, 16 Sep 2014 12:57:42 +0100 (BST) X-AuditID: cbfec7f4-b7f156d0000063c7-a1-5418250eee2b Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id BF.28.25543.E0528145; Tue, 16 Sep 2014 12:54:54 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NBZ00CMIT3CL960@eusync2.samsung.com>; Tue, 16 Sep 2014 12:54:54 +0100 (BST) From: Marek Szyprowski To: iommu@lists.linux-foundation.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Marek Szyprowski , linaro-mm-sig@lists.linaro.org, Arnd Bergmann , Shaik Ameer Basha , Cho KyongHo , Joerg Roedel , Thierry Reding , Olof Johansson , Laurent Pinchart , Rob Herring , Will Deacon , David Wodhouse , Inki Dae , Kukjin Kim , Tomasz Figa , Kyungmin Park Subject: [PATCH v2 02/18] arm: exynos: bind power domains earlier, on device creation Date: Tue, 16 Sep 2014 13:54:29 +0200 Message-id: <1410868485-4143-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1410868485-4143-1-git-send-email-m.szyprowski@samsung.com> References: <1410868485-4143-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNLMWRmVeSWpSXmKPExsVy+t/xK7p8qhIhBheP8lr8nXSM3WLiysnM FpPuT2CxWLDf2qJz9gZ2i94FV9kszja9YbfonLiE3eLLlYdMFpseX2O1mHF+H5PF2iN32S1O Xf/MZvGv9yCjxf89O9gtjjzczW6xatcfRovbv/ksXn48weIg7PHk4DwmjzXz1jB6/P41idFj 56y77B6zO2ayemxeoeWxaVUnm8fmJfUet/89ZvaYfGM5o8eVE02sHr3N79g8+rasYvT4vEku gC+KyyYlNSezLLVI3y6BK2PX6nlsBTN4Kl6t2M/YwDiZq4uRk0NCwETi3vzVLBC2mMSFe+vZ uhi5OIQEljJK9K5Yzw7h9DFJ7Nu6lx2kik3AUKLrbRcbiC0ikC/xYu9fsG5mgTcsEvc2GYLY wgLhEodO/mMEsVkEVCW2tE5jArF5BdwlNjW8ZYbYJifx/+UKsDingIfE5LYnYHEhoJqP304x TWDkXcDIsIpRNLU0uaA4KT3XUK84Mbe4NC9dLzk/dxMjJEK+7GBcfMzqEKMAB6MSD2/GP/EQ IdbEsuLK3EOMEhzMSiK8GooSIUK8KYmVValF+fFFpTmpxYcYmTg4pRoYU/S6Oxb6KwXlxU76 x2D++IPW/afhYfcTFTZYVXT9WuR78Q+DxN4dkbwqzY8dXLeXyZ/2P5GsaB3pIB5mcK9wut23 hL+1x/k6Z1ZprbZ695D95/1psnOulAjsnc3+uOjQvx1vDh5d0uDpOn0964Y3X8Ubpydv3rH2 05xXbo+vFkx0/5e4xdzinxJLcUaioRZzUXEiAB67GeBuAgAA Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 fd76e1b5a471..1d368a26528c 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; }