Skip to content

Commit 3faaff9

Browse files
committed
Merge branch 'gpio/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git
# Conflicts: # drivers/gpio/gpio-ljca.c # drivers/gpio/gpio-vf610.c
2 parents 97101bf + 9bc6331 commit 3faaff9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1119
-750
lines changed

Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,17 @@ properties:
1818
- fsl,imx31-gpio
1919
- fsl,imx35-gpio
2020
- fsl,imx7d-gpio
21+
- items:
22+
- enum:
23+
- fsl,imx27-gpio
24+
- const: fsl,imx21-gpio
2125
- items:
2226
- const: fsl,imx35-gpio
2327
- const: fsl,imx31-gpio
28+
- items:
29+
- enum:
30+
- fsl,imx25-gpio
31+
- const: fsl,imx35-gpio
2432
- items:
2533
- enum:
2634
- fsl,imx50-gpio

Documentation/devicetree/bindings/gpio/gpio-vf610.yaml

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,26 @@ description: |
2020
properties:
2121
compatible:
2222
oneOf:
23+
- const: fsl,imx8ulp-gpio
2324
- const: fsl,vf610-gpio
2425
- items:
2526
- const: fsl,imx7ulp-gpio
2627
- const: fsl,vf610-gpio
2728
- items:
2829
- enum:
2930
- fsl,imx93-gpio
30-
- fsl,imx8ulp-gpio
31-
- const: fsl,imx7ulp-gpio
31+
- fsl,imx95-gpio
32+
- const: fsl,imx8ulp-gpio
3233

3334
reg:
34-
description: The first reg tuple represents the PORT module, the second tuple
35-
represents the GPIO module.
35+
minItems: 1
3636
maxItems: 2
3737

3838
interrupts:
39-
maxItems: 1
39+
items:
40+
- description: GPIO Trustzone non-secure interrupt number
41+
- description: GPIO Trustzone secure interrupt number
42+
minItems: 1
4043

4144
interrupt-controller: true
4245

@@ -59,7 +62,8 @@ properties:
5962
- const: port
6063

6164
gpio-ranges:
62-
maxItems: 1
65+
minItems: 1
66+
maxItems: 4
6367

6468
patternProperties:
6569
"^.+-hog(-[0-9]+)?$":
@@ -77,6 +81,30 @@ required:
7781
- "#gpio-cells"
7882
- gpio-controller
7983

84+
allOf:
85+
- if:
86+
properties:
87+
compatible:
88+
contains:
89+
enum:
90+
- fsl,vf610-gpio
91+
- fsl,imx7ulp-gpio
92+
then:
93+
properties:
94+
interrupts:
95+
maxItems: 1
96+
reg:
97+
items:
98+
- description: PORT register base address
99+
- description: GPIO register base address
100+
else:
101+
properties:
102+
interrupts:
103+
minItems: 2
104+
reg:
105+
items:
106+
- description: GPIO register base address
107+
80108
additionalProperties: false
81109

82110
examples:

