linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] gpio: Cleanup kerneldoc
@ 2017-07-24 14:57 Thierry Reding
  2017-07-24 14:57 ` [PATCH 2/7] gpio: of: Improve kerneldoc Thierry Reding
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Thierry Reding @ 2017-07-24 14:57 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Mika Westerberg, Andy Shevchenko, Jonathan Corbet, linux-gpio,
	linux-acpi, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Some kerneldoc has become stale or wasn't quite correct from the outset.
Fix up the most serious issues to silence warnings when building the
documentation.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/gpiolib.c      | 82 +++++++++++++++++++++++++++++++++------------
 include/linux/gpio/driver.h |  3 +-
 2 files changed, 61 insertions(+), 24 deletions(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 9568708a550b..c8493f765994 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -84,7 +84,12 @@ static inline void desc_set_label(struct gpio_desc *d, const char *label)
 }
 
 /**
- * Convert a GPIO number to its descriptor
+ * gpio_to_desc - Convert a GPIO number to its descriptor
+ * @gpio: global GPIO number
+ *
+ * Returns:
+ * The GPIO descriptor associated with the given GPIO, or %NULL if no GPIO
+ * with the given number exists in the system.
  */
 struct gpio_desc *gpio_to_desc(unsigned gpio)
 {
@@ -111,7 +116,14 @@ struct gpio_desc *gpio_to_desc(unsigned gpio)
 EXPORT_SYMBOL_GPL(gpio_to_desc);
 
 /**
- * Get the GPIO descriptor corresponding to the given hw number for this chip.
+ * gpiochip_get_desc - get the GPIO descriptor corresponding to the given
+ *                     hardware number for this chip
+ * @chip: GPIO chip
+ * @hwnum: hardware number of the GPIO for this chip
+ *
+ * Returns:
+ * A pointer to the GPIO descriptor or %ERR_PTR(-EINVAL) if no GPIO exists
+ * in the given chip for the specified hardware number.
  */
 struct gpio_desc *gpiochip_get_desc(struct gpio_chip *chip,
 				    u16 hwnum)
@@ -125,9 +137,14 @@ struct gpio_desc *gpiochip_get_desc(struct gpio_chip *chip,
 }
 
 /**
- * Convert a GPIO descriptor to the integer namespace.
+ * desc_to_gpio - convert a GPIO descriptor to the integer namespace
+ * @desc: GPIO descriptor
+ *
  * This should disappear in the future but is needed since we still
- * use GPIO numbers for error messages and sysfs nodes
+ * use GPIO numbers for error messages and sysfs nodes.
+ *
+ * Returns:
+ * The global GPIO number for the GPIO specified by its descriptor.
  */
 int desc_to_gpio(const struct gpio_desc *desc)
 {
@@ -254,7 +271,7 @@ static int gpiodev_add_to_list(struct gpio_device *gdev)
 	return -EBUSY;
 }
 
-/**
+/*
  * Convert a GPIO name to its descriptor
  */
 static struct gpio_desc *gpio_name_to_desc(const char * const name)
@@ -879,7 +896,7 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip)
 	return ret;
 }
 
-/**
+/*
  * gpio_ioctl() - ioctl handler for the GPIO chardev
  */
 static long gpio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
@@ -1078,11 +1095,9 @@ static void gpiochip_setup_devs(void)
 /**
  * gpiochip_add_data() - register a gpio_chip
  * @chip: the chip to register, with chip->base initialized
- * Context: potentially before irqs will work
+ * @data: driver-private data associated with this chip
  *
- * Returns a negative errno if the chip can't be registered, such as
- * because the chip->base is invalid or already associated with a
- * different chip.  Otherwise it returns zero as a success code.
+ * Context: potentially before irqs will work
  *
  * When gpiochip_add_data() is called very early during boot, so that GPIOs
  * can be freely used, the chip->parent device must be registered before
@@ -1094,6 +1109,11 @@ static void gpiochip_setup_devs(void)
  *
  * If chip->base is negative, this requests dynamic assignment of
  * a range of valid GPIOs.
+ *
+ * Returns:
+ * A negative errno if the chip can't be registered, such as because the
+ * chip->base is invalid or already associated with a different chip.
+ * Otherwise it returns zero as a success code.
  */
 int gpiochip_add_data(struct gpio_chip *chip, void *data)
 {
@@ -1288,6 +1308,10 @@ EXPORT_SYMBOL_GPL(gpiochip_add_data);
 
 /**
  * gpiochip_get_data() - get per-subdriver data for the chip
+ * @chip: GPIO chip
+ *
+ * Returns:
+ * The per-subdriver data for the chip.
  */
 void *gpiochip_get_data(struct gpio_chip *chip)
 {
@@ -1371,13 +1395,16 @@ static int devm_gpio_chip_match(struct device *dev, void *res, void *data)
  * devm_gpiochip_add_data() - Resource manager piochip_add_data()
  * @dev: the device pointer on which irq_chip belongs to.
  * @chip: the chip to register, with chip->base initialized
- * Context: potentially before irqs will work
+ * @data: driver-private data associated with this chip
  *
- * Returns a negative errno if the chip can't be registered, such as
- * because the chip->base is invalid or already associated with a
- * different chip.  Otherwise it returns zero as a success code.
+ * Context: potentially before irqs will work
  *
  * The gpio chip automatically be released when the device is unbound.
+ *
+ * Returns:
+ * A negative errno if the chip can't be registered, such as because the
+ * chip->base is invalid or already associated with a different chip.
+ * Otherwise it returns zero as a success code.
  */
 int devm_gpiochip_add_data(struct device *dev, struct gpio_chip *chip,
 			   void *data)
@@ -1423,7 +1450,7 @@ EXPORT_SYMBOL_GPL(devm_gpiochip_remove);
 /**
  * gpiochip_find() - iterator for locating a specific gpio_chip
  * @data: data to pass to match function
- * @callback: Callback function to check gpio_chip
+ * @match: Callback function to check gpio_chip
  *
  * Similar to bus_find_device.  It returns a reference to a gpio_chip as
  * determined by a user supplied @match callback.  The callback should return
@@ -1931,11 +1958,14 @@ EXPORT_SYMBOL_GPL(gpiochip_add_pingroup_range);
 /**
  * gpiochip_add_pin_range() - add a range for GPIO <-> pin mapping
  * @chip: the gpiochip to add the range for
- * @pinctrl_name: the dev_name() of the pin controller to map to
+ * @pinctl_name: the dev_name() of the pin controller to map to
  * @gpio_offset: the start offset in the current gpio_chip number space
  * @pin_offset: the start offset in the pin controller number space
  * @npins: the number of pins from the offset of each pin space (GPIO and
  *	pin controller) to accumulate in this range
+ *
+ * Returns:
+ * 0 on success, or a negative error-code on failure.
  */
 int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
 			   unsigned int gpio_offset, unsigned int pin_offset,
@@ -2180,7 +2210,8 @@ EXPORT_SYMBOL_GPL(gpiochip_is_requested);
 
 /**
  * gpiochip_request_own_desc - Allow GPIO chip to request its own descriptor
- * @desc: GPIO descriptor to request
+ * @chip: GPIO chip
+ * @hwnum: hardware number of the GPIO for which to request the descriptor
  * @label: label for the GPIO
  *
  * Function allows GPIO chip drivers to request and use their own GPIO
@@ -2188,6 +2219,10 @@ EXPORT_SYMBOL_GPL(gpiochip_is_requested);
  * function will not increase reference count of the GPIO chip module. This
  * allows the GPIO chip module to be unloaded as needed (we assume that the
  * GPIO chip driver handles freeing the GPIOs it has requested).
+ *
+ * Returns:
+ * A pointer to the GPIO descriptor, or an ERR_PTR()-encoded negative error
+ * code on failure.
  */
 struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *chip, u16 hwnum,
 					    const char *label)
@@ -2369,12 +2404,13 @@ int gpiod_direction_output(struct gpio_desc *desc, int value)
 EXPORT_SYMBOL_GPL(gpiod_direction_output);
 
 /**
- * gpiod_set_debounce - sets @debounce time for a @gpio
- * @gpio: the gpio to set debounce time
- * @debounce: debounce time is microseconds
+ * gpiod_set_debounce - sets @debounce time for a GPIO
+ * @desc: descriptor of the GPIO for which to set debounce time
+ * @debounce: debounce time in microseconds
  *
- * returns -ENOTSUPP if the controller does not support setting
- * debounce.
+ * Returns:
+ * 0 on success, %-ENOTSUPP if the controller doesn't support setting the
+ * debounce time.
  */
 int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce)
 {
@@ -3323,6 +3359,7 @@ EXPORT_SYMBOL_GPL(gpiod_get_index);
  * @propname:	name of the firmware property representing the GPIO
  * @index:	index of the GPIO to obtain in the consumer
  * @dflags:	GPIO initialization flags
+ * @label:	label to attach to the requested GPIO
  *
  * This function can be used for drivers that get their configuration
  * from firmware.
@@ -3331,6 +3368,7 @@ EXPORT_SYMBOL_GPL(gpiod_get_index);
  * underlying firmware interface and then makes sure that the GPIO
  * descriptor is requested before it is returned to the caller.
  *
+ * Returns:
  * On successful request the GPIO pin is configured in accordance with
  * provided @dflags.
  *
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index af20369ec8e7..ad4150d075c3 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -327,11 +327,10 @@ int gpiochip_generic_config(struct gpio_chip *chip, unsigned offset,
 
 /**
  * struct gpio_pin_range - pin range controlled by a gpio chip
- * @head: list for maintaining set of pin ranges, used internally
+ * @node: list for maintaining set of pin ranges, used internally
  * @pctldev: pinctrl device which handles corresponding pins
  * @range: actual range of pins controlled by a gpio controller
  */
-
 struct gpio_pin_range {
 	struct list_head node;
 	struct pinctrl_dev *pctldev;
-- 
2.13.3


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 2/7] gpio: of: Improve kerneldoc
  2017-07-24 14:57 [PATCH 1/7] gpio: Cleanup kerneldoc Thierry Reding
@ 2017-07-24 14:57 ` Thierry Reding
  2017-08-02 12:07   ` Linus Walleij
  2017-07-24 14:57 ` [PATCH 3/7] gpio: devres: " Thierry Reding
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Thierry Reding @ 2017-07-24 14:57 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Mika Westerberg, Andy Shevchenko, Jonathan Corbet, linux-gpio,
	linux-acpi, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Add descriptions for missing fields and fix up some parameter references
