blob: 2e1de0e19717629dc7ff979175dd89b543e3caa8 [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
45static inline struct amba_device *
46dbx500_add_uart(const char *name, resource_size_t base, int irq)
47{
48 return dbx500_add_amba_device(name, base, irq, NULL, 0);
49}
50
51struct nmk_i2c_controller;
52
53static inline struct platform_device *
54dbx500_add_i2c(int id, resource_size_t base, int irq,
55 struct nmk_i2c_controller *pdata)
56{
57 return dbx500_add_platform_device_4k1irq("nmk-i2c", id, base, irq,
58 pdata);
59}
60
61struct msp_i2s_platform_data;
62
63static inline struct platform_device *
64dbx500_add_msp_i2s(int id, resource_size_t base, int irq,
65 struct msp_i2s_platform_data *pdata)
66{
67 return dbx500_add_platform_device_4k1irq("MSP_I2S", id, base, irq,
68 pdata);
69}
70
71static inline struct amba_device *
72dbx500_add_rtc(resource_size_t base, int irq)
73{
74 return dbx500_add_amba_device("rtc-pl031", base, irq, NULL, 0);
75}
76
77#endif