mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
gpiolib: move gpiolib-sysfs function declarations into their own header
Move gpiolib-sysfs function declarations into their own header. These functions are in gpiolib-sysfs.c, and are only required by gpiolib.c, and so should be in a module header, not gpiolib.h. This brings gpiolib-sysfs into line with gpiolib-cdev, and is another step towards removing the sysfs inferface. Signed-off-by: Kent Gibson <warthog618@gmail.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
This commit is contained in:
committed by
Bartosz Golaszewski
parent
4672a4a9fb
commit
ef087d8e95
@@ -11,6 +11,7 @@
|
|||||||
#include <linux/ctype.h>
|
#include <linux/ctype.h>
|
||||||
|
|
||||||
#include "gpiolib.h"
|
#include "gpiolib.h"
|
||||||
|
#include "gpiolib-sysfs.h"
|
||||||
|
|
||||||
#define GPIO_IRQF_TRIGGER_FALLING BIT(0)
|
#define GPIO_IRQF_TRIGGER_FALLING BIT(0)
|
||||||
#define GPIO_IRQF_TRIGGER_RISING BIT(1)
|
#define GPIO_IRQF_TRIGGER_RISING BIT(1)
|
||||||
|
24
drivers/gpio/gpiolib-sysfs.h
Normal file
24
drivers/gpio/gpiolib-sysfs.h
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
|
|
||||||
|
#ifndef GPIOLIB_SYSFS_H
|
||||||
|
#define GPIOLIB_SYSFS_H
|
||||||
|
|
||||||
|
#ifdef CONFIG_GPIO_SYSFS
|
||||||
|
|
||||||
|
int gpiochip_sysfs_register(struct gpio_device *gdev);
|
||||||
|
void gpiochip_sysfs_unregister(struct gpio_device *gdev);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
static inline int gpiochip_sysfs_register(struct gpio_device *gdev)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void gpiochip_sysfs_unregister(struct gpio_device *gdev)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_GPIO_SYSFS */
|
||||||
|
|
||||||
|
#endif /* GPIOLIB_SYSFS_H */
|
@@ -26,6 +26,7 @@
|
|||||||
#include "gpiolib-of.h"
|
#include "gpiolib-of.h"
|
||||||
#include "gpiolib-acpi.h"
|
#include "gpiolib-acpi.h"
|
||||||
#include "gpiolib-cdev.h"
|
#include "gpiolib-cdev.h"
|
||||||
|
#include "gpiolib-sysfs.h"
|
||||||
|
|
||||||
#define CREATE_TRACE_POINTS
|
#define CREATE_TRACE_POINTS
|
||||||
#include <trace/events/gpio.h>
|
#include <trace/events/gpio.h>
|
||||||
|
@@ -175,22 +175,4 @@ static inline int gpio_chip_hwgpio(const struct gpio_desc *desc)
|
|||||||
#define chip_dbg(gc, fmt, ...) \
|
#define chip_dbg(gc, fmt, ...) \
|
||||||
dev_dbg(&gc->gpiodev->dev, "(%s): " fmt, gc->label, ##__VA_ARGS__)
|
dev_dbg(&gc->gpiodev->dev, "(%s): " fmt, gc->label, ##__VA_ARGS__)
|
||||||
|
|
||||||
#ifdef CONFIG_GPIO_SYSFS
|
|
||||||
|
|
||||||
int gpiochip_sysfs_register(struct gpio_device *gdev);
|
|
||||||
void gpiochip_sysfs_unregister(struct gpio_device *gdev);
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
static inline int gpiochip_sysfs_register(struct gpio_device *gdev)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void gpiochip_sysfs_unregister(struct gpio_device *gdev)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* CONFIG_GPIO_SYSFS */
|
|
||||||
|
|
||||||
#endif /* GPIOLIB_H */
|
#endif /* GPIOLIB_H */
|
||||||
|
Reference in New Issue
Block a user