Commit 131561f2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'gpio-updates-for-v6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio updates from Bartosz Golaszewski:
 "Three new drivers, support for some new models in existing ones and
  lots of various tweaks and improvements across the board (switching to
  using recommended APIs, code shrink and simplification, etc.).

  Also a new feature in the character device uAPI where we now notify
  the user-space about changes triggered by in-kernel users as well, not
  only when they were done by other user-space agents.

  Summary:

  GPIOLIB core:
   - use the new mem_is_zero() instead of memchr_inv(s, 0, n)
   - don't store debounce period twice needlessly
   - clean-up debugfs handling
   - remove leftover comments referring to no longer used spinlocks
   - unduplicate some operations like SRCU locks and initializing GPIO
     descriptors
   - constify the sysfs class struct
   - use lock guards in GPIO sysfs code
   - update GPIO uAPI internal flags all at once atomically for
     consistency with other places
   - modify the behavior of the sysfs interface by no longer exporting
     lines that are named inside the driver code or board files with the
     sysfs links bearing the line names as this has for many years been
     largely unused due to the prevalence of DT, ACPI and firmware nodes
     over board files and made the API inconsistent
   - for GPIO interrupt providers: free irqs that are still requested by
     users when removing the chip

  GPIO uAPI:
   - notify user-space about changes to GPIO lines' state (requested,
     released, reconfigured) triggered from the kernel as well (until
     now we'd only do this for changes triggered from user-space)
   - to that end: modify the internal workings of the notification
     mechanism by switching to an atomic notifier which allows us to
     send events from atomic context
   - also to that end store the debounce period in the GPIO descriptor
     struct and not in the character device context struct
   - while at it, also cover the corner-case of users introducing
     changes over sysfs while others watch them via the character device
   - don't report GPIO lines requested as interrupts as "used" to
     user-space as it can still request them as GPIOs

  New drivers:
   - GPIO part of the MFD Congatec Board Controller
   - PolarFire GPIO controller
   - GPIOs on FTDI FT2232H

  Driver improvements:
   - use generic device property accessors instead of OF-specific ones
     across many GPIO drivers (mpc8xxx, vf610, eic-sprd, davinci,
     ts4900, xilinx, mvebu)
   - use devres helpers to simplify error paths and either shrink or
     entirely remove the driver's remove() callback (grgpio, amdpt,
     menz127, max730x, ftgpio010, 74x164, ljca)
   - use helper variables to store the address of pdev->dev and avoid
     some line-breaks
   - use device_for_each_child_node_scoped() to avoid having to put the
     fwnode on breaks or errors (gpio-sim, gpio-dwapb, gpiolib-acpi)
   - use a scoped bitmap to simplify the code and drop goto labels in
     gpio-aggregator
   - drop unneeded Kconfig dependencies on OF_GPIO (grgpio, mveby,
     xilinx)
   - add support for new models to gpio-aspeed, gpio-rockchip and
     gpio-dwapb
   - clean-up ACPI handling and some other bits in gpio-xgene-sb
   - replace deprecated PCI functions in pcie-idio-24 and pci-idio-16
   - allow to build davinci and mvebu drivers with COMPILE_TEST=y
   - remove dead code in gpio-mb86s7x
   - switch back to using platform_driver::remove() (after the
     conversion to remove_new()) across the GPIO drivers
   - remove remaining uses of GPIOF_ACTIVE_LOW across the tree and drop
     this deprecated symbol
   - convert the gpio-altera driver to no longer pull in the deprecated
     legacy-of-mm-gpiochip.h header
   - use of_property_present() instead of of_property_read_bool() in
     gpiolib-of and gpio-rockchip
   - allow to build the tegra186 driver on Tegra234 platforms in Kconfig

  Late fixes:
   - add a missing return value check after devm_kasprintf() to
     gpio-grgpio

  DT bindings:
   - document the ngpios property of gpio-mmio
   - add support for a new aspeed model
   - fix the example for st,nomadik-gpio

  Other:
   - kernel doc and comments tweaks
   - fix typos in TODO
   - reorder headers alphabetically in some drivers
   - fix incorrect format specifiers in gpio tools"

