blob: 14c3d4d4e7728550459ca82f72ab78b1dfb3341d [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Peng Fan83431532016-02-03 10:06:08 +08002/*
3 * Copyright (C) 2016 Peng Fan <van.freenix@gmail.com>
Peng Fan83431532016-02-03 10:06:08 +08004 */
5
Simon Glass11c89f32017-05-17 17:18:03 -06006#include <dm.h>
Peng Fan83431532016-02-03 10:06:08 +08007#include <dm/pinctrl.h>
8
9#include "pinctrl-imx.h"
10
Marek BehĂșn4bebdd32021-05-20 13:23:52 +020011static struct imx_pinctrl_soc_info imx7_pinctrl_soc_info __section(".data");
Peng Fan83431532016-02-03 10:06:08 +080012
13static struct imx_pinctrl_soc_info imx7_lpsr_pinctrl_soc_info = {
14 .flags = ZERO_OFFSET_VALID,
15};
16
Peng Fan83431532016-02-03 10:06:08 +080017static const struct udevice_id imx7_pinctrl_match[] = {
18 { .compatible = "fsl,imx7d-iomuxc", .data = (ulong)&imx7_pinctrl_soc_info },
19 { .compatible = "fsl,imx7d-iomuxc-lpsr", .data = (ulong)&imx7_lpsr_pinctrl_soc_info },
20 { /* sentinel */ }
21};
22
Marek Vasut5b213c32025-01-24 15:50:51 +010023static const struct pinctrl_ops imx7_pinctrl_ops = {
Marek Vasut964d87c2025-01-24 15:50:56 +010024 .set_state = imx_pinctrl_set_state_mmio,
Marek Vasut4646bd92025-01-24 15:50:50 +010025};
26
Peng Fan83431532016-02-03 10:06:08 +080027U_BOOT_DRIVER(imx7_pinctrl) = {
28 .name = "imx7-pinctrl",
29 .id = UCLASS_PINCTRL,
30 .of_match = of_match_ptr(imx7_pinctrl_match),
Marek Vasutf19a47f2025-01-24 15:50:54 +010031 .probe = imx_pinctrl_probe_mmio,
Marek Vasuta81f0d62025-01-24 15:50:55 +010032 .remove = imx_pinctrl_remove_mmio,
Simon Glass8a2b47f2020-12-03 16:55:17 -070033 .priv_auto = sizeof(struct imx_pinctrl_priv),
Marek Vasut5b213c32025-01-24 15:50:51 +010034 .ops = &imx7_pinctrl_ops,
Peng Fan83431532016-02-03 10:06:08 +080035 .flags = DM_FLAG_PRE_RELOC,
Peng Fan83431532016-02-03 10:06:08 +080036};