From patchwork Wed Aug 10 13:03:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1053662 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7AD5cDm013069 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 10 Aug 2011 13:06:05 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qr8Sx-0008N6-68; Wed, 10 Aug 2011 13:04:59 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qr8Sw-000389-LU; Wed, 10 Aug 2011 13:04:58 +0000 Received: from mail-wy0-f177.google.com ([74.125.82.177]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qr8SN-0002wD-Sl for linux-arm-kernel@lists.infradead.org; Wed, 10 Aug 2011 13:04:26 +0000 Received: by mail-wy0-f177.google.com with SMTP id 11so843620wyh.36 for ; Wed, 10 Aug 2011 06:04:23 -0700 (PDT) Received: by 10.216.81.9 with SMTP id l9mr599005wee.12.1312981463503; Wed, 10 Aug 2011 06:04:23 -0700 (PDT) Received: from localhost.localdomain (cpc2-aztw13-0-0-cust146.aztw.cable.virginmedia.com [77.99.12.147]) by mx.google.com with ESMTPS id et16sm741790wbb.19.2011.08.10.06.04.22 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Aug 2011 06:04:23 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, arnd@arndb.de Subject: [PATCH 4/4] Move top level platform devices in sysfs to /sys/devices/soc/X Date: Wed, 10 Aug 2011 14:03:42 +0100 Message-Id: <1312981422-13294-4-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1312981422-13294-1-git-send-email-lee.jones@linaro.org> References: <1312981422-13294-1-git-send-email-lee.jones@linaro.org> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110810_090424_318848_FFB42B44 X-CRM114-Status: GOOD ( 18.18 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.177 listed in list.dnswl.org] Cc: gregkh@suse.de, lee.jones@linaro.org, linus.walleij@stericsson.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 10 Aug 2011 13:06:09 +0000 (UTC) At the request of Arnd Bergmann this patch moves all SoC platform devices found in sysfs from /sys/devices/platform to /sys/devices/soc//. It is believed as the devices are SoC specific and a /sys/devices/soc node has recently become available, that this would be a more appropriate place to display the data. Signed-off-by: Lee Jones --- arch/arm/mach-ux500/board-mop500.c | 19 +++++++++++++++---- arch/arm/mach-ux500/board-u5500.c | 6 ++++++ arch/arm/mach-ux500/cpu-db5500.c | 6 ++++++ arch/arm/mach-ux500/cpu-db8500.c | 12 +++++++++++- arch/arm/mach-ux500/devices-common.c | 19 +++++++++++++++---- arch/arm/mach-ux500/usb.c | 4 ++++ 6 files changed, 57 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 5b43fed..4c3295d 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -603,6 +603,7 @@ static struct platform_device *snowball_platform_devs[] __initdata = { static void __init mop500_init_machine(void) { int i2c0_devs; + int i; /* * The HREFv60 board removed a GPIO expander and routed @@ -620,12 +621,22 @@ static void __init mop500_init_machine(void) mop500_pins_init(); - if (machine_is_snowball()) + if (machine_is_snowball()) { + if (soc_parent->parent != NULL) + for (i=0; idev.parent = soc_parent; + platform_add_devices(snowball_platform_devs, - ARRAY_SIZE(snowball_platform_devs)); - else + ARRAY_SIZE(snowball_platform_devs)); + } + else { + if (soc_parent->parent != NULL) + for (i=0; idev.parent = soc_parent; + platform_add_devices(mop500_platform_devs, - ARRAY_SIZE(mop500_platform_devs)); + ARRAY_SIZE(mop500_platform_devs)); + } mop500_i2c_init(); mop500_sdi_init(); diff --git a/arch/arm/mach-ux500/board-u5500.c b/arch/arm/mach-ux500/board-u5500.c index 81e0475..4866436 100644 --- a/arch/arm/mach-ux500/board-u5500.c +++ b/arch/arm/mach-ux500/board-u5500.c @@ -53,11 +53,17 @@ static void __init u5500_uart_init(void) static void __init u5500_init_machine(void) { + int i; + u5500_init_devices(); u5500_sdi_init(); u5500_uart_init(); + if (soc_parent->parent != NULL) + for (i=0; idev.parent = soc_parent; + platform_add_devices(u5500_platform_devices, ARRAY_SIZE(u5500_platform_devices)); } diff --git a/arch/arm/mach-ux500/cpu-db5500.c b/arch/arm/mach-ux500/cpu-db5500.c index 7d940a8..52cbbd2 100644 --- a/arch/arm/mach-ux500/cpu-db5500.c +++ b/arch/arm/mach-ux500/cpu-db5500.c @@ -216,11 +216,17 @@ static int usb_db5500_tx_dma_cfg[] = { void __init u5500_init_devices(void) { + int i; + db5500_add_gpios(); db5500_dma_init(); db5500_add_rtc(); db5500_add_usb(usb_db5500_rx_dma_cfg, usb_db5500_tx_dma_cfg); + if (soc_parent->parent != NULL) + for (i=0; idev.parent = soc_parent; + platform_add_devices(db5500_platform_devs, ARRAY_SIZE(db5500_platform_devs)); } diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 07562e8..cd63363 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -196,6 +196,8 @@ static int usb_db8500_tx_dma_cfg[] = { */ void __init u8500_init_devices(void) { + int i; + if (cpu_is_u8500ed()) dma40_u8500ed_fixup(); @@ -203,7 +205,15 @@ void __init u8500_init_devices(void) db8500_add_gpios(); db8500_add_usb(usb_db8500_rx_dma_cfg, usb_db8500_tx_dma_cfg); - platform_device_register_simple("cpufreq-u8500", -1, NULL, 0); + + platform_device_register_resndata( + (soc_parent->parent != NULL) ? soc_parent : NULL, + "cpufreq-u8500", -1, NULL, 0, NULL, 0); + + if (soc_parent->parent != NULL) + for (i=0; idev.parent = soc_parent; + platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); return ; diff --git a/arch/arm/mach-ux500/devices-common.c b/arch/arm/mach-ux500/devices-common.c index 7418552..c8d1399 100644 --- a/arch/arm/mach-ux500/devices-common.c +++ b/arch/arm/mach-ux500/devices-common.c @@ -15,7 +15,7 @@ #include #include - +#include #include "devices-common.h" struct amba_device * @@ -45,6 +45,9 @@ dbx500_add_amba_device(const char *name, resource_size_t base, dev->dev.platform_data = pdata; + if (soc_parent->parent != NULL) + dev->dev.parent = soc_parent; + ret = amba_device_register(dev, &iomem_resource); if (ret) { kfree(dev); @@ -74,6 +77,9 @@ dbx500_add_platform_device(const char *name, int id, void *pdata, dev->dev.platform_data = pdata; + if (soc_parent->parent != NULL) + dev->dev.parent = soc_parent; + ret = platform_device_add(dev); if (ret) goto out_free; @@ -124,9 +130,14 @@ dbx500_add_gpio(int id, resource_size_t addr, int irq, } }; - return platform_device_register_resndata(NULL, "gpio", id, - resources, ARRAY_SIZE(resources), - pdata, sizeof(*pdata)); + return platform_device_register_resndata( + (soc_parent->parent != NULL) ? soc_parent : NULL, + "gpio", + id, + resources, + ARRAY_SIZE(resources), + pdata, + sizeof(*pdata)); } void dbx500_add_gpios(resource_size_t *base, int num, int irq, diff --git a/arch/arm/mach-ux500/usb.c b/arch/arm/mach-ux500/usb.c index 0a01cbd..29cdd3c 100644 --- a/arch/arm/mach-ux500/usb.c +++ b/arch/arm/mach-ux500/usb.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #define MUSB_DMA40_RX_CH { \ @@ -157,5 +158,8 @@ void ux500_add_usb(resource_size_t base, int irq, int *dma_rx_cfg, ux500_usb_dma_update_rx_ch_config(dma_rx_cfg); ux500_usb_dma_update_tx_ch_config(dma_tx_cfg); + if (soc_parent->parent != NULL) + ux500_musb_device.dev.parent = soc_parent; + platform_device_register(&ux500_musb_device); }