Commit ce952d8f authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

Pull gpio updates from Bartosz Golaszewski
 "This was a quiet release cycle for the GPIO tree and so this
  pull-request is relatively small.

  We have one new driver, some minor improvements to the GPIO core code
  and across several drivers, some DT and documentation updates but in
  general nothing stands out or is controversial. All changes have spent
  time in next with no reported issues (or ones that were quickly
  fixed).

  GPIO core:
   - remove more unused legacy interfaces (after converting the last
     remaining users to better alternatives)
   - update kerneldocs
   - improve error handling and log messages in GPIO ACPI code
   - remove dead code (always true checks) from GPIOLIB

  New drivers:
   - add a driver for Intel Granite Rapids-D vGPIO

  Driver improvements:
   - use -ENOTSUPP consistently in gpio-regmap and gpio-pcie-idio-24
   - provide an ID table for gpio-cros-ec to avoid a driver name
     fallback check
   - add support for gpio-ranges for GPIO drivers supporting multiple
     GPIO banks
   - switch to using dynamic GPIO base in gpio-brcmstb
   - fix irq handling in gpio-npcm-sgpio
   - switch to memory mapped IO accessors in gpio-sch

  DT bindings:
   - add support for gpio-ranges to gpio-brcmstb
   - add support for a new model and the gpio-line-names property to
     gpio-mpfs

  Documentation:
   - replace leading tabs with spaces in code blocks
   - fix typos"

* tag 'gpio-updates-for-v6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (30 commits)
  gpio: nuvoton: Fix sgpio irq handle error
  gpiolib: Discourage to use formatting strings in line names
  gpio: brcmstb: add support for gpio-ranges
  gpio: of: support gpio-ranges for multiple gpiochip devices
  dt-bindings: gpio: brcmstb: add gpio-ranges
  gpio: Add Intel Granite Rapids-D vGPIO driver
  gpio: brcmstb: Use dynamic GPIO base numbers
  gpiolib: acpi: Set label for IRQ only lines
  gpiolib: acpi: Add fwnode name to the GPIO interrupt label
  gpiolib: Get rid of never false gpio_is_valid() calls
  gpiolib: acpi: Pass con_id instead of property into acpi_dev_gpio_irq_get_by()
  gpiolib: acpi: Move acpi_can_fallback_to_crs() out of __acpi_find_gpio()
  gpiolib: acpi: Simplify error handling in __acpi_find_gpio()
  gpiolib: acpi: Extract __acpi_find_gpio() helper
  gpio: sch: Utilise temporary variable for struct device
  gpio: sch: Switch to memory mapped IO accessors
  gpio: regmap: Use -ENOTSUPP consistently
  gpio: pcie-idio-24: Use -ENOTSUPP consistently
  Documentation: gpio: Replace leading TABs by spaces in code blocks
  gpiolib: acpi: Check for errors first in acpi_find_gpio()
  ...
parents 9d81e2d5 7f45fe2e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -62,6 +62,8 @@ properties:

  interrupt-controller: true

  gpio-ranges: true

  wakeup-source:
    type: boolean
    description: >
@@ -88,6 +90,7 @@ examples:
        interrupt-parent = <&irq0_intc>;
        interrupts = <0x6>;
        brcm,gpio-bank-widths = <32 32 32 24>;
        gpio-ranges = <&pinctrl 0 0 120>;
    };

    upg_gio_aon: gpio@f04172c0 {
+14 −3
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ properties:
    items:
      - enum:
          - microchip,mpfs-gpio
          - microchip,coregpio-rtl-v3

  reg:
    maxItems: 1
@@ -43,6 +44,7 @@ properties:
    default: 32

  gpio-controller: true
  gpio-line-names: true

patternProperties:
  "^.+-hog(-[0-9]+)?$":
@@ -62,12 +64,21 @@ patternProperties:
      - gpio-hog
      - gpios

allOf:
  - if:
      properties:
        compatible:
          contains:
            const: microchip,mpfs-gpio
    then:
      required:
  - compatible
  - reg
        - interrupts
        - "#interrupt-cells"
        - interrupt-controller

required:
  - compatible
  - reg
  - "#gpio-cells"
  - gpio-controller
  - clocks
+14 −14
Original line number Diff line number Diff line
@@ -550,8 +550,8 @@ the interrupt separately and go with it:
  struct my_gpio *g;
  struct gpio_irq_chip *girq;

  ret = devm_request_threaded_irq(dev, irq, NULL,
		irq_thread_fn, IRQF_ONESHOT, "my-chip", g);
  ret = devm_request_threaded_irq(dev, irq, NULL, irq_thread_fn,
                                  IRQF_ONESHOT, "my-chip", g);
  if (ret < 0)
      return ret;

+0 −16
Original line number Diff line number Diff line
@@ -225,8 +225,6 @@ setup or driver probe/teardown code, so this is an easy constraint.)::
                gpio_request()

        ## 	gpio_request_one()
        ##	gpio_request_array()
        ## 	gpio_free_array()

                gpio_free()

@@ -295,14 +293,6 @@ are claimed, three additional calls are defined::
	 */
	int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);

	/* request multiple GPIOs in a single call
	 */
	int gpio_request_array(struct gpio *array, size_t num);

	/* release multiple GPIOs in a single call
	 */
	void gpio_free_array(struct gpio *array, size_t num);

where 'flags' is currently defined to specify the following properties:

	* GPIOF_DIR_IN		- to configure direction as input
@@ -341,12 +331,6 @@ A typical example of usage::
	if (err)
		...

	err = gpio_request_array(leds_gpios, ARRAY_SIZE(leds_gpios));
	if (err)
		...

	gpio_free_array(leds_gpios, ARRAY_SIZE(leds_gpios));


GPIOs mapped to IRQs
--------------------
+0 −16
Original line number Diff line number Diff line
@@ -208,8 +208,6 @@ GPIO 值的命令需要等待其信息排到队首才发送命令,再获得其
                gpio_request()

        ## 	gpio_request_one()
        ##	gpio_request_array()
        ## 	gpio_free_array()

                gpio_free()

@@ -272,14 +270,6 @@ gpio_request()前将这类细节配置好,例如使用引脚控制子系统的
	 */
	int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);

	/* 在单个函数中申请多个 GPIO
	 */
	int gpio_request_array(struct gpio *array, size_t num);

	/* 在单个函数中释放多个 GPIO
	 */
	void gpio_free_array(struct gpio *array, size_t num);

这里 'flags' 当前定义可指定以下属性:

	* GPIOF_DIR_IN		- 配置方向为输入
@@ -317,12 +307,6 @@ gpio_request()前将这类细节配置好,例如使用引脚控制子系统的
	if (err)
		...

	err = gpio_request_array(leds_gpios, ARRAY_SIZE(leds_gpios));
	if (err)
		...

	gpio_free_array(leds_gpios, ARRAY_SIZE(leds_gpios));


GPIO 映射到 IRQ
----------------
Loading