uboot/drivers/pinctrl/nxp/pinctrl-imx7.c
<<
>>
Prefs
   1/*
   2 * Copyright (C) 2016 Peng Fan <van.freenix@gmail.com>
   3 *
   4 * SPDX-License-Identifier:     GPL-2.0+
   5 */
   6
   7#include <common.h>
   8#include <dm.h>
   9#include <dm/pinctrl.h>
  10
  11#include "pinctrl-imx.h"
  12
  13static struct imx_pinctrl_soc_info imx7_pinctrl_soc_info;
  14
  15static struct imx_pinctrl_soc_info imx7_lpsr_pinctrl_soc_info = {
  16        .flags = ZERO_OFFSET_VALID,
  17};
  18
  19static int imx7_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
  27static const struct udevice_id imx7_pinctrl_match[] = {
  28        { .compatible = "fsl,imx7d-iomuxc", .data = (ulong)&imx7_pinctrl_soc_info },
  29        { .compatible = "fsl,imx7d-iomuxc-lpsr", .data = (ulong)&imx7_lpsr_pinctrl_soc_info },
  30        { /* sentinel */ }
  31};
  32
  33U_BOOT_DRIVER(imx7_pinctrl) = {
  34        .name = "imx7-pinctrl",
  35        .id = UCLASS_PINCTRL,
  36        .of_match = of_match_ptr(imx7_pinctrl_match),
  37        .probe = imx7_pinctrl_probe,
  38        .remove = imx_pinctrl_remove,
  39        .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
  40        .ops = &imx_pinctrl_ops,
  41        .flags = DM_FLAG_PRE_RELOC,
  42};
  43