Skip to content

Commit 8c23f23

Browse files
committed
Merge tag 'gpio-fixes-for-v5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux
Pull gpio fixes from Bartosz Golaszewski: - make the irqchip immutable in gpio-realtek-otto - fix error code propagation in gpio-winbond - fix device removing in gpio-grgpio - fix a typo in gpio-mxs which indicates the driver is for a different model - documentation fixes - MAINTAINERS file updates * tag 'gpio-fixes-for-v5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: mxs: Fix header comment gpio: Fix kernel-doc comments to nested union gpio: grgpio: Fix device removing gpio: winbond: Fix error code in winbond_gpio_get() gpio: realtek-otto: Make the irqchip immutable docs: driver-api: gpio: Fix filename mismatch MAINTAINERS: add include/dt-bindings/gpio to GPIO SUBSYSTEM
2 parents 6a0a17e + b0d4731 commit 8c23f23

File tree

9 files changed

+38
-39
lines changed

9 files changed

+38
-39
lines changed

Documentation/driver-api/gpio/board.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This document explains how GPIOs can be assigned to given devices and functions.
66

77
Note that it only applies to the new descriptor-based interface. For a
88
description of the deprecated integer-based GPIO interface please refer to
9-
gpio-legacy.txt (actually, there is no real mapping possible with the old
9+
legacy.rst (actually, there is no real mapping possible with the old
1010
interface; you just fetch an integer from somewhere and request the
1111
corresponding GPIO).
1212

Documentation/driver-api/gpio/consumer.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ GPIO Descriptor Consumer Interface
44

55
This document describes the consumer interface of the GPIO framework. Note that
66
it describes the new descriptor-based interface. For a description of the
7-
deprecated integer-based GPIO interface please refer to gpio-legacy.txt.
7+
deprecated integer-based GPIO interface please refer to legacy.rst.
88

99

1010
Guidelines for GPIOs consumers
@@ -78,7 +78,7 @@ whether the line is configured active high or active low (see
7878

7979
The two last flags are used for use cases where open drain is mandatory, such
8080
as I2C: if the line is not already configured as open drain in the mappings
81-
(see board.txt), then open drain will be enforced anyway and a warning will be
81+
(see board.rst), then open drain will be enforced anyway and a warning will be
8282
printed that the board configuration needs to be updated to match the use case.
8383

8484
Both functions return either a valid GPIO descriptor, or an error code checkable
@@ -270,7 +270,7 @@ driven.
270270
The same is applicable for open drain or open source output lines: those do not
271271
actively drive their output high (open drain) or low (open source), they just
272272
switch their output to a high impedance value. The consumer should not need to
273-
care. (For details read about open drain in driver.txt.)
273+
care. (For details read about open drain in driver.rst.)
274274

275275
With this, all the gpiod_set_(array)_value_xxx() functions interpret the
276276
parameter "value" as "asserted" ("1") or "de-asserted" ("0"). The physical line

Documentation/driver-api/gpio/intro.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ Due to the history of GPIO interfaces in the kernel, there are two different
1414
ways to obtain and use GPIOs:
1515

1616
- The descriptor-based interface is the preferred way to manipulate GPIOs,
17-
and is described by all the files in this directory excepted gpio-legacy.txt.
17+
and is described by all the files in this directory excepted legacy.rst.
1818
- The legacy integer-based interface which is considered deprecated (but still
19-
usable for compatibility reasons) is documented in gpio-legacy.txt.
19+
usable for compatibility reasons) is documented in legacy.rst.
2020

2121
The remainder of this document applies to the new descriptor-based interface.
22-
gpio-legacy.txt contains the same information applied to the legacy
22+
legacy.rst contains the same information applied to the legacy
2323
integer-based interface.
2424

2525

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8498,6 +8498,7 @@ F: Documentation/devicetree/bindings/gpio/
84988498
F: Documentation/driver-api/gpio/
84998499
F: drivers/gpio/
85008500
F: include/asm-generic/gpio.h
8501+
F: include/dt-bindings/gpio/
85018502
F: include/linux/gpio.h
85028503
F: include/linux/gpio/
85038504
F: include/linux/of_gpio.h

drivers/gpio/gpio-grgpio.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -434,25 +434,13 @@ static int grgpio_probe(struct platform_device *ofdev)
434434
static int grgpio_remove(struct platform_device *ofdev)
435435
{
436436
struct grgpio_priv *priv = platform_get_drvdata(ofdev);
437-
int i;
438-
int ret = 0;
439-
440-
if (priv->domain) {
441-
for (i = 0; i < GRGPIO_MAX_NGPIO; i++) {
442-
if (priv->uirqs[i].refcnt != 0) {
443-
ret = -EBUSY;
444-
goto out;
445-
}
446-
}
447-
}
448437

449438
gpiochip_remove(&priv->gc);
450439

451440
if (priv->domain)
452441
irq_domain_remove(priv->domain);
453442

454-
out:
455-
return ret;
443+
return 0;
456444
}
457445

458446
static const struct of_device_id grgpio_match[] = {

drivers/gpio/gpio-mxs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0+
22
//
3-
// MXC GPIO support. (c) 2008 Daniel Mack <[email protected]>
3+
// MXS GPIO support. (c) 2008 Daniel Mack <[email protected]>
44
// Copyright 2008 Juergen Beisert, [email protected]
55
//
66
// Based on code from Freescale,

drivers/gpio/gpio-realtek-otto.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ static void realtek_gpio_irq_unmask(struct irq_data *data)
172172
unsigned long flags;
173173
u16 m;
174174

175+
gpiochip_enable_irq(&ctrl->gc, line);
176+
175177
raw_spin_lock_irqsave(&ctrl->lock, flags);
176178
m = ctrl->intr_mask[port];
177179
m |= realtek_gpio_imr_bits(port_pin, REALTEK_GPIO_IMR_LINE_MASK);
@@ -195,6 +197,8 @@ static void realtek_gpio_irq_mask(struct irq_data *data)
195197
ctrl->intr_mask[port] = m;
196198
realtek_gpio_write_imr(ctrl, port, ctrl->intr_type[port], m);
197199
raw_spin_unlock_irqrestore(&ctrl->lock, flags);
200+
201+
gpiochip_disable_irq(&ctrl->gc, line);
198202
}
199203

200204
static int realtek_gpio_irq_set_type(struct irq_data *data, unsigned int flow_type)
@@ -315,13 +319,15 @@ static int realtek_gpio_irq_init(struct gpio_chip *gc)
315319
return 0;
316320
}
317321

