1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2019 MediaTek Inc. All Rights Reserved.
5 * Author: Weijie Gao <weijie.gao@mediatek.com>
8 #ifndef _PINCTRL_MTMIPS_COMMON_H_
9 #define _PINCTRL_MTMIPS_COMMON_H_
13 struct mtmips_pmx_func {
18 struct mtmips_pmx_group {
26 const struct mtmips_pmx_func *funcs;
29 struct mtmips_pinctrl_priv {
33 const struct mtmips_pmx_group *groups;
36 const struct mtmips_pmx_func **funcs;
39 #define FUNC(name, value) { name, value }
41 #define GRP(_name, _funcs, _reg, _shift, _mask) \
42 { .name = (_name), .reg = (_reg), .shift = (_shift), .mask = (_mask), \
43 .funcs = (_funcs), .nfuncs = ARRAY_SIZE(_funcs) }
45 int mtmips_get_functions_count(struct udevice *dev);
46 const char *mtmips_get_function_name(struct udevice *dev,
47 unsigned int selector);
48 int mtmips_pinmux_group_set(struct udevice *dev, unsigned int group_selector,
49 unsigned int func_selector);
50 int mtmips_pinctrl_probe(struct mtmips_pinctrl_priv *priv, u32 ngroups,
51 const struct mtmips_pmx_group *groups);
53 #endif /* _PINCTRL_MTMIPS_COMMON_H_ */