diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2016-09-17 03:33:04 +0900 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2016-09-18 23:10:44 +0900 |
commit | 5ac9dfbe9d9a19b04ddb306e7d6833861f9b6f72 (patch) | |
tree | 4b3b0dbb2acf69140460079ff2b0c908c90d9cd2 /arch/arm/mach-uniphier/pinctrl-glue.c | |
parent | 6a93478b93390a123b1d85512d66c093843e3f9b (diff) | |
download | u-boot-5ac9dfbe9d9a19b04ddb306e7d6833861f9b6f72.tar.gz |
ARM: uniphier: consolidate NAND pin-mux settings
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>
Diffstat (limited to 'arch/arm/mach-uniphier/pinctrl-glue.c')
-rw-r--r-- | arch/arm/mach-uniphier/pinctrl-glue.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/mach-uniphier/pinctrl-glue.c b/arch/arm/mach-uniphier/pinctrl-glue.c new file mode 100644 index 0000000000..48549e313b --- /dev/null +++ b/arch/arm/mach-uniphier/pinctrl-glue.c @@ -0,0 +1,32 @@ +/* + * 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; +} |