Commit graph

5302 commits

Author SHA1 Message Date
Svyatoslav Ryhel
7d1aa08aff gpio: tegra: Convert to immutable irq chip
Update the driver to use an immutable IRQ chip to fix this warning:

    "not an immutable chip, please consider fixing it!"

Preserve per-chip labels by adding an ->irq_print_chip() callback.

Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # TF201 T30
Tested-by: Robert Eckelmann <longnoserob@gmail.com> # TF101 T20
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2022-10-20 13:47:54 +02:00
Linus Torvalds
60ac35bf6b Interrupt subsystem updates:
- Core code:
 
     - Provide a generic wrapper which can be utilized in drivers to handle
       the problem of force threaded demultiplex interrupts on RT enabled
       kernels. This avoids conditionals and horrible quirks in drivers all
       over the place.
 
     - Fix up affected pinctrl and GPIO drivers to make them cleanly RT safe.
 
   - Interrupt drivers:
 
     - A new driver for the FSL MU platform specific MSI implementation.
 
     - Make irqchip_init() available for pure ACPI based systems.
 
     - Provide a functional DT binding for the Realtek RTL interrupt chip.
 
     - The usual DT updates and small code improvements all over the place.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCgAxFiEEQp8+kY+LLUocC4bMphj1TA10mKEFAmNGxRYTHHRnbHhAbGlu
 dXRyb25peC5kZQAKCRCmGPVMDXSYoWJyD/0emJAlIuD0DzkEkoAtnHSq7eyGFMpI
 PFMyZ0IYXlVWuxEmQMyd7E9M+fmlRqnnhErg6x7jPW1bKzoyIn1A7eNE/cvhXPru
 BiTy6g2o7pNegUh5bQrE8p0Yyq6/HsVO4YyE3RGxpUQVh/qwB+RKnzUY6RfDj87z
 naQx10+15b+76SXvTQpIrvQTWhfTswk9un2MYDkjHctfVgjcnb/8dTPQuXsZrdTQ
 VBWWwjLpCKcqqQS1e9MQqmQKpVqGs/DGW8XNTPk3jI4QF1fIHjhNdcoI51/lM4Ri
 r912FPE8R48FS9g0dQgpMxGmHjikYpf3rXXosn8uyWkt5zNy6CXOEEg3DRIoAIdg
 czKve+bgZZXUK/QcSSdPuPthBoLKQCG5MZsVFNF8IArmPCHaiYcOQBe7pel3U4cc
 MpQe9yUXJI40XgwTAyAOlidjmD69384nEhzbI5d/AfJI5ssdXcBMrFN/xEeBDWdz
 Dg2+Yle9HNglxBA6E3GX3yiaCQJxHFhKMnqd1zhxWjXFRzkfGF7bBpRj1j+vXnzN
 ap/wMQuMlOWriWsH3UkZtFrC4PvgByGVfzlzYA076CjutyYfQolQ8k0bLHnp2VSu
 VWUn4WATfaxJcqij7vyI9BYtFXdrB/yYhFasDBepQbDgiy8WEAmX+bObvXWs9XYa
 UGVCNGsYx2TKMA==
 =2ok5
 -----END PGP SIGNATURE-----

Merge tag 'irq-core-2022-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull interrupt updates from Thomas Gleixner:
 "Core code:

   - Provide a generic wrapper which can be utilized in drivers to
     handle the problem of force threaded demultiplex interrupts on RT
     enabled kernels. This avoids conditionals and horrible quirks in
     drivers all over the place

   - Fix up affected pinctrl and GPIO drivers to make them cleanly RT
     safe

  Interrupt drivers:

   - A new driver for the FSL MU platform specific MSI implementation

   - Make irqchip_init() available for pure ACPI based systems

   - Provide a functional DT binding for the Realtek RTL interrupt chip

   - The usual DT updates and small code improvements all over the
     place"

* tag 'irq-core-2022-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (21 commits)
  irqchip: IMX_MU_MSI should depend on ARCH_MXC
  irqchip/imx-mu-msi: Fix wrong register offset for 8ulp
  irqchip/ls-extirq: Fix invalid wait context by avoiding to use regmap
  dt-bindings: irqchip: Describe the IMX MU block as a MSI controller
  irqchip: Add IMX MU MSI controller driver
  dt-bindings: irqchip: renesas,irqc: Add r8a779g0 support
  irqchip/gic-v3: Fix typo in comment
  dt-bindings: interrupt-controller: ti,sci-intr: Fix missing reg property in the binding
  dt-bindings: irqchip: ti,sci-inta: Fix warning for missing #interrupt-cells
  irqchip: Allow extra fields to be passed to IRQCHIP_PLATFORM_DRIVER_END
  platform-msi: Export symbol platform_msi_create_irq_domain()
  irqchip/realtek-rtl: use parent interrupts
  dt-bindings: interrupt-controller: realtek,rtl-intc: require parents
  irqchip/realtek-rtl: use irq_domain_add_linear()
  irqchip: Make irqchip_init() usable on pure ACPI systems
  bcma: gpio: Use generic_handle_irq_safe()
  gpio: mlxbf2: Use generic_handle_irq_safe()
  platform/x86: intel_int0002_vgpio: Use generic_handle_irq_safe()
  ssb: gpio: Use generic_handle_irq_safe()
  pinctrl: amd: Use generic_handle_irq_safe()
  ...
2022-10-12 10:23:24 -07:00
Linus Torvalds
979bb59016 These are the pin control changes for the v6.1 kernel cycle:
New drivers:
 
 - Cypress CY8C95x0 chip pin control support, along with an immediate
   cleanup.
 
 - Mediatek MT8188 SoC pin control support.
 
 - Qualcomm SM8450 and SC8280XP LPASS (low power audio subsystem)
   pin control support.
 
 - Qualcomm PM7250, PM8450
 
 - Rockchip RV1126 SoC pin control support.
 
 Improvements:
 
 - Fix some missing pins in the Armada 37xx driver.
 
 - Convert Broadcom and Nomadik drivers to use PINCTRL_PINGROUP() macro.
 
 - Fix some GPIO irq_chips to be immutable.
 
 - Massive Qualcomm device tree binding cleanup, with more to come.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmNEhjMACgkQQRCzN7AZ
 XXMNXRAAuqKM8b/Kw7H9S2sBgMuESk2WKe/lmJ6mQCWK1iyo0xecEQi1wN3WGZt1
 DfoYHdsB45GWnRcwIVIl2wAjce72EFepCa/sut55TR/bLDxRfSiHGBKatSk5VkQp
 IGx75EtsRPgnZCUU3jQgrQEiI8eqj90nr8CugZwD7gocjAtaRJXb0cc3NPyk/TDh
 Wyku3rYuzztLCJHwsZ7Q9zh3s9b8Vb43pK9BW8HHeuODqMECaDWTEQUDetKz/Z8X
 v7v01PSOafBQUCoFPezz/20kOV9llxFSCeCqbwG3zvjPSjofVwSFoSH1Op4Ybr/t
 JWM8Py1+/G/rbsRhZuEahLJ+/eLy7SWABSUq2sxwCEr/VkzNCZ1jKH/qB1S7ZkI6
 GcHPbEeCDzcN+yfKIo8p6WHUYivpj2XKXqh/BWIY63rJ3ukrq3WHuJNvCO15F/TJ
 PDuLIL0RdNxSanoamsplNtFWA3ap92P2P933k+v06VEZpZys8j/JHFUaysbiqpL+
 GoHdRjspFC/4Ob3FwbbiYktpoKmRsZl7PCJSYnnz5nrHFUbQ4LtrgppqMgGXny16
 P0pW8IBmIF4yVteodQFsyYZq2yH91TengHleqoFsK0OjYXG0BmRm3lYWLjWbojxe
 U7E5T5qQo2rtdVct9d47UznK3IRThDDJx9DtG+Y19VpkKiOy6j8=
 =PvLX
 -----END PGP SIGNATURE-----

Merge tag 'pinctrl-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control updates from Linus Walleij:
 "There is nothing exciting going on, no core changes, just a few
  drivers and cleanups.

  New drivers:

   - Cypress CY8C95x0 chip pin control support, along with an immediate
     cleanup

   - Mediatek MT8188 SoC pin control support

   - Qualcomm SM8450 and SC8280XP LPASS (low power audio subsystem) pin
     control support

   - Qualcomm PM7250, PM8450

   - Rockchip RV1126 SoC pin control support

  Improvements:

   - Fix some missing pins in the Armada 37xx driver

   - Convert Broadcom and Nomadik drivers to use PINCTRL_PINGROUP()
     macro

   - Fix some GPIO irq_chips to be immutable

   - Massive Qualcomm device tree binding cleanup, with more to come"

