blob: 829ce28a230dcbfa272fffea00bb1dc67b69f916 [file] [log] [blame]
Googler0bcd2362023-05-09 16:45:27 +08001// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2019 Amlogic, Inc. All rights reserved.
4 */
5
6#include <common.h>
7#include <dm/uclass.h>
8#include <linux/err.h>
9#include <asm/arch/pinctrl_init.h>
10
11int pinctrl_devices_active(int pinctrl_num)
12{
13 int ret;
14 int idx;
15 struct udevice *pinctrl;
16
17 for (idx = 0; idx < pinctrl_num; idx++) {
18 ret = uclass_get_device(UCLASS_PINCTRL, idx, &pinctrl);
19 if (ret) {
20 debug("%s: failed to active pinctrl device [%d]",
21 __func__, idx);
22 return -EINVAL;
23 }
24 }
25
26 return 0;
27}