Skip to content

Commit

Permalink
Merge tag 'gpio-updates-for-v5.19' of git://git.kernel.org/pub/scm/li…
Browse files Browse the repository at this point in the history
…nux/kernel/git/brgl/linux

Pull gpio updates from Bartosz Golaszewski:
 "We have lots of small changes all over the place, but no huge reworks
  or new drivers:

   - use ioread()/iowrite() interfaces instead of raw inb()/outb() in
     drivers

   - make irqchips immutable due to the new warning popping up when
     drivers try to modify the irqchip structures

   - add new compatibles to dt-bindings for realtek-otto, renesas-rcar
     and pca95xx

   - add support for new models to gpio-rcar, gpio-pca953x &
     gpio-realtek-otto

   - allow parsing of GPIO hogs represented as children nodes of
     gpio-uniphier

   - define a set of common GPIO consumer strings in dt-bindings

   - shrink code in gpio-ml-ioh by using more devres interfaces

   - pass arguments to devm_kcalloc() in correct order in gpio-sim

   - add new helpers for iterating over GPIO firmware nodes and
     descriptors to gpiolib core and use it in several drivers

   - drop unused syscon_regmap_lookup_by_compatible() function

   - correct format specifiers and signedness of variables in GPIO ACPI

   - drop unneeded error checks in gpio-ftgpio

   - stop using the deprecated of_gpio.h header in gpio-zevio

   - drop platform_data support in gpio-max732x

   - simplify Kconfig dependencies in gpio-vf610

   - use raw spinlocks where needed to make PREEMPT_RT happy

   - fix return values in board files using gpio-pcf857x

   - convert more drivers to using fwnode instead of of_node

   - minor fixes and improvements in gpiolib core"

* tag 'gpio-updates-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (55 commits)
  gpio: sifive: Make the irqchip immutable
  gpio: rcar: Make the irqchip immutable
  gpio: pcf857x: Make the irqchip immutable
  gpio: pca953x: Make the irqchip immutable
  gpio: dwapb: Make the irqchip immutable
  gpio: sim: Use correct order for the parameters of devm_kcalloc()
  gpio: ml-ioh: Convert to use managed functions pcim* and devm_*
  gpio: ftgpio: Remove unneeded ERROR check before clk_disable_unprepare
  gpio: ws16c48: Utilize iomap interface
  gpio: gpio-mm: Utilize iomap interface
  gpio: 104-idio-16: Utilize iomap interface
  gpio: 104-idi-48: Utilize iomap interface
  gpio: 104-dio-48e: Utilize iomap interface
  gpio: zevio: drop of_gpio.h header
  gpio: max77620: Make the irqchip immutable
  dt-bindings: gpio: pca95xx: add entry for pca6408
  gpio: pca953xx: Add support for pca6408
  gpio: max732x: Drop unused support for irq and setup code via platform data
  gpio: vf610: drop the SOC_VF610 dependency for GPIO_VF610
  gpio: syscon: Remove usage of syscon_regmap_lookup_by_compatible
  ...
  • Loading branch information
torvalds committed May 26, 2022
2 parents f1f88bb + 5a7cb9f commit 7182e89
Show file tree
Hide file tree
Showing 61 changed files with 965 additions and 961 deletions.
64 changes: 64 additions & 0 deletions Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/gpio/gpio-consumer-common.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Common GPIO lines

maintainers:
- Bartosz Golaszewski <brgl@bgdev.pl>
- Linus Walleij <linus.walleij@linaro.org>

description:
Pay attention to using proper GPIO flag (e.g. GPIO_ACTIVE_LOW) for the GPIOs
using inverted signal (e.g. RESETN).

select: true

properties:
enable-gpios:
maxItems: 1
description:
GPIO connected to the enable control pin.

reset-gpios:
description:
GPIO (or GPIOs for power sequence) connected to the device reset pin
(e.g. RESET or RESETN).

powerdown-gpios:
maxItems: 1
description:
GPIO connected to the power down pin (hardware power down or power cut,
e.g. PD or PWDN).

pwdn-gpios:
maxItems: 1
description: Use powerdown-gpios
deprecated: true

wakeup-gpios:
maxItems: 1
description:
GPIO connected to the pin waking up the device from suspend or other
power-saving modes.

allOf:
- if:
properties:
compatible:
contains:
enum:
- mmc-pwrseq-simple
then:
properties:
reset-gpios:
minItems: 1
maxItems: 32
else:
properties:
reset-gpios:
maxItems: 1

additionalProperties: true
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/gpio/gpio-pca95xx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ properties:
- maxim,max7325
- maxim,max7326
- maxim,max7327
- nxp,pca6408
- nxp,pca6416
- nxp,pca9505
- nxp,pca9506
Expand Down
34 changes: 32 additions & 2 deletions Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ properties:
- enum:
- realtek,rtl8380-gpio
- realtek,rtl8390-gpio
- realtek,rtl9300-gpio
- realtek,rtl9310-gpio
- const: realtek,otto-gpio

reg:
maxItems: 1
reg: true

"#gpio-cells":
const: 2
Expand All @@ -50,6 +51,23 @@ properties:
interrupts:
maxItems: 1

