Skip to content

Commit 5d6a1b8

Browse files
committed
Merge tag 'gpio-updates-for-v5.13-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux
Pull gpio updates from Bartosz Golaszewski: - new driver for the Realtek Otto GPIO controller - ACPI support for gpio-mpc8xxx - edge event support for gpio-sch (+ Kconfig fixes) - Kconfig improvements in gpio-ich - fixes to older issues in gpio-mockup - ACPI quirk for ignoring EC wakeups on Dell Venue 10 Pro 5055 - improve the GPIO aggregator code by using more generic interfaces instead of reimplementing them in the driver - convert the DT bindings for gpio-74x164 to yaml - documentation improvements - a slew of other minor fixes and improvements to GPIO drivers * tag 'gpio-updates-for-v5.13-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (34 commits) dt-bindings: gpio: add YAML description for rockchip,gpio-bank gpio: mxs: remove useless function dt-bindings: gpio: fairchild,74hc595: Convert to json-schema gpio: it87: remove unused code gpio: 104-dio-48e: Fix coding style issues gpio: mpc8xxx: Add ACPI support gpio: ich: Switch to be dependent on LPC_ICH gpio: sch: Drop MFD_CORE selection gpio: sch: depends on LPC_SCH gpiolib: acpi: Add quirk to ignore EC wakeups on Dell Venue 10 Pro 5055 gpio: sch: Hook into ACPI GPE handler to catch GPIO edge events gpio: sch: Add edge event support gpio: aggregator: Replace custom get_arg() with a generic next_arg() lib/cmdline: Export next_arg() for being used in modules gpio: omap: Use device_get_match_data() helper gpio: Add Realtek Otto GPIO support dt-bindings: gpio: Binding for Realtek Otto GPIO docs: kernel-parameters: Add gpio_mockup_named_lines docs: kernel-parameters: Move gpio-mockup for alphabetic order lib: bitmap: provide devm_bitmap_alloc() and devm_bitmap_zalloc() ...
2 parents 5a5bcd4 + 4449529 commit 5d6a1b8

33 files changed

+1068
-350
lines changed

Documentation/admin-guide/gpio/gpio-mockup.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ module.
1717
gpio_mockup_ranges
1818

1919
This parameter takes an argument in the form of an array of integer
20-
pairs. Each pair defines the base GPIO number (if any) and the number
21-
of lines exposed by the chip. If the base GPIO is -1, the gpiolib
22-
will assign it automatically.
20+
pairs. Each pair defines the base GPIO number (non-negative integer)
21+
and the first number after the last of this chip. If the base GPIO
22+
is -1, the gpiolib will assign it automatically. while the following
23+
parameter is the number of lines exposed by the chip.
2324

24-
Example: gpio_mockup_ranges=-1,8,-1,16,405,4
25+
Example: gpio_mockup_ranges=-1,8,-1,16,405,409
2526

2627
The line above creates three chips. The first one will expose 8 lines,
2728
the second 16 and the third 4. The base GPIO for the third chip is set
2829
to 405 while for two first chips it will be assigned automatically.
2930

30-
gpio_named_lines
31+
gpio_mockup_named_lines
3132

3233
This parameter doesn't take any arguments. It lets the driver know that
3334
GPIO lines exposed by it should be named.

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,6 +1469,12 @@
14691469
Don't use this when you are not running on the
14701470
android emulator
14711471

1472+
gpio-mockup.gpio_mockup_ranges
1473+
[HW] Sets the ranges of gpiochip of for this device.
1474+
Format: <start1>,<end1>,<start2>,<end2>...
1475+
gpio-mockup.gpio_mockup_named_lines
1476+
[HW] Let the driver know GPIO lines should be named.
1477+
14721478
gpt [EFI] Forces disk with valid GPT signature but
14731479
invalid Protective MBR to be treated as GPT. If the
14741480
primary GPT is corrupted, it enables the backup/alternate
@@ -1492,10 +1498,6 @@
14921498
Format: <unsigned int> such that (rxsize & ~0x1fffc0) == 0.
14931499
Default: 1024
14941500

1495-
gpio-mockup.gpio_mockup_ranges
1496-
[HW] Sets the ranges of gpiochip of for this device.
1497-
Format: <start1>,<end1>,<start2>,<end2>...
1498-
14991501
hardlockup_all_cpu_backtrace=
15001502
[KNL] Should the hard-lockup detector generate
15011503
backtraces on all cpus.

