Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Patrick Bruenn | ba81b04 | 2016-11-04 11:57:02 +0100 | [diff] [blame] | 2 | |
| 3 | /* |
| 4 | * Copyright (C) 2016 Peng Fan <van.freenix@gmail.com> |
Patrick Bruenn | ba81b04 | 2016-11-04 11:57:02 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
Simon Glass | 51a3ec3 | 2017-05-17 17:18:07 -0600 | [diff] [blame] | 7 | #include <common.h> |
Simon Glass | 11c89f3 | 2017-05-17 17:18:03 -0600 | [diff] [blame] | 8 | #include <dm.h> |
Patrick Bruenn | ba81b04 | 2016-11-04 11:57:02 +0100 | [diff] [blame] | 9 | #include <dm/pinctrl.h> |
| 10 | |
| 11 | #include "pinctrl-imx.h" |
| 12 | |
Peng Fan | 119cc04 | 2020-05-30 16:43:20 +0800 | [diff] [blame] | 13 | static struct imx_pinctrl_soc_info imx5_pinctrl_soc_info __attribute__((section(".data"))); |
Patrick Bruenn | ba81b04 | 2016-11-04 11:57:02 +0100 | [diff] [blame] | 14 | |
| 15 | static int imx5_pinctrl_probe(struct udevice *dev) |
| 16 | { |
| 17 | struct imx_pinctrl_soc_info *info = |
| 18 | (struct imx_pinctrl_soc_info *)dev_get_driver_data(dev); |
| 19 | |
| 20 | return imx_pinctrl_probe(dev, info); |
| 21 | } |
| 22 | |
| 23 | static const struct udevice_id imx5_pinctrl_match[] = { |
| 24 | { |
| 25 | .compatible = "fsl,imx53-iomuxc", |
| 26 | .data = (ulong)&imx5_pinctrl_soc_info |
| 27 | }, |
| 28 | { |
| 29 | .compatible = "fsl,imx53-iomuxc-gpr", |
| 30 | .data = (ulong)&imx5_pinctrl_soc_info |
| 31 | }, |
| 32 | { /* sentinel */ } |
| 33 | }; |
| 34 | |
| 35 | U_BOOT_DRIVER(imx5_pinctrl) = { |
| 36 | .name = "imx5-pinctrl", |
| 37 | .id = UCLASS_PINCTRL, |
| 38 | .of_match = of_match_ptr(imx5_pinctrl_match), |
| 39 | .probe = imx5_pinctrl_probe, |
| 40 | .remove = imx_pinctrl_remove, |
Simon Glass | 8a2b47f | 2020-12-03 16:55:17 -0700 | [diff] [blame] | 41 | .priv_auto = sizeof(struct imx_pinctrl_priv), |
Patrick Bruenn | ba81b04 | 2016-11-04 11:57:02 +0100 | [diff] [blame] | 42 | .ops = &imx_pinctrl_ops, |
| 43 | .flags = DM_FLAG_PRE_RELOC, |
Patrick Bruenn | ba81b04 | 2016-11-04 11:57:02 +0100 | [diff] [blame] | 44 | }; |