Peng Fan | f70bf2b | 2017-02-22 16:21:49 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 Freescale Semiconductor, Inc. |
| 3 | * |
| 4 | * Peng Fan <peng.fan@nxp.com> |
| 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0+ |
| 7 | */ |
| 8 | |
Simon Glass | 51a3ec3 | 2017-05-17 17:18:07 -0600 | [diff] [blame] | 9 | #include <common.h> |
Simon Glass | 11c89f3 | 2017-05-17 17:18:03 -0600 | [diff] [blame] | 10 | #include <dm.h> |
Peng Fan | f70bf2b | 2017-02-22 16:21:49 +0800 | [diff] [blame] | 11 | #include <dm/pinctrl.h> |
| 12 | |
| 13 | #include "pinctrl-imx.h" |
| 14 | |
Peng Fan | 7f0fb44 | 2017-08-14 18:09:17 +0800 | [diff] [blame] | 15 | static struct imx_pinctrl_soc_info imx7ulp_pinctrl_soc_info0 = { |
Peng Fan | f70bf2b | 2017-02-22 16:21:49 +0800 | [diff] [blame] | 16 | .flags = ZERO_OFFSET_VALID | SHARE_MUX_CONF_REG | CONFIG_IBE_OBE, |
| 17 | }; |
| 18 | |
Peng Fan | 7f0fb44 | 2017-08-14 18:09:17 +0800 | [diff] [blame] | 19 | static struct imx_pinctrl_soc_info imx7ulp_pinctrl_soc_info1 = { |
| 20 | .flags = ZERO_OFFSET_VALID | SHARE_MUX_CONF_REG | CONFIG_IBE_OBE, |
| 21 | }; |
| 22 | |
Peng Fan | f70bf2b | 2017-02-22 16:21:49 +0800 | [diff] [blame] | 23 | static int imx7ulp_pinctrl_probe(struct udevice *dev) |
| 24 | { |
| 25 | struct imx_pinctrl_soc_info *info = |
| 26 | (struct imx_pinctrl_soc_info *)dev_get_driver_data(dev); |
| 27 | |
| 28 | return imx_pinctrl_probe(dev, info); |
| 29 | } |
| 30 | |
| 31 | static const struct udevice_id imx7ulp_pinctrl_match[] = { |
Peng Fan | 7f0fb44 | 2017-08-14 18:09:17 +0800 | [diff] [blame] | 32 | { .compatible = "fsl,imx7ulp-iomuxc-0", .data = (ulong)&imx7ulp_pinctrl_soc_info0 }, |
| 33 | { .compatible = "fsl,imx7ulp-iomuxc-1", .data = (ulong)&imx7ulp_pinctrl_soc_info1 }, |
Peng Fan | f70bf2b | 2017-02-22 16:21:49 +0800 | [diff] [blame] | 34 | { /* sentinel */ } |
| 35 | }; |
| 36 | |
| 37 | U_BOOT_DRIVER(imx7ulp_pinctrl) = { |
| 38 | .name = "imx7ulp-pinctrl", |
| 39 | .id = UCLASS_PINCTRL, |
| 40 | .of_match = of_match_ptr(imx7ulp_pinctrl_match), |
| 41 | .probe = imx7ulp_pinctrl_probe, |
| 42 | .remove = imx_pinctrl_remove, |
| 43 | .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv), |
| 44 | .ops = &imx_pinctrl_ops, |
| 45 | .flags = DM_FLAG_PRE_RELOC, |
| 46 | }; |