diff options
| author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-03-29 17:33:45 -0400 |
|---|---|---|
| committer | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2019-04-01 04:32:29 -0400 |
| commit | 85edcd01a902885fcb7bc02b7fc0f6e6a01b9386 (patch) | |
| tree | f8e2dcfa8d45ca943bd3510e93a8ba41e66ac59f | |
| parent | 43c691e6232cef62daeca3d434e8729a725b2fe2 (diff) | |
gpiolib: acpi: Fix references in kernel doc and amend
This patch does the following bunch of changes:
- append () to the functions for reference
- convert gpiochip(s) -> GPIO chip(s)
- add a note about returned error code type [acpi_find_gpio()]
- move long summary to a description [acpi_gpio_count()]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
| -rw-r--r-- | drivers/gpio/gpiolib-acpi.c | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index 30d0baf7ddae..e9ddf66f2d14 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c | |||
| @@ -24,13 +24,13 @@ | |||
| 24 | * | 24 | * |
| 25 | * @node: list-entry of the events list of the struct acpi_gpio_chip | 25 | * @node: list-entry of the events list of the struct acpi_gpio_chip |
| 26 | * @handle: handle of ACPI method to execute when the IRQ triggers | 26 | * @handle: handle of ACPI method to execute when the IRQ triggers |
| 27 | * @handler: irq_handler to pass to request_irq when requesting the IRQ | 27 | * @handler: handler function to pass to request_irq() when requesting the IRQ |
| 28 | * @pin: GPIO pin number on the gpio_chip | 28 | * @pin: GPIO pin number on the struct gpio_chip |
| 29 | * @irq: Linux IRQ number for the event, for request_ / free_irq | 29 | * @irq: Linux IRQ number for the event, for request_irq() / free_irq() |
| 30 | * @irqflags: flags to pass to request_irq when requesting the IRQ | 30 | * @irqflags: flags to pass to request_irq() when requesting the IRQ |
| 31 | * @irq_is_wake: If the ACPI flags indicate the IRQ is a wakeup source | 31 | * @irq_is_wake: If the ACPI flags indicate the IRQ is a wakeup source |
| 32 | * @irq_requested:True if request_irq has been done | 32 | * @irq_requested:True if request_irq() has been done |
| 33 | * @desc: gpio_desc for the GPIO pin for this event | 33 | * @desc: struct gpio_desc for the GPIO pin for this event |
| 34 | */ | 34 | */ |
| 35 | struct acpi_gpio_event { | 35 | struct acpi_gpio_event { |
| 36 | struct list_head node; | 36 | struct list_head node; |
| @@ -65,10 +65,10 @@ struct acpi_gpio_chip { | |||
| 65 | }; | 65 | }; |
| 66 | 66 | ||
| 67 | /* | 67 | /* |
| 68 | * For gpiochips which call acpi_gpiochip_request_interrupts() before late_init | 68 | * For GPIO chips which call acpi_gpiochip_request_interrupts() before late_init |
| 69 | * (so builtin drivers) we register the ACPI GpioInt IRQ handlers from a | 69 | * (so builtin drivers) we register the ACPI GpioInt IRQ handlers from a |
| 70 | * late_initcall_sync handler, so that other builtin drivers can register their | 70 | * late_initcall_sync() handler, so that other builtin drivers can register their |
| 71 | * OpRegions before the event handlers can run. This list contains gpiochips | 71 | * OpRegions before the event handlers can run. This list contains GPIO chips |
| 72 | * for which the acpi_gpiochip_request_irqs() call has been deferred. | 72 | * for which the acpi_gpiochip_request_irqs() call has been deferred. |
| 73 | */ | 73 | */ |
| 74 | static DEFINE_MUTEX(acpi_gpio_deferred_req_irqs_lock); | 74 | static DEFINE_MUTEX(acpi_gpio_deferred_req_irqs_lock); |
| @@ -90,7 +90,7 @@ static int acpi_gpiochip_find(struct gpio_chip *gc, void *data) | |||
| 90 | * | 90 | * |
| 91 | * Return: GPIO descriptor to use with Linux generic GPIO API, or ERR_PTR | 91 | * Return: GPIO descriptor to use with Linux generic GPIO API, or ERR_PTR |
| 92 | * error value. Specifically returns %-EPROBE_DEFER if the referenced GPIO | 92 | * error value. Specifically returns %-EPROBE_DEFER if the referenced GPIO |
| 93 | * controller does not have gpiochip registered at the moment. This is to | 93 | * controller does not have GPIO chip registered at the moment. This is to |
| 94 | * support probe deferral. | 94 | * support probe deferral. |
| 95 | */ | 95 | */ |
| 96 | static struct gpio_desc *acpi_get_gpiod(char *path, int pin) | 96 | static struct gpio_desc *acpi_get_gpiod(char *path, int pin) |
| @@ -287,9 +287,9 @@ fail_free_desc: | |||
| 287 | * | 287 | * |
| 288 | * ACPI5 platforms can use GPIO signaled ACPI events. These GPIO interrupts are | 288 | * ACPI5 platforms can use GPIO signaled ACPI events. These GPIO interrupts are |
| 289 | * handled by ACPI event methods which need to be called from the GPIO | 289 | * handled by ACPI event methods which need to be called from the GPIO |
| 290 | * chip's interrupt handler. acpi_gpiochip_request_interrupts finds out which | 290 | * chip's interrupt handler. acpi_gpiochip_request_interrupts() finds out which |
| 291 | * gpio pins have acpi event methods and assigns interrupt handlers that calls | 291 | * GPIO pins have ACPI event methods and assigns interrupt handlers that calls |
| 292 | * the acpi event methods for those pins. | 292 | * the ACPI event methods for those pins. |
| 293 | */ | 293 | */ |
| 294 | void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) | 294 | void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) |
| 295 | { | 295 | { |
| @@ -653,7 +653,7 @@ static int acpi_gpio_property_lookup(struct fwnode_handle *fwnode, | |||
| 653 | * that case @index is used to select the GPIO entry in the property value | 653 | * that case @index is used to select the GPIO entry in the property value |
| 654 | * (in case of multiple). | 654 | * (in case of multiple). |
| 655 | * | 655 | * |
| 656 | * If the GPIO cannot be translated or there is an error an ERR_PTR is | 656 | * If the GPIO cannot be translated or there is an error, an ERR_PTR is |
| 657 | * returned. | 657 | * returned. |
| 658 | * | 658 | * |
| 659 | * Note: if the GPIO resource has multiple entries in the pin list, this | 659 | * Note: if the GPIO resource has multiple entries in the pin list, this |
| @@ -751,10 +751,13 @@ struct gpio_desc *acpi_find_gpio(struct device *dev, | |||
| 751 | * @index: index of GpioIo/GpioInt resource (starting from %0) | 751 | * @index: index of GpioIo/GpioInt resource (starting from %0) |
| 752 | * @info: info pointer to fill in (optional) | 752 | * @info: info pointer to fill in (optional) |
| 753 | * | 753 | * |
| 754 | * If @fwnode is an ACPI device object, call %acpi_get_gpiod_by_index() for it. | 754 | * If @fwnode is an ACPI device object, call acpi_get_gpiod_by_index() for it. |
| 755 | * Otherwise (ie. it is a data-only non-device object), use the property-based | 755 | * Otherwise (i.e. it is a data-only non-device object), use the property-based |
| 756 | * GPIO lookup to get to the GPIO resource with the relevant information and use | 756 | * GPIO lookup to get to the GPIO resource with the relevant information and use |
| 757 | * that to obtain the GPIO descriptor to return. | 757 | * that to obtain the GPIO descriptor to return. |
| 758 | * | ||
| 759 | * If the GPIO cannot be translated or there is an error an ERR_PTR is | ||
| 760 | * returned. | ||
| 758 | */ | 761 | */ |
| 759 | struct gpio_desc *acpi_node_get_gpiod(struct fwnode_handle *fwnode, | 762 | struct gpio_desc *acpi_node_get_gpiod(struct fwnode_handle *fwnode, |
| 760 | const char *propname, int index, | 763 | const char *propname, int index, |
| @@ -1158,11 +1161,13 @@ static int acpi_find_gpio_count(struct acpi_resource *ares, void *data) | |||
| 1158 | } | 1161 | } |
| 1159 | 1162 | ||
| 1160 | /** | 1163 | /** |
| 1161 | * acpi_gpio_count - return the number of GPIOs associated with a | 1164 | * acpi_gpio_count - count the GPIOs associated with a device / function |
| 1162 | * device / function or -ENOENT if no GPIO has been | 1165 | * @dev: GPIO consumer, can be %NULL for system-global GPIOs |
| 1163 | * assigned to the requested function. | ||
| 1164 | * @dev: GPIO consumer, can be NULL for system-global GPIOs | ||
| 1165 | * @con_id: function within the GPIO consumer | 1166 | * @con_id: function within the GPIO consumer |
| 1167 | * | ||
| 1168 | * Return: | ||
| 1169 | * The number of GPIOs associated with a device / function or %-ENOENT, | ||
| 1170 | * if no GPIO has been assigned to the requested function. | ||
| 1166 | */ | 1171 | */ |
| 1167 | int acpi_gpio_count(struct device *dev, const char *con_id) | 1172 | int acpi_gpio_count(struct device *dev, const char *con_id) |
| 1168 | { | 1173 | { |