to match the code.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/gpiolib-of.c   |  7 +++----
 include/linux/gpio/driver.h | 19 +++++++++++++++++++
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 54ce8dc58ad0..9c1b8a5d2f33 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -273,14 +273,13 @@ static int of_gpiochip_scan_gpios(struct gpio_chip *chip)
 }
 
 /**
- * of_gpio_simple_xlate - translate gpio_spec to the GPIO number and flags
+ * of_gpio_simple_xlate - translate gpiospec to the GPIO number and flags
  * @gc:		pointer to the gpio_chip structure
- * @np:		device node of the GPIO chip
- * @gpio_spec:	gpio specifier as found in the device tree
+ * @gpiospec:	GPIO specifier as found in the device tree
  * @flags:	a flags pointer to fill in
  *
  * This is simple translation function, suitable for the most 1:1 mapped
- * gpio chips. This function performs only one sanity check: whether gpio
+ * GPIO chips. This function performs only one sanity check: whether GPIO
  * is less than ngpios (that is specified in the gpio_chip).
  */
 int of_gpio_simple_xlate(struct gpio_chip *gc,
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index ad4150d075c3..fe66c9306caf 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -180,8 +180,27 @@ struct gpio_chip {
 	 * If CONFIG_OF is enabled, then all GPIO controllers described in the
 	 * device tree automatically may have an OF translation
 	 */
+
+	/**
+	 * @of_node:
+	 *
+	 * Pointer to a device tree node representing this GPIO controller.
+	 */
 	struct device_node *of_node;
+
+	/**
+	 * @of_gpio_n_cells:
+	 *
+	 * Number of cells used to form the GPIO specifier.
+	 */
 	int of_gpio_n_cells;
+
+	/**
+	 * @of_xlate:
+	 *
+	 * Callback to translate a device tree GPIO specifier into a chip-
+	 * relative GPIO number and flags.
+	 */
 	int (*of_xlate)(struct gpio_chip *gc,
 			const struct of_phandle_args *gpiospec, u32 *flags);
 #endif
-- 
2.13.3


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 3/7] gpio: devres: Improve kerneldoc
  2017-07-24 14:57 [PATCH 1/7] gpio: Cleanup kerneldoc Thierry Reding
  2017-07-24 14:57 ` [PATCH 2/7] gpio: of: Improve kerneldoc Thierry Reding
@ 2017-07-24 14:57 ` Thierry Reding
  2017-08-02 12:07   ` Linus Walleij
  2017-07-24 14:57 ` [PATCH 4/7] gpio: acpi: Fixup kerneldoc Thierry Reding
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Thierry Reding @ 2017-07-24 14:57 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Mika Westerberg, Andy Shevchenko, Jonathan Corbet, linux-gpio,
	linux-acpi, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Add missing descriptions for some parameters to match the code.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/devres.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c
index a75511d1ea5d..afbff155a0ba 100644
--- a/drivers/gpio/devres.c
+++ b/drivers/gpio/devres.c
@@ -132,6 +132,7 @@ EXPORT_SYMBOL(devm_gpiod_get_index);
  * @index:	index of the GPIO to obtain in the consumer
  * @child:	firmware node (child of @dev)
  * @flags:	GPIO initialization flags
+ * @label:	label to attach to the requested GPIO
  *
  * GPIO descriptors returned from this function are automatically disposed on
  * driver detach.
@@ -271,6 +272,7 @@ EXPORT_SYMBOL(devm_gpiod_get_array_optional);
 
 /**
  * devm_gpiod_put - Resource-managed gpiod_put()
+ * @dev:	GPIO consumer
  * @desc:	GPIO descriptor to dispose of
  *
  * Dispose of a GPIO descriptor obtained with devm_gpiod_get() or
@@ -286,6 +288,7 @@ EXPORT_SYMBOL(devm_gpiod_put);
 
 /**
  * devm_gpiod_put_array - Resource-managed gpiod_put_array()
+ * @dev:	GPIO consumer
  * @descs:	GPIO descriptor array to dispose of
  *
  * Dispose of an array of GPIO descriptors obtained with devm_gpiod_get_array().
-- 
2.13.3


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 4/7] gpio: acpi: Fixup kerneldoc
  2017-07-24 14:57 [PATCH 1/7] gpio: Cleanup kerneldoc Thierry Reding
  2017-07-24 14:57 ` [PATCH 2/7] gpio: of: Improve kerneldoc Thierry Reding
  2017-07-24 14:57 ` [PATCH 3/7] gpio: devres: " Thierry Reding
@ 2017-07-24 14:57 ` Thierry Reding
  2017-07-24 15:13   ` Andy Shevchenko
  2017-08-02 12:09   ` Linus Walleij
  2017-07-24 14:57 ` [PATCH 5/7] gpio: sysfs: " Thierry Reding
                   ` (4 subsequent siblings)
  7 siblings, 2 replies; 18+ messages in thread
From: Thierry Reding @ 2017-07-24 14:57 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Mika Westerberg, Andy Shevchenko, Jonathan Corbet, linux-gpio,
	linux-acpi, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Fix up a parameter description to match the code and fix markup for a
constant to prettify output.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/gpiolib-acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index c9b42dd12dfa..4d2113530735 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -61,7 +61,7 @@ static int acpi_gpiochip_find(struct gpio_chip *gc, void *data)
 #ifdef CONFIG_PINCTRL
 /**
  * acpi_gpiochip_pin_to_gpio_offset() - translates ACPI GPIO to Linux GPIO
- * @chip: GPIO chip
+ * @gdev: GPIO device
  * @pin: ACPI GPIO pin number from GpioIo/GpioInt resource
  *
  * Function takes ACPI GpioIo/GpioInt pin number as a parameter and
@@ -763,7 +763,7 @@ struct gpio_desc *acpi_node_get_gpiod(struct fwnode_handle *fwnode,
  * The function is idempotent, though each time it runs it will configure GPIO
  * pin direction according to the flags in GpioInt resource.
  *
- * Return: Linux IRQ number (>%0) on success, negative errno on failure.
+ * Return: Linux IRQ number (> %0) on success, negative errno on failure.
  */
 int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index)
 {
-- 
2.13.3


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 5/7] gpio: sysfs: Fixup kerneldoc
  2017-07-24 14:57 [PATCH 1/7] gpio: Cleanup kerneldoc Thierry Reding
                   ` (2 preceding siblings ...)
  2017-07-24 14:57 ` [PATCH 4/7] gpio: acpi: Fixup kerneldoc Thierry Reding
