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) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  * Marvell Berlin SoC pinctrl driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  * Copyright (C) 2014 Marvell Technology Group Ltd.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)  * Antoine Ténart <antoine.tenart@free-electrons.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #ifndef __PINCTRL_BERLIN_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #define __PINCTRL_BERLIN_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) struct berlin_desc_function {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) 	const char	*name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) 	u8		muxval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) struct berlin_desc_group {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) 	const char			*name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 	u8				offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 	u8				bit_width;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 	u8				lsb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 	struct berlin_desc_function	*functions;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) struct berlin_pinctrl_desc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 	const struct berlin_desc_group	*groups;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 	unsigned			ngroups;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) struct berlin_pinctrl_function {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 	const char	*name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 	const char	**groups;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 	unsigned	ngroups;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #define BERLIN_PINCTRL_GROUP(_name, _offset, _width, _lsb, ...)		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 	{								\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 		.name = _name,						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 		.offset = _offset,					\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 		.bit_width = _width,					\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 		.lsb = _lsb,						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 		.functions = (struct berlin_desc_function[]){		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 			__VA_ARGS__, { } },				\
^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) #define BERLIN_PINCTRL_FUNCTION(_muxval, _name)		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 	{						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 		.name = _name,				\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 		.muxval = _muxval,			\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #define BERLIN_PINCTRL_FUNCTION_UNKNOWN		{}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) int berlin_pinctrl_probe(struct platform_device *pdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 			 const struct berlin_pinctrl_desc *desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) int berlin_pinctrl_probe_regmap(struct platform_device *pdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 				const struct berlin_pinctrl_desc *desc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 				struct regmap *regmap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #endif /* __PINCTRL_BERLIN_H */