* tag 'gpio-updates-for-v6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (98 commits)
  gpio: tegra186: Allow to enable driver on Tegra234
  gpio: grgpio: Add NULL check in grgpio_probe
  tools: gpio: Fix several incorrect format specifiers
  gpio: mpfs: add CoreGPIO support
  gpio: rockchip: support new version GPIO
  gpio: rockchip: change the GPIO version judgment logic
  gpio: rockchip: explan the format of the GPIO version ID
  gpiolib: cdev: use !mem_is_zero() instead of memchr_inv(s, 0, n)
  MAINTAINERS: add gpio driver to PolarFire entry
  gpio: Get rid of GPIOF_ACTIVE_LOW
  USB: gadget: pxa27x_udc: Avoid using GPIOF_ACTIVE_LOW
  pcmcia: soc_common: Avoid using GPIOF_ACTIVE_LOW
  leds: gpio: Avoid using GPIOF_ACTIVE_LOW
  Input: gpio_keys_polled - avoid using GPIOF_ACTIVE_LOW
  Input: gpio_keys - avoid using GPIOF_ACTIVE_LOW
  gpio: Use of_property_present() for non-boolean properties
  gpio: mpfs: add polarfire soc gpio support
  gpio: altera: Drop legacy-of-mm-gpiochip.h header
  gpio: pcie-idio-24: Replace deprecated PCI functions
  gpio: pci-idio-16: Replace deprecated PCI functions
  ...
parents 7d756066 bef29ca3
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ properties:
      - aspeed,ast2400-gpio
      - aspeed,ast2500-gpio
      - aspeed,ast2600-gpio
      - aspeed,ast2700-gpio

  reg:
    maxItems: 1
@@ -25,7 +26,7 @@ properties:

  gpio-controller: true
  gpio-line-names:
    minItems: 36
    minItems: 12
    maxItems: 232

  gpio-ranges: true
@@ -42,7 +43,7 @@ properties:
    const: 2

  ngpios:
    minimum: 36
    minimum: 12
    maximum: 232

required:
@@ -93,6 +94,20 @@ allOf:
          enum: [ 36, 208 ]
      required:
        - ngpios
  - if:
      properties:
        compatible:
          contains:
            const: aspeed,ast2700-gpio
    then:
      properties:
        gpio-line-names:
          minItems: 12
          maxItems: 216
        ngpios:
          enum: [ 12, 216 ]
      required:
        - ngpios

additionalProperties: false

+12 −1
Original line number Diff line number Diff line
@@ -37,7 +37,8 @@ properties:
    description:
      A list of registers in the controller. The width of each register is
      determined by its size. All registers must have the same width. The number
      of GPIOs is set by the width, with bit 0 corresponding to GPIO 0.
      of GPIOs is set by the width, with bit 0 corresponding to GPIO 0, unless
      the ngpios property further restricts the number of used lines.
    items:
      - description:
          Register to READ the value of the GPIO lines. If GPIO line is high,
@@ -74,6 +75,15 @@ properties:

  native-endian: true

  ngpios:
    minimum: 1
    maximum: 63
    description:
      If this property is present the number of usable GPIO lines are restricted
      to the first 0 .. ngpios lines. This is useful when the GPIO MMIO register
      has 32 bits for GPIO but only the first 12 are actually connected to
      real electronics, and then we set ngpios to 12.

  no-output:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
@@ -111,6 +121,7 @@ examples:
      compatible = "brcm,bcm6345-gpio";
      reg-names = "dirout", "dat";
      reg = <0xfffe0406 2>, <0xfffe040a 2>;
      ngpios = <15>;
      native-endian;
      gpio-controller;
      #gpio-cells = <2>;
+1 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ examples:
        interrupts = <0 120 0x4>;
        #gpio-cells = <2>;
        gpio-controller;
        #interrupt-cells = <2>;
        interrupt-controller;
        st,supports-sleepmode;
        gpio-bank = <1>;
+10 −0
Original line number Diff line number Diff line
@@ -5741,6 +5741,15 @@ F: fs/configfs/
F:	include/linux/configfs.h
F:	samples/configfs/
CONGATEC BOARD CONTROLLER MFD DRIVER
M:	Thomas Richard <thomas.richard@bootlin.com>
S:	Maintained
F:	drivers/gpio/gpio-cgbc.c
F:	drivers/i2c/busses/i2c-cgbc.c
F:	drivers/mfd/cgbc-core.c
F:	drivers/watchdog/cgbc_wdt.c
F:	include/linux/mfd/cgbc.h
CONSOLE SUBSYSTEM
M:	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
S:	Supported
@@ -19879,6 +19888,7 @@ F: arch/riscv/boot/dts/microchip/
F:	drivers/char/hw_random/mpfs-rng.c
F:	drivers/clk/microchip/clk-mpfs*.c
F:	drivers/firmware/microchip/mpfs-auto-update.c
F:	drivers/gpio/gpio-mpfs.c
F:	drivers/i2c/busses/i2c-microchip-corei2c.c
F:	drivers/mailbox/mailbox-mpfs.c
F:	drivers/pci/controller/plda/pcie-microchip-host.c
+29 −12
Original line number Diff line number Diff line
@@ -70,8 +70,7 @@ config GPIO_SYSFS
	  ioctl() operations instead.