@ 2017-07-24 14:57 ` Thierry Reding
  2017-08-02 12:10   ` Linus Walleij
  2017-07-24 14:57 ` [PATCH 6/7] docs: driver-api: Add GPIO section Thierry Reding
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Thierry Reding @ 2017-07-24 14:57 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Mika Westerberg, Andy Shevchenko, Jonathan Corbet, linux-gpio,
	linux-acpi, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Fix up some references to parameters to match the code.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/gpiolib-sysfs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index 16fe9742597b..45b8c0679fee 100644
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -534,8 +534,8 @@ static struct class gpio_class = {
 
 /**
  * gpiod_export - export a GPIO through sysfs
- * @gpio: gpio to make available, already requested
- * @direction_may_change: true if userspace may change gpio direction
+ * @desc: GPIO to make available, already requested
+ * @direction_may_change: true if userspace may change GPIO direction
  * Context: arch_initcall or later
  *
  * When drivers want to make a GPIO accessible to userspace after they
@@ -643,7 +643,7 @@ static int match_export(struct device *dev, const void *desc)
  * gpiod_export_link - create a sysfs link to an exported GPIO node
  * @dev: device under which to create symlink
  * @name: name of the symlink
- * @gpio: gpio to create symlink to, already exported
+ * @desc: GPIO to create symlink to, already exported
  *
  * Set up a symlink from /sys/.../dev/name to /sys/class/gpio/gpioN
  * node. Caller is responsible for unlinking.
@@ -674,7 +674,7 @@ EXPORT_SYMBOL_GPL(gpiod_export_link);
 
 /**
  * gpiod_unexport - reverse effect of gpiod_export()
- * @gpio: gpio to make unavailable
+ * @desc: GPIO to make unavailable
  *
  * This is implicit on gpiod_free().
  */
-- 
2.13.3


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 6/7] docs: driver-api: Add GPIO section
  2017-07-24 14:57 [PATCH 1/7] gpio: Cleanup kerneldoc Thierry Reding
                   ` (3 preceding siblings ...)
  2017-07-24 14:57 ` [PATCH 5/7] gpio: sysfs: " Thierry Reding
@ 2017-07-24 14:57 ` Thierry Reding
  2017-08-02 12:13   ` Linus Walleij
  2017-07-24 14:57 ` [PATCH 7/7] gpio: Use unsigned int for of_gpio_n_cells Thierry Reding
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Thierry Reding @ 2017-07-24 14:57 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Mika Westerberg, Andy Shevchenko, Jonathan Corbet, linux-gpio,
	linux-acpi, linux-kernel

