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
;
57 void __iomem
**base_gafr
;
58 void __iomem
**base_gpdr
;
59 void __iomem
**base_pgsr
;
61 struct pinctrl_desc desc
;
62 struct pinctrl_dev
*pctl_dev
;
64 const struct pxa_desc_pin
*ppins
;
66 struct pingroup
*groups
;
68 struct pinfunction
*functions
;
72 int pxa2xx_pinctrl_init(struct platform_device
*pdev
,
73 const struct pxa_desc_pin
*ppins
, int npins
,
74 void __iomem
*base_gafr
[], void __iomem
*base_gpdr
[],
75 void __iomem
*base_gpsr
[]);
77 #endif /* __PINCTRL_PXA_H */