if:
properties:
compatible:
contains:
const: realtek,rtl9300-gpio
then:
properties:
reg:
items:
- description: GPIO and interrupt control
- description: interrupt CPU map
else:
properties:
reg:
items:
- description: GPIO and interrupt control

required:
- compatible
- reg
Expand All @@ -74,5 +92,17 @@ examples:
interrupt-parent = <&rtlintc>;
interrupts = <23>;
};
- |
gpio@3300 {
compatible = "realtek,rtl9300-gpio", "realtek,otto-gpio";
reg = <0x3300 0x1c>, <0x3338 0x8>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <24>;
interrupt-controller;
#interrupt-cells = <2>;
interrupt-parent = <&rtlintc>;
interrupts = <13>;
};
...
5 changes: 5 additions & 0 deletions Documentation/devicetree/bindings/gpio/renesas,rcar-gpio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ properties:
- items:
- const: renesas,gpio-r8a779a0 # R-Car V3U

- items:
- enum:
- renesas,gpio-r8a779f0 # R-Car S4-8
- const: renesas,rcar-gen4-gpio # R-Car Gen4

reg:
maxItems: 1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,23 @@ properties:
<child-interrupt-base parent-interrupt-base length> triplets.
$ref: /schemas/types.yaml#/definitions/uint32-matrix

patternProperties:
"^.+-hog(-[0-9]+)?$":
type: object
properties:
gpio-hog: true
gpios: true
input: true
output-high: true
output-low: true
line-name: true

required:
- gpio-hog
- gpios

additionalProperties: false

required:
- compatible
- reg
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-davinci/board-da830-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,10 @@ static int __init da830_evm_ui_expander_setup(struct i2c_client *client,
return 0;
}

static int da830_evm_ui_expander_teardown(struct i2c_client *client, int gpio,
static void da830_evm_ui_expander_teardown(struct i2c_client *client, int gpio,
unsigned ngpio, void *context)
{
gpio_free(gpio + 6);
return 0;
}

static struct pcf857x_platform_data __initdata da830_evm_ui_expander_info = {
Expand Down
9 changes: 3 additions & 6 deletions arch/arm/mach-davinci/board-dm644x-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,13 @@ evm_led_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
return status;
}

static int
static void
evm_led_teardown(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
{
if (evm_led_dev) {
platform_device_unregister(evm_led_dev);
evm_led_dev = NULL;
}
return 0;
}

static struct pcf857x_platform_data pcf_data_u2 = {
Expand Down Expand Up @@ -427,7 +426,7 @@ evm_u18_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
return 0;
}

static int
static void
evm_u18_teardown(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
{
gpio_free(gpio + 1);
Expand All @@ -438,7 +437,6 @@ evm_u18_teardown(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
device_remove_file(&client->dev, &dev_attr_user_sw);
gpio_free(sw_gpio);
}
return 0;
}

static struct pcf857x_platform_data pcf_data_u18 = {
Expand Down Expand Up @@ -487,7 +485,7 @@ evm_u35_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
return 0;
}

static int
static void
evm_u35_teardown(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
{
gpio_free(gpio + 7);
Expand All @@ -497,7 +495,6 @@ evm_u35_teardown(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
gpio_free(gpio + 2);
gpio_free(gpio + 1);
gpio_free(gpio + 0);
return 0;
}

static struct pcf857x_platform_data pcf_data_u35 = {
Expand Down
4 changes: 1 addition & 3 deletions arch/arm/mach-davinci/board-dm646x-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,15 +314,13 @@ static int evm_pcf_setup(struct i2c_client *client, int gpio,
return evm_led_setup(client, gpio+4, 4, c);
}

static int evm_pcf_teardown(struct i2c_client *client, int gpio,
static void evm_pcf_teardown(struct i2c_client *client, int gpio,
unsigned int ngpio, void *c)
{
BUG_ON(ngpio < 8);

evm_sw_teardown(client, gpio, 4, c);
evm_led_teardown(client, gpio+4, 4, c);

return 0;
}

static struct pcf857x_platform_data pcf_data = {
Expand Down
7 changes: 4 additions & 3 deletions drivers/gpio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ config GPIO_IOP

config GPIO_IXP4XX
bool "Intel IXP4xx GPIO"
depends on ARM # For <asm/mach-types.h>
depends on ARCH_IXP4XX
depends on OF
select GPIO_GENERIC
select GPIOLIB_IRQCHIP
select IRQ_DOMAIN_HIERARCHY
Expand All @@ -363,6 +363,7 @@ config GPIO_IXP4XX
IXP4xx series of chips.

If unsure, say N.

config GPIO_LOGICVC
tristate "Xylon LogiCVC GPIO support"
depends on MFD_SYSCON && OF
Expand Down Expand Up @@ -674,10 +675,10 @@ config GPIO_UNIPHIER

config GPIO_VF610
def_bool y
depends on ARCH_MXC && SOC_VF610
depends on ARCH_MXC
select GPIOLIB_IRQCHIP
help
Say yes here to support Vybrid vf610 GPIOs.
Say yes here to support i.MX or Vybrid vf610 GPIOs.

config GPIO_VISCONTI
tristate "Toshiba Visconti GPIO support"
Expand Down
Loading

0 comments on commit 7182e89

Please sign in to comment.