2 * Marvell PXA2xx family pin control
4 * Copyright (C) 2015 Robert Jarzmik
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
12 #ifndef __PINCTRL_PXA_H
13 #define __PINCTRL_PXA_H
15 #define PXA_FUNCTION(_dir, _af, _name) \
18 .muxval = (_dir | (_af << 1)), \
21 #define PXA_PIN(_pin, funcs...) \
24 .functions = (struct pxa_desc_function[]){ \
28 #define PXA_GPIO_PIN(_pin, funcs...) \
31 .functions = (struct pxa_desc_function[]){ \
32 PXA_FUNCTION(0, 0, "gpio_in"), \
33 PXA_FUNCTION(1, 0, "gpio_out"), \
37 #define PXA_GPIO_ONLY_PIN(_pin) \
40 .functions = (struct pxa_desc_function[]){ \
41 PXA_FUNCTION(0, 0, "gpio_in"), \
42 PXA_FUNCTION(1, 0, "gpio_out"), \
46 #define PXA_PINCTRL_PIN(pin) \
47 PINCTRL_PIN(pin, "P" #pin)
49 struct pxa_desc_function
{
55 struct pinctrl_pin_desc pin
;
56 struct pxa_desc_function
*functions
;
59 struct pxa_pinctrl_group
{
64 struct pxa_pinctrl_function
{
72 void __iomem
**base_gafr
;
73 void __iomem
**base_gpdr
;
74 void __iomem
**base_pgsr
;
76 struct pinctrl_desc desc
;
77 struct pinctrl_dev
*pctl_dev
;
79 const struct pxa_desc_pin
*ppins
;
81 struct pxa_pinctrl_group
*groups
;
83 struct pxa_pinctrl_function
*functions
;
87 int pxa2xx_pinctrl_init(struct platform_device
*pdev
,
88 const struct pxa_desc_pin
*ppins
, int npins
,
89 void __iomem
*base_gafr
[], void __iomem
*base_gpdr
[],
90 void __iomem
*base_gpsr
[]);
92 #endif /* __PINCTRL_PXA_H */