Eric Miao | 14c6b5e | 2009-03-20 12:50:22 +0800 | [diff] [blame] | 1 | #ifndef __ASM_MACH_PXA910_H |
| 2 | #define __ASM_MACH_PXA910_H |
| 3 | |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 4 | extern void pxa910_timer_init(void); |
Haojian Zhuang | c052d13 | 2013-04-21 13:21:48 +0800 | [diff] [blame] | 5 | extern void __init icu_init_irq(void); |
Eric Miao | 2728701 | 2010-07-15 22:22:33 +0800 | [diff] [blame] | 6 | extern void __init pxa910_init_irq(void); |
| 7 | |
Eric Miao | 1a77920 | 2009-04-13 15:34:54 +0800 | [diff] [blame] | 8 | #include <linux/i2c.h> |
Sebastian Andrzej Siewior | b459396 | 2011-02-23 12:38:16 +0100 | [diff] [blame] | 9 | #include <linux/i2c/pxa-i2c.h> |
Arnd Bergmann | 293b2da | 2012-08-24 15:16:48 +0200 | [diff] [blame] | 10 | #include <linux/platform_data/mtd-nand-pxa3xx.h> |
Zhou Zhu | 333893c | 2013-02-21 16:42:20 -0800 | [diff] [blame] | 11 | #include <video/mmp_disp.h> |
Eric Miao | 14c6b5e | 2009-03-20 12:50:22 +0800 | [diff] [blame] | 12 | |
Arnd Bergmann | b501fd7 | 2014-04-15 20:38:32 +0200 | [diff] [blame] | 13 | #include "devices.h" |
| 14 | |
Eric Miao | 14c6b5e | 2009-03-20 12:50:22 +0800 | [diff] [blame] | 15 | extern struct pxa_device_desc pxa910_device_uart1; |
| 16 | extern struct pxa_device_desc pxa910_device_uart2; |
Eric Miao | 1a77920 | 2009-04-13 15:34:54 +0800 | [diff] [blame] | 17 | extern struct pxa_device_desc pxa910_device_twsi0; |
| 18 | extern struct pxa_device_desc pxa910_device_twsi1; |
Eric Miao | a27ba76 | 2009-04-13 18:29:52 +0800 | [diff] [blame] | 19 | extern struct pxa_device_desc pxa910_device_pwm1; |
| 20 | extern struct pxa_device_desc pxa910_device_pwm2; |
| 21 | extern struct pxa_device_desc pxa910_device_pwm3; |
| 22 | extern struct pxa_device_desc pxa910_device_pwm4; |
Haojian Zhuang | a0f266c | 2009-10-13 15:24:55 +0800 | [diff] [blame] | 23 | extern struct pxa_device_desc pxa910_device_nand; |
Neil Zhang | 75b1bdf | 2012-05-03 14:19:13 +0800 | [diff] [blame] | 24 | extern struct platform_device pxa168_device_u2o; |
| 25 | extern struct platform_device pxa168_device_u2ootg; |
| 26 | extern struct platform_device pxa168_device_u2oehci; |
Zhou Zhu | 333893c | 2013-02-21 16:42:20 -0800 | [diff] [blame] | 27 | extern struct pxa_device_desc pxa910_device_disp; |
| 28 | extern struct pxa_device_desc pxa910_device_fb; |
| 29 | extern struct pxa_device_desc pxa910_device_panel; |
Haojian Zhuang | 157d264 | 2011-10-17 20:37:52 +0800 | [diff] [blame] | 30 | extern struct platform_device pxa910_device_gpio; |
Haojian Zhuang | 4128e27 | 2012-02-23 23:37:33 +0800 | [diff] [blame] | 31 | extern struct platform_device pxa910_device_rtc; |
Haojian Zhuang | 157d264 | 2011-10-17 20:37:52 +0800 | [diff] [blame] | 32 | |
Eric Miao | 14c6b5e | 2009-03-20 12:50:22 +0800 | [diff] [blame] | 33 | static inline int pxa910_add_uart(int id) |
| 34 | { |
| 35 | struct pxa_device_desc *d = NULL; |
| 36 | |
| 37 | switch (id) { |
| 38 | case 1: d = &pxa910_device_uart1; break; |
| 39 | case 2: d = &pxa910_device_uart2; break; |
| 40 | } |
| 41 | |
| 42 | if (d == NULL) |
| 43 | return -EINVAL; |
| 44 | |
| 45 | return pxa_register_device(d, NULL, 0); |
| 46 | } |
Eric Miao | 1a77920 | 2009-04-13 15:34:54 +0800 | [diff] [blame] | 47 | |
| 48 | static inline int pxa910_add_twsi(int id, struct i2c_pxa_platform_data *data, |
| 49 | struct i2c_board_info *info, unsigned size) |
| 50 | { |
| 51 | struct pxa_device_desc *d = NULL; |
| 52 | int ret; |
| 53 | |
| 54 | switch (id) { |
| 55 | case 0: d = &pxa910_device_twsi0; break; |
| 56 | case 1: d = &pxa910_device_twsi1; break; |
| 57 | default: |
| 58 | return -EINVAL; |
| 59 | } |
| 60 | |
| 61 | ret = i2c_register_board_info(id, info, size); |
| 62 | if (ret) |
| 63 | return ret; |
| 64 | |
| 65 | return pxa_register_device(d, data, sizeof(*data)); |
| 66 | } |
Eric Miao | a27ba76 | 2009-04-13 18:29:52 +0800 | [diff] [blame] | 67 | |
| 68 | static inline int pxa910_add_pwm(int id) |
| 69 | { |
| 70 | struct pxa_device_desc *d = NULL; |
| 71 | |
| 72 | switch (id) { |
| 73 | case 1: d = &pxa910_device_pwm1; break; |
| 74 | case 2: d = &pxa910_device_pwm2; break; |
| 75 | case 3: d = &pxa910_device_pwm3; break; |
| 76 | case 4: d = &pxa910_device_pwm4; break; |
| 77 | default: |
| 78 | return -EINVAL; |
| 79 | } |
| 80 | |
| 81 | return pxa_register_device(d, NULL, 0); |
| 82 | } |
Haojian Zhuang | a0f266c | 2009-10-13 15:24:55 +0800 | [diff] [blame] | 83 | |
| 84 | static inline int pxa910_add_nand(struct pxa3xx_nand_platform_data *info) |
| 85 | { |
| 86 | return pxa_register_device(&pxa910_device_nand, info, sizeof(*info)); |
| 87 | } |
Eric Miao | 14c6b5e | 2009-03-20 12:50:22 +0800 | [diff] [blame] | 88 | #endif /* __ASM_MACH_PXA910_H */ |