* tag 'pinctrl-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (119 commits)
  MAINTAINERS: adjust STARFIVE JH7100 PINCTRL DRIVER after file movement
  pinctrl: starfive: Rename "pinctrl-starfive" to "pinctrl-starfive-jh7100"
  pinctrl: Create subdirectory for StarFive drivers
  dt-bindings: pinctrl: st,stm32: Document interrupt-controller property
  dt-bindings: pinctrl: st,stm32: Document gpio-hog pattern property
  dt-bindings: pinctrl: st,stm32: Document gpio-line-names
  pinctrl: st: stop abusing of_get_named_gpio()
  pinctrl: wpcm450: Correct the fwnode_irq_get() return value check
  pinctrl: bcm: Remove unused struct bcm6328_pingroup
  pinctrl: qcom: restrict drivers per ARM/ARM64
  pinctrl: bcm: ns: Remove redundant dev_err call
  gpio: rockchip: request GPIO mux to pinctrl when setting direction
  pinctrl: rockchip: add pinmux_ops.gpio_set_direction callback
  pinctrl: cy8c95x0: Align function names in cy8c95x0_pmxops
  pinctrl: cy8c95x0: Drop atomicity on operations on push_pull
  pinctrl: cy8c95x0: Lock register accesses in cy8c95x0_set_mux()
  pinctrl: sunxi: sun50i-h5: Switch to use dev_err_probe() helper
  pinctrl: stm32: Switch to use dev_err_probe() helper
  dt-bindings: qcom-pmic-gpio: Add PM7250B and PM8450 bindings
  pinctrl: qcom: spmi-gpio: Add compatible for PM7250B
  ...
2022-10-11 10:59:59 -07:00
Linus Torvalds
694b37a5dd Input updates for 6.1 merge window:
- a new driver for IBM Operational Panel
 
 - a new driver for PinePhone keyboards
 
 - RT5120 PMIC power key support
 
 - various enhancements and support for new models in xpad (Xbox) driver
 
 - a new compatible ID for Elan touchscreen driver
 
 - rework of adp5588-keys driver to support configuring via device
   properties (OF, ACPI, etc) instead of platform data, and proper support
   of optional gpiochip functionality (and removal of gpio-adp5588 driver)
 
 - improvements to firmware update handling in Synaptics RMI4 driver
 
 - support for double key matrix in mt6779-keypad
 
 - support for polled mode in adc-joystick driver
 
 - other assorted driver fixes, cleanups and improvements.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQST2eWILY88ieB2DOtAj56VGEWXnAUCY0O9YwAKCRBAj56VGEWX
 nICKAQD6/pS5tIWFCyYrM/A0xbkYuPWtmXqJTSGANlevU7nypwEAqaH2tYSDAdxM
 NylDCPvvduHVmA2ewXgvIlUzjCLr6As=
 =cUmW
 -----END PGP SIGNATURE-----

Merge tag 'input-for-v6.1-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull input updates from Dmitry Torokhov:

 - a new driver for IBM Operational Panel

 - a new driver for PinePhone keyboards

 - RT5120 PMIC power key support

 - various enhancements and support for new models in xpad (Xbox) driver

 - a new compatible ID for Elan touchscreen driver

 - rework of adp5588-keys driver to support configuring via device
   properties (OF, ACPI, etc) instead of platform data, and proper
   support of optional gpiochip functionality (and removal of
   gpio-adp5588 driver)

 - improvements to firmware update handling in Synaptics RMI4 driver

 - support for double key matrix in mt6779-keypad

 - support for polled mode in adc-joystick driver

 - other assorted driver fixes, cleanups and improvements

* tag 'input-for-v6.1-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (90 commits)
  Input: i8042 - fix refount leak on sparc
  Input: i8042 - add LoongArch support in i8042-acpipnpio.h
  Input: i8042 - rename i8042-x86ia64io.h to i8042-acpipnpio.h
  Input: pinephone-keyboard - support the proxied I2C bus
  Input: pinephone-keyboard - add PinePhone keyboard driver
  dt-bindings: input: Add the PinePhone keyboard binding
  dt-bindings: input: Convert hid-over-i2c to DT schema
  input: drop empty comment blocks
  Input: xpad - add X-Box Adaptive Profile button
  Input: add ABS_PROFILE to uapi and documentation
  Input: xpad - add X-Box Adaptive XBox button
  Input: xpad - add X-Box Adaptive support
  Input: ims-pcu - fix spelling mistake "BOOLTLOADER" -> "BOOTLOADER"
  Input: ibm-panel - add missing MODULE_DEVICE_TABLE
  Input: icn8505 - utilize acpi_get_subsystem_id()
  Input: xpad - decipher xpadone packages with GIP defines
  Input: xpad - refactor using BIT() macro
  Input: synaptics-rmi4 - convert to use sysfs_emit() APIs
  Input: twl4030-pwrbutton - add missing of.h include
  Input: applespi - replace zero-length array with DECLARE_FLEX_ARRAY() helper
  ...
2022-10-11 10:53:25 -07:00
Linus Torvalds
3a1e24fa70 More ACPI updates for 6.1-rc1
- Fix ACPI device object reference counting in (recently updated)
    skl_int3472_fill_clk_pdata() (Andy Shevchenko).
 
  - Fix a memory leak in APEI by avoiding to add a task_work to kernel
    threads running when an asynchronous error is detected (Shuai Xue).
 
  - Add ACPI support for handling system wakeups via GPIO wake capable
    IRQs in addition to GPEs (Raul E Rangel).
 
  - Make the system reboot code put ACPI-enabled systems into the S5
    (system off) state which is necessary for some platforms to work as
    expected (Kai-Heng Feng).
 
  - Make the white space usage in the ACPI thermal driver more consistent
    and drop redundant code from it (Rafael Wysocki).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmNEVJMSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxQ1YP/0abCMN+M3TVoLC2CKr4ejVUbDlzpFpx
 NN7CQVl6rCO68XN3JiYjlxasEl3gWI2SKNsjbN8flIXsIYh1WYgDaEHlN1urIzXW
 0dpMa8lryMashWYYt5FNv05vRW33xta4HwmnHwqr8ASp7MClvB9I+s94CMZryeEh
 UTqIu9HPJ/I8VZlNgZHHisQkL1IOT+3QRbVMJr7QMkAKy01UiJco0e962T+h3nBU
 RPSg0FctjorfCnPO5hmjVA99AAOskfB1HSh3CRYy9TSrx4MFEAsttxNeEofNHGTn
 Gyjgugy5DJYvvfe0A/BgWWqwiUXoLmfRIjeARuv+JL1vPQfSJaF7PqnNPPAhexLG
 62wF1CE38zKSbbKAg3fNywXQnXnuBLPlNTUxt3tH3PBdI+un1zuH5/9C0YgkRlRO
 Pwv3tAs52HKFIqenHz2axxZQrQObrHvSiJJN+q1TlURt5QHyb1n6FJYg/1MCQ6fz
 5etirjbptTD+q2YAqDodGge9HaHvKndrUi3oAs0wsKWFKVlawtqzGPeqNkRNTIYt
 RU4kEtCcOkUgwNmKRRly4nWf2UgF/YxGugX1FW3Y7p6nHj7VY7BnaQaTXbtLaTXU
 PTbT7GZKSIcGQO1xtxDSL3uXYVurqyr4LtM8JBbJSjbwNKAJuVpzgx6iDdg08vVc
 mg/pOlmgMpoO
 =pwnm
 -----END PGP SIGNATURE-----

Merge tag 'acpi-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull more ACPI updates from Rafael Wysocki:
 "These fix two issues, in APEI and in the int3472 driver, clean up the
  ACPI thermal driver, add ACPI support for non-GPE system wakeup events
  and make the system reboot code use the S5 (system off) state by
  default.

  Specifics:

   - Fix ACPI device object reference counting in (recently updated)
     skl_int3472_fill_clk_pdata() (Andy Shevchenko).

   - Fix a memory leak in APEI by avoiding to add a task_work to kernel
     threads running when an asynchronous error is detected (Shuai Xue).

   - Add ACPI support for handling system wakeups via GPIO wake capable
     IRQs in addition to GPEs (Raul E Rangel).

   - Make the system reboot code put ACPI-enabled systems into the S5
     (system off) state which is necessary for some platforms to work as
     expected (Kai-Heng Feng).

   - Make the white space usage in the ACPI thermal driver more
     consistent and drop redundant code from it (Rafael Wysocki)"

