Merge tag 'sparc-for-6.10-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / include / linux / of_gpio.h
CommitLineData
af6074fc 1/* SPDX-License-Identifier: GPL-2.0+ */
863fbf49
AV
2/*
3 * OF helpers for the GPIO API
4 *
5 * Copyright (c) 2007-2008 MontaVista Software, Inc.
6 *
7 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
863fbf49
AV
8 */
9
10#ifndef __LINUX_OF_GPIO_H
11#define __LINUX_OF_GPIO_H
12
b908b53d 13#include <linux/compiler.h>
046e14af
AS
14#include <linux/gpio/driver.h>
15#include <linux/gpio.h> /* FIXME: Shouldn't be here */
15c9a0ac 16#include <linux/of.h>
863fbf49 17
b908b53d
AV
18struct device_node;
19
863fbf49
AV
20#ifdef CONFIG_OF_GPIO
21
40fc56ee
DT
22extern int of_get_named_gpio(const struct device_node *np,
23 const char *list_name, int index);
a6b09191 24
a19e3da5 25#else /* CONFIG_OF_GPIO */
863fbf49 26
046e14af
AS
27#include <linux/errno.h>
28
863fbf49 29/* Drivers may not strictly depend on the GPIO support, so let them link. */
e6ae9a83 30static inline int of_get_named_gpio(const struct device_node *np,
a6b09191
JB
31 const char *propname, int index)
32{
40fc56ee 33 return -ENOSYS;
a6b09191
JB
34}
35
40fc56ee 36#endif /* CONFIG_OF_GPIO */
b908b53d 37
863fbf49 38#endif /* __LINUX_OF_GPIO_H */