From patchwork Wed May 30 04:47:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 9020 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B033F23E58 for ; Wed, 30 May 2012 04:48:07 +0000 (UTC) Received: from mail-ob0-f180.google.com (mail-ob0-f180.google.com [209.85.214.180]) by fiordland.canonical.com (Postfix) with ESMTP id 592A8A18073 for ; Wed, 30 May 2012 04:48:07 +0000 (UTC) Received: by obbun3 with SMTP id un3so10000826obb.11 for ; Tue, 29 May 2012 21:48:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=PxNDmAsbwF2PN5Qkr6JZQ3aQx+sKzKMyBcA3jzJV6t4=; b=f7SPJAbQVWo94c7LANK7SiaAoS0LDXqnc16tXkxe+B3NbFXTPUZ5ozagIaPMMJSF4f Rntu2wYDquEdnifyEFxXoWvvoOX1hGB5yRJlCs8uY6H2OTvZWAQmaFGt3gUgDXW0pROz EhtSD9fhsz2Pkea79TQlDzw9PQcprC/FTo35jUaOeO9K3WobQdNHLyeyd2heAPTrCRN0 j6fjbaGZPS3uHXBMX5h142UBxLO0cxrVPEqQuAKSiSdzutkO8rJzU4VJ+qmWRMjS32B6 qJImmLsrRcQRkJtYkDZJQy7n4JWbHKyf7NL74cKFdHjCb+RJkLB7i9hzAx7wOmN06ctX /Dew== Received: by 10.50.195.234 with SMTP id ih10mr9537272igc.0.1338353286587; Tue, 29 May 2012 21:48:06 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp170226ibb; Tue, 29 May 2012 21:48:06 -0700 (PDT) Received: by 10.68.213.200 with SMTP id nu8mr35222035pbc.133.1338353285829; Tue, 29 May 2012 21:48:05 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id kg6si23391939pbc.215.2012.05.29.21.48.05 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 29 May 2012 21:48:05 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-pb0-f50.google.com with SMTP id rr4so7848714pbb.37 for ; Tue, 29 May 2012 21:48:05 -0700 (PDT) Received: by 10.68.228.170 with SMTP id sj10mr45093052pbc.106.1338353285521; Tue, 29 May 2012 21:48:05 -0700 (PDT) Received: from localhost.localdomain ([118.143.64.134]) by mx.google.com with ESMTPS id kd6sm25122557pbc.24.2012.05.29.21.48.02 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 29 May 2012 21:48:04 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, arnd@arndb.de, linus.walleij@stericsson.com, grant.likely@secretlab.ca, cjb@laptop.org, broonie@opensource.wolfsonmicro.com, sameo@linux.intel.com Cc: Lee Jones Subject: [PATCH 02/22] ARM: ux500: New DT:ed u8500_init_devices for one-by-one device enablement Date: Wed, 30 May 2012 12:47:20 +0800 Message-Id: <1338353260-10097-3-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1338353260-10097-1-git-send-email-lee.jones@linaro.org> References: <1338353260-10097-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQkwrsBcPonHFESEQSEzI3reZo8Uuzd2jfUr5C+L+pIn95E4bab845iuvpPhjH+DOIjFFaEV During Device Tree enablement it is necessary to remove _add_ calls one at at time, as and when particular devices are DT enabled. This patch provides a temporary solution. Once the new *of_init_devices function has been fully unpopulated it will be removed again. Acked-by: Linus Walleij Signed-off-by: Arnd Bergmann Signed-off-by: Lee Jones --- arch/arm/mach-ux500/board-mop500.c | 2 +- arch/arm/mach-ux500/board-mop500.h | 3 +++ arch/arm/mach-ux500/cpu-db8500.c | 22 ++++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index d4132f5..ff04010 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -859,7 +859,7 @@ static void __init u8500_init_machine(void) else if (of_machine_is_compatible("st-ericsson,hrefv60+")) hrefv60_pinmaps_init(); - parent = u8500_init_devices(); + parent = u8500_of_init_devices(); for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++) mop500_platform_devs[i]->dev.parent = parent; diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h index bc44c07..3be0cb8 100644 --- a/arch/arm/mach-ux500/board-mop500.h +++ b/arch/arm/mach-ux500/board-mop500.h @@ -92,4 +92,7 @@ void __init hrefv60_pinmaps_init(void); void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info, unsigned n); +/* TODO: Once all pieces are DT:ed, remove completely. */ +struct device * __init u8500_of_init_devices(void); + #endif diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 16169c4..04244b0 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -222,6 +222,28 @@ struct device * __init u8500_init_devices(void) platform_device_register_data(parent, "cpufreq-u8500", -1, NULL, 0); + for (i = 0; i < ARRAY_SIZE(platform_devs); i++) + platform_devs[i]->dev.parent = parent; + + platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); + + return parent; +} + +/* TODO: Once all pieces are DT:ed, remove completely. */ +struct device * __init u8500_of_init_devices(void) +{ + struct device *parent; + int i; + + parent = db8500_soc_device_init(); + + db8500_add_rtc(parent); + db8500_add_usb(parent, usb_db8500_rx_dma_cfg, usb_db8500_tx_dma_cfg); + + platform_device_register_data(parent, + "cpufreq-u8500", -1, NULL, 0); + for (i = 0; i < ARRAY_SIZE(of_platform_devs); i++) of_platform_devs[i]->dev.parent = parent;