aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/devices-common.h
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2012-02-06 14:22:21 -0500
committerArnd Bergmann <arnd@arndb.de>2012-02-13 01:31:29 -0500
commit18403424c4fe5bac509bf52343f5d5407d45ee3a (patch)
treeae9a0f3056c712ee7f8042d667b267bedda92abf /arch/arm/mach-ux500/devices-common.h
parentd65b4e98d7ea3038b767b70fe8be959b2913f16d (diff)
ARM: ux500: pass parent pointer to each platform device
This patch provides a means for any device within ux500 platform code to allocate its own parent. This is particularly prudent with the introduction of /sys/devices/socX, as a device can now proclaim to be integral part of an SoC, rather than a more generic platform device. Latter patches make good use of this functionality. Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-ux500/devices-common.h')
-rw-r--r--arch/arm/mach-ux500/devices-common.h39
1 files changed, 21 insertions, 18 deletions
diff --git a/arch/arm/mach-ux500/devices-common.h b/arch/arm/mach-ux500/devices-common.h
index 7825705033bf..f8adff891a91 100644
--- a/arch/arm/mach-ux500/devices-common.h
+++ b/arch/arm/mach-ux500/devices-common.h
@@ -9,7 +9,7 @@
9#define __DEVICES_COMMON_H 9#define __DEVICES_COMMON_H
10 10
11extern struct amba_device * 11extern struct amba_device *
12dbx500_add_amba_device(const char *name, resource_size_t base, 12dbx500_add_amba_device(struct device *parent, const char *name, resource_size_t base,
13 int irq, void *pdata, unsigned int periphid); 13 int irq, void *pdata, unsigned int periphid);
14 14
15extern struct platform_device * 15extern struct platform_device *
@@ -20,43 +20,46 @@ dbx500_add_platform_device_4k1irq(const char *name, int id,
20struct spi_master_cntlr; 20struct spi_master_cntlr;
21 21
22static inline struct amba_device * 22static inline struct amba_device *
23dbx500_add_msp_spi(const char *name, resource_size_t base, int irq, 23dbx500_add_msp_spi(struct device *parent, const char *name,
24 resource_size_t base, int irq,
24 struct spi_master_cntlr *pdata) 25 struct spi_master_cntlr *pdata)
25{ 26{
26 return dbx500_add_amba_device(name, base, irq, pdata, 0); 27 return dbx500_add_amba_device(parent, name, base, irq,
28 pdata, 0);
27} 29}
28 30
29static inline struct amba_device * 31static inline struct amba_device *
30dbx500_add_spi(const char *name, resource_size_t base, int irq, 32dbx500_add_spi(struct device *parent, const char *name, resource_size_t base,
31 struct spi_master_cntlr *pdata, 33 int irq, struct spi_master_cntlr *pdata,
32 u32 periphid) 34 u32 periphid)
33{ 35{
34 return dbx500_add_amba_device(name, base, irq, pdata, periphid); 36 return dbx500_add_amba_device(parent, name, base, irq,
37 pdata, periphid);
35} 38}
36 39
37struct mmci_platform_data; 40struct mmci_platform_data;
38 41
39static inline struct amba_device * 42static inline struct amba_device *
40dbx500_add_sdi(const char *name, resource_size_t base, int irq, 43dbx500_add_sdi(struct device *parent, const char *name, resource_size_t base,
41 struct mmci_platform_data *pdata, 44 int irq, struct mmci_platform_data *pdata, u32 periphid)
42 u32 periphid)
43{ 45{
44 return dbx500_add_amba_device(name, base, irq, pdata, periphid); 46 return dbx500_add_amba_device(parent, name, base, irq,
47 pdata, periphid);
45} 48}
46 49
47struct amba_pl011_data; 50struct amba_pl011_data;
48 51
49static inline struct amba_device * 52static inline struct amba_device *
50dbx500_add_uart(const char *name, resource_size_t base, int irq, 53dbx500_add_uart(struct device *parent, const char *name, resource_size_t base,
51 struct amba_pl011_data *pdata) 54 int irq, struct amba_pl011_data *pdata)
52{ 55{
53 return dbx500_add_amba_device(name, base, irq, pdata, 0); 56 return dbx500_add_amba_device(parent, name, base, irq, pdata, 0);
54} 57}
55 58
56struct nmk_i2c_controller; 59struct nmk_i2c_controller;
57 60
58static inline struct platform_device * 61static inline struct platform_device *
59dbx500_add_i2c(int id, resource_size_t base, int irq, 62dbx500_add_i2c(struct device *parent, int id, resource_size_t base, int irq,
60 struct nmk_i2c_controller *pdata) 63 struct nmk_i2c_controller *pdata)
61{ 64{
62 return dbx500_add_platform_device_4k1irq("nmk-i2c", id, base, irq, 65 return dbx500_add_platform_device_4k1irq("nmk-i2c", id, base, irq,
@@ -74,14 +77,14 @@ dbx500_add_msp_i2s(int id, resource_size_t base, int irq,
74} 77}
75 78
76static inline struct amba_device * 79static inline struct amba_device *
77dbx500_add_rtc(resource_size_t base, int irq) 80dbx500_add_rtc(struct device *parent, resource_size_t base, int irq)
78{ 81{
79 return dbx500_add_amba_device("rtc-pl031", base, irq, NULL, 0); 82 return dbx500_add_amba_device(parent, "rtc-pl031", base, irq, NULL, 0);
80} 83}
81 84
82struct nmk_gpio_platform_data; 85struct nmk_gpio_platform_data;
83 86
84void dbx500_add_gpios(resource_size_t *base, int num, int irq, 87void dbx500_add_gpios(struct device *parent, resource_size_t *base, int num,
85 struct nmk_gpio_platform_data *pdata); 88 int irq, struct nmk_gpio_platform_data *pdata);
86 89
87#endif 90#endif