* tag 'acpi-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: thermal: Drop some redundant code
  ACPI: thermal: Drop redundant parens from expressions
  ACPI: thermal: Use white space more consistently
  platform/x86: int3472: Don't leak reference on error
  ACPI: APEI: do not add task_work to kernel thread to avoid memory leak
  PM: ACPI: reboot: Reinstate S5 for reboot
  kernel/reboot: Add SYS_OFF_MODE_RESTART_PREPARE mode
  ACPI: PM: Take wake IRQ into consideration when entering suspend-to-idle
  i2c: acpi: Use ACPI wake capability bit to set wake_irq
  ACPI: resources: Add wake_capable parameter to acpi_dev_irq_flags
  gpiolib: acpi: Add wake_capable variants of acpi_dev_gpio_irq_get
2022-10-10 13:28:06 -07:00
Rafael J. Wysocki
056a81549c Merge branches 'acpi-apei', 'acpi-wakeup', 'acpi-reboot' and 'acpi-thermal'
Merge additional APEI changes, ACPI updates related to device wakeup and
system restart and ACPI thermal driver cleanups for 6.1-rc1:

 - Fix a memory leak in APEI by avoiding to add do not add task_work to
   kernel threads running when an asynchronous error is detected (Shuai
   Xue).

 - Add ACPI support for handling system wakeups via GPIO wake capable
   IRQs in addition to GPEs (Raul E Rangel).

 - Make the system reboot code put ACPI-enabled systems into the S5
   (system off) state which is necessary for some platforms to work as
   expected (Kai-Heng Feng).

 - Make the white space usage in the ACPI thermal driver more consistent
   and drop redundant code from it (Rafael Wysocki).

* acpi-apei:
  ACPI: APEI: do not add task_work to kernel thread to avoid memory leak

* acpi-wakeup:
  ACPI: PM: Take wake IRQ into consideration when entering suspend-to-idle
  i2c: acpi: Use ACPI wake capability bit to set wake_irq
  ACPI: resources: Add wake_capable parameter to acpi_dev_irq_flags
  gpiolib: acpi: Add wake_capable variants of acpi_dev_gpio_irq_get

* acpi-reboot:
  PM: ACPI: reboot: Reinstate S5 for reboot
  kernel/reboot: Add SYS_OFF_MODE_RESTART_PREPARE mode

* acpi-thermal:
  ACPI: thermal: Drop some redundant code
  ACPI: thermal: Drop redundant parens from expressions
  ACPI: thermal: Use white space more consistently
2022-10-10 18:11:11 +02:00
Linus Torvalds
f01603979a gpio updates for v6.1-rc1
New drivers:
 - add a new driver for the IMX System Controller Unit GPIOs
 
 GPIO core:
 - add fdinfo output for the GPIO character device file descriptors (allows
   user-space to determine which processes own which GPIO lines)
 - improvements to OF GPIO code
 - new quirk for Asus UM325UAZ in gpiolib-acpi
 - new quirk for Freescale SPI in gpiolib-of
 
 Driver improvements:
 - add a new macro that reduces the amount of boilerplate code in ISA drivers
   and use it in relevant drivers
 - support two new models in gpio-pca953x
 - support new model in gpio-f7188x
 - convert more drivers to use immutable irq chips
 - other minor tweaks
 
 Device-tree bindings:
 - add DT bindings for gpio-imx-scu
 - convert Xilinx GPIO bindings to YAML
 - reference the properties from the SPI peripheral device-tree bindings
   instead of providing custom ones in the GPIO controller document
 - add parsing of GPIO hog nodes to the DT bindings for gpio-mpfs-gpio
 - relax the node name requirements in gpio-stmpe
 - add new models for gpio-rcar and gpio-pxa95xx
 - add a new vendor prefix: Diodes (for Diodes, Inc.)
 
 Misc:
 - pulled in the immutable branch from the x86 platform drivers tree including
   support for a new simatic board that depends on GPIO changes
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmNAhB8ACgkQEacuoBRx
 13KY5xAAjBvBPNxtKqwqs82M6A3rmIPGsfuBBsuWGwQw9MFrVeHx1c58uCistq1s
 ECnvNuPkpXB/9npXWvWipr9kV5UA5hneDzT9ploUzCsSi+Bvb8W2ZUmW1tsELo04
 deJmQ5VAImcUVnDIuIwWXt+sx0Clc8fMVNGy9yiSs1JOAT1WO7N9VNy/is3cRIk2
 VsVH7iN/G7MJPWx+CoBj7eVkdXs7W93yUSW6QLzVCvoYFWcf8A4xQe2SDFnaRXvH
 5BERflEjbl+0iSHG14jvd7YMmMdnxCZdCkFpjVIEUpKvVT/X6+wbO7q1aCz0/Vig
 LgbElUT8fRCq7RxrZjrZA7mXI8rpSkTugDqweIbqlw8larA5zjSj+S+0mpEQPwZT
 tA+mEjHRBWiDBr//tHgnF9TU4HezVwqFaZ72bhctuIgZ5ivbF8PA+Cd7HAkUKnn8
 K8dZdOde4d9WmWj7w3olIgFOwJwvPCztKr5uYgxJOG8ECr7MM5pepaMXK6stSC19
 21Iwwb9dOUi3LwIWAQW2upG0S9BNHGy/hqNd5YN+lF2S9neQ3n4vrWQj7AJivtXi
 vldCqXdbukyrKiUlf9svXdmudYFPgf6zwPlXNWk1CtZ1uB8OR8rbDn9bEeQSwzGf
 op6ADdPTuoD49NO0r49cb8dmr1tFwGbGIX54JJB3FTKuGo7SxcY=
 =Ax6X
 -----END PGP SIGNATURE-----

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

Pull gpio updates from Bartosz Golaszewski:
 "We have a single new driver, support for a bunch of new models,
  improvements in drivers and core gpiolib code as well device-tree
  bindings changes.

  Summary:

  New driver:
   - IMX System Controller Unit GPIOs

  GPIO core:
   - add fdinfo output for the GPIO character device file descriptors
     (allows user-space to determine which processes own which GPIO
     lines)
   - improvements to OF GPIO code
   - new quirk for Asus UM325UAZ in gpiolib-acpi
   - new quirk for Freescale SPI in gpiolib-of

  Driver improvements:
   - add a new macro that reduces the amount of boilerplate code in ISA
     drivers and use it in relevant drivers
   - support two new models in gpio-pca953x
   - support new model in gpio-f7188x
   - convert more drivers to use immutable irq chips
   - other minor tweaks

  Device-tree bindings:
   - add DT bindings for gpio-imx-scu
   - convert Xilinx GPIO bindings to YAML
   - reference the properties from the SPI peripheral device-tree
     bindings instead of providing custom ones in the GPIO controller
     document
   - add parsing of GPIO hog nodes to the DT bindings for gpio-mpfs-gpio
   - relax the node name requirements in gpio-stmpe
   - add new models for gpio-rcar and gpio-pxa95xx
   - add a new vendor prefix: Diodes (for Diodes, Inc.)

  Misc:
   - pulled in the immutable branch from the x86 platform drivers tree
     including support for a new simatic board that depends on GPIO
     changes"

* tag 'gpio-updates-for-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (36 commits)
  gpio: tc3589x: Make irqchip immutable
  gpiolib: cdev: add fdinfo output for line request file descriptors
  gpio: twl4030: Reorder functions which allows to drop a forward declaraion
  gpiolib: fix OOB access in quirk callbacks
  gpiolib: of: factor out conversion from OF flags
  gpiolib: rework quirk handling in of_find_gpio()
  gpiolib: of: make Freescale SPI quirk similar to all others
  gpiolib: of: do not ignore requested index when applying quirks
  gpio: ws16c48: Ensure number of irq matches number of base
  gpio: 104-idio-16: Ensure number of irq matches number of base
  gpio: 104-idi-48: Ensure number of irq matches number of base
  gpio: 104-dio-48e: Ensure number of irq matches number of base
  counter: 104-quad-8: Ensure number of irq matches number of base
  isa: Introduce the module_isa_driver_with_irq helper macro
  gpio: pca953x: Add support for PCAL6534
  gpio: pca953x: Swap if statements to save later complexity
  gpio: pca953x: Fix pca953x_gpio_set_pull_up_down()
  dt-bindings: gpio: pca95xx: add entry for pcal6534 and PI4IOE5V6534Q
  dt-bindings: vendor-prefixes: add Diodes
  gpio: mt7621: Switch to use platform_get_irq() function
  ...
