Ye Li | 0bf4a77 | 2021-08-07 16:00:43 +0800 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Copyright 2020 NXP |
| 4 | * |
| 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <dm.h> |
| 9 | #include <dm/pinctrl.h> |
| 10 | |
| 11 | #include "pinctrl-imx.h" |
| 12 | |
| 13 | static struct imx_pinctrl_soc_info imx8ulp_pinctrl_soc_info0 = { |
Tom Rini | 6e7df1d | 2023-01-10 11:19:45 -0500 | [diff] [blame^] | 14 | .flags = ZERO_OFFSET_VALID | SHARE_MUX_CONF_REG | CFG_IBE_OBE, |
Ye Li | 0bf4a77 | 2021-08-07 16:00:43 +0800 | [diff] [blame] | 15 | }; |
| 16 | |
| 17 | static struct imx_pinctrl_soc_info imx8ulp_pinctrl_soc_info1 = { |
Tom Rini | 6e7df1d | 2023-01-10 11:19:45 -0500 | [diff] [blame^] | 18 | .flags = ZERO_OFFSET_VALID | SHARE_MUX_CONF_REG | CFG_IBE_OBE, |
Ye Li | 0bf4a77 | 2021-08-07 16:00:43 +0800 | [diff] [blame] | 19 | }; |
| 20 | |
| 21 | static int imx8ulp_pinctrl_probe(struct udevice *dev) |
| 22 | { |
| 23 | struct imx_pinctrl_soc_info *info = |
| 24 | (struct imx_pinctrl_soc_info *)dev_get_driver_data(dev); |
| 25 | |
| 26 | return imx_pinctrl_probe(dev, info); |
| 27 | } |
| 28 | |
| 29 | static const struct udevice_id imx8ulp_pinctrl_match[] = { |
| 30 | { .compatible = "fsl,imx8ulp-iomuxc0", .data = (ulong)&imx8ulp_pinctrl_soc_info0 }, |
| 31 | { .compatible = "fsl,imx8ulp-iomuxc1", .data = (ulong)&imx8ulp_pinctrl_soc_info1 }, |
| 32 | { /* sentinel */ } |
| 33 | }; |
| 34 | |
| 35 | U_BOOT_DRIVER(imx8ulp_pinctrl) = { |
| 36 | .name = "imx8ulp-pinctrl", |
| 37 | .id = UCLASS_PINCTRL, |
| 38 | .of_match = of_match_ptr(imx8ulp_pinctrl_match), |
| 39 | .probe = imx8ulp_pinctrl_probe, |
| 40 | .remove = imx_pinctrl_remove, |
| 41 | .priv_auto = sizeof(struct imx_pinctrl_priv), |
| 42 | .ops = &imx_pinctrl_ops, |
| 43 | .flags = DM_FLAG_PRE_RELOC, |
| 44 | }; |