aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-imx1.h
diff options
context:
space:
mode:
authorMarkus Pargmann <mpa@pengutronix.de>2013-10-28 05:00:36 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-10-29 09:54:37 -0400
commit30612cd90005d8c4a3c53c7acadcf934a46c13df (patch)
treec62c5e7eadd0fdef37ea704ec16eb1dad2374ea0 /drivers/pinctrl/pinctrl-imx1.h
parentc6ce2b6bffe5740d572fdc5b5e690d5261abee51 (diff)
pinctrl: imx1 core driver
Core driver for register formats of imx1/imx21/imx27 processors. The pins of those processors are grouped into ports. Each port has 32 pins. The pins mux configuration is controlled by registers with 1 or 2 bit per pin, depending on the specific control register. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-imx1.h')
-rw-r--r--drivers/pinctrl/pinctrl-imx1.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-imx1.h b/drivers/pinctrl/pinctrl-imx1.h
new file mode 100644
index 000000000000..692a54c15cda
--- /dev/null
+++ b/drivers/pinctrl/pinctrl-imx1.h
@@ -0,0 +1,73 @@
1/*
2 * IMX pinmux core definitions
3 *
4 * Copyright (C) 2012 Freescale Semiconductor, Inc.
5 * Copyright (C) 2012 Linaro Ltd.
6 *
7 * Author: Dong Aisheng <dong.aisheng@linaro.org>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 */
14
15#ifndef __DRIVERS_PINCTRL_IMX1_H
16#define __DRIVERS_PINCTRL_IMX1_H
17
18struct platform_device;
19
20/**
21 * struct imx1_pin - describes an IMX1/21/27 pin.
22 * @pin_id: ID of the described pin.
23 * @mux_id: ID of the mux setup.
24 * @config: Configuration of the pin (currently only pullup-enable).
25 */
26struct imx1_pin {
27 unsigned int pin_id;
28 unsigned int mux_id;
29 unsigned long config;
30};
31
32/**
33 * struct imx1_pin_group - describes an IMX pin group
34 * @name: the name of this specific pin group
35 * @pins: an array of imx1_pin structs used in this group
36 * @npins: the number of pins in this group array, i.e. the number of
37 * elements in .pins so we can iterate over that array
38 */
39struct imx1_pin_group {
40 const char *name;
41 unsigned int *pin_ids;
42 struct imx1_pin *pins;
43 unsigned npins;
44};
45
46/**
47 * struct imx1_pmx_func - describes IMX pinmux functions
48 * @name: the name of this specific function
49 * @groups: corresponding pin groups
50 * @num_groups: the number of groups
51 */
52struct imx1_pmx_func {
53 const char *name;
54 const char **groups;
55 unsigned num_groups;
56};
57
58struct imx1_pinctrl_soc_info {
59 struct device *dev;
60 const struct pinctrl_pin_desc *pins;
61 unsigned int npins;
62 struct imx1_pin_group *groups;
63 unsigned int ngroups;
64 struct imx1_pmx_func *functions;
65 unsigned int nfunctions;
66};
67
68#define IMX_PINCTRL_PIN(pin) PINCTRL_PIN(pin, #pin)
69
70int imx1_pinctrl_core_probe(struct platform_device *pdev,
71 struct imx1_pinctrl_soc_info *info);
72int imx1_pinctrl_core_remove(struct platform_device *pdev);
73#endif /* __DRIVERS_PINCTRL_IMX1_H */