2022-10-08 09:46:29 -07:00
Linus Torvalds
7fb68b6c82 platform-drivers-x86 for v6.1-1
Highlights:
  -  AMD Platform Management Framework (PMF) driver with AMT and QnQF support
  -  AMD PMC: Improved logging for debugging s2idle issues
  -  Big refactor of the ACPI/x86 backlight handling, ensuring that we only
     register 1 /sys/class/backlight device per LCD panel
  -  Microsoft Surface:
     -  Surface Laptop Go 2 support
     -  Surface Pro 8 HID sensor support
  -  Asus WMI:
     -  Lots of cleanups
     -  Support for TUF RGB keyboard backlight control
     -  Add support for ROG X13 tablet mode
  -  Siemens Simatic: IPC227G and IPC427G support
  -  Toshiba ACPI laptop driver: Fan hwmon and battery ECO mode support
  -  tools/power/x86/intel-speed-select: Various improvements
  -  Various cleanups
  -  Various small bugfixes
 
 The following is an automated git shortlog grouped by driver:
 
 ACPI:
  -  video: Change disable_backlight_sysfs_if quirks to acpi_backlight=native
  -  s2idle: Add a new ->check() callback for platform_s2idle_ops
  -  video: Fix indentation of video_detect_dmi_table[] entries
  -  video: Drop NL5x?U, PF4NU1F and PF5?U?? acpi_backlight=native quirks
  -  video: Drop "Samsung X360" acpi_backlight=native quirk
  -  video: Remove acpi_video_set_dmi_backlight_type()
  -  video: Add Apple GMUX brightness control detection
  -  video: Add Nvidia WMI EC brightness control detection (v3)
  -  video: Refactor acpi_video_get_backlight_type() a bit
  -  video: Remove code to unregister acpi_video backlight when a native backlight registers
  -  video: Make backlight class device registration a separate step (v2)
  -  video: Simplify acpi_video_unregister_backlight()
  -  video: Remove acpi_video_bus from list before tearing it down
  -  video: Drop backlight_device_get_by_type() call from acpi_video_get_backlight_type()
  -  video: Add acpi_video_backlight_use_native() helper
 
 acer-wmi:
  -  Move backlight DMI quirks to acpi/video_detect.c
  -  Acer Aspire One AOD270/Packard Bell Dot keymap fixes
 
 apple-gmux:
  -  Stop calling acpi/video.h functions
 
 asus-wmi:
  -  Expand support of GPU fan to read RPM and label
  -  Make kbd_rgb_mode_groups static
  -  Move acpi_backlight=native quirks to ACPI video_detect.c
  -  Move acpi_backlight=vendor quirks to ACPI video_detect.c
  -  Drop DMI chassis-type check from backlight handling
  -  Increase FAN_CURVE_BUF_LEN to 32
  -  Fix the name of the mic-mute LED classdev
  -  Implement TUF laptop keyboard power states
  -  Implement TUF laptop keyboard LED modes
  -  Support the GPU fan on TUF laptops
  -  Modify behaviour of Fn+F5 fan key
  -  Update tablet_mode_sw module-param help text
  -  Simplify tablet-mode-switch handling
  -  Simplify tablet-mode-switch probing
  -  Add support for ROG X13 tablet mode
  -  Adjust tablet/lidflip handling to use enum
  -  Support the hardware GPU MUX on some laptops
  -  Simplify some of the *_check_present() helpers
  -  Refactor panel_od attribute
  -  Refactor egpu_enable attribute
  -  Refactor disable_gpu attribute
  -  Document the panel_od sysfs attribute
  -  Document the egpu_enable sysfs attribute
  -  Document the dgpu_disable sysfs attribute
  -  Use kobj_to_dev()
  -  Convert all attr-show to use sysfs_emit
 
 compal-laptop:
  -  Get rid of a few forward declarations
 
 dell-privacy:
  -  convert to use dev_groups
 
 dell-smbios-base:
  -  Use sysfs_emit()
 
 dell-wmi:
  -  Add WMI event 0x0012 0x0003 to the list
 
 docs:
  -  ABI: charge_control_end_threshold may not support all values
 
 drivers/platform:
  -  toshiba_acpi: Call HCI_PANEL_POWER_ON on resume on some models
 
 drm/amdgpu:
  -  Register ACPI video backlight when skipping amdgpu backlight registration
  -  Don't register backlight when another backlight should be used (v3)
 
 drm/i915:
  -  Call acpi_video_register_backlight() (v3)
  -  Don't register backlight when another backlight should be used (v2)
 
 drm/nouveau:
  -  Register ACPI video backlight when nv_backlight registration fails (v2)
  -  Don't register backlight when another backlight should be used (v2)
 
 drm/radeon:
  -  Register ACPI video backlight when skipping radeon backlight registration
  -  Don't register backlight when another backlight should be used (v3)
 
 drm/todo:
  -  Add entry about dealing with brightness control on devices with > 1 panel
 
 gpio-f7188x:
  -  use unique labels for banks/chips
  -  Add GPIO support for Nuvoton NCT6116
  -  add a prefix to macros to keep gpio namespace clean
  -  switch over to using pr_fmt
 
 hp-wmi:
  -  Support touchpad on/off
  -  Setting thermal profile fails with 0x06
 
 int3472/discrete:
  -  Drop a forward declaration
 
 intel-uncore-freq:
  -  Use sysfs_emit() to instead of scnprintf()
 
 intel_cht_int33fe:
  -  Fix comment according to the code flow
 
 leds:
  -  simatic-ipc-leds-gpio: Make simatic_ipc_led_gpio_table static
  -  simatic-ipc-leds-gpio: add new model 227G
 
 move from strlcpy with unused retval to strscpy:
  - move from strlcpy with unused retval to strscpy
 
 msi-laptop:
  -  Change DMI match / alias strings to fix module autoloading
  -  Add msi_scm_disable_hw_fn_handling() helper
  -  Add msi_scm_model_exit() helper
  -  Fix resource cleanup
  -  Simplify ec_delay handling
  -  Fix old-ec check for backlight registering
  -  Drop MSI_DRIVER_VERSION
  -  Use MODULE_DEVICE_TABLE()
 
 nvidia-wmi-ec-backlight:
  -  Use acpi_video_get_backlight_type()
  -  Move fw interface definitions to a header (v2)
 
 p2sb:
  -  Fix UAF when caller uses resource name
 
 platform/mellanox:
  -  mlxreg-lc: Make error handling flow consistent
  -  Remove redundant 'NULL' check
  -  Remove unnecessary code
  -  mlxreg-lc: Fix locking issue
  -  mlxreg-lc: Fix coverity warning
 
 platform/surface:
  -  Split memcpy() of struct ssam_event flexible array
  -  aggregator_registry: Add HID devices for sensors and UCSI client to SP8
  -  aggregator_registry: Rename HID device nodes based on new findings
  -  aggregator_registry: Rename HID device nodes based on their function
  -  aggregator_registry: Add support for Surface Laptop Go 2
 
 platform/x86:
  - use PLATFORM_DEVID_NONE instead of -1
 
 platform/x86/amd:
  -  pmc: Dump idle mask during "check" stage instead
  -  pmc: remove CONFIG_DEBUG_FS checks
  -  pmc: Fix build without debugfs
  -  pmc: Add sysfs files for SMU
  -  pmc: Add an extra STB message for checking s2idle entry
  -  pmc: Always write to the STB
  -  pmc: Add defines for STB events
 
 platform/x86/amd/pmf:
  -  Remove unused power_delta instances
  -  install notify handler after acpi init
  -  Add sysfs to toggle CnQF
  -  Add support for CnQF
  -  Fix clang unused variable warning
  -  Fix undefined reference to platform_profile
  -  Force load driver on older supported platforms
  -  Handle AMT and CQL events for Auto mode
  -  Add support for Auto mode feature
  -  Get performance metrics from PMFW
  -  Add fan control support
  -  Add heartbeat signal support
  -  Add debugfs information
  -  Add support SPS PMF feature
  -  Add support for PMF APCI layer
  -  Add support for PMF core layer
  -  Add ABI doc for AMD PMF
  -  Add AMD PMF driver entry
 
 platform/x86/intel/wmi:
  -  thunderbolt: Use dev_groups callback
 
 pmc_atom:
  -  Amend comment style and grammar
  -  Make terminator entry uniform
  -  Improve quirk message to be less cryptic
  -  Fix SLP_TYPx bitfield mask
 
 samsung-laptop:
  -  Move acpi_backlight=[vendor|native] quirks to ACPI video_detect.c
 
 simatic-ipc:
  -  add new model 427G
  -  enable watchdog for 227G
 
 thinkpad_acpi:
  -  Explicitly set to balanced mode on startup
 
 tools/power/x86/intel-speed-select:
  -  Release v1.13
  -  Optimize CPU initialization
  -  Utilize cpu_map to get physical id
  -  Remove unused struct clos_config fields
  -  Enforce isst_id value
  -  Do not export get_physical_id
  -  Introduce is_cpu_in_power_domain helper
  -  Cleanup get_physical_id usage
  -  Convert more function to use isst_id
  -  Add pkg and die in isst_id
  -  Introduce struct isst_id
  -  Remove unused core_mask array
  -  Remove dead code
  -  Fix cpu count for TDP level display
 
 toshiba_acpi:
  -  change turn_on_panel_on_resume to static
  -  Remove duplicate include
  -  Set correct parent for input device.
  -  Add fan RPM reading (hwmon interface)
  -  Add fan RPM reading (internals)
  -  Stop using acpi_video_set_dmi_backlight_type()
  -  Fix ECO LED control on Toshiba Z830
  - Battery charge mode in toshiba_acpi (internals)
  - Battery charge mode in toshiba_acpi (sysfs)
 
 wmi:
  -  Drop forward declaration of static functions
  -  Allow duplicate GUIDs for drivers that use struct wmi_driver
 
 x86-android-tablets:
  -  Fix broken touchscreen on Chuwi Hi8 with Windows BIOS
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEEuvA7XScYQRpenhd+kuxHeUQDJ9wFAmM9eLgUHGhkZWdvZWRl
 QHJlZGhhdC5jb20ACgkQkuxHeUQDJ9zIzAf+JG058wucK0Zsnu4POzGp+uHjnWuu
 AJUmTeRvCD7MidwIv5PiwEtTucQ8OuXYR+tPc8LIwCVZtc05FBmh7Y8le/CX0SS6
 n9EZIvCk3Owosti5w2TPnCK920kh+Wfxl/fmfDbpi6+lpAL8r+F/mZEGKGFdZpWu
 Q+yM/eyxwPH8q8gjrXOUC7rN43aYeO3OCpNG3GYkQ/2S5qrjuz39dXhNVzdSsxm7
 aYOqJRNjZQEjQ3kJcp65kC6oWp3UaI1zdpGwhBG/SY8BCtCYZzlRy7gN2FCJfAa/
 EyYayOvdy0zNwewbIYzck4W80hUDtfidgZgZ9crQscO/JjbGi6LhveD4YA==
 =afGw
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver updates from Hans de Goede:

 - AMD Platform Management Framework (PMF) driver with AMT and QnQF
   support

 - AMD PMC: Improved logging for debugging s2idle issues

 - Big refactor of the ACPI/x86 backlight handling, ensuring that we
   only register 1 /sys/class/backlight device per LCD panel

 - Microsoft Surface:
    - Surface Laptop Go 2 support
    - Surface Pro 8 HID sensor support

 - Asus WMI:
    - Lots of cleanups
    - Support for TUF RGB keyboard backlight control
    - Add support for ROG X13 tablet mode

 - Siemens Simatic: IPC227G and IPC427G support

 - Toshiba ACPI laptop driver: Fan hwmon and battery ECO mode support

 - tools/power/x86/intel-speed-select: Various improvements

 - Various cleanups

 - Various small bugfixes