From: Thierry Reding <treding@nvidia.com>

This adds a section about the various parts of the GPIO subsystem to the
driver API documentation. Note that this isn't exhaustive documentation,
but rather focusses on pulling in the kerneldoc from various sources, in
order to improve coverage of kerneldoc processing.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 Documentation/driver-api/gpio.rst  | 45 ++++++++++++++++++++++++++++++++++++++
 Documentation/driver-api/index.rst |  1 +
 2 files changed, 46 insertions(+)
 create mode 100644 Documentation/driver-api/gpio.rst

diff --git a/Documentation/driver-api/gpio.rst b/Documentation/driver-api/gpio.rst
new file mode 100644
index 000000000000..6dd4aa647f27
--- /dev/null
+++ b/Documentation/driver-api/gpio.rst
@@ -0,0 +1,45 @@
+===================================
+General Purpose Input/Output (GPIO)
+===================================
+
+Core
+====
+
+.. kernel-doc:: include/linux/gpio/driver.h
+   :internal:
+
+.. kernel-doc:: drivers/gpio/gpiolib.c
+   :export:
+
+Legacy API
+==========
+
+The functions listed in this section are deprecated. The GPIO descriptor based
+API described above should be used in new code.
+
+.. kernel-doc:: drivers/gpio/gpiolib-legacy.c
+   :export:
+
+ACPI support
+============
+
+.. kernel-doc:: drivers/gpio/gpiolib-acpi.c
+   :export:
+
+Device tree support
+===================
+
+.. kernel-doc:: drivers/gpio/gpiolib-of.c
+   :export:
+
+Device-managed API
+==================
+
+.. kernel-doc:: drivers/gpio/devres.c
+   :export:
+
+sysfs helpers
+=============
+
+.. kernel-doc:: drivers/gpio/gpiolib-sysfs.c
+   :export:
diff --git a/Documentation/driver-api/index.rst b/Documentation/driver-api/index.rst
index 7c94ab50afed..9c20624842b7 100644
--- a/Documentation/driver-api/index.rst
+++ b/Documentation/driver-api/index.rst
@@ -44,6 +44,7 @@ available subsections can be seen below.
    uio-howto
    firmware/index
    pinctl
