1 // SPDX-License-Identifier: GPL-2.0+
3 * OWL SoC's Pinctrl definitions
5 * Copyright (c) 2014 Actions Semi Inc.
6 * Author: David Liu <liuwei@actions-semi.com>
8 * Copyright (c) 2018 Linaro Ltd.
9 * Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
12 #ifndef __PINCTRL_OWL_H__
13 #define __PINCTRL_OWL_H__
15 #define OWL_PINCONF_SLEW_SLOW 0
16 #define OWL_PINCONF_SLEW_FAST 1
18 enum owl_pinconf_pull
{
20 OWL_PINCONF_PULL_DOWN
,
22 OWL_PINCONF_PULL_HOLD
,
25 enum owl_pinconf_drv
{
33 * struct owl_pullctl - Actions pad pull control register
34 * @reg: offset to the pull control register
35 * @shift: shift value of the register
36 * @width: width of the register
45 * struct owl_st - Actions pad schmitt trigger enable register
46 * @reg: offset to the schmitt trigger enable register
47 * @shift: shift value of the register
48 * @width: width of the register
57 * struct owl_pingroup - Actions pingroup definition
58 * @name: name of the pin group
59 * @pads: list of pins assigned to this pingroup
60 * @npads: size of @pads array
61 * @funcs: list of pinmux functions for this pingroup
62 * @nfuncs: size of @funcs array
63 * @mfpctl_reg: multiplexing control register offset
64 * @mfpctl_shift: multiplexing control register bit mask
65 * @mfpctl_width: multiplexing control register width
66 * @drv_reg: drive control register offset
67 * @drv_shift: drive control register bit mask
68 * @drv_width: driver control register width
69 * @sr_reg: slew rate control register offset
70 * @sr_shift: slew rate control register bit mask
71 * @sr_width: slew rate control register width
81 unsigned int mfpctl_shift
;
82 unsigned int mfpctl_width
;
85 unsigned int drv_shift
;
86 unsigned int drv_width
;
89 unsigned int sr_shift
;
90 unsigned int sr_width
;
94 * struct owl_padinfo - Actions pinctrl pad info
95 * @pad: pad name of the SoC
96 * @pullctl: pull control register info
97 * @st: schmitt trigger register info
101 struct owl_pullctl
*pullctl
;
106 * struct owl_pinmux_func - Actions pinctrl mux functions
107 * @name: name of the pinmux function.
108 * @groups: array of pin groups that may select this function.
109 * @ngroups: number of entries in @groups.
111 struct owl_pinmux_func
{
113 const char * const *groups
;
114 unsigned int ngroups
;
118 * struct owl_gpio_port - Actions GPIO port info
119 * @offset: offset of the GPIO port.
120 * @pins: number of pins belongs to the GPIO port.
121 * @outen: offset of the output enable register.
122 * @inen: offset of the input enable register.
123 * @dat: offset of the data register.
125 struct owl_gpio_port
{
134 * struct owl_pinctrl_soc_data - Actions pin controller driver configuration
135 * @pins: array describing all pins of the pin controller.
136 * @npins: number of entries in @pins.
137 * @functions: array describing all mux functions of this SoC.
138 * @nfunction: number of entries in @functions.
139 * @groups: array describing all pin groups of this SoC.
140 * @ngroups: number of entries in @groups.
141 * @padinfo: array describing the pad info of this SoC.
142 * @ngpios: number of pingroups the driver should expose as GPIOs.
143 * @port: array describing all GPIO ports of this SoC.
144 * @nports: number of GPIO ports in this SoC.
146 struct owl_pinctrl_soc_data
{
147 const struct pinctrl_pin_desc
*pins
;
149 const struct owl_pinmux_func
*functions
;
150 unsigned int nfunctions
;
151 const struct owl_pingroup
*groups
;
152 unsigned int ngroups
;
153 const struct owl_padinfo
*padinfo
;
155 const struct owl_gpio_port
*ports
;
159 int owl_pinctrl_probe(struct platform_device
*pdev
,
160 struct owl_pinctrl_soc_data
*soc_data
);
162 #endif /* __PINCTRL_OWL_H__ */