]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/arm/mach-mmp/pxa910.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[mirror_ubuntu-bionic-kernel.git] / arch / arm / mach-mmp / pxa910.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
14c6b5e7
EM
2#ifndef __ASM_MACH_PXA910_H
3#define __ASM_MACH_PXA910_H
4
6bb27d73 5extern void pxa910_timer_init(void);
c052d13c 6extern void __init icu_init_irq(void);
2728701d
EM
7extern void __init pxa910_init_irq(void);
8
1a77920e 9#include <linux/i2c.h>
b459396e 10#include <linux/i2c/pxa-i2c.h>
293b2da1 11#include <linux/platform_data/mtd-nand-pxa3xx.h>
333893cd 12#include <video/mmp_disp.h>
14c6b5e7 13
b501fd7b
AB
14#include "devices.h"
15
14c6b5e7
EM
16extern struct pxa_device_desc pxa910_device_uart1;
17extern struct pxa_device_desc pxa910_device_uart2;
1a77920e
EM
18extern struct pxa_device_desc pxa910_device_twsi0;
19extern struct pxa_device_desc pxa910_device_twsi1;
a27ba768
EM
20extern struct pxa_device_desc pxa910_device_pwm1;
21extern struct pxa_device_desc pxa910_device_pwm2;
22extern struct pxa_device_desc pxa910_device_pwm3;
23extern struct pxa_device_desc pxa910_device_pwm4;
a0f266c1 24extern struct pxa_device_desc pxa910_device_nand;
75b1bdf5
NZ
25extern struct platform_device pxa168_device_u2o;
26extern struct platform_device pxa168_device_u2ootg;
27extern struct platform_device pxa168_device_u2oehci;
333893cd
ZZ
28extern struct pxa_device_desc pxa910_device_disp;
29extern struct pxa_device_desc pxa910_device_fb;
30extern struct pxa_device_desc pxa910_device_panel;
157d2644 31extern struct platform_device pxa910_device_gpio;
4128e275 32extern struct platform_device pxa910_device_rtc;
157d2644 33
14c6b5e7
EM
34static inline int pxa910_add_uart(int id)
35{
36 struct pxa_device_desc *d = NULL;
37
38 switch (id) {
39 case 1: d = &pxa910_device_uart1; break;
40 case 2: d = &pxa910_device_uart2; break;
41 }
42
43 if (d == NULL)
44 return -EINVAL;
45
46 return pxa_register_device(d, NULL, 0);
47}
1a77920e
EM
48
49static inline int pxa910_add_twsi(int id, struct i2c_pxa_platform_data *data,
50 struct i2c_board_info *info, unsigned size)
51{
52 struct pxa_device_desc *d = NULL;
53 int ret;
54
55 switch (id) {
56 case 0: d = &pxa910_device_twsi0; break;
57 case 1: d = &pxa910_device_twsi1; break;
58 default:
59 return -EINVAL;
60 }
61
62 ret = i2c_register_board_info(id, info, size);
63 if (ret)
64 return ret;
65
66 return pxa_register_device(d, data, sizeof(*data));
67}
a27ba768
EM
68
69static inline int pxa910_add_pwm(int id)
70{
71 struct pxa_device_desc *d = NULL;
72
73 switch (id) {
74 case 1: d = &pxa910_device_pwm1; break;
75 case 2: d = &pxa910_device_pwm2; break;
76 case 3: d = &pxa910_device_pwm3; break;
77 case 4: d = &pxa910_device_pwm4; break;
78 default:
79 return -EINVAL;
80 }
81
82 return pxa_register_device(d, NULL, 0);
83}
a0f266c1
HZ
84
85static inline int pxa910_add_nand(struct pxa3xx_nand_platform_data *info)
86{
87 return pxa_register_device(&pxa910_device_nand, info, sizeof(*info));
88}
14c6b5e7 89#endif /* __ASM_MACH_PXA910_H */