GNU Linux-libre 4.19.304-gnu1
[releases.git] / drivers / pinctrl / freescale / pinctrl-imx1.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * IMX pinmux core definitions
4  *
5  * Copyright (C) 2012 Freescale Semiconductor, Inc.
6  * Copyright (C) 2012 Linaro Ltd.
7  *
8  * Author: Dong Aisheng <dong.aisheng@linaro.org>
9  */
10
11 #ifndef __DRIVERS_PINCTRL_IMX1_H
12 #define __DRIVERS_PINCTRL_IMX1_H
13
14 struct platform_device;
15
16 /**
17  * struct imx1_pin - describes an IMX1/21/27 pin.
18  * @pin_id: ID of the described pin.
19  * @mux_id: ID of the mux setup.
20  * @config: Configuration of the pin (currently only pullup-enable).
21  */
22 struct imx1_pin {
23         unsigned int pin_id;
24         unsigned int mux_id;
25         unsigned long config;
26 };
27
28 /**
29  * struct imx1_pin_group - describes an IMX pin group
30  * @name: the name of this specific pin group
31  * @pins: an array of imx1_pin structs used in this group
32  * @npins: the number of pins in this group array, i.e. the number of
33  *      elements in .pins so we can iterate over that array
34  */
35 struct imx1_pin_group {
36         const char *name;
37         unsigned int *pin_ids;
38         struct imx1_pin *pins;
39         unsigned npins;
40 };
41
42 /**
43  * struct imx1_pmx_func - describes IMX pinmux functions
44  * @name: the name of this specific function
45  * @groups: corresponding pin groups
46  * @num_groups: the number of groups
47  */
48 struct imx1_pmx_func {
49         const char *name;
50         const char **groups;
51         unsigned num_groups;
52 };
53
54 struct imx1_pinctrl_soc_info {
55         struct device *dev;
56         const struct pinctrl_pin_desc *pins;
57         unsigned int npins;
58         struct imx1_pin_group *groups;
59         unsigned int ngroups;
60         struct imx1_pmx_func *functions;
61         unsigned int nfunctions;
62 };
63
64 #define IMX_PINCTRL_PIN(pin) PINCTRL_PIN(pin, #pin)
65
66 int imx1_pinctrl_core_probe(struct platform_device *pdev,
67                         struct imx1_pinctrl_soc_info *info);
68 #endif /* __DRIVERS_PINCTRL_IMX1_H */