* tag 'platform-drivers-x86-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (153 commits)
  platform/x86: use PLATFORM_DEVID_NONE instead of -1
  platform/x86/amd: pmc: Dump idle mask during "check" stage instead
  platform/x86/intel/wmi: thunderbolt: Use dev_groups callback
  platform/x86/amd: pmc: remove CONFIG_DEBUG_FS checks
  platform/surface: Split memcpy() of struct ssam_event flexible array
  platform/x86: compal-laptop: Get rid of a few forward declarations
  platform/x86: intel-uncore-freq: Use sysfs_emit() to instead of scnprintf()
  platform/x86: dell-smbios-base: Use sysfs_emit()
  platform/x86/amd/pmf: Remove unused power_delta instances
  platform/x86/amd/pmf: install notify handler after acpi init
  Documentation/ABI/testing/sysfs-amd-pmf: Add ABI doc for AMD PMF
  platform/x86/amd/pmf: Add sysfs to toggle CnQF
  platform/x86/amd/pmf: Add support for CnQF
  platform/x86/amd: pmc: Fix build without debugfs
  platform/x86: hp-wmi: Support touchpad on/off
  platform/x86: int3472/discrete: Drop a forward declaration
  platform/x86: toshiba_acpi: change turn_on_panel_on_resume to static
  platform/x86: wmi: Drop forward declaration of static functions
  platform/x86: toshiba_acpi: Remove duplicate include
  platform/x86: msi-laptop: Change DMI match / alias strings to fix module autoloading
  ...
2022-10-05 10:38:24 -07:00
Linus Torvalds
b86406d42a * 'remove' callback converted to return void. Big change with trivial
fixes all over the tree. Other subsystems depending on this change
   have been asked to pull an immutable topic branch for this.
 * new driver for Microchip PCI1xxxx switch
 * heavy refactoring of the Mellanox BlueField driver
 * we prefer async probe in the i801 driver now
 * the rest is usual driver updates (support for more SoCs, some
   refactoring, some feature additions)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmM7T3IACgkQFA3kzBSg
 KbYnAxAAn2SXzpUuuJ05hhk/y89RWHhzSilU+7d+egYfQJlbXUl2WzYx/Wu1BSZM
 ciyXuJFIiTywdUiX1r1VeMO80zmQQZXAUG7VygAtOSk7iPSd/qTyL+7J+k1DXADI
 hGR+pZLBVfTFyY3d1qHnwKFkzByvQjc2raARv9g7kDxkSQa8xI/sXScmhGYtrLch
 DUYUK1F3Sdqbk0FsudJ5Jvd7bZCSS+n+jSR+mrZaOXbkUD4JmDUauW8pAS6UI9in
 CxnjZoOLMHdAmC9ADanLeDRXxKz23uNU/9vdZ1/DMYnNsF/TnyWl6Rz/3BFE3YFk
 Vq7A1XAK4b3oJAgM92mdvKSkmzBIzkmj02vaVyuNPtRgHZo5MsIcEnWiBhymZY5g
 W6BPrjt/8YKRKeNlP/nrZmageklepsXZbUrNQt1ws8i4bbT+CKInKbjKLnBfDgVz
 5VSd8M9+y2Jd/JaJhMt9TBNmP0W2RrThxLF06Hux1ue7k4maE7Eljvkzcd4GJ6Un
 HYePZMhwCx3aeYsFmFT/V3kHFsfyHUlIFy/vgXTEICsKUpyj/dX96ANWhe+tJdcX
 Cknmc+XOVGPm0LPPju4M8WScMjSqNODm1yfDWUe2cRKlxzI45v6x4Oxl8rWD9hb4
 KKMGXit0LOtWETlHALffwFCifs6DdaaA0IMUtMQUj8egvys0enE=
 =arni
 -----END PGP SIGNATURE-----

Merge tag 'i2c-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c updates from Wolfram Sang:

 - 'remove' callback converted to return void. Big change with trivial
   fixes all over the tree. Other subsystems depending on this change
   have been asked to pull an immutable topic branch for this.

 - new driver for Microchip PCI1xxxx switch

 - heavy refactoring of the Mellanox BlueField driver

 - we prefer async probe in the i801 driver now

 - the rest is usual driver updates (support for more SoCs, some
   refactoring, some feature additions)

* tag 'i2c-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (37 commits)
  i2c: pci1xxxx: prevent signed integer overflow
  i2c: acpi: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
  i2c: i801: Prefer async probe
  i2c: designware-pci: Use standard pattern for memory allocation
  i2c: designware-pci: Group AMD NAVI quirk parts together
  i2c: microchip: pci1xxxx: Add driver for I2C host controller in multifunction endpoint of pci1xxxx switch
  docs: i2c: slave-interface: return errno when handle I2C_SLAVE_WRITE_REQUESTED
  i2c: mlxbf: remove device tree support
  i2c: mlxbf: support BlueField-3 SoC
  i2c: cadence: Add standard bus recovery support
  i2c: mlxbf: add multi slave functionality
  i2c: mlxbf: support lock mechanism
  macintosh/ams: Adapt declaration of ams_i2c_remove() to earlier change
  i2c: riic: Use devm_platform_ioremap_resource()
  i2c: mlxbf: remove IRQF_ONESHOT
  dt-bindings: i2c: rockchip: add rockchip,rk3128-i2c
  dt-bindings: i2c: renesas,rcar-i2c: Add r8a779g0 support
  i2c: tegra: Add GPCDMA support
  i2c: scmi: Convert to be a platform driver
  i2c: rk3x: Add rv1126 support
  ...
