blob: c719b5a1d9130ee47f36e97889686ee7c7038ad0 [file] [log] [blame]
Rabin Vincentfbf1eadf2010-09-29 19:46:32 +05301/*
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
11extern struct amba_device *
12dbx500_add_amba_device(const char *name, resource_size_t base,
13 int irq, void *pdata, unsigned int periphid);
14
15extern struct platform_device *
16dbx500_add_platform_device_4k1irq(const char *name, int id,
17 resource_size_t base,
18 int irq, void *pdata);
19
20struct spi_master_cntlr;
21
22static inline struct amba_device *
23dbx500_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
29static inline struct amba_device *
30dbx500_add_spi(const char *name, resource_size_t base, int irq,
31 struct spi_master_cntlr *pdata)
32{
33 return dbx500_add_amba_device(name, base, irq, pdata, 0);
34}
35
36struct mmci_platform_data;
37
38static inline struct amba_device *
39dbx500_add_sdi(const char *name, resource_size_t base, int irq,
40 struct mmci_platform_data *pdata)
41{
42 return dbx500_add_amba_device(name, base, irq, pdata, 0);
43}
44
Linus Walleij5d7b8462010-10-14 13:57:59 +020045struct amba_pl011_data;
46
Rabin Vincentfbf1eadf2010-09-29 19:46:32 +053047static inline struct amba_device *
Linus Walleij5d7b8462010-10-14 13:57:59 +020048dbx500_add_uart(const char *name, resource_size_t base, int irq,
49 struct amba_pl011_data *pdata)
Rabin Vincentfbf1eadf2010-09-29 19:46:32 +053050{
Linus Walleij5d7b8462010-10-14 13:57:59 +020051 return dbx500_add_amba_device(name, base, irq, pdata, 0);
Rabin Vincentfbf1eadf2010-09-29 19:46:32 +053052}
53
54struct nmk_i2c_controller;
55
56static inline struct platform_device *
57dbx500_add_i2c(int id, resource_size_t base, int irq,
58 struct nmk_i2c_controller *pdata)
59{
60 return dbx500_add_platform_device_4k1irq("nmk-i2c", id, base, irq,
61 pdata);
62}
63
64struct msp_i2s_platform_data;
65
66static inline struct platform_device *
67dbx500_add_msp_i2s(int id, resource_size_t base, int irq,
68 struct msp_i2s_platform_data *pdata)
69{
70 return dbx500_add_platform_device_4k1irq("MSP_I2S", id, base, irq,
71 pdata);
72}
73
74static inline struct amba_device *
75dbx500_add_rtc(resource_size_t base, int irq)
76{
77 return dbx500_add_amba_device("rtc-pl031", base, irq, NULL, 0);
78}
79
Rabin Vincent01afdd12010-12-08 11:07:55 +053080struct nmk_gpio_platform_data;
81
82void dbx500_add_gpios(resource_size_t *base, int num, int irq,
83 struct nmk_gpio_platform_data *pdata);
84
Rabin Vincentfbf1eadf2010-09-29 19:46:32 +053085#endif