+   gpio
    misc_devices
 
 .. only::  subproject and html
-- 
2.13.3


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 7/7] gpio: Use unsigned int for of_gpio_n_cells
  2017-07-24 14:57 [PATCH 1/7] gpio: Cleanup kerneldoc Thierry Reding
                   ` (4 preceding siblings ...)
  2017-07-24 14:57 ` [PATCH 6/7] docs: driver-api: Add GPIO section Thierry Reding
@ 2017-07-24 14:57 ` Thierry Reding
  2017-08-02 12:14   ` Linus Walleij
  2017-07-31 11:02 ` [PATCH 1/7] gpio: Cleanup kerneldoc Thierry Reding
  2017-08-02 12:06 ` Linus Walleij
  7 siblings, 1 reply; 18+ messages in thread
From: Thierry Reding @ 2017-07-24 14:57 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Mika Westerberg, Andy Shevchenko, Jonathan Corbet, linux-gpio,
	linux-acpi, linux-kernel

From: Thierry Reding <treding@nvidia.com>

The cell count for GPIO specifiers can never be negative, so make the
field unsigned.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 include/linux/gpio/driver.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index fe66c9306caf..c97f8325e8bf 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -193,7 +193,7 @@ struct gpio_chip {
 	 *
 	 * Number of cells used to form the GPIO specifier.
 	 */
-	int of_gpio_n_cells;
+	unsigned int of_gpio_n_cells;
 
 	/**
 	 * @of_xlate:
-- 
2.13.3


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/7] gpio: acpi: Fixup kerneldoc
  2017-07-24 14:57 ` [PATCH 4/7] gpio: acpi: Fixup kerneldoc Thierry Reding
@ 2017-07-24 15:13   ` Andy Shevchenko
  2017-07-25  8:50     ` Mika Westerberg
  2017-08-02 12:09   ` Linus Walleij
  1 sibling, 1 reply; 18+ messages in thread
From: Andy Shevchenko @ 2017-07-24 15:13 UTC (permalink / raw)
  To: Thierry Reding, Linus Walleij
  Cc: Mika Westerberg, Jonathan Corbet, linux-gpio, linux-acpi,
	linux-kernel

On Mon, 2017-07-24 at 16:57 +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Fix up a parameter description to match the code and fix markup for a
> constant to prettify output.
> 

Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  drivers/gpio/gpiolib-acpi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
> index c9b42dd12dfa..4d2113530735 100644
> --- a/drivers/gpio/gpiolib-acpi.c
> +++ b/drivers/gpio/gpiolib-acpi.c
> @@ -61,7 +61,7 @@ static int acpi_gpiochip_find(struct gpio_chip *gc,
> void *data)
>  #ifdef CONFIG_PINCTRL
>  /**
>   * acpi_gpiochip_pin_to_gpio_offset() - translates ACPI GPIO to Linux
> GPIO
> - * @chip: GPIO chip
> + * @gdev: GPIO device
>   * @pin: ACPI GPIO pin number from GpioIo/GpioInt resource
>   *
>   * Function takes ACPI GpioIo/GpioInt pin number as a parameter and
> @@ -763,7 +763,7 @@ struct gpio_desc *acpi_node_get_gpiod(struct
> fwnode_handle *fwnode,
>   * The function is idempotent, though each time it runs it will
> configure GPIO
>   * pin direction according to the flags in GpioInt resource.
>   *
> - * Return: Linux IRQ number (>%0) on success, negative errno on
> failure.
> + * Return: Linux IRQ number (> %0) on success, negative errno on
> failure.
>   */
>  int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index)
>  {

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/7] gpio: acpi: Fixup kerneldoc
  2017-07-24 15:13   ` Andy Shevchenko
@ 2017-07-25  8:50     ` Mika Westerberg
  0 siblings, 0 replies; 18+ messages in thread