2022-10-04 18:54:33 -07:00
Raul E Rangel
4c99256013 gpiolib: acpi: Add wake_capable variants of acpi_dev_gpio_irq_get
The ACPI spec defines the SharedAndWake and ExclusiveAndWake share type
keywords. This is an indication that the GPIO IRQ can also be used as a
wake source. This change exposes the wake_capable bit so drivers can
correctly enable wake functionality instead of making an assumption.

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2022-10-04 15:41:12 +02:00
Quentin Schulz
8ea8af6c84 gpio: rockchip: request GPIO mux to pinctrl when setting direction
Before the split of gpio and pinctrl sections in their own driver,
rockchip_set_mux was called in pinmux_ops.gpio_set_direction for
configuring a pin in its GPIO function.

This is essential for cases where pinctrl is "bypassed" by gpio
consumers otherwise the GPIO function is not configured for the pin and
it does not work. Such was the case for the sysfs/libgpiod userspace
GPIO handling.

Let's call pinctrl_gpio_direction_input/output when setting the
direction of a GPIO so that the pinctrl core requests from the rockchip
pinctrl driver to put the pin in its GPIO function.

Fixes: 9ce9a02039 ("pinctrl/rockchip: drop the gpio related codes")
Fixes: 936ee2675e ("gpio/rockchip: add driver for rockchip gpio")
Cc: stable@vger.kernel.org
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Link: https://lore.kernel.org/r/20220930132033.4003377-3-foss+kernel@0leil.net
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2022-10-04 09:20:41 +02:00
Linus Walleij
3c92506d86 gpio: tc3589x: Make irqchip immutable
This turns the Toshiba tc3589x gpio irqchip immutable.

Cc: Marc Zyngier <maz@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-10-03 20:56:46 +02:00
Wolfram Sang
85f17d677f Merge branch 'master' into i2c/for-mergewindow 2022-09-27 21:33:37 +02:00
Bartosz Golaszewski
0ae3109a83 gpiolib: cdev: add fdinfo output for line request file descriptors
Add fdinfo output for file descriptors created for user-space line
requests in GPIO uAPI v2. The fdinfo file now contains the name of the
GPIO chip that is the "parent" of the request as well as offsets of
the lines requested. This allows user-space to parse the /proc/$PID/fdinfo
entries and deduce the PID of the process that requested a specific line.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Reviewed-by: Kent Gibson <warthog618@gmail.com>
2022-09-26 14:15:38 +02:00
Pali Rohár
4335417da2 gpio: mvebu: Fix check for pwm support on non-A8K platforms
pwm support incompatible with Armada 80x0/70x0 API is not only in
Armada 370, but also in Armada XP, 38x and 39x. So basically every non-A8K
platform. Fix check for pwm support appropriately.

Fixes: 85b7d8abfe ("gpio: mvebu: add pwm support for Armada 8K/7K")
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-26 09:20:09 +02:00
Meng Li
69bef19d6b gpiolib: cdev: Set lineevent_state::irq after IRQ register successfully
When running gpio test on nxp-ls1028 platform with below command
gpiomon --num-events=3 --rising-edge gpiochip1 25
There will be a warning trace as below:
Call trace:
free_irq+0x204/0x360
lineevent_free+0x64/0x70
gpio_ioctl+0x598/0x6a0
__arm64_sys_ioctl+0xb4/0x100
invoke_syscall+0x5c/0x130
......
el0t_64_sync+0x1a0/0x1a4
The reason of this issue is that calling request_threaded_irq()
function failed, and then lineevent_free() is invoked to release
the resource. Since the lineevent_state::irq was already set, so
the subsequent invocation of free_irq() would trigger the above
warning call trace. To fix this issue, set the lineevent_state::irq
after the IRQ register successfully.