Documentation/devicetree/bindings/gpio/intel,ixp4xx-gpio.txt

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/gpio/intel,ixp4xx-gpio.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Intel IXP4xx XScale Networking Processors GPIO Controller
8+
9+
description: |
10+
This GPIO controller is found in the Intel IXP4xx
11+
processors. It supports 16 GPIO lines.
12+
The interrupt portions of the GPIO controller is hierarchical.
13+
The synchronous edge detector is part of the GPIO block, but the
14+
actual enabling/disabling of the interrupt line is done in the
15+
main IXP4xx interrupt controller which has a 1-to-1 mapping for
16+
the first 12 GPIO lines to 12 system interrupts.
17+
The remaining 4 GPIO lines can not be used for receiving
18+
interrupts.
19+
The interrupt parent of this GPIO controller must be the
20+
IXP4xx interrupt controller.
21+
GPIO 14 and 15 can be used as clock outputs rather than GPIO,
22+
and this can be enabled by a special flag.
23+
24+
maintainers:
25+
- Linus Walleij <linus.walleij@linaro.org>
26+
27+
properties:
28+
compatible:
29+
const: intel,ixp4xx-gpio
30+
31+
reg:
32+
maxItems: 1
33+
34+
gpio-controller: true
35+
36+
"#gpio-cells":
37+
const: 2
38+
39+
interrupt-controller: true
40+
41+
"#interrupt-cells":
42+
const: 2
43+
44+
intel,ixp4xx-gpio14-clkout:
45+
description: If defined, enables clock output on GPIO 14
46+
instead of GPIO.
47+
type: boolean
48+
49+
intel,ixp4xx-gpio15-clkout:
50+
description: If defined, enables clock output on GPIO 15
51+
instead of GPIO.
52+
type: boolean
53+
54+
required:
55+
- compatible
56+
- reg
57+
- "#gpio-cells"
58+
- interrupt-controller
59+
- "#interrupt-cells"
60+
61+
additionalProperties: false
62+
63+
examples:
64+
- |
65+
#include <dt-bindings/interrupt-controller/irq.h>
66+
gpio@c8004000 {
67+
compatible = "intel,ixp4xx-gpio";
68+
reg = <0xc8004000 0x1000>;
69+
gpio-controller;
70+
#gpio-cells = <2>;
71+
interrupt-controller;
72+
#interrupt-cells = <2>;
73+
};

Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,22 @@ maintainers:
1111

1212
properties:
1313
compatible:
14-
enum:
15-
- loongson,ls2k-gpio
16-
- loongson,ls7a-gpio
14+
oneOf:
15+
- enum:
16+
- loongson,ls2k-gpio
17+
- loongson,ls2k0500-gpio0
18+
- loongson,ls2k0500-gpio1
19+
- loongson,ls2k2000-gpio0
20+
- loongson,ls2k2000-gpio1
21+
- loongson,ls2k2000-gpio2
22+
- loongson,ls3a5000-gpio
23+
- loongson,ls7a-gpio
24+
- items:
25+
- const: loongson,ls2k1000-gpio
26+
- const: loongson,ls2k-gpio
27+
- items:
28+
- const: loongson,ls7a1000-gpio
29+
- const: loongson,ls7a-gpio
1730

