blob: 0f767d90790a0dbeb974029a7d88cac6c03ae23f [file] [log] [blame]
Peng Fan745df682016-02-03 10:06:07 +08001
2/*
3 * Copyright (C) 2016 Peng Fan <van.freenix@gmail.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
Simon Glass4af0d7e2017-05-17 17:18:07 -06008#include <common.h>
Simon Glass9d922452017-05-17 17:18:03 -06009#include <dm.h>
Peng Fan745df682016-02-03 10:06:07 +080010#include <dm/pinctrl.h>
11
12#include "pinctrl-imx.h"
13
14static struct imx_pinctrl_soc_info imx6_pinctrl_soc_info;
15
Peng Fanca751592016-08-11 14:02:52 +080016static struct imx_pinctrl_soc_info imx6_snvs_pinctrl_soc_info = {
17 .flags = ZERO_OFFSET_VALID,
18};
19
Peng Fan745df682016-02-03 10:06:07 +080020static int imx6_pinctrl_probe(struct udevice *dev)
21{
22 struct imx_pinctrl_soc_info *info =
23 (struct imx_pinctrl_soc_info *)dev_get_driver_data(dev);
24
25 return imx_pinctrl_probe(dev, info);
26}
27
28static const struct udevice_id imx6_pinctrl_match[] = {
29 { .compatible = "fsl,imx6q-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info },
30 { .compatible = "fsl,imx6dl-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info },
31 { .compatible = "fsl,imx6sl-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info },
Peng Fanef0afaa2016-12-11 19:24:35 +080032 { .compatible = "fsl,imx6sll-iomuxc-snvs", .data = (ulong)&imx6_snvs_pinctrl_soc_info },
33 { .compatible = "fsl,imx6sll-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info },
Peng Fan745df682016-02-03 10:06:07 +080034 { .compatible = "fsl,imx6sx-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info },
35 { .compatible = "fsl,imx6ul-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info },
Peng Fanca751592016-08-11 14:02:52 +080036 { .compatible = "fsl,imx6ull-iomuxc-snvs", .data = (ulong)&imx6_snvs_pinctrl_soc_info },
Peng Fan745df682016-02-03 10:06:07 +080037 { /* sentinel */ }
38};
39
40U_BOOT_DRIVER(imx6_pinctrl) = {
41 .name = "imx6-pinctrl",
42 .id = UCLASS_PINCTRL,
43 .of_match = of_match_ptr(imx6_pinctrl_match),
44 .probe = imx6_pinctrl_probe,
45 .remove = imx_pinctrl_remove,
46 .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
47 .ops = &imx_pinctrl_ops,
48 .flags = DM_FLAG_PRE_RELOC,
49};