18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef __ASM_MACH_PXA910_H 38c2ecf20Sopenharmony_ci#define __ASM_MACH_PXA910_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ciextern void pxa910_timer_init(void); 68c2ecf20Sopenharmony_ciextern void __init icu_init_irq(void); 78c2ecf20Sopenharmony_ciextern void __init pxa910_init_irq(void); 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#include <linux/i2c.h> 108c2ecf20Sopenharmony_ci#include <linux/platform_data/i2c-pxa.h> 118c2ecf20Sopenharmony_ci#include <linux/platform_data/mtd-nand-pxa3xx.h> 128c2ecf20Sopenharmony_ci#include <video/mmp_disp.h> 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#include "devices.h" 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ciextern struct pxa_device_desc pxa910_device_uart1; 178c2ecf20Sopenharmony_ciextern struct pxa_device_desc pxa910_device_uart2; 188c2ecf20Sopenharmony_ciextern struct pxa_device_desc pxa910_device_twsi0; 198c2ecf20Sopenharmony_ciextern struct pxa_device_desc pxa910_device_twsi1; 208c2ecf20Sopenharmony_ciextern struct pxa_device_desc pxa910_device_pwm1; 218c2ecf20Sopenharmony_ciextern struct pxa_device_desc pxa910_device_pwm2; 228c2ecf20Sopenharmony_ciextern struct pxa_device_desc pxa910_device_pwm3; 238c2ecf20Sopenharmony_ciextern struct pxa_device_desc pxa910_device_pwm4; 248c2ecf20Sopenharmony_ciextern struct pxa_device_desc pxa910_device_nand; 258c2ecf20Sopenharmony_ciextern struct platform_device pxa168_device_usb_phy; 268c2ecf20Sopenharmony_ciextern struct platform_device pxa168_device_u2o; 278c2ecf20Sopenharmony_ciextern struct platform_device pxa168_device_u2ootg; 288c2ecf20Sopenharmony_ciextern struct platform_device pxa168_device_u2oehci; 298c2ecf20Sopenharmony_ciextern struct pxa_device_desc pxa910_device_disp; 308c2ecf20Sopenharmony_ciextern struct pxa_device_desc pxa910_device_fb; 318c2ecf20Sopenharmony_ciextern struct pxa_device_desc pxa910_device_panel; 328c2ecf20Sopenharmony_ciextern struct platform_device pxa910_device_gpio; 338c2ecf20Sopenharmony_ciextern struct platform_device pxa910_device_rtc; 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_cistatic inline int pxa910_add_uart(int id) 368c2ecf20Sopenharmony_ci{ 378c2ecf20Sopenharmony_ci struct pxa_device_desc *d = NULL; 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci switch (id) { 408c2ecf20Sopenharmony_ci case 1: d = &pxa910_device_uart1; break; 418c2ecf20Sopenharmony_ci case 2: d = &pxa910_device_uart2; break; 428c2ecf20Sopenharmony_ci } 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci if (d == NULL) 458c2ecf20Sopenharmony_ci return -EINVAL; 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ci return pxa_register_device(d, NULL, 0); 488c2ecf20Sopenharmony_ci} 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_cistatic inline int pxa910_add_twsi(int id, struct i2c_pxa_platform_data *data, 518c2ecf20Sopenharmony_ci struct i2c_board_info *info, unsigned size) 528c2ecf20Sopenharmony_ci{ 538c2ecf20Sopenharmony_ci struct pxa_device_desc *d = NULL; 548c2ecf20Sopenharmony_ci int ret; 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci switch (id) { 578c2ecf20Sopenharmony_ci case 0: d = &pxa910_device_twsi0; break; 588c2ecf20Sopenharmony_ci case 1: d = &pxa910_device_twsi1; break; 598c2ecf20Sopenharmony_ci default: 608c2ecf20Sopenharmony_ci return -EINVAL; 618c2ecf20Sopenharmony_ci } 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ci ret = i2c_register_board_info(id, info, size); 648c2ecf20Sopenharmony_ci if (ret) 658c2ecf20Sopenharmony_ci return ret; 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci return pxa_register_device(d, data, sizeof(*data)); 688c2ecf20Sopenharmony_ci} 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_cistatic inline int pxa910_add_pwm(int id) 718c2ecf20Sopenharmony_ci{ 728c2ecf20Sopenharmony_ci struct pxa_device_desc *d = NULL; 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_ci switch (id) { 758c2ecf20Sopenharmony_ci case 1: d = &pxa910_device_pwm1; break; 768c2ecf20Sopenharmony_ci case 2: d = &pxa910_device_pwm2; break; 778c2ecf20Sopenharmony_ci case 3: d = &pxa910_device_pwm3; break; 788c2ecf20Sopenharmony_ci case 4: d = &pxa910_device_pwm4; break; 798c2ecf20Sopenharmony_ci default: 808c2ecf20Sopenharmony_ci return -EINVAL; 818c2ecf20Sopenharmony_ci } 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ci return pxa_register_device(d, NULL, 0); 848c2ecf20Sopenharmony_ci} 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_cistatic inline int pxa910_add_nand(struct pxa3xx_nand_platform_data *info) 878c2ecf20Sopenharmony_ci{ 888c2ecf20Sopenharmony_ci return pxa_register_device(&pxa910_device_nand, info, sizeof(*info)); 898c2ecf20Sopenharmony_ci} 908c2ecf20Sopenharmony_ci#endif /* __ASM_MACH_PXA910_H */ 91