From: Mika Westerberg @ 2017-07-25  8:50 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Thierry Reding, Linus Walleij, Jonathan Corbet, linux-gpio,
	linux-acpi, linux-kernel

On Mon, Jul 24, 2017 at 06:13:47PM +0300, Andy Shevchenko wrote:
> On Mon, 2017-07-24 at 16:57 +0200, Thierry Reding wrote:
> > From: Thierry Reding <treding@nvidia.com>
> > 
> > Fix up a parameter description to match the code and fix markup for a
> > constant to prettify output.
> > 
> 
> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Also

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

:)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/7] gpio: Cleanup kerneldoc
  2017-07-24 14:57 [PATCH 1/7] gpio: Cleanup kerneldoc Thierry Reding
                   ` (5 preceding siblings ...)
  2017-07-24 14:57 ` [PATCH 7/7] gpio: Use unsigned int for of_gpio_n_cells Thierry Reding
@ 2017-07-31 11:02 ` Thierry Reding
  2017-08-02 12:04   ` Linus Walleij
  2017-08-02 12:06 ` Linus Walleij
  7 siblings, 1 reply; 18+ messages in thread
From: Thierry Reding @ 2017-07-31 11:02 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Mika Westerberg, Andy Shevchenko, Jonathan Corbet, linux-gpio,
	linux-acpi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 817 bytes --]

On Mon, Jul 24, 2017 at 04:57:22PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Some kerneldoc has become stale or wasn't quite correct from the outset.
> Fix up the most serious issues to silence warnings when building the
> documentation.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  drivers/gpio/gpiolib.c      | 82 +++++++++++++++++++++++++++++++++------------
>  include/linux/gpio/driver.h |  3 +-
>  2 files changed, 61 insertions(+), 24 deletions(-)

Hi Linus,

any chance we can get this merged? The GPIO IRQ chip and banked
controller support patches that I'm working on depend on this, so I'd
like for these to go in before I send out the former in order to
decrease the dependency tracking for everyone involved.

Thanks,
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/7] gpio: Cleanup kerneldoc
  2017-07-31 11:02 ` [PATCH 1/7] gpio: Cleanup kerneldoc Thierry Reding
