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

Configure Feed

Select the types of activity you want to include in your feed.

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

+38 -39
+1 -1
Documentation/driver-api/gpio/board.rst
··· 6 6 7 7 Note that it only applies to the new descriptor-based interface. For a 8 8 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 10 10 interface; you just fetch an integer from somewhere and request the 11 11 corresponding GPIO). 12 12
+3 -3
Documentation/driver-api/gpio/consumer.rst
··· 4 4 5 5 This document describes the consumer interface of the GPIO framework. Note that 6 6 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. 8 8 9 9 10 10 Guidelines for GPIOs consumers ··· 78 78 79 79 The two last flags are used for use cases where open drain is mandatory, such 80 80 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 82 82 printed that the board configuration needs to be updated to match the use case. 83 83 84 84 Both functions return either a valid GPIO descriptor, or an error code checkable ··· 270 270 The same is applicable for open drain or open source output lines: those do not 271 271 actively drive their output high (open drain) or low (open source), they just 272 272 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.) 274 274 275 275 With this, all the gpiod_set_(array)_value_xxx() functions interpret the 276 276 parameter "value" as "asserted" ("1") or "de-asserted" ("0"). The physical line
+3 -3
Documentation/driver-api/gpio/intro.rst
··· 14 14 ways to obtain and use GPIOs: 15 15 16 16 - 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. 18 18 - 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. 20 20 21 21 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 23 23 integer-based interface. 24 24 25 25
+1
MAINTAINERS
··· 8498 8498 F: Documentation/driver-api/gpio/ 8499 8499 F: drivers/gpio/ 8500 8500 F: include/asm-generic/gpio.h 8501 + F: include/dt-bindings/gpio/ 8501 8502 F: include/linux/gpio.h 8502 8503 F: include/linux/gpio/ 8503 8504 F: include/linux/of_gpio.h
+1 -13
drivers/gpio/gpio-grgpio.c
··· 434 434 static int grgpio_remove(struct platform_device *ofdev) 435 435 { 436 436 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 - } 448 437 449 438 gpiochip_remove(&priv->gc); 450 439 451 440 if (priv->domain) 452 441 irq_domain_remove(priv->domain); 453 442 454 - out: 455 - return ret; 443 + return 0; 456 444 } 457 445 458 446 static const struct of_device_id grgpio_match[] = {
+1 -1
drivers/gpio/gpio-mxs.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0+ 2 2 // 3 - // MXC GPIO support. (c) 2008 Daniel Mack <daniel@caiaq.de> 3 + // MXS GPIO support. (c) 2008 Daniel Mack <daniel@caiaq.de> 4 4 // Copyright 2008 Juergen Beisert, kernel@pengutronix.de 5 5 // 6 6 // Based on code from Freescale,
+8 -2
drivers/gpio/gpio-realtek-otto.c
··· 172 172 unsigned long flags; 173 173 u16 m; 174 174 175 + gpiochip_enable_irq(&ctrl->gc, line); 176 + 175 177 raw_spin_lock_irqsave(&ctrl->lock, flags); 176 178 m = ctrl->intr_mask[port]; 177 179 m |= realtek_gpio_imr_bits(port_pin, REALTEK_GPIO_IMR_LINE_MASK); ··· 197 195 ctrl->intr_mask[port] = m; 198 196 realtek_gpio_write_imr(ctrl, port, ctrl->intr_type[port], m); 199 197 raw_spin_unlock_irqrestore(&ctrl->lock, flags); 198 + 199 + gpiochip_disable_irq(&ctrl->gc, line); 200 200 } 201 201 202 202 static int realtek_gpio_irq_set_type(struct irq_data *data, unsigned int flow_type) ··· 319 315 return 0; 320 316 } 321 317 322 - static struct irq_chip realtek_gpio_irq_chip = { 318 + static const struct irq_chip realtek_gpio_irq_chip = { 323 319 .name = "realtek-otto-gpio", 324 320 .irq_ack = realtek_gpio_irq_ack, 325 321 .irq_mask = realtek_gpio_irq_mask, 326 322 .irq_unmask = realtek_gpio_irq_unmask, 327 323 .irq_set_type = realtek_gpio_irq_set_type, 328 324 .irq_set_affinity = realtek_gpio_irq_set_affinity, 325 + .flags = IRQCHIP_IMMUTABLE, 326 + GPIOCHIP_IRQ_RESOURCE_HELPERS, 329 327 }; 330 328 331 329 static const struct of_device_id realtek_gpio_of_match[] = { ··· 410 404 irq = platform_get_irq_optional(pdev, 0); 411 405 if (!(dev_flags & GPIO_INTERRUPTS_DISABLED) && irq > 0) { 412 406 girq = &ctrl->gc.irq; 413 - girq->chip = &realtek_gpio_irq_chip; 407 + gpio_irq_chip_set_chip(girq, &realtek_gpio_irq_chip); 414 408 girq->default_type = IRQ_TYPE_NONE; 415 409 girq->handler = handle_bad_irq; 416 410 girq->parent_handler = realtek_gpio_irq_handler;
+4 -3
drivers/gpio/gpio-winbond.c
··· 385 385 unsigned long *base = gpiochip_get_data(gc); 386 386 const struct winbond_gpio_info *info; 387 387 bool val; 388 + int ret; 388 389 389 390 winbond_gpio_get_info(&offset, &info); 390 391 391 - val = winbond_sio_enter(*base); 392 - if (val) 393 - return val; 392 + ret = winbond_sio_enter(*base); 393 + if (ret) 394 + return ret; 394 395 395 396 winbond_sio_select_logical(*base, info->dev); 396 397
+16 -13
include/linux/gpio/driver.h
··· 167 167 */ 168 168 irq_flow_handler_t parent_handler; 169 169 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 - */ 183 170 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 + */ 184 178 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 + */ 185 188 void **parent_handler_data_array; 186 189 }; 187 190