#include <linux/bitops.h>
#include <linux/cleanup.h>
#include <linux/device.h>
#include <linux/idr.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kdev_t.h>
#include <linux/kstrtox.h>
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/printk.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/string.h>
#include <linux/srcu.h>
#include <linux/sysfs.h>
#include <linux/types.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/driver.h>
#include "gpiolib.h"
#include "gpiolib-sysfs.h"
struct kernfs_node;
#define GPIO_IRQF_TRIGGER_NONE …
#define GPIO_IRQF_TRIGGER_FALLING …
#define GPIO_IRQF_TRIGGER_RISING …
#define GPIO_IRQF_TRIGGER_BOTH …
struct gpiod_data { … };
static DEFINE_MUTEX(sysfs_lock);
static ssize_t direction_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t direction_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size)
{ … }
static DEVICE_ATTR_RW(direction);
static ssize_t value_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t value_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size)
{ … }
static DEVICE_ATTR_PREALLOC(value, S_IWUSR | S_IRUGO, value_show, value_store);
static irqreturn_t gpio_sysfs_irq(int irq, void *priv)
{ … }
static int gpio_sysfs_request_irq(struct device *dev, unsigned char flags)
{ … }
static void gpio_sysfs_free_irq(struct device *dev)
{ … }
static const char * const trigger_names[] = …;
static ssize_t edge_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t edge_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size)
{ … }
static DEVICE_ATTR_RW(edge);
static int gpio_sysfs_set_active_low(struct device *dev, int value)
{ … }
static ssize_t active_low_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t active_low_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size)
{ … }
static DEVICE_ATTR_RW(active_low);
static umode_t gpio_is_visible(struct kobject *kobj, struct attribute *attr,
int n)
{ … }
static struct attribute *gpio_attrs[] = …;
static const struct attribute_group gpio_group = …;
static const struct attribute_group *gpio_groups[] = …;
static ssize_t base_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(base);
static ssize_t label_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(label);
static ssize_t ngpio_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(ngpio);
static struct attribute *gpiochip_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static ssize_t export_store(const struct class *class,
const struct class_attribute *attr,
const char *buf, size_t len)
{ … }
static CLASS_ATTR_WO(export);
static ssize_t unexport_store(const struct class *class,
const struct class_attribute *attr,
const char *buf, size_t len)
{ … }
static CLASS_ATTR_WO(unexport);
static struct attribute *gpio_class_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static struct class gpio_class = …;
int gpiod_export(struct gpio_desc *desc, bool direction_may_change)
{ … }
EXPORT_SYMBOL_GPL(…);
static int match_export(struct device *dev, const void *desc)
{ … }
int gpiod_export_link(struct device *dev, const char *name,
struct gpio_desc *desc)
{ … }
EXPORT_SYMBOL_GPL(…);
void gpiod_unexport(struct gpio_desc *desc)
{ … }
EXPORT_SYMBOL_GPL(…);
int gpiochip_sysfs_register(struct gpio_device *gdev)
{ … }
void gpiochip_sysfs_unregister(struct gpio_device *gdev)
{ … }
static int gpiofind_sysfs_register(struct gpio_chip *gc, const void *data)
{ … }
static int __init gpiolib_sysfs_init(void)
{ … }
postcore_initcall(gpiolib_sysfs_init);