Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) #ifndef __ASM_MACH_PXA168_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) #define __ASM_MACH_PXA168_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) #include <linux/reboot.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) extern void pxa168_timer_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) extern void __init icu_init_irq(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) extern void __init pxa168_init_irq(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) extern void pxa168_restart(enum reboot_mode, const char *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) extern void pxa168_clear_keypad_wakeup(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/i2c.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/platform_data/i2c-pxa.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/platform_data/mtd-nand-pxa3xx.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <video/pxa168fb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/platform_data/keypad-pxa27x.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <linux/pxa168_eth.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <linux/platform_data/mv_usb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include <linux/soc/mmp/cputype.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include "devices.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) extern struct pxa_device_desc pxa168_device_uart1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) extern struct pxa_device_desc pxa168_device_uart2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) extern struct pxa_device_desc pxa168_device_uart3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) extern struct pxa_device_desc pxa168_device_twsi0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) extern struct pxa_device_desc pxa168_device_twsi1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) extern struct pxa_device_desc pxa168_device_pwm1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) extern struct pxa_device_desc pxa168_device_pwm2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) extern struct pxa_device_desc pxa168_device_pwm3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) extern struct pxa_device_desc pxa168_device_pwm4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) extern struct pxa_device_desc pxa168_device_ssp1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) extern struct pxa_device_desc pxa168_device_ssp2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) extern struct pxa_device_desc pxa168_device_ssp3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) extern struct pxa_device_desc pxa168_device_ssp4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) extern struct pxa_device_desc pxa168_device_ssp5;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) extern struct pxa_device_desc pxa168_device_nand;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) extern struct pxa_device_desc pxa168_device_fb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) extern struct pxa_device_desc pxa168_device_keypad;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) extern struct pxa_device_desc pxa168_device_eth;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) /* pdata can be NULL */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) extern int __init pxa168_add_usb_host(struct mv_usb_platform_data *pdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) extern struct platform_device pxa168_device_gpio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) static inline int pxa168_add_uart(int id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	struct pxa_device_desc *d = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	switch (id) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	case 1: d = &pxa168_device_uart1; break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	case 2: d = &pxa168_device_uart2; break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	case 3: d = &pxa168_device_uart3; break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	if (d == NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	return pxa_register_device(d, NULL, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) static inline int pxa168_add_twsi(int id, struct i2c_pxa_platform_data *data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 				  struct i2c_board_info *info, unsigned size)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	struct pxa_device_desc *d = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	switch (id) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	case 0: d = &pxa168_device_twsi0; break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	case 1: d = &pxa168_device_twsi1; break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	ret = i2c_register_board_info(id, info, size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 		return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	return pxa_register_device(d, data, sizeof(*data));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) static inline int pxa168_add_pwm(int id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	struct pxa_device_desc *d = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	switch (id) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	case 1: d = &pxa168_device_pwm1; break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	case 2: d = &pxa168_device_pwm2; break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	case 3: d = &pxa168_device_pwm3; break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	case 4: d = &pxa168_device_pwm4; break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	return pxa_register_device(d, NULL, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) static inline int pxa168_add_ssp(int id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	struct pxa_device_desc *d = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	switch (id) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	case 1: d = &pxa168_device_ssp1; break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	case 2: d = &pxa168_device_ssp2; break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	case 3: d = &pxa168_device_ssp3; break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	case 4: d = &pxa168_device_ssp4; break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	case 5: d = &pxa168_device_ssp5; break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	return pxa_register_device(d, NULL, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) static inline int pxa168_add_nand(struct pxa3xx_nand_platform_data *info)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	return pxa_register_device(&pxa168_device_nand, info, sizeof(*info));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) static inline int pxa168_add_fb(struct pxa168fb_mach_info *mi)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	return pxa_register_device(&pxa168_device_fb, mi, sizeof(*mi));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) static inline int pxa168_add_keypad(struct pxa27x_keypad_platform_data *data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	if (cpu_is_pxa168())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 		data->clear_wakeup_event = pxa168_clear_keypad_wakeup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	return pxa_register_device(&pxa168_device_keypad, data, sizeof(*data));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) static inline int pxa168_add_eth(struct pxa168_eth_platform_data *data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	return pxa_register_device(&pxa168_device_eth, data, sizeof(*data));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) #endif /* __ASM_MACH_PXA168_H */