Path: blob/master/arch/arm/mach-mmp/include/mach/pxa168.h
15162 views
#ifndef __ASM_MACH_PXA168_H1#define __ASM_MACH_PXA168_H23struct sys_timer;45extern struct sys_timer pxa168_timer;6extern void __init pxa168_init_irq(void);7extern void pxa168_clear_keypad_wakeup(void);89#include <linux/i2c.h>10#include <linux/i2c/pxa-i2c.h>11#include <mach/devices.h>12#include <plat/pxa3xx_nand.h>13#include <video/pxa168fb.h>14#include <plat/pxa27x_keypad.h>15#include <mach/cputype.h>1617extern struct pxa_device_desc pxa168_device_uart1;18extern struct pxa_device_desc pxa168_device_uart2;19extern struct pxa_device_desc pxa168_device_twsi0;20extern struct pxa_device_desc pxa168_device_twsi1;21extern struct pxa_device_desc pxa168_device_pwm1;22extern struct pxa_device_desc pxa168_device_pwm2;23extern struct pxa_device_desc pxa168_device_pwm3;24extern struct pxa_device_desc pxa168_device_pwm4;25extern struct pxa_device_desc pxa168_device_ssp1;26extern struct pxa_device_desc pxa168_device_ssp2;27extern struct pxa_device_desc pxa168_device_ssp3;28extern struct pxa_device_desc pxa168_device_ssp4;29extern struct pxa_device_desc pxa168_device_ssp5;30extern struct pxa_device_desc pxa168_device_nand;31extern struct pxa_device_desc pxa168_device_fb;32extern struct pxa_device_desc pxa168_device_keypad;3334static inline int pxa168_add_uart(int id)35{36struct pxa_device_desc *d = NULL;3738switch (id) {39case 1: d = &pxa168_device_uart1; break;40case 2: d = &pxa168_device_uart2; break;41}4243if (d == NULL)44return -EINVAL;4546return pxa_register_device(d, NULL, 0);47}4849static inline int pxa168_add_twsi(int id, struct i2c_pxa_platform_data *data,50struct i2c_board_info *info, unsigned size)51{52struct pxa_device_desc *d = NULL;53int ret;5455switch (id) {56case 0: d = &pxa168_device_twsi0; break;57case 1: d = &pxa168_device_twsi1; break;58default:59return -EINVAL;60}6162ret = i2c_register_board_info(id, info, size);63if (ret)64return ret;6566return pxa_register_device(d, data, sizeof(*data));67}6869static inline int pxa168_add_pwm(int id)70{71struct pxa_device_desc *d = NULL;7273switch (id) {74case 1: d = &pxa168_device_pwm1; break;75case 2: d = &pxa168_device_pwm2; break;76case 3: d = &pxa168_device_pwm3; break;77case 4: d = &pxa168_device_pwm4; break;78default:79return -EINVAL;80}8182return pxa_register_device(d, NULL, 0);83}8485static inline int pxa168_add_ssp(int id)86{87struct pxa_device_desc *d = NULL;8889switch (id) {90case 1: d = &pxa168_device_ssp1; break;91case 2: d = &pxa168_device_ssp2; break;92case 3: d = &pxa168_device_ssp3; break;93case 4: d = &pxa168_device_ssp4; break;94case 5: d = &pxa168_device_ssp5; break;95default:96return -EINVAL;97}98return pxa_register_device(d, NULL, 0);99}100101static inline int pxa168_add_nand(struct pxa3xx_nand_platform_data *info)102{103return pxa_register_device(&pxa168_device_nand, info, sizeof(*info));104}105106static inline int pxa168_add_fb(struct pxa168fb_mach_info *mi)107{108return pxa_register_device(&pxa168_device_fb, mi, sizeof(*mi));109}110111static inline int pxa168_add_keypad(struct pxa27x_keypad_platform_data *data)112{113if (cpu_is_pxa168())114data->clear_wakeup_event = pxa168_clear_keypad_wakeup;115116return pxa_register_device(&pxa168_device_keypad, data, sizeof(*data));117}118119#endif /* __ASM_MACH_PXA168_H */120121122