2017-12-28 02:55:14 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2008-04-11 21:06:45 +08:00
|
|
|
/*
|
|
|
|
* OF helpers for the GPIO API
|
|
|
|
*
|
|
|
|
* Copyright (c) 2007-2008 MontaVista Software, Inc.
|
|
|
|
*
|
|
|
|
* Author: Anton Vorontsov <avorontsov@ru.mvista.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LINUX_OF_GPIO_H
|
|
|
|
#define __LINUX_OF_GPIO_H
|
|
|
|
|
2008-12-01 14:30:04 +08:00
|
|
|
#include <linux/compiler.h>
|
2020-02-05 21:43:36 +08:00
|
|
|
#include <linux/gpio/driver.h>
|
|
|
|
#include <linux/gpio.h> /* FIXME: Shouldn't be here */
|
2011-12-13 00:25:57 +08:00
|
|
|
#include <linux/of.h>
|
2008-04-11 21:06:45 +08:00
|
|
|
|
2008-12-01 14:30:04 +08:00
|
|
|
struct device_node;
|
|
|
|
|
2008-04-11 21:06:45 +08:00
|
|
|
#ifdef CONFIG_OF_GPIO
|
|
|
|
|
2022-12-20 03:20:15 +08:00
|
|
|
extern int of_get_named_gpio(const struct device_node *np,
|
|
|
|
const char *list_name, int index);
|
2011-06-28 07:49:57 +08:00
|
|
|
|
2010-06-08 21:48:16 +08:00
|
|
|
#else /* CONFIG_OF_GPIO */
|
2008-04-11 21:06:45 +08:00
|
|
|
|
2020-02-05 21:43:36 +08:00
|
|
|
#include <linux/errno.h>
|
|
|
|
|
2008-04-11 21:06:45 +08:00
|
|
|
/* Drivers may not strictly depend on the GPIO support, so let them link. */
|
2021-07-28 22:42:28 +08:00
|
|
|
static inline int of_get_named_gpio(const struct device_node *np,
|
2011-06-28 07:49:57 +08:00
|
|
|
const char *propname, int index)
|
|
|
|
{
|
2022-12-20 03:20:15 +08:00
|
|
|
return -ENOSYS;
|
2011-06-28 07:49:57 +08:00
|
|
|
}
|
|
|
|
|
2022-12-20 03:20:15 +08:00
|
|
|
#endif /* CONFIG_OF_GPIO */
|
2008-12-01 14:30:04 +08:00
|
|
|
|
2008-04-11 21:06:45 +08:00
|
|
|
#endif /* __LINUX_OF_GPIO_H */
|