config GPIO_CDEV
	bool
	prompt "Character device (/dev/gpiochipN) support" if EXPERT
	bool "Character device (/dev/gpiochipN) support" if EXPERT
	default y
	help
	  Say Y here to add the character device /dev/gpiochipN interface
@@ -149,9 +148,7 @@ config GPIO_74XX_MMIO

config GPIO_ALTERA
	tristate "Altera GPIO"
	depends on OF_GPIO
	select GPIOLIB_IRQCHIP
	select OF_GPIO_MM_GPIOCHIP
	help
	  Say Y or M here to build support for the Altera PIO device.

@@ -243,7 +240,7 @@ config GPIO_CLPS711X
config GPIO_DAVINCI
	tristate "TI Davinci/Keystone GPIO support"
	default y if ARCH_DAVINCI
	depends on (ARM || ARM64) && (ARCH_DAVINCI || ARCH_KEYSTONE || ARCH_K3)
	depends on ((ARM || ARM64) && (ARCH_DAVINCI || ARCH_KEYSTONE || ARCH_K3)) || COMPILE_TEST
	help
	  Say yes here to enable GPIO support for TI Davinci/Keystone SoCs.

@@ -341,7 +338,6 @@ config GPIO_GRANITERAPIDS

config GPIO_GRGPIO
	tristate "Aeroflex Gaisler GRGPIO support"
	depends on OF_GPIO
	select GPIO_GENERIC
	select IRQ_DOMAIN
	help
@@ -487,8 +483,7 @@ config GPIO_MT7621

config GPIO_MVEBU
	def_bool y
	depends on PLAT_ORION || ARCH_MVEBU
	depends on OF_GPIO
	depends on PLAT_ORION || ARCH_MVEBU || COMPILE_TEST
	select GENERIC_IRQ_CHIP
	select REGMAP_MMIO

@@ -549,6 +544,12 @@ config GPIO_PL061
	help
	  Say yes here to support the PrimeCell PL061 GPIO device.

config GPIO_POLARFIRE_SOC
	bool "Microchip FPGA GPIO support"
	select REGMAP_MMIO
	help
	  Say yes here to support the GPIO controllers on Microchip FPGAs.

config GPIO_PXA
	bool "PXA GPIO support"
	depends on ARCH_PXA || ARCH_MMP || COMPILE_TEST
@@ -714,13 +715,13 @@ config GPIO_TEGRA

config GPIO_TEGRA186
	tristate "NVIDIA Tegra186 GPIO support"
	default ARCH_TEGRA_186_SOC || ARCH_TEGRA_194_SOC
	depends on ARCH_TEGRA_186_SOC || ARCH_TEGRA_194_SOC || COMPILE_TEST
	default ARCH_TEGRA_186_SOC || ARCH_TEGRA_194_SOC || ARCH_TEGRA_234_SOC
	depends on ARCH_TEGRA_186_SOC || ARCH_TEGRA_194_SOC || ARCH_TEGRA_234_SOC || COMPILE_TEST
	depends on OF_GPIO
	select GPIOLIB_IRQCHIP
	select IRQ_DOMAIN_HIERARCHY
	help
	  Say yes here to support GPIO pins on NVIDIA Tegra186 SoCs.
	  Say yes here to support GPIO pins on NVIDIA Tegra186, 194 and 234 SoCs.

config GPIO_TS4800
	tristate "TS-4800 DIO blocks and compatibles"
@@ -796,7 +797,6 @@ config GPIO_XGENE_SB
config GPIO_XILINX
	tristate "Xilinx GPIO support"
	select GPIOLIB_IRQCHIP
	depends on OF_GPIO
	help
	  Say yes here to support the Xilinx FPGA GPIO device.

@@ -1287,6 +1287,16 @@ config GPIO_BD9571MWV
	  This driver can also be built as a module. If so, the module
	  will be called gpio-bd9571mwv.

config GPIO_CGBC
	tristate "Congatec Board Controller GPIO support"
	depends on MFD_CGBC
	help
	  Select this option to enable GPIO support for the Congatec Board
	  Controller.

	  This driver can also be built as a module. If so, the module will be
	  called gpio-cgbc.

config GPIO_CROS_EC
	tristate "ChromeOS EC GPIO support"
	depends on CROS_EC
@@ -1844,6 +1854,13 @@ config GPIO_VIPERBOARD
	  River Tech's viperboard.h for detailed meaning
	  of the module parameters.

config GPIO_MPSSE
	tristate "FTDI MPSSE GPIO support"
	select GPIOLIB_IRQCHIP
	help
	  GPIO driver for FTDI's MPSSE interface. These can do input and
	  output. Each MPSSE provides 16 IO pins.

endmenu

menu "Virtual GPIO drivers"
Loading