Commit 5e6a5845 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'gpio-updates-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio updates from Bartosz Golaszewski:
 "We mostly have various improvements and refactoring all over the place
  but also some interesting new features - like the virtio GPIO driver
  that allows guest VMs to use host's GPIOs. We also have a new/old GPIO
  driver for rockchip - this one has been split out of the pinctrl
  driver.

  Summary:

   - new driver: gpio-virtio allowing a guest VM running linux to access
     GPIO lines provided by the host

   - split the GPIO driver out of the rockchip pin control driver

   - add support for a new model to gpio-aspeed-sgpio, refactor the
     driver and use generic device property interfaces, improve property
     sanitization

   - add ACPI support to gpio-tegra186

   - improve the code setting the line names to support multiple GPIO
     banks per device

   - constify a bunch of OF functions in the core GPIO code and make the
     declaration for one of the core OF functions we use consistent
     within its header

   - use software nodes in intel_quark_i2c_gpio

   - add support for the gpio-line-names property in gpio-mt7621

   - use the standard GPIO function for setting the GPIO names in
     gpio-brcmstb

   - fix a bunch of leaks and other bugs in gpio-mpc8xxx

   - use generic pm callbacks in gpio-ml-ioh

   - improve resource management and PM handling in gpio-mlxbf2

   - modernize and improve the gpio-dwapb driver

   - coding style improvements in gpio-rcar

   - documentation fixes and improvements

   - update the MAINTAINERS entry for gpio-zynq

   - minor tweaks in several drivers"

* tag 'gpio-updates-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (35 commits)
  gpio: mpc8xxx: Use 'devm_gpiochip_add_data()' to simplify the code and avoid a leak
  gpio: mpc8xxx: Fix a potential double iounmap call in 'mpc8xxx_probe()'
  gpio: mpc8xxx: Fix a resources leak in the error handling path of 'mpc8xxx_probe()'
  gpio: viperboard: remove platform_set_drvdata() call in probe
  gpio: virtio: Add missing mailings lists in MAINTAINERS entry
  gpio: virtio: Fix sparse warnings
  gpio: remove the obsolete MX35 3DS BOARD MC9S08DZ60 GPIO functions
  gpio: max730x: Use the right include
  gpio: Add virtio-gpio driver
  gpio: mlxbf2: Use DEFINE_RES_MEM_NAMED() helper macro
  gpio: mlxbf2: Use devm_platform_ioremap_resource()
  gpio: mlxbf2: Drop wrong use of ACPI_PTR()
  gpio: mlxbf2: Convert to device PM ops
  gpio: dwapb: Get rid of legacy platform data
  mfd: intel_quark_i2c_gpio: Convert GPIO to use software nodes
  gpio: dwapb: Read GPIO base from gpio-base property
  gpio: dwapb: Unify ACPI enumeration checks in get_irq() and configure_irqs()
  gpiolib: Deduplicate forward declaration in the consumer.h header
  MAINTAINERS: update gpio-zynq.yaml reference
  gpio: tegra186: Add ACPI support
  ...
parents 75b96f0e 889a1b3f
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -72,6 +72,10 @@ for the GPIO. Values can be:
* GPIOD_OUT_HIGH_OPEN_DRAIN same as GPIOD_OUT_HIGH but also enforce the line
  to be electrically used with open drain.

Note that the initial value is *logical* and the physical line level depends on
whether the line is configured active high or active low (see
:ref:`active_low_semantics`).

The two last flags are used for use cases where open drain is mandatory, such
as I2C: if the line is not already configured as open drain in the mappings
(see board.txt), then open drain will be enforced anyway and a warning will be
@@ -252,6 +256,8 @@ that can't be accessed from hardIRQ handlers, these calls act the same as the
spinlock-safe calls.


.. _active_low_semantics:

The active low and open drain semantics
---------------------------------------
As a consumer should not have to care about the physical line level, all of the
@@ -309,9 +315,11 @@ work on the raw line value::
	void gpiod_set_raw_value_cansleep(struct gpio_desc *desc, int value)
	int gpiod_direction_output_raw(struct gpio_desc *desc, int value)

The active low state of a GPIO can also be queried using the following call::
The active low state of a GPIO can also be queried and toggled using the
following calls::

	int gpiod_is_active_low(const struct gpio_desc *desc)
	void gpiod_toggle_active_low(struct gpio_desc *desc)

Note that these functions should only be used with great moderation; a driver
should not have to care about the physical line level or open drain semantics.
+4 −7
Original line number Diff line number Diff line
@@ -547,13 +547,10 @@ To use the helpers please keep the following in mind:
  the irqchip can initialize. E.g. .dev and .can_sleep shall be set up
  properly.

