Markus Pargmann | 30612cd9 | 2013-10-28 10:00:36 +0100 | [diff] [blame] | 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 | |
| 18 | struct 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 | */ |
| 26 | struct 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 | */ |
| 39 | struct 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 | */ |
| 52 | struct imx1_pmx_func { |
| 53 | const char *name; |
| 54 | const char **groups; |
| 55 | unsigned num_groups; |
| 56 | }; |
| 57 | |
| 58 | struct 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 | |
| 70 | int imx1_pinctrl_core_probe(struct platform_device *pdev, |
| 71 | struct imx1_pinctrl_soc_info *info); |
| 72 | int imx1_pinctrl_core_remove(struct platform_device *pdev); |
| 73 | #endif /* __DRIVERS_PINCTRL_IMX1_H */ |