@ 2017-08-02 12:04   ` Linus Walleij
  0 siblings, 0 replies; 18+ messages in thread
From: Linus Walleij @ 2017-08-02 12:04 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Mika Westerberg, Andy Shevchenko, Jonathan Corbet,
	linux-gpio@vger.kernel.org, ACPI Devel Maling List,
	linux-kernel@vger.kernel.org

On Mon, Jul 31, 2017 at 1:02 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:
> On Mon, Jul 24, 2017 at 04:57:22PM +0200, Thierry Reding wrote:
>> From: Thierry Reding <treding@nvidia.com>
>>
>> Some kerneldoc has become stale or wasn't quite correct from the outset.
>> Fix up the most serious issues to silence warnings when building the
>> documentation.
>>
>> Signed-off-by: Thierry Reding <treding@nvidia.com>
>> ---
>>  drivers/gpio/gpiolib.c      | 82 +++++++++++++++++++++++++++++++++------------
>>  include/linux/gpio/driver.h |  3 +-
>>  2 files changed, 61 insertions(+), 24 deletions(-)
>
> Hi Linus,
>
> any chance we can get this merged? The GPIO IRQ chip and banked
> controller support patches that I'm working on depend on this, so I'd
> like for these to go in before I send out the former in order to
> decrease the dependency tracking for everyone involved.

I've been on vacation, sorry.

I'm churning the backlog now...

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/7] gpio: Cleanup kerneldoc
  2017-07-24 14:57 [PATCH 1/7] gpio: Cleanup kerneldoc Thierry Reding
                   ` (6 preceding siblings ...)
  2017-07-31 11:02 ` [PATCH 1/7] gpio: Cleanup kerneldoc Thierry Reding
@ 2017-08-02 12:06 ` Linus Walleij
  7 siblings, 0 replies; 18+ messages in thread
From: Linus Walleij @ 2017-08-02 12:06 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Mika Westerberg, Andy Shevchenko, Jonathan Corbet,
	linux-gpio@vger.kernel.org, ACPI Devel Maling List,
	linux-kernel@vger.kernel.org

On Mon, Jul 24, 2017 at 4:57 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:

> From: Thierry Reding <treding@nvidia.com>
>
> Some kerneldoc has become stale or wasn't quite correct from the outset.
> Fix up the most serious issues to silence warnings when building the
> documentation.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Patch applied, thanks a lot for fixing this!

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/7] gpio: of: Improve kerneldoc
  2017-07-24 14:57 ` [PATCH 2/7] gpio: of: Improve kerneldoc Thierry Reding
@ 2017-08-02 12:07   ` Linus Walleij
  0 siblings, 0 replies; 18+ messages in thread
From: Linus Walleij @ 2017-08-02 12:07 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Mika Westerberg, Andy Shevchenko, Jonathan Corbet,
	linux-gpio@vger.kernel.org, ACPI Devel Maling List,
	linux-kernel@vger.kernel.org

On Mon, Jul 24, 2017 at 4:57 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:

> From: Thierry Reding <treding@nvidia.com>
>
> Add descriptions for missing fields and fix up some parameter references
> to match the code.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 3/7] gpio: devres: Improve kerneldoc
  2017-07-24 14:57 ` [PATCH 3/7] gpio: devres: " Thierry Reding
@ 2017-08-02 12:07   ` Linus Walleij
  0 siblings, 0 replies; 18+ messages in thread
From: Linus Walleij @ 2017-08-02 12:07 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Mika Westerberg, Andy Shevchenko, Jonathan Corbet,
	linux-gpio@vger.kernel.org, ACPI Devel Maling List,
	linux-kernel@vger.kernel.org

On Mon, Jul 24, 2017 at 4:57 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:

> From: Thierry Reding <treding@nvidia.com>
>
> Add missing descriptions for some parameters to match the code.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/7] gpio: acpi: Fixup kerneldoc
  2017-07-24 14:57 ` [PATCH 4/7] gpio: acpi: Fixup kerneldoc Thierry Reding
  2017-07-24 15:13   ` Andy Shevchenko
