Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pinctrl-imx.h
Go to the documentation of this file.
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 <[email protected]>
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_IMX_H
16 #define __DRIVERS_PINCTRL_IMX_H
17 
18 struct platform_device;
19 
32 struct imx_pin_group {
33  const char *name;
34  unsigned int *pins;
35  unsigned npins;
36  unsigned int *mux_mode;
37  unsigned long *configs;
38 };
39 
46 struct imx_pmx_func {
47  const char *name;
48  const char **groups;
49  unsigned num_groups;
50 };
51 
63 struct imx_pin_reg {
70 };
71 
73  struct device *dev;
74  const struct pinctrl_pin_desc *pins;
75  unsigned int npins;
76  const struct imx_pin_reg *pin_regs;
77  unsigned int npin_regs;
79  unsigned int ngroups;
81  unsigned int nfunctions;
82 };
83 
84 #define NO_MUX 0x0
85 #define NO_PAD 0x0
86 
87 #define IMX_PIN_REG(id, conf, mux, mode, input, val) \
88  { \
89  .pid = id, \
90  .conf_reg = conf, \
91  .mux_reg = mux, \
92  .mux_mode = mode, \
93  .input_reg = input, \
94  .input_val = val, \
95  }
96 
97 #define IMX_PINCTRL_PIN(pin) PINCTRL_PIN(pin, #pin)
98 
99 #define PAD_CTL_MASK(len) ((1 << len) - 1)
100 #define IMX_MUX_MASK 0x7
101 #define IOMUXC_CONFIG_SION (0x1 << 4)
102 
103 int imx_pinctrl_probe(struct platform_device *pdev,
104  struct imx_pinctrl_soc_info *info);
105 int imx_pinctrl_remove(struct platform_device *pdev);
106 #endif /* __DRIVERS_PINCTRL_IMX_H */