mmp: add device support in armada610
Subsystems (3)
PATCH 1/1 mmp: add device support in armada610
Add uart, twsi devie support in armada610. Add mfp configuration in armada610.
--- arch/arm/mach-mmp/Makefile | 1 + arch/arm/mach-mmp/armada610.c | 83 ++++++++ arch/arm/mach-mmp/include/mach/armada610.h | 60 ++++++ arch/arm/mach-mmp/include/mach/devices.h | 12 ++ arch/arm/mach-mmp/include/mach/mfp-armada610.h | 241 ++++++++++++++++++++++++ 5 files changed, 397 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-mmp/armada610.c create mode 100644 arch/arm/mach-mmp/include/mach/armada610.h create mode 100644 arch/arm/mach-mmp/include/mach/mfp-armada610.h
arch/arm/mach-mmp/Makefile +1 -0
@@ -7,6 +7,7 @@ obj-y += common.o clock.o devices.o irq.o time.o # SoC support obj-$(CONFIG_CPU_PXA168) += pxa168.o obj-$(CONFIG_CPU_PXA910) += pxa910.o +obj-$(CONFIG_CPU_ARMADA610) += armada610.o # board support obj-$(CONFIG_MACH_ASPENITE) += aspenite.o
arch/arm/mach-mmp/armada610.c new file +83 -0
83 lines not on this page · raw message
(quoted diff) +0 -0
b/arch/arm/mach-mmp/include/mach/armada610.h
new file mode 100644
index 0000000..6f2d499
arch/arm/mach-mmp/include/mach/armada610.h new file +35 -0
@@ -0,0 +1,60 @@ +#ifndef __ASM_MACH_ARMADA610_H +#define __ASM_MACH_ARMADA610_H + +#include <linux/i2c.h> +#include <mach/devices.h> +#include <plat/i2c.h> + +extern struct pxa_device_desc armada610_device_uart1; +extern struct pxa_device_desc armada610_device_uart2; +extern struct pxa_device_desc armada610_device_uart3; +extern struct pxa_device_desc armada610_device_uart4; +extern struct pxa_device_desc armada610_device_twsi1; +extern struct pxa_device_desc armada610_device_twsi2; +extern struct pxa_device_desc armada610_device_twsi3; +extern struct pxa_device_desc armada610_device_twsi4; +extern struct pxa_device_desc armada610_device_twsi5; +extern struct pxa_device_desc armada610_device_twsi6; + +static inline int armada610_add_uart (int id) +{ +struct pxa_device_desc *d =NULL ; + +switch (id) { +case 1 : d = &armada610_device_uart1;break ; +case 2 : d = &armada610_device_uart2;break ; +case 3 : d = &armada610_device_uart3;break ; +case 4 : d = &armada610_device_uart4;break ; +default : +return -EINVAL ; + } + +return pxa_register_device (d,NULL ,0 ); +} + +static inline int armada610_add_twsi(int id, struct
i2c_pxa_platform_data *data,
+ struct i2c_board_info *info, unsigned size)
+{
+ struct pxa_device_desc *d = NULL;
+ int ret;
+
+ switch (id) {
+ case 0: d = &armada610_device_twsi1; break;
+ case 1: d = &armada610_device_twsi2; break;
+ case 2: d = &armada610_device_twsi3; break;
+ case 3: d = &armada610_device_twsi4; break;
+ case 4: d = &armada610_device_twsi5; break;
+ case 5: d = &armada610_device_twsi6; break;
+ default:
+ return -EINVAL;
+ }
+
+ ret = i2c_register_board_info(id, info, size);
+ if (ret)
+ return ret;
+
+ return pxa_register_device(d, data, sizeof(*data));
+}
+
+#endif /* __ASM_MACH_ARMADA610_H */
+
(quoted diff) +0 -0
b/arch/arm/mach-mmp/include/mach/devices.h
index 2458539..a991618 100644
arch/arm/mach-mmp/include/mach/devices.h +0 -0
@@ -34,4 +34,16 @@ struct pxa_device_desc pxa910_device_##_name
__initdata = { \
.size = _size, \
.dma = { _dma }, \
};
+
+#define ARMADA610_DEVICE(_name, _drv, _id, _irq, _start, _size, _dma...) \
+struct pxa_device_desc armada610_device_##_name __initdata = { \
+ .dev_name = "armada610-" #_name, \
+ .drv_name = _drv, \
+ .id = _id, \
+ .irq = IRQ_ARMADA610_##_irq, \
+ .start = _start, \
+ .size = _size, \
+ .dma = { _dma }, \+}
+
extern int pxa_register_device(struct pxa_device_desc *, void *, size_t);
(quoted diff) +0 -0
b/arch/arm/mach-mmp/include/mach/mfp-armada610.h
new file mode 100644
index 0000000..3a27fb4
arch/arm/mach-mmp/include/mach/mfp-armada610.h new file +241 -0
241 lines not on this page · raw message
Signature · 1 line
1.5.6.5