@@ -7,7 +7,7 @@ This document serves as a guide for writers of GPIO chip drivers.
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,7 +144,7 @@ is not open, it will present a high-impedance (tristate) to the external rail::
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,10 +550,10 @@ the interrupt separately and go with it:
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,12 +681,12 @@ certain operations and keep track of usage inside of the gpiolib subsystem.
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,12 +708,12 @@ When a GPIO is used as an IRQ signal, then gpiolib also needs to know if
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,12 +763,12 @@ Sometimes it is useful to allow a GPIO chip driver to request its own GPIO
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().
0 commit comments