/* SPDX-License-Identifier: GPL-2.0 */ /* * NOTE: This header *must not* be included. * * This is the LEGACY GPIO bulk include file, including legacy APIs. It is * used for GPIO drivers still referencing the global GPIO numberspace, * and should not be included in new code. * * If you're implementing a GPIO driver, only include <linux/gpio/driver.h> * If you're implementing a GPIO consumer, only include <linux/gpio/consumer.h>
*/ #ifndef __LINUX_GPIO_H #define __LINUX_GPIO_H
/* make these flag values available regardless of GPIO kconfig options */ #define GPIOF_IN ((1 << 0)) #define GPIOF_OUT_INIT_LOW ((0 << 0) | (0 << 1)) #define GPIOF_OUT_INIT_HIGH ((0 << 0) | (1 << 1))
#ifdef CONFIG_GPIOLIB /* * "valid" GPIO numbers are nonnegative and may be passed to * setup routines like gpio_request(). Only some valid numbers * can successfully be requested and used. * * Invalid GPIO numbers are useful for indicating no-such-GPIO in * platform data and other tables.
*/ staticinlinebool gpio_is_valid(int number)
{ /* only non-negative numbers are valid */ return number >= 0;
}
/* * Platforms may implement their GPIO interface with library code, * at a small performance cost for non-inlined operations and some * extra memory (for code and for per-GPIO table entries).
*/
/* Always use the library code for GPIO management calls, * or when sleeping may be involved.
*/ int gpio_request(unsigned gpio, constchar *label); void gpio_free(unsigned gpio);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.