Fixes: 4682427241 ("gpiolib: cdev: refactor lineevent cleanup into lineevent_free")
Cc: stable@vger.kernel.org
Signed-off-by: Meng Li <Meng.Li@windriver.com>
Reviewed-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-21 09:32:11 +02:00
Dongliang Mu
21a9acc162 gpio: tqmx86: fix uninitialized variable girq
The commit 924610607f ("gpio: tpmx86: Move PM device over to
irq domain") adds a dereference of girq that may be uninitialized.

Fix this by moving irq_domain_set_pm_device into if true branch
as suggested by Marc Zyngier.

Fixes: 924610607f ("gpio: tpmx86: Move PM device over to irq domain")
Suggested-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-21 09:31:22 +02:00
Linus Walleij
ab637d4836 gpio: ftgpio010: Make irqchip immutable
This turns the FTGPIO010 irqchip immutable.

Tested on the D-Link DIR-685.

Cc: Marc Zyngier <maz@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-20 16:10:53 +02:00
Andy Shevchenko
02743c4091 gpio: mockup: Fix potential resource leakage when register a chip
If creation of software node fails, the locally allocated string
array is left unfreed. Free it on error path.

Fixes: 6fda593f30 ("gpio: mockup: Convert to use software nodes")
Cc: stable@vger.kernel.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-20 16:07:15 +02:00
Bartosz Golaszewski
b7df41a6f7 gpio: mockup: fix NULL pointer dereference when removing debugfs
We now remove the device's debugfs entries when unbinding the driver.
This now causes a NULL-pointer dereference on module exit because the
platform devices are unregistered *after* the global debugfs directory
has been recursively removed. Fix it by unregistering the devices first.

Fixes: 303e6da994 ("gpio: mockup: remove gpio debugfs when remove device")
Cc: Wei Yongjun <weiyongjun1@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-20 16:06:42 +02:00
Bartosz Golaszewski
361c1ca384 intel-gpio for v6.1-1
* Add a quirk for Asus UM325UAZ to make GPIO interrupts working
 
 The following is an automated git shortlog grouped by driver:
 
 gpiolib:
  -  acpi: Add a quirk for Asus UM325UAZ
  -  acpi: Add support to ignore programming an interrupt
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEqaflIX74DDDzMJJtb7wzTHR8rCgFAmMpvw8ACgkQb7wzTHR8
 rCjgdRAArvfEkU34xwuD+Ost0Jb7qu33LIXk/FHMoTDFviICA3RA9S+WEVIZzbuZ
 zbZyK1JlobgYBMs8R3hfFRu/9ZEvSOe91pvrToMOe+u9FrSFf90+ItYrNQfJs4nU
 sqb/FYqUUKtled4ASqVPNiXPv/qVf3y9zFDFDfjtfZHHkMUycMs8K47/9xt0KJWL
 hb9/clwKxz+OGHW/Zsmhpuu8LKEUXpD0pZk9S9B/AyuTUWT/tzEbBllY2nbtohlK
 eWEno0Ztgw++bMY9R/DmIi7DHpYFHZV1onO8GpEsRaoheUAjG3KVr3gePvnDvqPz
 gIZvSZkzqqXiYZS510/PzcHbEBoO1mQ3BzvrALXGAiH8tBfioaab61C5hpxnmhmM
 zR0QGzcDRgsjxXVtdugEC+MW+oqqKBMkTTFFhkbbDj938j90zLra+648f+eXTbkv
 gfBxjsgF6mjpeAkJo6WumHrXYnEn9riths8S7bGOxs5INTS1j1MMTsH6eDswe2dy
 6mT6/Qd/O7CLFwoWQTlpFVTcHQkcKJ86xqnu3mG4bqpsvClxXO1MSEQ9fg6ESDDl
 qSYHzJYVc7/nBpiNLy+oO3cKFlr7LkXLs5glHeUI/6l2fjwhxMnFQDLp5O7wAG2F
 Cof/uozgFFehqOzzQv3UZzEQ4A9BWI4dVUwXRR4snrpcjSafZiM=
 =4yCI
 -----END PGP SIGNATURE-----

Merge tag 'intel-gpio-v6.1-1' of gitolite.kernel.org:pub/scm/linux/kernel/git/andy/linux-gpio-intel into gpio/for-next

intel-gpio for v6.1-1

* Add a quirk for Asus UM325UAZ to make GPIO interrupts working
2022-09-20 16:00:41 +02:00
Uwe Kleine-König
9714791154 gpio: twl4030: Reorder functions which allows to drop a forward declaraion
There is no cyclic dependency between gpio_twl4030_probe() and
gpio_twl4030_remove(), so by moving the latter before the former the
forward declaration can be dropped.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-20 09:02:08 +02:00
Michael Walle
8b10ca2f75 gpiolib: fix OOB access in quirk callbacks
Commit a2b5e207ca ("gpiolib: rework quirk handling in of_find_gpio()")
introduced an array of quirk functions which get iterated over. But a
sentinal value is missing. Add it.

Fixes: a2b5e207ca ("gpiolib: rework quirk handling in of_find_gpio()")
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-20 08:30:57 +02:00
Sebastian Andrzej Siewior
118c3ba24d gpio: mlxbf2: Use generic_handle_irq_safe()
On PREEMPT_RT enabled kernels the demultiplex interrupt handler is force
threaded and runs with interrupts enabled. The invocation of
generic_handle_irq() with interrupts enabled triggers a lockdep warning due
to a non-irq safe lock acquisition.

Instead of disabling interrupts on the driver level, use
generic_handle_domain_irq_safe().

[ tglx: Split out from combo patch ]

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/YnkfWFzvusFFktSt@linutronix.de
2022-09-19 15:08:38 +02:00
Linus Torvalds
a335366bad gpio fixes for v6.0-rc6
- fix the level-low interrupt type support in gpio-mpc8xxx
 - convert another two drivers to using immputable irq chips
 - MAINTAINERS update
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmMkJ+EACgkQEacuoBRx
 13JTBhAAgd37u3Q0XiLSGgKOwHlrD08d2n814Rs5TQf3vAlD5aHpz3z1ezqPmOhM
 31fB8ottUHhP91qyTsNxPEY1wy+Pp6GSvUQGApLwqLN5K2EbxolbdXARSt9zLUvs
 L8oOJKt+SUEETNCjcxQW1CMMLZ8lWy0P9I/vv51fdYbVOKJldxHskO8F2OCiaKjI
 Z6ZCFVHSP1zi3RNQYqBH1Rr5Ow34CeAc74u/F5ygD4yluNQKu5BkThiGpBSKwqyh
 IvyYfYoo/RGQOwWxiv72gfRfwAC/ebyILz9MsdyotpUOj3OyzHrKo8KQmh82zcTP
 khQcLdCYlc5FmHgE8wxfK/sqckFqVBdm/iQQTIS2FD2hsH67QgMg/cVk8eZ9xRS7
 wWf1z+jnC5JEJy3fjV6gGXKSfLsi0VxcPapAgmG8X6v9bglocTDSDfSf68ZkwEkE
 CTkjTPls1QwdfBFos0HY5mA07IpnFJWeNcaYdo8VTx5G7wX7m4C5iwvWoF3Zav0M
 RS7OkgihUOGjn3hIvQXu/PvdzpnPI+bQUqmr75aKFkAffxOB/eZc2W9+JogzfLpZ
 JoP6r0juZXy88W5/jpLS47n028hf8M9nw5F6GtI3CHFdbPJ47po9OjIVYY/bpK3p
 OOls6tMCf4NQrslon1kYcjR7lGzSW3oasQvLyhgYW1ICDUu5oMk=
 =/cR5
 -----END PGP SIGNATURE-----

Merge tag 'gpio-fixes-for-v6.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fixes from Bartosz Golaszewski:

 - fix the level-low interrupt type support in gpio-mpc8xxx

 - convert another two drivers to using immutable irq chips

 - MAINTAINERS update

* tag 'gpio-fixes-for-v6.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  gpio: mt7621: Make the irqchip immutable
  gpio: ixp4xx: Make irqchip immutable
  MAINTAINERS: Update HiSilicon GPIO Driver maintainer
  gpio: mpc8xxx: Fix support for IRQ_TYPE_LEVEL_LOW flow_type in mpc85xx
2022-09-16 12:58:17 -07:00
Wolfram Sang
d819524d31 Merge tag 'v6.0-rc5' into i2c/for-mergewindow
Linux 6.0-rc5
2022-09-16 20:42:18 +01:00
Linus Torvalds
6879c2d3b9 Some pin control fixes for v6.0:
- Fix IRQ wakeup and pins for UFS and SDC2 issues on the
   Qualcomm SC8180x
 - Fix the Rockchip driver to support interrupt on both rising
   and falling edges.
 - Name the Allwinner A100 R_PIO properly
 - Fix several issues with the Ocelot interrupts.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmMkaAgACgkQQRCzN7AZ
 XXN5Hg/+Ktv4bK5aN8ldE8csIDHFQ6VCTMk70dqpLVSpbKwuoY5ag1+bmTzcqmUB
 zP+ToL9a2CH1rDuDhM+hPHgzjYs/qD+wdm9q1qPSpbtbNEKCvQpWxEtFsBKvcdRy
 JfEsK0fyld7MCJBZp9Y1qSpmcKMWaaxXaffcaE2k2fG7/BcrXpnyfa2vHdji64YE
 5JXhpA6CtTmEjclVKcRw595Z8o0ml1UBjgRqWX14YQwtL5rj2bf+pWbjkN8w6DRw
 WyuFHxY55ww95dkTPcI5VkF5dVdrIiqilxxpiSyyDJxm2s1HUsWOPuAfo3NKyH7y
 s9qO5LRblvB3kS8Yuh94gzO/sgXC6D3gKDQp5Hkf6zn2X4tO1M5IH+5mZyeTPbDb
 LoGg4AF+E4buK3ztA0oSTe2Ok3aVwtdd4HUaWffHK7dVhET/eVEIup33hq2eY+z+
 jHaC26MvP6qL7EDKNg2OY70ok1qGVupuIHz/Km/asBymzgRzotdWNCr1rxl4E3LF
 VY7eecXYEyCZQ9C3llaDZvbIuIQPuM0yTsI36i2fdv4aqBtgteW+gSOnPpVpoFSg
 j9jo8F57FKcZM28qpXSorPY0TFq2/U/rLwR5Zg8jtguudEtm2izUjiNDY/yiN7Hr
 5hWn2CKVi8du7JZKJImOhQ3v/cYWqke4uv2rnwJ/D3jzPGxpFx8=
 =i8Nw
 -----END PGP SIGNATURE-----

Merge tag 'pinctrl-v6.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control fixes from Linus Walleij:
 "Nothing special, just driver fixes:

   - Fix IRQ wakeup and pins for UFS and SDC2 issues on the Qualcomm
     SC8180x

   - Fix the Rockchip driver to support interrupt on both rising and
     falling edges.

   - Name the Allwinner A100 R_PIO properly

   - Fix several issues with the Ocelot interrupts"

* tag 'pinctrl-v6.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: ocelot: Fix interrupt controller
  pinctrl: sunxi: Fix name for A100 R_PIO
  pinctrl: rockchip: Enhance support for IRQ_TYPE_EDGE_BOTH
  pinctrl: qcom: sc8180x: Fix wrong pin numbers
  pinctrl: qcom: sc8180x: Fix gpio_wakeirq_map
2022-09-16 07:06:05 -07:00
Dmitry Torokhov
d9e7f0e320 gpiolib: of: factor out conversion from OF flags
There are several places where we need to convert from OF flags to
"normal" GPIO_* flags, so let's introduce a helper and use it.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-15 10:36:39 +02:00
Dmitry Torokhov
a2b5e207ca gpiolib: rework quirk handling in of_find_gpio()
Instead of having a string of "if" statements let's put all quirks into
an array and iterate over them.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-15 10:36:33 +02:00
Dmitry Torokhov
984914ec4f gpiolib: of: make Freescale SPI quirk similar to all others
There is no need for of_find_spi_cs_gpio() to be different from other
quirks: the only variant of property actually used in DTS is "gpios"
(plural) so we can use of_get_named_gpiod_flags() instead of recursing
into of_find_gpio() again.

This will allow us consolidate quirk handling down the road.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-15 10:36:08 +02:00
Dmitry Torokhov
98c3c940ea gpiolib: of: do not ignore requested index when applying quirks
We should not ignore index passed into of_find_gpio() when handling
quirks. While in practice this change will not have any effect, it
will allow consolidate quirk handling.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-15 10:36:02 +02:00
William Breathitt Gray
c95671a3e7 gpio: ws16c48: Ensure number of irq matches number of base
The ws16c48 module calls devm_request_irq() for each device. If the
number of irq passed to the module does not match the number of base, a
default value of 0 is passed to devm_request_irq(). IRQ 0 is probably
not what the user wants, so utilize the module_isa_driver_with_irq macro
to ensure the number of irq matches the number of base.

Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-15 10:29:12 +02:00
William Breathitt Gray
c6074f3fcf gpio: 104-idio-16: Ensure number of irq matches number of base
The 104-idio-16 module calls devm_request_irq() for each device. If the
number of irq passed to the module does not match the number of base, a
default value of 0 is passed to devm_request_irq(). IRQ 0 is probably
not what the user wants, so utilize the module_isa_driver_with_irq macro
to ensure the number of irq matches the number of base.

Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-15 10:29:04 +02:00
William Breathitt Gray
99c3ac85cb gpio: 104-idi-48: Ensure number of irq matches number of base
The 104-idi-48 module calls devm_request_irq() for each device. If the
number of irq passed to the module does not match the number of base, a
default value of 0 is passed to devm_request_irq(). IRQ 0 is probably
not what the user wants, so utilize the module_isa_driver_with_irq macro
to ensure the number of irq matches the number of base.

Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-15 10:28:55 +02:00
William Breathitt Gray
443ad0f730 gpio: 104-dio-48e: Ensure number of irq matches number of base
The 104-dio-48e module calls devm_request_irq() for each device. If the
number of irq passed to the module does not match the number of base, a
default value of 0 is passed to devm_request_irq(). IRQ 0 is probably
not what the user wants, so utilize the module_isa_driver_with_irq macro
to ensure the number of irq matches the number of base.

Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-15 10:28:47 +02:00
Martyn Welch
13c5d4ce80 gpio: pca953x: Add support for PCAL6534
Add support for the NXP PCAL6534. This device is broadly a 34-bit version
of the PCAL6524. However, whilst the registers are broadly what you'd
expect for a 34-bit version of the PCAL6524, the spacing of the registers
has been compacted. This has the unfortunate effect of breaking the bit
shift based mechanism that is employed to work out register locations used
by the other chips supported by this driver. To accommodate ths, callback
functions have been added to allow alterate implementations of
pca953x_recalc_addr() and pca953x_check_register() for the PCAL6534.

Datasheet: https://www.nxp.com/docs/en/data-sheet/PCAL6534.pdf
Datasheet: https://www.diodes.com/assets/Datasheets/PI4IOE5V6534Q.pdf
Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-15 10:08:49 +02:00
Martyn Welch
5faf9801d4 gpio: pca953x: Swap if statements to save later complexity
A later patch in the series adds support for a further chip type that
shares some similarity with the PCA953X_TYPE. In order to keep the logic
simple, swap over the if and else portions where checks are made against
PCA953X_TYPE and instead check for PCA957X_TYPE.

Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-15 10:08:44 +02:00
Martyn Welch
b122624ab9 gpio: pca953x: Fix pca953x_gpio_set_pull_up_down()
A previous fix, commit dc87f6dd05 ("gpio: pca953x: Fix
pca953x_gpio_set_config"), identified that pinconf_to_config_param() needed
to be used to isolate the config_param from the pinconf in
pca953x_gpio_set_config(). This fix however did not consider that this
would also be needed in pca953x_gpio_set_pull_up_down() to which it passes
this config.

Perform a similar call in pca953x_gpio_set_pull_up_down() to isolate the
configuration parameter there as well, rather than passing it from
pca953x_gpio_set_config() as the configuration argument may also be needed
in pca953x_gpio_set_pull_up_down() at a later date.

Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-15 10:08:44 +02:00
Sergio Paracuellos
f7d619e9ab gpio: mt7621: Switch to use platform_get_irq() function
Mt7621 SoC GPIO driver is a platform driver so we can directly use
'platform_get_irq' instead of 'irq_of_parse_and_map'.

Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-14 14:23:51 +02:00
Sergio Paracuellos
09eed5a1ed gpio: mt7621: Make the irqchip immutable
Commit 6c846d026d ("gpio: Don't fiddle with irqchips marked as
immutable") added a warning to indicate if the gpiolib is altering the
internals of irqchips.  Following this change the following warnings
are now observed for the mt7621 driver:

gpio gpiochip0: (1e000600.gpio-bank0): not an immutable chip, please consider fixing it!
gpio gpiochip1: (1e000600.gpio-bank1): not an immutable chip, please consider fixing it!
gpio gpiochip2: (1e000600.gpio-bank2): not an immutable chip, please consider fixing it!

Fix this by making the irqchip in the mt7621 driver immutable.

Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-14 14:18:08 +02:00
Nate Drude
6d50b79051 gpio: pca953x: introduce support for nxp,pcal6408
The NXP PCAL6408 is the 8-bit version of PCAL6416.

Signed-off-by: Nate Drude <nate.d@variscite.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-14 14:14:51 +02:00
Linus Walleij
94e9bc73d8 gpio: ixp4xx: Make irqchip immutable
This turns the IXP4xx GPIO irqchip into an immutable
irqchip, a bit different from the standard template due
to being hierarchical.

Tested on the IXP4xx which uses drivers/ata/pata_ixp4xx_cf.c
for a rootfs on compact flash with IRQs from this GPIO
block to the CF ATA controller.

Cc: Marc Zyngier <maz@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-13 16:17:45 +02:00
Pali Rohár
279c12df8d gpio: mpc8xxx: Fix support for IRQ_TYPE_LEVEL_LOW flow_type in mpc85xx
Commit e39d5ef678 ("powerpc/5xxx: extend mpc8xxx_gpio driver to support
mpc512x gpios") implemented support for IRQ_TYPE_LEVEL_LOW flow type in
mpc512x via falling edge type. Do same for mpc85xx which support was added
in commit 345e5c8a1c ("powerpc: Add interrupt support to mpc8xxx_gpio").

Fixes probing of lm90 hwmon driver on mpc85xx based board which use level
interrupt. Without it kernel prints error and refuse lm90 to work:

    [   15.258370] genirq: Setting trigger mode 8 for irq 49 failed (mpc8xxx_irq_set_type+0x0/0xf8)
    [   15.267168] lm90 0-004c: cannot request IRQ 49
    [   15.272708] lm90: probe of 0-004c failed with error -22

Fixes: 345e5c8a1c ("powerpc: Add interrupt support to mpc8xxx_gpio")
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-07 13:17:23 +02:00
Mario Limonciello
0ea76c401f gpiolib: acpi: Add a quirk for Asus UM325UAZ
Asus UM325UAZ has GPIO 18 programmed as both an interrupt and a wake
source, but confirmed with internal team on this design this pin is
floating and shouldn't have been programmed. This causes lots of
spurious IRQs on the system and horrendous battery life.

Add a quirk to ignore attempts to program this pin on this system.

Reported-by: Pavel Krc <reg.krn@pkrc.net>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216208
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2022-09-05 13:15:56 +03:00
Mario Limonciello
6b6af7bd57 gpiolib: acpi: Add support to ignore programming an interrupt
gpiolib-acpi already had support for ignoring a pin for wakeup, but
if an OEM configures a floating pin as an interrupt source then
stopping it from being a wakeup won't do much good to stop the
interrupt storm.

Add support for a module parameter and quirk infrastructure to
ignore interrupts as well.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2022-09-05 13:15:56 +03:00
Qingtao Cao
5134272f9f gpio: exar: access MPIO registers on cascaded chips
When EXAR xr17v35x chips are cascaded in order to access the MPIO registers
(part of the Device Configuration Registers) of the secondary chips, an offset
needs to be applied based on the number of primary chip's UART channels.

Signed-off-by: Qingtao Cao <qingtao.cao@digi.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-04 22:25:10 +02:00
Dmitry Torokhov
0eadd36d91 gpiolib: make fwnode_get_named_gpiod() static
There are no external users of fwnode_get_named_gpiod() anymore, so
let's stop exporting it and mark it as static.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-04 22:12:15 +02:00
William Breathitt Gray
6890381720 gpio: ws16c48: Make irq_chip immutable
Kernel warns about mutable irq_chips:

    "not an immutable chip, please consider fixing!"

Make the struct irq_chip const, flag it as IRQCHIP_IMMUTABLE, add the
new helper functions, and call the appropriate gpiolib functions.

Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-03 22:56:34 +02:00
William Breathitt Gray
410a5041aa gpio: 104-idio-16: Make irq_chip immutable
Kernel warns about mutable irq_chips:

    "not an immutable chip, please consider fixing!"

Make the struct irq_chip const, flag it as IRQCHIP_IMMUTABLE, add the
new helper functions, and call the appropriate gpiolib functions.

Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-03 22:56:26 +02:00
William Breathitt Gray
fa1329f9e4 gpio: 104-idi-48: Make irq_chip immutable
Kernel warns about mutable irq_chips:

    "not an immutable chip, please consider fixing!"

Make the struct irq_chip const, flag it as IRQCHIP_IMMUTABLE, add the
new helper functions, and call the appropriate gpiolib functions.

Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-09-03 22:56:17 +02:00