mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-25 22:20:45 +00:00
5ac9dfbe9d
The NAND subsystem has not supported the Driver Model yet, but the NAND pin-mux data are already in the pinctrl drivers. Use them by calling pinctrl_generic_set_state() directly. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
32 lines
629 B
C
32 lines
629 B
C
/*
|
|
* Copyright (C) 2016 Socionext Inc.
|
|
* Author: Masahiro Yamada <yamada.masahiro@socionext.com>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
*/
|
|
|
|
#include <linux/err.h>
|
|
#include <dm/device.h>
|
|
#include <dm/pinctrl.h>
|
|
#include <dm/uclass.h>
|
|
|
|
#include "init.h"
|
|
|
|
int uniphier_pin_init(const char *pinconfig_name)
|
|
{
|
|
struct udevice *pctldev, *config, *next;
|
|
int ret;
|
|
|
|
ret = uclass_first_device(UCLASS_PINCTRL, &pctldev);
|
|
if (ret)
|
|
return ret;
|
|
|
|
device_foreach_child_safe(config, next, pctldev) {
|
|
if (strcmp(config->name, pinconfig_name))
|
|
continue;
|
|
|
|
return pinctrl_generic_set_state(pctldev, config);
|
|
}
|
|
|
|
return -ENODEV;
|
|
}
|