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