aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-nomadik.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-22 12:39:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-22 12:39:42 -0400
commit813a95e5b4fa936bbde10ef89188932745dcd7f4 (patch)
tree571ca345861ffb89b45fabe26fcab4e133c8537b /drivers/pinctrl/pinctrl-nomadik.h
parent9f639269ed1522c7d69c54cc8b80ab8ee53fcb10 (diff)
parentf3f08dcb9965f42378851ce888fb7539607712e6 (diff)
Merge tag 'pinctrl' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull arm soc-specific pinctrl changes from Olof Johansson: "With this, five platforms are moving to the relatively new pinctrl subsystem for their pin management, replacing the older soc specific in-kernel interfaces with common code. There is quite a bit of net addition of code for each platform being added to the pinctrl subsystem. But the payback comes later when adding new boards can be done by only providing new device trees instead." Fix up trivial conflicts in arch/arm/mach-ux500/{Makefile,board-mop500.c} * tag 'pinctrl' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (61 commits) mtd: nand: gpmi: fix compile error caused by pinctrl call ARM: PRIMA2: select PINCTRL and PINCTRL_SIRF in Kconfig ARM: nomadik: enable PINCTRL_NOMADIK where needed ARM: mxs: enable pinctrl support video: mxsfb: adopt pinctrl support ASoC: mxs-saif: adopt pinctrl support i2c: mxs: adopt pinctrl support mtd: nand: gpmi: adopt pinctrl support mmc: mxs-mmc: adopt pinctrl support serial: mxs-auart: adopt pinctrl support serial: amba-pl011: adopt pinctrl support spi/imx: adopt pinctrl support i2c: imx: adopt pinctrl support can: flexcan: adopt pinctrl support net: fec: adopt pinctrl support ARM: ux500: switch MSP to using pinctrl for pins ARM: ux500: alter MSP registration to return a device pointer ARM: ux500: switch to using pinctrl for uart0 ARM: ux500: delete custom pin control system ARM: ux500: switch over to Nomadik pinctrl driver ...
Diffstat (limited to 'drivers/pinctrl/pinctrl-nomadik.h')
-rw-r--r--drivers/pinctrl/pinctrl-nomadik.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-nomadik.h b/drivers/pinctrl/pinctrl-nomadik.h
new file mode 100644
index 000000000000..bc91aed7185d
--- /dev/null
+++ b/drivers/pinctrl/pinctrl-nomadik.h
@@ -0,0 +1,77 @@
1#ifndef PINCTRL_PINCTRL_NOMADIK_H
2#define PINCTRL_PINCTRL_NOMADIK_H
3
4#include <plat/gpio-nomadik.h>
5
6/* Package definitions */
7#define PINCTRL_NMK_STN8815 0
8#define PINCTRL_NMK_DB8500 1
9
10/**
11 * struct nmk_function - Nomadik pinctrl mux function
12 * @name: The name of the function, exported to pinctrl core.
13 * @groups: An array of pin groups that may select this function.
14 * @ngroups: The number of entries in @groups.
15 */
16struct nmk_function {
17 const char *name;
18 const char * const *groups;
19 unsigned ngroups;
20};
21
22/**
23 * struct nmk_pingroup - describes a Nomadik pin group
24 * @name: the name of this specific pin group
25 * @pins: an array of discrete physical pins used in this group, taken
26 * from the driver-local pin enumeration space
27 * @num_pins: the number of pins in this group array, i.e. the number of
28 * elements in .pins so we can iterate over that array
29 * @altsetting: the altsetting to apply to all pins in this group to
30 * configure them to be used by a function
31 */
32struct nmk_pingroup {
33 const char *name;
34 const unsigned int *pins;
35 const unsigned npins;
36 int altsetting;
37};
38
39/**
40 * struct nmk_pinctrl_soc_data - Nomadik pin controller per-SoC configuration
41 * @gpio_ranges: An array of GPIO ranges for this SoC
42 * @gpio_num_ranges: The number of GPIO ranges for this SoC
43 * @pins: An array describing all pins the pin controller affects.
44 * All pins which are also GPIOs must be listed first within the
45 * array, and be numbered identically to the GPIO controller's
46 * numbering.
47 * @npins: The number of entries in @pins.
48 * @functions: The functions supported on this SoC.
49 * @nfunction: The number of entries in @functions.
50 * @groups: An array describing all pin groups the pin SoC supports.
51 * @ngroups: The number of entries in @groups.
52 */
53struct nmk_pinctrl_soc_data {
54 struct pinctrl_gpio_range *gpio_ranges;
55 unsigned gpio_num_ranges;
56 const struct pinctrl_pin_desc *pins;
57 unsigned npins;
58 const struct nmk_function *functions;
59 unsigned nfunctions;
60 const struct nmk_pingroup *groups;
61 unsigned ngroups;
62};
63
64#ifdef CONFIG_PINCTRL_DB8500
65
66void nmk_pinctrl_db8500_init(const struct nmk_pinctrl_soc_data **soc);
67
68#else
69
70static inline void
71nmk_pinctrl_db8500_init(const struct nmk_pinctrl_soc_data **soc)
72{
73}
74
75#endif
76
77#endif /* PINCTRL_PINCTRL_NOMADIK_H */