Rabin Vincent | fbf1eadf | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 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 * |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame^] | 12 | dbx500_add_amba_device(struct device *parent, const char *name, resource_size_t base, |
Rabin Vincent | fbf1eadf | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 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 * |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame^] | 23 | dbx500_add_msp_spi(struct device *parent, const char *name, |
| 24 | resource_size_t base, int irq, |
Rabin Vincent | fbf1eadf | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 25 | struct spi_master_cntlr *pdata) |
| 26 | { |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame^] | 27 | return dbx500_add_amba_device(parent, name, base, irq, |
| 28 | pdata, 0); |
Rabin Vincent | fbf1eadf | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | static inline struct amba_device * |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame^] | 32 | dbx500_add_spi(struct device *parent, const char *name, resource_size_t base, |
| 33 | int irq, struct spi_master_cntlr *pdata, |
Linus Walleij | 7293031 | 2011-03-24 16:13:13 +0100 | [diff] [blame] | 34 | u32 periphid) |
Rabin Vincent | fbf1eadf | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 35 | { |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame^] | 36 | return dbx500_add_amba_device(parent, name, base, irq, |
| 37 | pdata, periphid); |
Rabin Vincent | fbf1eadf | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | struct mmci_platform_data; |
| 41 | |
| 42 | static inline struct amba_device * |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame^] | 43 | dbx500_add_sdi(struct device *parent, const char *name, resource_size_t base, |
| 44 | int irq, struct mmci_platform_data *pdata, u32 periphid) |
Rabin Vincent | fbf1eadf | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 45 | { |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame^] | 46 | return dbx500_add_amba_device(parent, name, base, irq, |
| 47 | pdata, periphid); |
Rabin Vincent | fbf1eadf | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 48 | } |
| 49 | |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 50 | struct amba_pl011_data; |
| 51 | |
Rabin Vincent | fbf1eadf | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 52 | static inline struct amba_device * |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame^] | 53 | dbx500_add_uart(struct device *parent, const char *name, resource_size_t base, |
| 54 | int irq, struct amba_pl011_data *pdata) |
Rabin Vincent | fbf1eadf | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 55 | { |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame^] | 56 | return dbx500_add_amba_device(parent, name, base, irq, pdata, 0); |
Rabin Vincent | fbf1eadf | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | struct nmk_i2c_controller; |
| 60 | |
| 61 | static inline struct platform_device * |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame^] | 62 | dbx500_add_i2c(struct device *parent, int id, resource_size_t base, int irq, |
Rabin Vincent | fbf1eadf | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 63 | struct nmk_i2c_controller *pdata) |
| 64 | { |
| 65 | return dbx500_add_platform_device_4k1irq("nmk-i2c", id, base, irq, |
| 66 | pdata); |
| 67 | } |
| 68 | |
| 69 | struct msp_i2s_platform_data; |
| 70 | |
| 71 | static inline struct platform_device * |
| 72 | dbx500_add_msp_i2s(int id, resource_size_t base, int irq, |
| 73 | struct msp_i2s_platform_data *pdata) |
| 74 | { |
| 75 | return dbx500_add_platform_device_4k1irq("MSP_I2S", id, base, irq, |
| 76 | pdata); |
| 77 | } |
| 78 | |
| 79 | static inline struct amba_device * |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame^] | 80 | dbx500_add_rtc(struct device *parent, resource_size_t base, int irq) |
Rabin Vincent | fbf1eadf | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 81 | { |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame^] | 82 | return dbx500_add_amba_device(parent, "rtc-pl031", base, irq, NULL, 0); |
Rabin Vincent | fbf1eadf | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 83 | } |
| 84 | |
Rabin Vincent | 01afdd1 | 2010-12-08 11:07:55 +0530 | [diff] [blame] | 85 | struct nmk_gpio_platform_data; |
| 86 | |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame^] | 87 | void dbx500_add_gpios(struct device *parent, resource_size_t *base, int num, |
| 88 | int irq, struct nmk_gpio_platform_data *pdata); |
Rabin Vincent | 01afdd1 | 2010-12-08 11:07:55 +0530 | [diff] [blame] | 89 | |
Rabin Vincent | fbf1eadf | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 90 | #endif |