Peng Fan | e84d11f | 2018-10-18 14:28:28 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Copyright 2018 NXP |
| 4 | */ |
| 5 | |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 6 | #include <asm/global_data.h> |
Peng Fan | e84d11f | 2018-10-18 14:28:28 +0200 | [diff] [blame] | 7 | #include <dm/device.h> |
| 8 | #include <dm/pinctrl.h> |
| 9 | |
| 10 | #include "pinctrl-imx.h" |
| 11 | |
| 12 | DECLARE_GLOBAL_DATA_PTR; |
| 13 | |
| 14 | static struct imx_pinctrl_soc_info imx8_pinctrl_soc_info = { |
| 15 | .flags = IMX8_USE_SCU, |
| 16 | }; |
| 17 | |
| 18 | static int imx8_pinctrl_probe(struct udevice *dev) |
| 19 | { |
| 20 | struct imx_pinctrl_soc_info *info = |
| 21 | (struct imx_pinctrl_soc_info *)dev_get_driver_data(dev); |
| 22 | |
| 23 | return imx_pinctrl_probe(dev, info); |
| 24 | } |
| 25 | |
| 26 | static const struct udevice_id imx8_pinctrl_match[] = { |
| 27 | { .compatible = "fsl,imx8qxp-iomuxc", .data = (ulong)&imx8_pinctrl_soc_info }, |
Peng Fan | ef86773 | 2019-03-05 02:32:13 +0000 | [diff] [blame] | 28 | { .compatible = "fsl,imx8qm-iomuxc", .data = (ulong)&imx8_pinctrl_soc_info }, |
Peng Fan | e84d11f | 2018-10-18 14:28:28 +0200 | [diff] [blame] | 29 | { /* sentinel */ } |
| 30 | }; |
| 31 | |
| 32 | U_BOOT_DRIVER(imx8_pinctrl) = { |
| 33 | .name = "imx8_pinctrl", |
| 34 | .id = UCLASS_PINCTRL, |
| 35 | .of_match = of_match_ptr(imx8_pinctrl_match), |
| 36 | .probe = imx8_pinctrl_probe, |
| 37 | .remove = imx_pinctrl_remove, |
Simon Glass | 8a2b47f | 2020-12-03 16:55:17 -0700 | [diff] [blame] | 38 | .priv_auto = sizeof(struct imx_pinctrl_priv), |
Peng Fan | e84d11f | 2018-10-18 14:28:28 +0200 | [diff] [blame] | 39 | .ops = &imx_pinctrl_ops, |
| 40 | .flags = DM_FLAG_PRE_RELOC, |
| 41 | }; |