Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Peng Fan | 8343153 | 2016-02-03 10:06:08 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2016 Peng Fan <van.freenix@gmail.com> |
Peng Fan | 8343153 | 2016-02-03 10:06:08 +0800 | [diff] [blame] | 4 | */ |
| 5 | |
Simon Glass | 11c89f3 | 2017-05-17 17:18:03 -0600 | [diff] [blame] | 6 | #include <dm.h> |
Peng Fan | 8343153 | 2016-02-03 10:06:08 +0800 | [diff] [blame] | 7 | #include <dm/pinctrl.h> |
| 8 | |
| 9 | #include "pinctrl-imx.h" |
| 10 | |
Marek BehĂșn | 4bebdd3 | 2021-05-20 13:23:52 +0200 | [diff] [blame] | 11 | static struct imx_pinctrl_soc_info imx7_pinctrl_soc_info __section(".data"); |
Peng Fan | 8343153 | 2016-02-03 10:06:08 +0800 | [diff] [blame] | 12 | |
| 13 | static struct imx_pinctrl_soc_info imx7_lpsr_pinctrl_soc_info = { |
| 14 | .flags = ZERO_OFFSET_VALID, |
| 15 | }; |
| 16 | |
| 17 | static int imx7_pinctrl_probe(struct udevice *dev) |
| 18 | { |
| 19 | struct imx_pinctrl_soc_info *info = |
| 20 | (struct imx_pinctrl_soc_info *)dev_get_driver_data(dev); |
| 21 | |
| 22 | return imx_pinctrl_probe(dev, info); |
| 23 | } |
| 24 | |
| 25 | static const struct udevice_id imx7_pinctrl_match[] = { |
| 26 | { .compatible = "fsl,imx7d-iomuxc", .data = (ulong)&imx7_pinctrl_soc_info }, |
| 27 | { .compatible = "fsl,imx7d-iomuxc-lpsr", .data = (ulong)&imx7_lpsr_pinctrl_soc_info }, |
| 28 | { /* sentinel */ } |
| 29 | }; |
| 30 | |
| 31 | U_BOOT_DRIVER(imx7_pinctrl) = { |
| 32 | .name = "imx7-pinctrl", |
| 33 | .id = UCLASS_PINCTRL, |
| 34 | .of_match = of_match_ptr(imx7_pinctrl_match), |
| 35 | .probe = imx7_pinctrl_probe, |
| 36 | .remove = imx_pinctrl_remove, |
Simon Glass | 8a2b47f | 2020-12-03 16:55:17 -0700 | [diff] [blame] | 37 | .priv_auto = sizeof(struct imx_pinctrl_priv), |
Peng Fan | 8343153 | 2016-02-03 10:06:08 +0800 | [diff] [blame] | 38 | .ops = &imx_pinctrl_ops, |
| 39 | .flags = DM_FLAG_PRE_RELOC, |
Peng Fan | 8343153 | 2016-02-03 10:06:08 +0800 | [diff] [blame] | 40 | }; |