Documentation/core-api/irq/irq-domain.rst

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ irq_domain usage
4242
================
4343

4444
An interrupt controller driver creates and registers an irq_domain by
45-
calling one of the irq_domain_add_*() functions (each mapping method
46-
has a different allocator function, more on that later). The function
47-
will return a pointer to the irq_domain on success. The caller must
48-
provide the allocator function with an irq_domain_ops structure.
45+
calling one of the irq_domain_add_*() or irq_domain_create_*() functions
46+
(each mapping method has a different allocator function, more on that later).
47+
The function will return a pointer to the irq_domain on success. The caller
48+
must provide the allocator function with an irq_domain_ops structure.
4949

5050
In most cases, the irq_domain will begin empty without any mappings
5151
between hwirq and IRQ numbers. Mappings are added to the irq_domain
@@ -147,6 +147,7 @@ Legacy
147147
irq_domain_add_simple()
148148
irq_domain_add_legacy()
149149
irq_domain_add_legacy_isa()
150+
irq_domain_create_simple()
150151
irq_domain_create_legacy()
151152

152153
The Legacy mapping is a special case for drivers that already have a
@@ -169,13 +170,13 @@ supported. For example, ISA controllers would use the legacy map for
169170
mapping Linux IRQs 0-15 so that existing ISA drivers get the correct IRQ
170171
numbers.
171172

172-
Most users of legacy mappings should use irq_domain_add_simple() which
173-
will use a legacy domain only if an IRQ range is supplied by the
174-
system and will otherwise use a linear domain mapping. The semantics
175-
of this call are such that if an IRQ range is specified then
173+
Most users of legacy mappings should use irq_domain_add_simple() or
174+
irq_domain_create_simple() which will use a legacy domain only if an IRQ range
175+
is supplied by the system and will otherwise use a linear domain mapping.
176+
The semantics of this call are such that if an IRQ range is specified then
176177
descriptors will be allocated on-the-fly for it, and if no range is
177-
specified it will fall through to irq_domain_add_linear() which means
178-
*no* irq descriptors will be allocated.
178+
specified it will fall through to irq_domain_add_linear() or
179+
irq_domain_create_linear() which means *no* irq descriptors will be allocated.
179180

180181
A typical use case for simple domains is where an irqchip provider
181182
is supporting both dynamic and static IRQ assignments.
@@ -186,6 +187,7 @@ that the driver using the simple domain call irq_create_mapping()
186187
before any irq_find_mapping() since the latter will actually work
187188
for the static IRQ assignment case.
188189

190+
irq_domain_add_simple() and irq_domain_create_simple() as well as
189191
irq_domain_add_legacy() and irq_domain_create_legacy() are functionally
190192
equivalent, except for the first argument is different - the former
191193
accepts an Open Firmware specific 'struct device_node', while the latter
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/gpio/fairchild,74hc595.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Generic 8-bit shift register
8+
9+
maintainers:
10+
- Maxime Ripard <mripard@kernel.org>
11+
12+
properties:
13+
compatible:
14+
enum:
15+
- fairchild,74hc595
16+
- nxp,74lvc594
17+
18+
reg:
19+
maxItems: 1
20+
21+
gpio-controller: true
22+
23+
'#gpio-cells':
24+
description:
25+
The second cell is only used to specify the GPIO polarity.
26+
const: 2
27+
28+
registers-number:
29+
description: Number of daisy-chained shift registers
30+
31+
enable-gpios:
32+
description: GPIO connected to the OE (Output Enable) pin.
33+
maxItems: 1
34+
35+
spi-max-frequency: true
36+
37+
patternProperties:
38+
"^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":
39+
type: object
40+
41+
properties:
42+
gpio-hog: true
43+
gpios: true
44+
output-high: true
45+
output-low: true
46+
line-name: true
47+
48+
required:
49+
- gpio-hog
50+
- gpios
51+
52+
additionalProperties: false
53+
54+
required:
55+
- compatible
56+
- reg
57+
- gpio-controller
58+
- '#gpio-cells'
59+
- registers-number
60+
61+
additionalProperties: false
62+
63+
examples:
64+
- |
65+
spi {
66+
#address-cells = <1>;
67+
#size-cells = <0>;
68+
69+
gpio5: gpio5@0 {
70+
compatible = "fairchild,74hc595";
71+
reg = <0>;
72+
gpio-controller;
73+
#gpio-cells = <2>;
74+
registers-number = <4>;
75+
spi-max-frequency = <100000>;
76+
};
77+
};