318-
static struct irq_chip realtek_gpio_irq_chip = {
322+
static const struct irq_chip realtek_gpio_irq_chip = {
319323
.name = "realtek-otto-gpio",
320324
.irq_ack = realtek_gpio_irq_ack,
321325
.irq_mask = realtek_gpio_irq_mask,
322326
.irq_unmask = realtek_gpio_irq_unmask,
323327
.irq_set_type = realtek_gpio_irq_set_type,
324328
.irq_set_affinity = realtek_gpio_irq_set_affinity,
329+
.flags = IRQCHIP_IMMUTABLE,
330+
GPIOCHIP_IRQ_RESOURCE_HELPERS,
325331
};
326332

327333
static const struct of_device_id realtek_gpio_of_match[] = {
@@ -404,7 +410,7 @@ static int realtek_gpio_probe(struct platform_device *pdev)
404410
irq = platform_get_irq_optional(pdev, 0);
405411
if (!(dev_flags & GPIO_INTERRUPTS_DISABLED) && irq > 0) {
406412
girq = &ctrl->gc.irq;
407-
girq->chip = &realtek_gpio_irq_chip;
413+
gpio_irq_chip_set_chip(girq, &realtek_gpio_irq_chip);
408414
girq->default_type = IRQ_TYPE_NONE;
409415
girq->handler = handle_bad_irq;
410416
girq->parent_handler = realtek_gpio_irq_handler;

drivers/gpio/gpio-winbond.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,12 +385,13 @@ static int winbond_gpio_get(struct gpio_chip *gc, unsigned int offset)
385385
unsigned long *base = gpiochip_get_data(gc);
386386
const struct winbond_gpio_info *info;
387387
bool val;
388+
int ret;
388389

389390
winbond_gpio_get_info(&offset, &info);
390391

391-
val = winbond_sio_enter(*base);
392-
if (val)
393-
return val;
392+
ret = winbond_sio_enter(*base);
393+
if (ret)
394+
return ret;
394395

395396
winbond_sio_select_logical(*base, info->dev);
396397

include/linux/gpio/driver.h

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -167,21 +167,24 @@ struct gpio_irq_chip {
167167
*/
168168
irq_flow_handler_t parent_handler;
169169

170-
/**
171-
* @parent_handler_data:
172-
*
173-
* If @per_parent_data is false, @parent_handler_data is a single
174-
* pointer used as the data associated with every parent interrupt.
175-
*
176-
* @parent_handler_data_array:
177-
*
178-
* If @per_parent_data is true, @parent_handler_data_array is
179-
* an array of @num_parents pointers, and is used to associate
180-
* different data for each parent. This cannot be NULL if
181-
* @per_parent_data is true.
182-
*/
183170
union {
171+
/**
172+
* @parent_handler_data:
173+
*
174+
* If @per_parent_data is false, @parent_handler_data is a
175+
* single pointer used as the data associated with every
176+
* parent interrupt.
177+
*/
184178
void *parent_handler_data;
179+
180+
/**
181+
* @parent_handler_data_array:
182+
*
183+
* If @per_parent_data is true, @parent_handler_data_array is
184+
* an array of @num_parents pointers, and is used to associate
185+
* different data for each parent. This cannot be NULL if
186+
* @per_parent_data is true.
187+
*/
185188
void **parent_handler_data_array;
186189
};
187190

0 commit comments

Comments
 (0)