Rabin Vincent | fbf1ead | 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 * |
| 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 | { |
| 33 | return dbx500_add_amba_device(name, base, irq, pdata, 0); |
| 34 | } |
| 35 | |
| 36 | struct mmci_platform_data; |
| 37 | |
| 38 | static inline struct amba_device * |
| 39 | dbx500_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 Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame^] | 45 | struct amba_pl011_data; |
| 46 | |
Rabin Vincent | fbf1ead | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 47 | static inline struct amba_device * |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame^] | 48 | dbx500_add_uart(const char *name, resource_size_t base, int irq, |
| 49 | struct amba_pl011_data *pdata) |
Rabin Vincent | fbf1ead | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 50 | { |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame^] | 51 | return dbx500_add_amba_device(name, base, irq, pdata, 0); |
Rabin Vincent | fbf1ead | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 52 | } |
| 53 | |
| 54 | struct nmk_i2c_controller; |
| 55 | |
| 56 | static inline struct platform_device * |
| 57 | dbx500_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 | |
| 64 | struct msp_i2s_platform_data; |
| 65 | |
| 66 | static inline struct platform_device * |
| 67 | dbx500_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 | |
| 74 | static inline struct amba_device * |
| 75 | dbx500_add_rtc(resource_size_t base, int irq) |
| 76 | { |
| 77 | return dbx500_add_amba_device("rtc-pl031", base, irq, NULL, 0); |
| 78 | } |
| 79 | |
Rabin Vincent | 01afdd1 | 2010-12-08 11:07:55 +0530 | [diff] [blame] | 80 | struct nmk_gpio_platform_data; |
| 81 | |
| 82 | void dbx500_add_gpios(resource_size_t *base, int num, int irq, |
| 83 | struct nmk_gpio_platform_data *pdata); |
| 84 | |
Rabin Vincent | fbf1ead | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 85 | #endif |