linux/drivers/gpio/gpiolib-swnode.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Software Node helpers for the GPIO API
 *
 * Copyright 2022 Google LLC
 */

#define pr_fmt(fmt)

#include <linux/err.h>
#include <linux/errno.h>
#include <linux/export.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/printk.h>
#include <linux/property.h>
#include <linux/string.h>

#include <linux/gpio/consumer.h>
#include <linux/gpio/driver.h>

#include "gpiolib.h"
#include "gpiolib-swnode.h"

#define GPIOLIB_SWNODE_UNDEFINED_NAME

static void swnode_format_propname(const char *con_id, char *propname,
				   size_t max_size)
{}

static struct gpio_device *swnode_get_gpio_device(struct fwnode_handle *fwnode)
{}

struct gpio_desc *swnode_find_gpio(struct fwnode_handle *fwnode,
				   const char *con_id, unsigned int idx,
				   unsigned long *flags)
{}

/**
 * swnode_gpio_count - count the GPIOs associated with a device / function
 * @fwnode:	firmware node of the GPIO consumer, can be %NULL for
 *		system-global GPIOs
 * @con_id:	function within the GPIO consumer
 *
 * Return:
 * The number of GPIOs associated with a device / function or %-ENOENT,
 * if no GPIO has been assigned to the requested function.
 */
int swnode_gpio_count(const struct fwnode_handle *fwnode, const char *con_id)
{}

#if IS_ENABLED(CONFIG_GPIO_SWNODE_UNDEFINED)
/*
 * A special node that identifies undefined GPIOs, this is primarily used as
 * a key for internal chip selects in SPI bindings.
 */
const struct software_node swnode_gpio_undefined =;
EXPORT_SYMBOL_NS_GPL();

static int __init swnode_gpio_init(void)
{}
subsys_initcall(swnode_gpio_init);

static void __exit swnode_gpio_cleanup(void)
{}
__exitcall();
#endif