Merge branch 'integration' into for-linus
[pandora-kernel.git] / arch / arm / mach-ux500 / devices-common.h
1 /*
2  * Copyright (C) ST-Ericsson SA 2010
3  *
4  * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
5  * License terms: GNU General Public License (GPL), version 2.
6  */
7
8 #ifndef __DEVICES_COMMON_H
9 #define __DEVICES_COMMON_H
10
11 extern struct amba_device *
12 dbx500_add_amba_device(const char *name, resource_size_t base,
13                        int irq, void *pdata, unsigned int periphid);
14
15 extern struct platform_device *
16 dbx500_add_platform_device_4k1irq(const char *name, int id,
17                                   resource_size_t base,
18                                   int irq, void *pdata);
19
20 struct spi_master_cntlr;
21
22 static inline struct amba_device *
23 dbx500_add_msp_spi(const char *name, resource_size_t base, int irq,
24                    struct spi_master_cntlr *pdata)
25 {
26         return dbx500_add_amba_device(name, base, irq, pdata, 0);
27 }
28
29 static inline struct amba_device *
30 dbx500_add_spi(const char *name, resource_size_t base, int irq,
31                struct spi_master_cntlr *pdata,
32                u32 periphid)
33 {
34         return dbx500_add_amba_device(name, base, irq, pdata, periphid);
35 }
36
37 struct mmci_platform_data;
38
39 static inline struct amba_device *
40 dbx500_add_sdi(const char *name, resource_size_t base, int irq,
41                struct mmci_platform_data *pdata,
42                u32 periphid)
43 {
44         return dbx500_add_amba_device(name, base, irq, pdata, periphid);
45 }
46
47 struct amba_pl011_data;
48
49 static inline struct amba_device *
50 dbx500_add_uart(const char *name, resource_size_t base, int irq,
51                 struct amba_pl011_data *pdata)
52 {
53         return dbx500_add_amba_device(name, base, irq, pdata, 0);
54 }
55
56 struct nmk_i2c_controller;
57
58 static inline struct platform_device *
59 dbx500_add_i2c(int id, resource_size_t base, int irq,
60                struct nmk_i2c_controller *pdata)
61 {
62         return dbx500_add_platform_device_4k1irq("nmk-i2c", id, base, irq,
63                                                  pdata);
64 }
65
66 struct msp_i2s_platform_data;
67
68 static inline struct platform_device *
69 dbx500_add_msp_i2s(int id, resource_size_t base, int irq,
70                    struct msp_i2s_platform_data *pdata)
71 {
72         return dbx500_add_platform_device_4k1irq("MSP_I2S", id, base, irq,
73                                                  pdata);
74 }
75
76 static inline struct amba_device *
77 dbx500_add_rtc(resource_size_t base, int irq)
78 {
79         return dbx500_add_amba_device("rtc-pl031", base, irq, NULL, 0);
80 }
81
82 struct nmk_gpio_platform_data;
83
84 void dbx500_add_gpios(resource_size_t *base, int num, int irq,
85                       struct nmk_gpio_platform_data *pdata);
86
87 #endif