From patchwork Tue Mar 15 14:41:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Langlais X-Patchwork-Id: 573 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:43:56 -0000 Delivered-To: patches@linaro.org Received: by 10.151.46.5 with SMTP id y5cs72208ybj; Tue, 15 Mar 2011 07:43:18 -0700 (PDT) Received: by 10.14.121.133 with SMTP id r5mr3738093eeh.32.1300200197631; Tue, 15 Mar 2011 07:43:17 -0700 (PDT) Received: from eu1sys200aog111.obsmtp.com (eu1sys200aog111.obsmtp.com [207.126.144.131]) by mx.google.com with SMTP id r3si20183860eeh.21.2011.03.15.07.43.13 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 Mar 2011 07:43:17 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.131 is neither permitted nor denied by best guess record for domain of philippe.langlais@stericsson.com) client-ip=207.126.144.131; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.131 is neither permitted nor denied by best guess record for domain of philippe.langlais@stericsson.com) smtp.mail=philippe.langlais@stericsson.com Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob111.postini.com ([207.126.147.11]) with SMTP ID DSNKTX97AbEk1zW5HqtIMBg657Gy/ZE1DBa4@postini.com; Tue, 15 Mar 2011 14:43:17 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B9E35127; Tue, 15 Mar 2011 14:43:12 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 6E76724B4; Tue, 15 Mar 2011 14:43:12 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 923C0A8065; Tue, 15 Mar 2011 15:42:36 +0100 (CET) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.2.254.0; Tue, 15 Mar 2011 15:42:41 +0100 From: Philippe Langlais To: Cc: , , , Philippe Langlais , Rabin Vincent Subject: [PATCH 4/4] ux500: pass name for db5500-spi & db8500v2-sdi devices Date: Tue, 15 Mar 2011 15:41:56 +0100 Message-ID: <1300200116-12185-5-git-send-email-philippe.langlais@stericsson.com> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: <1300200116-12185-1-git-send-email-philippe.langlais@stericsson.com> References: <1300200116-12185-1-git-send-email-philippe.langlais@stericsson.com> MIME-Version: 1.0 From: Philippe Langlais Acked-by: Linus Walleij Signed-off-by: Rabin Vincent Signed-off-by: Philippe Langlais --- arch/arm/mach-ux500/devices-common.c | 8 ++++-- arch/arm/mach-ux500/devices-common.h | 31 ++++++++++++++++++-------- arch/arm/mach-ux500/devices-db8500.h | 2 +- arch/arm/mach-ux500/include/mach/hardware.h | 3 -- 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/arch/arm/mach-ux500/devices-common.c b/arch/arm/mach-ux500/devices-common.c index 13a4ce0..e0acb75 100644 --- a/arch/arm/mach-ux500/devices-common.c +++ b/arch/arm/mach-ux500/devices-common.c @@ -20,8 +20,9 @@ #include "devices-common.h" struct amba_device * -dbx500_add_amba_device(const char *name, resource_size_t base, - int irq, void *pdata, unsigned int periphid) +dbx500_add_amba_device(const char *init_name, resource_size_t base, + int irq, void *pdata, unsigned int periphid, + const char *name) { struct amba_device *dev; int ret; @@ -30,7 +31,7 @@ dbx500_add_amba_device(const char *name, resource_size_t base, if (!dev) return ERR_PTR(-ENOMEM); - dev->dev.init_name = name; + dev->dev.init_name = init_name; dev->res.start = base; dev->res.end = base + SZ_4K - 1; @@ -43,6 +44,7 @@ dbx500_add_amba_device(const char *name, resource_size_t base, dev->irq[1] = NO_IRQ; dev->periphid = periphid; + dev->name = name; dev->dev.platform_data = pdata; diff --git a/arch/arm/mach-ux500/devices-common.h b/arch/arm/mach-ux500/devices-common.h index c719b5a1..cb5739e 100644 --- a/arch/arm/mach-ux500/devices-common.h +++ b/arch/arm/mach-ux500/devices-common.h @@ -9,8 +9,9 @@ #define __DEVICES_COMMON_H extern struct amba_device * -dbx500_add_amba_device(const char *name, resource_size_t base, - int irq, void *pdata, unsigned int periphid); +dbx500_add_amba_device(const char *init_name, resource_size_t base, + int irq, void *pdata, unsigned int periphid, + const char *name); extern struct platform_device * dbx500_add_platform_device_4k1irq(const char *name, int id, @@ -23,23 +24,33 @@ static inline struct amba_device * dbx500_add_msp_spi(const char *name, resource_size_t base, int irq, struct spi_master_cntlr *pdata) { - return dbx500_add_amba_device(name, base, irq, pdata, 0); + return dbx500_add_amba_device(name, base, irq, pdata, 0, NULL); } static inline struct amba_device * -dbx500_add_spi(const char *name, resource_size_t base, int irq, - struct spi_master_cntlr *pdata) +dbx500_add_spi(const char *init_name, resource_size_t base, int irq, + struct spi_master_cntlr *pdata) { - return dbx500_add_amba_device(name, base, irq, pdata, 0); + const char *name = NULL; + + if (cpu_is_u5500()) + name = "db5500-spi"; + + return dbx500_add_amba_device(init_name, base, irq, pdata, 0, name); } struct mmci_platform_data; static inline struct amba_device * -dbx500_add_sdi(const char *name, resource_size_t base, int irq, +dbx500_add_sdi(const char *init_name, resource_size_t base, int irq, struct mmci_platform_data *pdata) { - return dbx500_add_amba_device(name, base, irq, pdata, 0); + const char *name = NULL; + + if (cpu_is_u8500v2()) + name = "db8500v2-sdi"; + + return dbx500_add_amba_device(init_name, base, irq, pdata, 0, name); } struct amba_pl011_data; @@ -48,7 +59,7 @@ static inline struct amba_device * dbx500_add_uart(const char *name, resource_size_t base, int irq, struct amba_pl011_data *pdata) { - return dbx500_add_amba_device(name, base, irq, pdata, 0); + return dbx500_add_amba_device(name, base, irq, pdata, 0, NULL); } struct nmk_i2c_controller; @@ -74,7 +85,7 @@ dbx500_add_msp_i2s(int id, resource_size_t base, int irq, static inline struct amba_device * dbx500_add_rtc(resource_size_t base, int irq) { - return dbx500_add_amba_device("rtc-pl031", base, irq, NULL, 0); + return dbx500_add_amba_device("rtc-pl031", base, irq, NULL, 0, NULL); } struct nmk_gpio_platform_data; diff --git a/arch/arm/mach-ux500/devices-db8500.h b/arch/arm/mach-ux500/devices-db8500.h index 9cc6f8f..fdcea73 100644 --- a/arch/arm/mach-ux500/devices-db8500.h +++ b/arch/arm/mach-ux500/devices-db8500.h @@ -25,7 +25,7 @@ static inline struct amba_device * db8500_add_ssp(const char *name, resource_size_t base, int irq, struct pl022_ssp_controller *pdata) { - return dbx500_add_amba_device(name, base, irq, pdata, SSP_PER_ID); + return dbx500_add_amba_device(name, base, irq, pdata, 0, NULL); } diff --git a/arch/arm/mach-ux500/include/mach/hardware.h b/arch/arm/mach-ux500/include/mach/hardware.h index bf63f26..d54bb61 100644 --- a/arch/arm/mach-ux500/include/mach/hardware.h +++ b/arch/arm/mach-ux500/include/mach/hardware.h @@ -29,9 +29,6 @@ #include #include -/* ST-Ericsson modified pl022 id */ -#define SSP_PER_ID 0x01080022 - #ifndef __ASSEMBLY__ #include