diff options
author | Lee Jones <lee.jones@linaro.org> | 2012-02-06 14:22:21 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-02-13 01:31:29 -0500 |
commit | 18403424c4fe5bac509bf52343f5d5407d45ee3a (patch) | |
tree | ae9a0f3056c712ee7f8042d667b267bedda92abf /arch/arm/mach-ux500/devices-common.h | |
parent | d65b4e98d7ea3038b767b70fe8be959b2913f16d (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.h | 39 |
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 | ||
11 | extern struct amba_device * | 11 | extern struct amba_device * |
12 | dbx500_add_amba_device(const char *name, resource_size_t base, | 12 | dbx500_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 | ||
15 | extern struct platform_device * | 15 | extern struct platform_device * |
@@ -20,43 +20,46 @@ dbx500_add_platform_device_4k1irq(const char *name, int id, | |||
20 | struct spi_master_cntlr; | 20 | struct spi_master_cntlr; |
21 | 21 | ||
22 | static inline struct amba_device * | 22 | static inline struct amba_device * |
23 | dbx500_add_msp_spi(const char *name, resource_size_t base, int irq, | 23 | dbx500_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 | ||
29 | static inline struct amba_device * | 31 | static inline struct amba_device * |
30 | dbx500_add_spi(const char *name, resource_size_t base, int irq, | 32 | dbx500_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 | ||
37 | struct mmci_platform_data; | 40 | struct mmci_platform_data; |
38 | 41 | ||
39 | static inline struct amba_device * | 42 | static inline struct amba_device * |
40 | dbx500_add_sdi(const char *name, resource_size_t base, int irq, | 43 | dbx500_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 | ||
47 | struct amba_pl011_data; | 50 | struct amba_pl011_data; |
48 | 51 | ||
49 | static inline struct amba_device * | 52 | static inline struct amba_device * |
50 | dbx500_add_uart(const char *name, resource_size_t base, int irq, | 53 | dbx500_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 | ||
56 | struct nmk_i2c_controller; | 59 | struct nmk_i2c_controller; |
57 | 60 | ||
58 | static inline struct platform_device * | 61 | static inline struct platform_device * |
59 | dbx500_add_i2c(int id, resource_size_t base, int irq, | 62 | dbx500_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 | ||
76 | static inline struct amba_device * | 79 | static inline struct amba_device * |
77 | dbx500_add_rtc(resource_size_t base, int irq) | 80 | dbx500_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 | ||
82 | struct nmk_gpio_platform_data; | 85 | struct nmk_gpio_platform_data; |
83 | 86 | ||
84 | void dbx500_add_gpios(resource_size_t *base, int num, int irq, | 87 | void 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 |