17153c3cbSHuacai Chen /* SPDX-License-Identifier: GPL-2.0 */
27153c3cbSHuacai Chen /*
37153c3cbSHuacai Chen * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
47153c3cbSHuacai Chen */
5*2fd001cdSThomas Zimmermann #ifndef _ASM_VIDEO_H_
6*2fd001cdSThomas Zimmermann #define _ASM_VIDEO_H_
77153c3cbSHuacai Chen
88f8eaa1bSThomas Zimmermann #include <linux/compiler.h>
98f8eaa1bSThomas Zimmermann #include <linux/string.h>
108f8eaa1bSThomas Zimmermann
fb_memcpy_fromio(void * to,const volatile void __iomem * from,size_t n)1120d54e48SThomas Zimmermann static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n)
128f8eaa1bSThomas Zimmermann {
138f8eaa1bSThomas Zimmermann memcpy(to, (void __force *)from, n);
148f8eaa1bSThomas Zimmermann }
1520d54e48SThomas Zimmermann #define fb_memcpy_fromio fb_memcpy_fromio
168f8eaa1bSThomas Zimmermann
fb_memcpy_toio(volatile void __iomem * to,const void * from,size_t n)1720d54e48SThomas Zimmermann static inline void fb_memcpy_toio(volatile void __iomem *to, const void *from, size_t n)
188f8eaa1bSThomas Zimmermann {
198f8eaa1bSThomas Zimmermann memcpy((void __force *)to, from, n);
208f8eaa1bSThomas Zimmermann }
2120d54e48SThomas Zimmermann #define fb_memcpy_toio fb_memcpy_toio
228f8eaa1bSThomas Zimmermann
fb_memset_io(volatile void __iomem * addr,int c,size_t n)2320d54e48SThomas Zimmermann static inline void fb_memset_io(volatile void __iomem *addr, int c, size_t n)
248f8eaa1bSThomas Zimmermann {
258f8eaa1bSThomas Zimmermann memset((void __force *)addr, c, n);
268f8eaa1bSThomas Zimmermann }
2720d54e48SThomas Zimmermann #define fb_memset fb_memset_io
288f8eaa1bSThomas Zimmermann
29*2fd001cdSThomas Zimmermann #include <asm-generic/video.h>
307153c3cbSHuacai Chen
31*2fd001cdSThomas Zimmermann #endif /* _ASM_VIDEO_H_ */
32