1831
reg:
1932
maxItems: 1
@@ -49,7 +62,7 @@ examples:
4962
#include <dt-bindings/interrupt-controller/irq.h>
5063
5164
gpio0: gpio@1fe00500 {
52-
compatible = "loongson,ls2k-gpio";
65+
compatible = "loongson,ls2k1000-gpio", "loongson,ls2k-gpio";
5366
reg = <0x1fe00500 0x38>;
5467
ngpios = <64>;
5568
#gpio-cells = <2>;

Documentation/driver-api/gpio/consumer.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ warnings. These stubs are used for two use cases:
2929
will use it under other compile-time configurations. In this case the
3030
consumer must make sure not to call into these functions, or the user will
3131
be met with console warnings that may be perceived as intimidating.
32+
Combining truly optional GPIOLIB usage with calls to
33+
``[devm_]gpiod_get_optional()`` is a *bad idea*, and will result in weird
34+
error messages. Use the ordinary getter functions with optional GPIOLIB:
35+
some open coding of error handling should be expected when you do this.
3236

3337
All the functions that work with the descriptor-based GPIO interface are
3438
prefixed with ``gpiod_``. The ``gpio_`` prefix is used for the legacy

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2232,7 +2232,7 @@ M: Imre Kaloz <kaloz@openwrt.org>
22322232
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
22332233
S: Maintained
22342234
F: Documentation/devicetree/bindings/arm/intel-ixp4xx.yaml
2235-
F: Documentation/devicetree/bindings/gpio/intel,ixp4xx-gpio.txt
2235+
F: Documentation/devicetree/bindings/gpio/intel,ixp4xx-gpio.yaml
22362236
F: Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml
22372237
F: Documentation/devicetree/bindings/memory-controllers/intel,ixp4xx-expansion*
22382238
F: Documentation/devicetree/bindings/rng/intel,ixp46x-rng.yaml

arch/arm/mach-omap1/board-ams-delta.c

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -561,22 +561,6 @@ static struct gpiod_lookup_table *ams_delta_gpio_tables[] __initdata = {
561561
&ams_delta_nand_gpio_table,
562562
};
563563

564-
/*
565-
* Some drivers may not use GPIO lookup tables but need to be provided
566-
* with GPIO numbers. The same applies to GPIO based IRQ lines - some
567-
* drivers may even not use GPIO layer but expect just IRQ numbers.
568-
* We could either define GPIO lookup tables then use them on behalf
569-
* of those devices, or we can use GPIO driver level methods for
570-
* identification of GPIO and IRQ numbers. For the purpose of the latter,
571-
* defina a helper function which identifies GPIO chips by their labels.
572-
*/
573-
static int gpiochip_match_by_label(struct gpio_chip *chip, void *data)
574-
{
575-
char *label = data;
576-
577-
return !strcmp(label, chip->label);
578-
}
579-
580564
static struct gpiod_hog ams_delta_gpio_hogs[] = {
581565
GPIO_HOG(LATCH2_LABEL, LATCH2_PIN_KEYBRD_DATAOUT, "keybrd_dataout",
582566
GPIO_ACTIVE_HIGH, GPIOD_OUT_LOW),
@@ -616,14 +600,28 @@ static void __init modem_assign_irq(struct gpio_chip *chip)
616600
*/
617601
static void __init omap_gpio_deps_init(void)
618602
{
603+
struct gpio_device *gdev;
619604
struct gpio_chip *chip;
620605

621-
chip = gpiochip_find(OMAP_GPIO_LABEL, gpiochip_match_by_label);
622-
if (!chip) {
623-
pr_err("%s: OMAP GPIO chip not found\n", __func__);
606+
/*
607+
* Some drivers may not use GPIO lookup tables but need to be provided
608+
* with GPIO numbers. The same applies to GPIO based IRQ lines - some
609+
* drivers may even not use GPIO layer but expect just IRQ numbers.
610+
* We could either define GPIO lookup tables then use them on behalf
611+
* of those devices, or we can use GPIO driver level methods for
612+
* identification of GPIO and IRQ numbers.
613+
*
614+
* This reference will be leaked but that's alright as this device
615+
* never goes down.
616+
*/
617+
gdev = gpio_device_find_by_label(OMAP_GPIO_LABEL);
618+
if (!gdev) {
619+
pr_err("%s: OMAP GPIO device not found\n", __func__);
624620
return;
625621
}
626622

623+
chip = gpio_device_get_chip(gdev);
624+
627625
/*
628626
* Start with FIQ initialization as it may have to request
629627
* and release successfully each OMAP GPIO pin in turn.

arch/arm/mach-omap1/board-palmte.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@
5151
#define PALMTE_HDQ_GPIO 11
5252
#define PALMTE_HEADPHONES_GPIO 14
5353
#define PALMTE_SPEAKER_GPIO 15
54-
#define PALMTE_DC_GPIO OMAP_MPUIO(2)
55-
#define PALMTE_MMC_SWITCH_GPIO OMAP_MPUIO(4)
56-
#define PALMTE_MMC1_GPIO OMAP_MPUIO(6)
57-
#define PALMTE_MMC2_GPIO OMAP_MPUIO(7)
58-
#define PALMTE_MMC3_GPIO OMAP_MPUIO(11)
5954

6055
static const unsigned int palmte_keymap[] = {
6156
KEY(0, 0, KEY_F1), /* Calendar */

drivers/gpio/Kconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1790,9 +1790,11 @@ config GPIO_LATCH
17901790
connected to other GPIOs.
17911791

17921792
config GPIO_MOCKUP
1793-
tristate "GPIO Testing Driver"
1793+
tristate "GPIO Testing Driver (DEPRECATED)"
17941794
select IRQ_SIM
17951795
help
1796+
This module is DEPRECATED. Please consider using gpio-sim instead.
1797+
17961798
This enables GPIO Testing driver, which provides a way to test GPIO
17971799
subsystem through sysfs (or char device) and debugfs.
17981800
User could use it through the script in

0 commit comments

Comments
 (0)