Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Documentation: gpio: Replace leading TABs by spaces in code blocks

Code blocks are indented with two spaces. If there's a leading TAB, the
syntax highlighting might be broken in some editors. To prevent that,
unify all code blocks by using spaces instead of leading TAB(s).

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
[Bartosz: tweaked the commit message]
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

Andy Shevchenko and committed by
Bartosz Golaszewski
3de14369 1685f72a

+14 -14
+14 -14
Documentation/driver-api/gpio/driver.rst
··· 7 7 Each GPIO controller driver needs to include the following header, which defines 8 8 the structures used to define a GPIO driver:: 9 9 10 - #include <linux/gpio/driver.h> 10 + #include <linux/gpio/driver.h> 11 11 12 12 13 13 Internal Representation of GPIOs ··· 144 144 in ----|| |/ 145 145 ||--+ in ----| 146 146 | |\ 147 - GND GND 147 + GND GND 148 148 149 149 This configuration is normally used as a way to achieve one of two things: 150 150 ··· 550 550 struct my_gpio *g; 551 551 struct gpio_irq_chip *girq; 552 552 553 - ret = devm_request_threaded_irq(dev, irq, NULL, 554 - irq_thread_fn, IRQF_ONESHOT, "my-chip", g); 553 + ret = devm_request_threaded_irq(dev, irq, NULL, irq_thread_fn, 554 + IRQF_ONESHOT, "my-chip", g); 555 555 if (ret < 0) 556 - return ret; 556 + return ret; 557 557 558 558 /* Get a pointer to the gpio_irq_chip */ 559 559 girq = &g->gc.irq; ··· 681 681 Input GPIOs can be used as IRQ signals. When this happens, a driver is requested 682 682 to mark the GPIO as being used as an IRQ:: 683 683 684 - int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset) 684 + int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset) 685 685 686 686 This will prevent the use of non-irq related GPIO APIs until the GPIO IRQ lock 687 687 is released:: 688 688 689 - void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset) 689 + void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset) 690 690 691 691 When implementing an irqchip inside a GPIO driver, these two functions should 692 692 typically be called in the .startup() and .shutdown() callbacks from the ··· 708 708 the IRQ is enabled or disabled. In order to inform gpiolib about this, 709 709 the irqchip driver should call:: 710 710 711 - void gpiochip_disable_irq(struct gpio_chip *chip, unsigned int offset) 711 + void gpiochip_disable_irq(struct gpio_chip *chip, unsigned int offset) 712 712 713 713 This allows drivers to drive the GPIO as an output while the IRQ is 714 714 disabled. When the IRQ is enabled again, a driver should call:: 715 715 716 - void gpiochip_enable_irq(struct gpio_chip *chip, unsigned int offset) 716 + void gpiochip_enable_irq(struct gpio_chip *chip, unsigned int offset) 717 717 718 718 When implementing an irqchip inside a GPIO driver, these two functions should 719 719 typically be called in the .irq_disable() and .irq_enable() callbacks from the ··· 763 763 descriptors through the gpiolib API. A GPIO driver can use the following 764 764 functions to request and free descriptors:: 765 765 766 - struct gpio_desc *gpiochip_request_own_desc(struct gpio_desc *desc, 767 - u16 hwnum, 768 - const char *label, 769 - enum gpiod_flags flags) 766 + struct gpio_desc *gpiochip_request_own_desc(struct gpio_desc *desc, 767 + u16 hwnum, 768 + const char *label, 769 + enum gpiod_flags flags) 770 770 771 - void gpiochip_free_own_desc(struct gpio_desc *desc) 771 + void gpiochip_free_own_desc(struct gpio_desc *desc) 772 772 773 773 Descriptors requested with gpiochip_request_own_desc() must be released with 774 774 gpiochip_free_own_desc().