1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Marvell PXA2xx family pin control
5 * Copyright (C) 2015 Robert Jarzmik
8 #ifndef __PINCTRL_PXA_H
9 #define __PINCTRL_PXA_H
11 #define PXA_FUNCTION(_dir, _af, _name) \
14 .muxval = (_dir | (_af << 1)), \
17 #define PXA_PIN(_pin, funcs...) \
20 .functions = (struct pxa_desc_function[]){ \
24 #define PXA_GPIO_PIN(_pin, funcs...) \
27 .functions = (struct pxa_desc_function[]){ \
28 PXA_FUNCTION(0, 0, "gpio_in"), \
29 PXA_FUNCTION(1, 0, "gpio_out"), \
33 #define PXA_GPIO_ONLY_PIN(_pin) \
36 .functions = (struct pxa_desc_function[]){ \
37 PXA_FUNCTION(0, 0, "gpio_in"), \
38 PXA_FUNCTION(1, 0, "gpio_out"), \
42 #define PXA_PINCTRL_PIN(pin) \
43 PINCTRL_PIN(pin, "P" #pin)
45 struct pxa_desc_function
{
51 struct pinctrl_pin_desc pin
;
52 struct pxa_desc_function
*functions
;
55 struct pxa_pinctrl_group
{
60 struct pxa_pinctrl_function
{
68 void __iomem
**base_gafr
;
69 void __iomem
**base_gpdr
;
70 void __iomem
**base_pgsr
;
72 struct pinctrl_desc desc
;
73 struct pinctrl_dev
*pctl_dev
;
75 const struct pxa_desc_pin
*ppins
;
77 struct pxa_pinctrl_group
*groups
;
79 struct pxa_pinctrl_function
*functions
;
83 int pxa2xx_pinctrl_init(struct platform_device
*pdev
,
84 const struct pxa_desc_pin
*ppins
, int npins
,
85 void __iomem
*base_gafr
[], void __iomem
*base_gpdr
[],
86 void __iomem
*base_gpsr
[]);
88 #endif /* __PINCTRL_PXA_H */