Peng Fan | 745df68 | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright (C) 2016 Peng Fan <van.freenix@gmail.com> |
| 4 | * |
| 5 | * SPDX-License-Identifier: GPL-2.0+ |
| 6 | */ |
| 7 | |
| 8 | #include <dm/device.h> |
| 9 | #include <dm/pinctrl.h> |
| 10 | |
| 11 | #include "pinctrl-imx.h" |
| 12 | |
| 13 | static struct imx_pinctrl_soc_info imx6_pinctrl_soc_info; |
| 14 | |
Peng Fan | ca75159 | 2016-08-11 14:02:52 +0800 | [diff] [blame] | 15 | static struct imx_pinctrl_soc_info imx6_snvs_pinctrl_soc_info = { |
| 16 | .flags = ZERO_OFFSET_VALID, |
| 17 | }; |
| 18 | |
Peng Fan | 745df68 | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 19 | static int imx6_pinctrl_probe(struct udevice *dev) |
| 20 | { |
| 21 | struct imx_pinctrl_soc_info *info = |
| 22 | (struct imx_pinctrl_soc_info *)dev_get_driver_data(dev); |
| 23 | |
| 24 | return imx_pinctrl_probe(dev, info); |
| 25 | } |
| 26 | |
| 27 | static const struct udevice_id imx6_pinctrl_match[] = { |
| 28 | { .compatible = "fsl,imx6q-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
| 29 | { .compatible = "fsl,imx6dl-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
| 30 | { .compatible = "fsl,imx6sl-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
Peng Fan | ef0afaa | 2016-12-11 19:24:35 +0800 | [diff] [blame^] | 31 | { .compatible = "fsl,imx6sll-iomuxc-snvs", .data = (ulong)&imx6_snvs_pinctrl_soc_info }, |
| 32 | { .compatible = "fsl,imx6sll-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
Peng Fan | 745df68 | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 33 | { .compatible = "fsl,imx6sx-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
| 34 | { .compatible = "fsl,imx6ul-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
Peng Fan | ca75159 | 2016-08-11 14:02:52 +0800 | [diff] [blame] | 35 | { .compatible = "fsl,imx6ull-iomuxc-snvs", .data = (ulong)&imx6_snvs_pinctrl_soc_info }, |
Peng Fan | 745df68 | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 36 | { /* sentinel */ } |
| 37 | }; |
| 38 | |
| 39 | U_BOOT_DRIVER(imx6_pinctrl) = { |
| 40 | .name = "imx6-pinctrl", |
| 41 | .id = UCLASS_PINCTRL, |
| 42 | .of_match = of_match_ptr(imx6_pinctrl_match), |
| 43 | .probe = imx6_pinctrl_probe, |
| 44 | .remove = imx_pinctrl_remove, |
| 45 | .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv), |
| 46 | .ops = &imx_pinctrl_ops, |
| 47 | .flags = DM_FLAG_PRE_RELOC, |
| 48 | }; |