Documentation/devicetree/bindings/gpio/gpio-74x164.txt

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/gpio/realtek,otto-gpio.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Realtek Otto GPIO controller
8+
9+
maintainers:
10+
- Sander Vanheule <sander@svanheule.net>
11+
- Bert Vermeulen <bert@biot.com>
12+
13+
description: |
14+
Realtek's GPIO controller on their MIPS switch SoCs (Otto platform) consists
15+
of two banks of 32 GPIOs. These GPIOs can generate edge-triggered interrupts.
16+
Each bank's interrupts are cascased into one interrupt line on the parent
17+
interrupt controller, if provided.
18+
This binding allows defining a single bank in the devicetree. The interrupt
19+
controller is not supported on the fallback compatible name, which only
20+
allows for GPIO port use.
21+
22+
properties:
23+
$nodename:
24+
pattern: "^gpio@[0-9a-f]+$"
25+
26+
compatible:
27+
items:
28+
- enum:
29+
- realtek,rtl8380-gpio
30+
- realtek,rtl8390-gpio
31+
- const: realtek,otto-gpio
32+
33+
reg:
34+
maxItems: 1
35+
36+
"#gpio-cells":
37+
const: 2
38+
39+
gpio-controller: true
40+
41+
ngpios:
42+
minimum: 1
43+
maximum: 32
44+
45+
interrupt-controller: true
46+
47+
"#interrupt-cells":
48+
const: 2
49+
50+
interrupts:
51+
maxItems: 1
52+
53+
required:
54+
- compatible
55+
- reg
56+
- "#gpio-cells"
57+
- gpio-controller
58+
59+
additionalProperties: false
60+
61+
dependencies:
62+
interrupt-controller: [ interrupts ]
63+
64+
examples:
65+
- |
66+
gpio@3500 {
67+
compatible = "realtek,rtl8380-gpio", "realtek,otto-gpio";
68+
reg = <0x3500 0x1c>;
69+
gpio-controller;
70+
#gpio-cells = <2>;
71+
ngpios = <24>;
72+
interrupt-controller;
73+
#interrupt-cells = <2>;
74+
interrupt-parent = <&rtlintc>;
75+
interrupts = <23>;
76+
};
77+
78+
...
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/gpio/rockchip,gpio-bank.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Rockchip GPIO bank
8+
9+
maintainers:
10+
- Heiko Stuebner <heiko@sntech.de>
11+
12+
properties:
13+
compatible:
14+
enum:
15+
- rockchip,gpio-bank
16+
- rockchip,rk3188-gpio-bank0
17+
18+
reg:
19+
maxItems: 1
20+
21+
interrupts:
22+
maxItems: 1
23+
24+
clocks:
25+
maxItems: 1
26+
27+
gpio-controller: true
28+
29+
"#gpio-cells":
30+
const: 2
31+
32+
interrupt-controller: true
33+
34+
"#interrupt-cells":
35+
const: 2
36+
37+
required:
38+
- compatible
39+
- reg
40+
- interrupts
41+
- clocks
42+
- gpio-controller
43+
- "#gpio-cells"
44+
- interrupt-controller
45+
- "#interrupt-cells"
46+
47+
additionalProperties: false
48+
49+
examples:
50+
- |
51+
#include <dt-bindings/interrupt-controller/arm-gic.h>
52+
pinctrl: pinctrl {
53+
#address-cells = <1>;
54+
#size-cells = <1>;
55+
ranges;
56+
57+
gpio0: gpio@2000a000 {
58+
compatible = "rockchip,rk3188-gpio-bank0";
59+
reg = <0x2000a000 0x100>;
60+
interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
61+
clocks = <&clk_gates8 9>;
62+
63+
gpio-controller;
64+
#gpio-cells = <2>;
65+
66+
interrupt-controller;
67+
#interrupt-cells = <2>;
68+
};
69+
70+
gpio1: gpio@2003c000 {
71+
compatible = "rockchip,gpio-bank";
72+
reg = <0x2003c000 0x100>;
73+
interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
74+
clocks = <&clk_gates8 10>;
75+
76+
gpio-controller;
77+
#gpio-cells = <2>;
78+
79+
interrupt-controller;
80+
#interrupt-cells = <2>;
81+
};
82+
};

0 commit comments

Comments
 (0)