@ 2017-08-02 12:09   ` Linus Walleij
  1 sibling, 0 replies; 18+ messages in thread
From: Linus Walleij @ 2017-08-02 12:09 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Mika Westerberg, Andy Shevchenko, Jonathan Corbet,
	linux-gpio@vger.kernel.org, ACPI Devel Maling List,
	linux-kernel@vger.kernel.org

On Mon, Jul 24, 2017 at 4:57 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:

> From: Thierry Reding <treding@nvidia.com>
>
> Fix up a parameter description to match the code and fix markup for a
> constant to prettify output.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Patch applied with the ACKs.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 5/7] gpio: sysfs: Fixup kerneldoc
  2017-07-24 14:57 ` [PATCH 5/7] gpio: sysfs: " Thierry Reding
@ 2017-08-02 12:10   ` Linus Walleij
  0 siblings, 0 replies; 18+ messages in thread
From: Linus Walleij @ 2017-08-02 12:10 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Mika Westerberg, Andy Shevchenko, Jonathan Corbet,
	linux-gpio@vger.kernel.org, ACPI Devel Maling List,
	linux-kernel@vger.kernel.org

On Mon, Jul 24, 2017 at 4:57 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:

> From: Thierry Reding <treding@nvidia.com>
>
> Fix up some references to parameters to match the code.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 6/7] docs: driver-api: Add GPIO section
  2017-07-24 14:57 ` [PATCH 6/7] docs: driver-api: Add GPIO section Thierry Reding
@ 2017-08-02 12:13   ` Linus Walleij
  0 siblings, 0 replies; 18+ messages in thread
From: Linus Walleij @ 2017-08-02 12:13 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Mika Westerberg, Andy Shevchenko, Jonathan Corbet,
	linux-gpio@vger.kernel.org, ACPI Devel Maling List,
	linux-kernel@vger.kernel.org

On Mon, Jul 24, 2017 at 4:57 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:

> From: Thierry Reding <treding@nvidia.com>
>
> This adds a section about the various parts of the GPIO subsystem to the
> driver API documentation. Note that this isn't exhaustive documentation,
> but rather focusses on pulling in the kerneldoc from various sources, in
> order to improve coverage of kerneldoc processing.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Patch applied, but...

> +sysfs helpers
> +=============
> +
> +.. kernel-doc:: drivers/gpio/gpiolib-sysfs.c
> +   :export:

I don't know about this. That is the legacy ABI, I am thinking about hiding
it so as not to encourage it. Yet the code is definately there, sigh.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 7/7] gpio: Use unsigned int for of_gpio_n_cells
  2017-07-24 14:57 ` [PATCH 7/7] gpio: Use unsigned int for of_gpio_n_cells Thierry Reding
@ 2017-08-02 12:14   ` Linus Walleij
  0 siblings, 0 replies; 18+ messages in thread
From: Linus Walleij @ 2017-08-02 12:14 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Mika Westerberg, Andy Shevchenko, Jonathan Corbet,
	linux-gpio@vger.kernel.org, ACPI Devel Maling List,
	linux-kernel@vger.kernel.org

On Mon, Jul 24, 2017 at 4:57 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:

> From: Thierry Reding <treding@nvidia.com>
>
> The cell count for GPIO specifiers can never be negative, so make the
> field unsigned.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-08-02 12:14 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-24 14:57 [PATCH 1/7] gpio: Cleanup kerneldoc Thierry Reding
2017-07-24 14:57 ` [PATCH 2/7] gpio: of: Improve kerneldoc Thierry Reding
2017-08-02 12:07   ` Linus Walleij
2017-07-24 14:57 ` [PATCH 3/7] gpio: devres: " Thierry Reding
2017-08-02 12:07   ` Linus Walleij
2017-07-24 14:57 ` [PATCH 4/7] gpio: acpi: Fixup kerneldoc Thierry Reding
2017-07-24 15:13   ` Andy Shevchenko
2017-07-25  8:50     ` Mika Westerberg
2017-08-02 12:09   ` Linus Walleij
2017-07-24 14:57 ` [PATCH 5/7] gpio: sysfs: " Thierry Reding
2017-08-02 12:10   ` Linus Walleij
2017-07-24 14:57 ` [PATCH 6/7] docs: driver-api: Add GPIO section Thierry Reding
2017-08-02 12:13   ` Linus Walleij
2017-07-24 14:57 ` [PATCH 7/7] gpio: Use unsigned int for of_gpio_n_cells Thierry Reding
2017-08-02 12:14   ` Linus Walleij
2017-07-31 11:02 ` [PATCH 1/7] gpio: Cleanup kerneldoc Thierry Reding
2017-08-02 12:04   ` Linus Walleij
2017-08-02 12:06 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).