- Nominally set all handlers to handle_bad_irq() in the setup call and pass
  handle_bad_irq() as flow handler parameter in gpiochip_irqchip_add() if it is
  expected for GPIO driver that irqchip .set_type() callback will be called
  before using/enabling each GPIO IRQ. Then set the handler to
  handle_level_irq() and/or handle_edge_irq() in the irqchip .set_type()
  callback depending on what your controller supports and what is requested
  by the consumer.
- Nominally set gpio_irq_chip.handler to handle_bad_irq. Then, if your irqchip
  is cascaded, set the handler to handle_level_irq() and/or handle_edge_irq()
  in the irqchip .set_type() callback depending on what your controller
  supports and what is requested by the consumer.


Locking IRQ usage
+10 −1
Original line number Diff line number Diff line
@@ -19852,6 +19852,15 @@ F: Documentation/filesystems/virtiofs.rst
F:	fs/fuse/virtio_fs.c
F:	include/uapi/linux/virtio_fs.h
VIRTIO GPIO DRIVER
M:	Enrico Weigelt, metux IT consult <info@metux.net>
M:	Viresh Kumar <vireshk@kernel.org>
L:	linux-gpio@vger.kernel.org
L:	virtualization@lists.linux-foundation.org
S:	Maintained
F:	drivers/gpio/gpio-virtio.c
F:	include/uapi/linux/virtio_gpio.h
VIRTIO GPU DRIVER
M:	David Airlie <airlied@linux.ie>
M:	Gerd Hoffmann <kraxel@redhat.com>
@@ -20546,7 +20555,7 @@ R: Srinivas Neeli <srinivas.neeli@xilinx.com>
R:	Michal Simek <michal.simek@xilinx.com>
S:	Maintained
F:	Documentation/devicetree/bindings/gpio/gpio-xilinx.txt
F:	Documentation/devicetree/bindings/gpio/gpio-zynq.txt
F:	Documentation/devicetree/bindings/gpio/gpio-zynq.yaml
F:	drivers/gpio/gpio-xilinx.c
F:	drivers/gpio/gpio-zynq.c
+9 −6
Original line number Diff line number Diff line
@@ -1018,12 +1018,6 @@ config GPIO_MAX732X_IRQ
	  Say yes here to enable the max732x to be used as an interrupt
	  controller. It requires the driver to be built in the kernel.

config GPIO_MC9S08DZ60
	bool "MX35 3DS BOARD MC9S08DZ60 GPIO functions"
	depends on I2C=y && MACH_MX35_3DS
	help
	  Select this to enable the MC9S08DZ60 GPIO driver

config GPIO_PCA953X
	tristate "PCA95[357]x, PCA9698, TCA64xx, and MAX7310 I/O ports"
	select REGMAP_I2C
@@ -1677,6 +1671,15 @@ config GPIO_MOCKUP
	  tools/testing/selftests/gpio/gpio-mockup.sh. Reference the usage in
	  it.

config GPIO_VIRTIO
	tristate "VirtIO GPIO support"
	depends on VIRTIO
	help
	  Say Y here to enable guest support for virtio-based GPIO controllers.

	  These virtual GPIOs can be routed to real GPIOs or attached to
	  simulators on the host (like QEMU).

endmenu

endif
+1 −1
Original line number Diff line number Diff line
@@ -92,7 +92,6 @@ obj-$(CONFIG_GPIO_MAX77620) += gpio-max77620.o
obj-$(CONFIG_GPIO_MAX77650)		+= gpio-max77650.o
obj-$(CONFIG_GPIO_MB86S7X)		+= gpio-mb86s7x.o
obj-$(CONFIG_GPIO_MC33880)		+= gpio-mc33880.o
obj-$(CONFIG_GPIO_MC9S08DZ60)		+= gpio-mc9s08dz60.o
obj-$(CONFIG_GPIO_MENZ127)		+= gpio-menz127.o
obj-$(CONFIG_GPIO_MERRIFIELD)		+= gpio-merrifield.o
obj-$(CONFIG_GPIO_ML_IOH)		+= gpio-ml-ioh.o
@@ -166,6 +165,7 @@ obj-$(CONFIG_GPIO_UCB1400) += gpio-ucb1400.o
obj-$(CONFIG_GPIO_UNIPHIER)		+= gpio-uniphier.o
obj-$(CONFIG_GPIO_VF610)		+= gpio-vf610.o
obj-$(CONFIG_GPIO_VIPERBOARD)		+= gpio-viperboard.o
obj-$(CONFIG_GPIO_VIRTIO)		+= gpio-virtio.o
obj-$(CONFIG_GPIO_VISCONTI)		+= gpio-visconti.o
obj-$(CONFIG_GPIO_VR41XX)		+= gpio-vr41xx.o
obj-$(CONFIG_GPIO_VX855)		+= gpio-vx855.o
Loading