Commit d143493c authored by Kent Gibson's avatar Kent Gibson Committed by Bartosz Golaszewski

gpiolib: make cdev a build option

Make the gpiolib-cdev module a build option.  This allows the CDEV
interface to be removed from the kernel to reduce kernel size in
applications where is it not required, and provides the parent for
other CDEV interface specific build options to follow.
Suggested-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: default avatarKent Gibson <warthog618@gmail.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
parent b53911aa
...@@ -66,8 +66,21 @@ config GPIO_SYSFS ...@@ -66,8 +66,21 @@ config GPIO_SYSFS
This ABI is deprecated. If you want to use GPIO from userspace, This ABI is deprecated. If you want to use GPIO from userspace,
use the character device /dev/gpiochipN with the appropriate use the character device /dev/gpiochipN with the appropriate
ioctl() operations instead. The character device is always ioctl() operations instead.
available.
config GPIO_CDEV
bool
prompt "Character device (/dev/gpiochipN) support" if EXPERT
default y
help
Say Y here to add the character device /dev/gpiochipN interface
for GPIOs. The character device allows userspace to control GPIOs
using ioctl() operations.
Only say N if you are sure that the GPIO character device is not
required.
If unsure, say Y.
config GPIO_GENERIC config GPIO_GENERIC
depends on HAS_IOMEM # Only for IOMEM drivers depends on HAS_IOMEM # Only for IOMEM drivers
......
...@@ -6,8 +6,8 @@ ccflags-$(CONFIG_DEBUG_GPIO) += -DDEBUG ...@@ -6,8 +6,8 @@ ccflags-$(CONFIG_DEBUG_GPIO) += -DDEBUG
obj-$(CONFIG_GPIOLIB) += gpiolib.o obj-$(CONFIG_GPIOLIB) += gpiolib.o
obj-$(CONFIG_GPIOLIB) += gpiolib-devres.o obj-$(CONFIG_GPIOLIB) += gpiolib-devres.o
obj-$(CONFIG_GPIOLIB) += gpiolib-legacy.o obj-$(CONFIG_GPIOLIB) += gpiolib-legacy.o
obj-$(CONFIG_GPIOLIB) += gpiolib-cdev.o
obj-$(CONFIG_OF_GPIO) += gpiolib-of.o obj-$(CONFIG_OF_GPIO) += gpiolib-of.o
obj-$(CONFIG_GPIO_CDEV) += gpiolib-cdev.o
obj-$(CONFIG_GPIO_SYSFS) += gpiolib-sysfs.o obj-$(CONFIG_GPIO_SYSFS) += gpiolib-sysfs.o
obj-$(CONFIG_GPIO_ACPI) += gpiolib-acpi.o obj-$(CONFIG_GPIO_ACPI) += gpiolib-acpi.o
......
...@@ -5,7 +5,22 @@ ...@@ -5,7 +5,22 @@
#include <linux/device.h> #include <linux/device.h>
#ifdef CONFIG_GPIO_CDEV
int gpiolib_cdev_register(struct gpio_device *gdev, dev_t devt); int gpiolib_cdev_register(struct gpio_device *gdev, dev_t devt);
void gpiolib_cdev_unregister(struct gpio_device *gdev); void gpiolib_cdev_unregister(struct gpio_device *gdev);
#else
static inline int gpiolib_cdev_register(struct gpio_device *gdev, dev_t devt)
{
return 0;
}
static inline void gpiolib_cdev_unregister(struct gpio_device *gdev)
{
}
#endif /* CONFIG_GPIO_CDEV */
#endif /* GPIOLIB_CDEV_H */ #endif /* GPIOLIB_CDEV_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment