Commit graph

5042 commits

Author SHA1 Message Date
Linus Torvalds
2c271fe77d gpio fixes for v5.17-rc1
- fix the error checks of platform_get_irq() in gpio-mpc8xxx and gpio-idt3243x
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmHpcRsACgkQEacuoBRx
 13JtiRAAmHU3popEtD8UDiibc9UT/zstPgVKq2SgvJQzg8cAPyC97c8uETee9STZ
 kLzdrK+VMP1munb+hOT1yl0FXcU1IceDztFoJUZVfctTDnqam1lS/yYnGCnapNUA
 xdM9qqyCxYNfLSdrM0h5QUtL90f87MVLsvrrpG3vx1jR3ZSdB9pdVfDe3Av0RX0p
 0K5Pn48m4csFyti00NKkM0RGrPZJEuJY5jhZuz1/7S6Yt8077jjiSzYL1R3NOtDz
 eA7qMzPW/ZuGJfTQ/tr4MT0zggs6LrXTdnVqThvclpFxlA3RBEAw6mMUpT5/Ickn
 2MaaOzIEk82b7ndQDira2pHoT2I9LSZcQSKhHypWO2Azi8R7E7M+2et0/qYaKhZW
 n30PJopfUZ8tQp42RBPEF9nrybQZKYGBp+okBbCNDRFnmnQuSadkvuBO9Glf0y4Q
 nAwOMIsQh5A6xVqNwEK+pfDzAQ6FURCdGeAm8dTllKc67rXnVTikUQUZnILyTzj0
 lMGJEfxSNE/34lbb0NWHb36xjdY+JYxo/N2P8XIYRCFeR3oDfqSUTBmG+aON3Jn6
 6VyFAmFkfRlzBS2vmmbWkHCOxqYER6ubOOb1Hz4LcPrxeCg1E/toClkDmCC2+dDH
 UNDEKei0tExqzm09mGBCE+q3ligIG3M/VwnYo5ekXRhDbuf6AGQ=
 =il0X
 -----END PGP SIGNATURE-----

Merge tag 'gpio-fixes-for-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fixes from Bartosz Golaszewski:
 "Fix the same error check issue in two drivers. And then the drivers
  are fixed even more because the first patches were incomplete which I
  missed.

  Summary:

   - fix the error checks of platform_get_irq() in gpio-mpc8xxx and
     gpio-idt3243x"

* tag 'gpio-fixes-for-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  gpio: mpc8xxx: Fix an ignored error return from platform_get_irq()
  gpio: idt3243x: Fix an ignored error return from platform_get_irq()
  gpio: idt3243x: Fix IRQ check in idt_gpio_probe
  gpio: mpc8xxx: Fix IRQ check in mpc8xxx_probe
2022-01-20 17:38:23 +02:00
Yang Li
9f51ce0b9e gpio: mpc8xxx: Fix an ignored error return from platform_get_irq()
The return from the call to platform_get_irq() is int, it can be
a negative error code, however this is being assigned to an unsigned
int variable 'irqn', so making 'irqn' an int.

Eliminate the following coccicheck warning:
./drivers/gpio/gpio-mpc8xxx.c:391:5-21: WARNING: Unsigned expression
compared with zero: mpc8xxx_gc -> irqn < 0

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Fixes: 0b39536cc6 ("gpio: mpc8xxx: Fix IRQ check in mpc8xxx_probe")
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-01-20 09:05:57 +01:00
Yang Li
7c1cf55577 gpio: idt3243x: Fix an ignored error return from platform_get_irq()
The return from the call to platform_get_irq() is int, it can be
a negative error code, however this is being assigned to an unsigned
int variable 'parent_irq', so making 'parent_irq' an int.

Eliminate the following coccicheck warning:
./drivers/gpio/gpio-idt3243x.c:167:6-16: WARNING: Unsigned expression
compared with zero: parent_irq < 0

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Fixes: 30fee1d746 ("gpio: idt3243x: Fix IRQ check in idt_gpio_probe")
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-01-20 09:05:46 +01:00
Linus Torvalds
3bf6a9e36e virtio,vdpa,qemu_fw_cfg: features, cleanups, fixes
partial support for < MAX_ORDER - 1 granularity for virtio-mem
 driver_override for vdpa
 sysfs ABI documentation for vdpa
 multiqueue config support for mlx5 vdpa
 
 Misc fixes, cleanups.
 
 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQFDBAABCAAtFiEEXQn9CHHI+FuUyooNKB8NuNKNVGkFAmHiDHkPHG1zdEByZWRo
 YXQuY29tAAoJECgfDbjSjVRpVT4H/3Veixt3uYPOmuLU2tSx+8X+sFTtik81hyiE
 okz5fRJrxxA8SqS76FnmO10FS4hlPOGNk0Z5WVhr0yihwFvPLvpCM/xi2Lmrz9I7
 pB0sXOIocEL1xApsxukR9K1Twpb2hfYsflbJYUVlRfhS5G0izKJNZp5I7OPrzd80
 vVNNDWKW2iLDlfqsavumI4Kvm4nsFuCHG03jzMtcIa7YTXYV3DORD4ZGFFVUOIQN
 t5F74TznwHOeYgJeg7TzjFjfPWmXjLetvx10QX1A1uOvwppWW/QY6My0UafTXNXj
 VB3gOwJPf+gxXAXl/4bafq4NzM0xys6cpcPpjvhmU+erY4UuyAU=
 =Y1eO
 -----END PGP SIGNATURE-----

Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost

Pull virtio updates from Michael Tsirkin:
 "virtio,vdpa,qemu_fw_cfg: features, cleanups, and fixes.

   - partial support for < MAX_ORDER - 1 granularity for virtio-mem

   - driver_override for vdpa

   - sysfs ABI documentation for vdpa

   - multiqueue config support for mlx5 vdpa

   - and misc fixes, cleanups"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (42 commits)
  vdpa/mlx5: Fix tracking of current number of VQs
  vdpa/mlx5: Fix is_index_valid() to refer to features
  vdpa: Protect vdpa reset with cf_mutex
  vdpa: Avoid taking cf_mutex lock on get status
  vdpa/vdpa_sim_net: Report max device capabilities
  vdpa: Use BIT_ULL for bit operations
  vdpa/vdpa_sim: Configure max supported virtqueues
  vdpa/mlx5: Report max device capabilities
  vdpa: Support reporting max device capabilities
  vdpa/mlx5: Restore cur_num_vqs in case of failure in change_num_qps()
  vdpa: Add support for returning device configuration information
  vdpa/mlx5: Support configuring max data virtqueue
  vdpa/mlx5: Fix config_attr_mask assignment
  vdpa: Allow to configure max data virtqueues
  vdpa: Read device configuration only if FEATURES_OK
  vdpa: Sync calls set/get config/status with cf_mutex
  vdpa/mlx5: Distribute RX virtqueues in RQT object
  vdpa: Provide interface to read driver features
  vdpa: clean up get_config_size ret value handling
  virtio_ring: mark ring unused on error
  ...
2022-01-18 10:05:48 +02:00
Miaoqian Lin
30fee1d746 gpio: idt3243x: Fix IRQ check in idt_gpio_probe
platform_get_irq() returns negative error number instead 0 on failure.
And the doc of platform_get_irq() provides a usage example:

    int irq = platform_get_irq(pdev, 0);
    if (irq < 0)
        return irq;

Fix the check of return value to catch errors correctly.

Fixes: 4195926aed ("gpio: Add support for IDT 79RC3243x GPIO controller")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-01-17 14:18:11 +01:00
Miaoqian Lin
0b39536cc6 gpio: mpc8xxx: Fix IRQ check in mpc8xxx_probe
platform_get_irq() returns negative error number instead 0 on failure.
And the doc of platform_get_irq() provides a usage example:

    int irq = platform_get_irq(pdev, 0);
    if (irq < 0)
        return irq;

Fix the check of return value to catch errors correctly.

Fixes: 76c47d1449 ("gpio: mpc8xxx: Add ACPI support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-01-17 14:17:42 +01:00
Michael S. Tsirkin
d9679d0013 virtio: wrap config->reset calls
This will enable cleanups down the road.
The idea is to disable cbs, then add "flush_queued_cbs" callback
as a parameter, this way drivers can flush any work
queued after callbacks have been disabled.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://lore.kernel.org/r/20211013105226.20225-1-mst@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2022-01-14 18:50:52 -05:00
Linus Torvalds
e3084ed48f Pin control bulk changes for the v5.17 kernel cycle
Core changes:
 
 - New standard enumerator and corresponding device tree bindings
   for output impedance pin configuration. (Implemented and used
   in the Renesas rzg2l driver.)
 
 - Cleanup of Kconfig and Makefile to be somewhat orderly and
   alphabetic.
 
 New drivers:
 
 - Samsung Exynos 7885 pin controller.
 
 - Ocelot LAN966x pin controller.
 
 - Qualcomm SDX65 pin controller.
 
 - Qualcomm SM8450 pin controller.
 
 - Qualcomm PM8019, PM8226 and PM2250 pin controllers.
 
 - NXP/Freescale i.MXRT1050 pin controller.
 
 - Intel Thunder Bay pin controller.
 
 Enhancements:
 
 - Introduction of the string library helper function
   "kasprintf_strarray()" and subsequent use in Rockchip, ST and
   Armada pin control drivers, as well as the GPIO mockup driver.
 
 - The Ocelot pin controller has been extensively rewritten to
   use regmap and other modern kernel infrastructure.
 
 - The Microchip SGPIO driver has been converted to use regmap.
 
 - The SPEAr driver had been converted to use regmap.
 
 - Substantial cleanups and janitorial on the Apple pin control
   driver that was merged for v5.16.
 
 - Janitorial to remove of_node assignments in the GPIO portions
   that anyway get this handled in the GPIO core.
 
 - Minor cleanups and improvements in several pin controllers.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmHetMgACgkQQRCzN7AZ
 XXOXUA/+I8nEdBy8oBa+vYsJp/FwQi9oh2r488Bin7kCEwYJjPKDDjZuIQQQz34H
 DcSpzBBB/sSFiO27F27rk70vHGfZ4pVi57XfRI2IB1qSe4uCNCNEURVDSM9aY7Nl
 hR973GS5VDvmyo/7zUT7dWmG2b9lxRqwU2wCvVJ7y69gQEwT74iR8b51ycziBNWt
 AEQ+BUN9oVEIM6aHs9+jGgD843XIFZMWoKuwoD51036/wFDLO3lQNyuMytZaQtSB
 q1epb51jl4tPhybWrWc+IoVp6BshIZs1m8+LhgRqLfJEj1znTZDXvAEuTuI3Y9BY
 lyyvGuKNbe6q1aD8Hfu3qiO8PfBrI+pNpOcdw84pG6IwBz4vfLmhzyMd8vTyqoK8
 DIlfYCiGJB0aqDBWhRyql8KM04/gSlEm2eZONsudNuMugvRIxU1IOBaKFwlP5Z98
 y2/mYo/wLnVFKZE6cLp3Lxjpv4ENRJ1HkQe5JQak1ulq+XkUL9f82p7oGMJ4lvoB
 iTOPTkuhhkiUYmwbb97VoqWTYwL+EptvsWto+Mv/glHy7OGXXJFTAD+ARpZc+c5I
 f1/mzQYujmVj91XUi9xSGnL07mNNPOiX3p+9q7Fy+A3Rk1x5n0t+7hvmiuv8paLv
 KNowhECllp0lBKns39tcn8BQvRufvxv2b+QvEqgUPVI3Qj8vEc4=
 =+nxh
 -----END PGP SIGNATURE-----

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

Pull pin control bulk updates from Linus Walleij:
 "Core changes:

   - New standard enumerator and corresponding device tree bindings for
     output impedance pin configuration. (Implemented and used in the
     Renesas rzg2l driver.)

   - Cleanup of Kconfig and Makefile to be somewhat orderly and
     alphabetic.

  New drivers:

   - Samsung Exynos 7885 pin controller.

   - Ocelot LAN966x pin controller.

   - Qualcomm SDX65 pin controller.

   - Qualcomm SM8450 pin controller.

   - Qualcomm PM8019, PM8226 and PM2250 pin controllers.

   - NXP/Freescale i.MXRT1050 pin controller.

   - Intel Thunder Bay pin controller.

  Enhancements:

   - Introduction of the string library helper function
     "kasprintf_strarray()" and subsequent use in Rockchip, ST and
     Armada pin control drivers, as well as the GPIO mockup driver.

   - The Ocelot pin controller has been extensively rewritten to use
     regmap and other modern kernel infrastructure.

   - The Microchip SGPIO driver has been converted to use regmap.

   - The SPEAr driver had been converted to use regmap.

   - Substantial cleanups and janitorial on the Apple pin control driver
     that was merged for v5.16.

   - Janitorial to remove of_node assignments in the GPIO portions that
     anyway get this handled in the GPIO core.

   - Minor cleanups and improvements in several pin controllers"

* tag 'pinctrl-v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (98 commits)
  pinctrl: imx: fix assigning groups names
  dt-bindings: pinctrl: mt8195: add wrapping node of pin configurations
  pinctrl: bcm: ns: use generic groups & functions helpers
  pinctrl: imx: fix allocation result check
  pinctrl: samsung: Use platform_get_irq_optional() to get the interrupt
  pinctrl: Propagate firmware node from a parent device
  dt-bindings: pinctrl: qcom: Add SDX65 pinctrl bindings
  pinctrl: add one more "const" for generic function groups
  pinctrl: keembay: rework loops looking for groups names
  pinctrl: keembay: comment process of building functions a bit
  pinctrl: imx: prepare for making "group_names" in "function_desc" const
  ARM: dts: gpio-ranges property is now required
  pinctrl: aspeed: fix unmet dependencies on MFD_SYSCON for PINCTRL_ASPEED
  pinctrl: Get rid of duplicate of_node assignment in the drivers
  pinctrl-sunxi: don't call pinctrl_gpio_direction()
  pinctrl-bcm2835: don't call pinctrl_gpio_direction()
  pinctrl: bcm2835: Silence uninit warning
  pinctrl: Sort Kconfig and Makefile entries alphabetically
  pinctrl: Add Intel Thunder Bay pinctrl driver
  dt-bindings: pinctrl: Add bindings for Intel Thunderbay pinctrl driver
  ...
2022-01-12 10:56:08 -08:00
Linus Torvalds
c288ea6798 gpio updates for v5.17
- new testing module: gpio-sim that is scheduled to replace gpio-mockup
 - initial changes aiming at converting all GPIO drivers to using the fwnode
   interface and limiting any references to OF symbols to gpiolib-of.c
 - add support for Tegra234 and Tegra241 to gpio-tegra186
 - add support for new models (SSD201 and SSD202D) to gpio-msc313
 - add basic support for interrupts to gpio-aggregator
 - add support for AMDIF031 HID device to gpio-amdpt
 - drop support for unused platforms in gpio-xlp
 - cleanup leftovers from the removal of the legacy Samsung Exynos GPIO driver
 - use raw spinlocks in gpio-aspeed and gpio-aspeed-sgpio to make PREEMPT_RT
   happy
 - generalize the common 'ngpios' device property by reading it in the core
   gpiolib code so that we can remove duplicate reads from drivers
 - allow line names from device properties to override names set by drivers
 - code shrink in gpiod_add_lookup_table()
 - add new model to the DT bindings for gpio-vf610
 - convert DT bindings for tegra devices to YAML
 - improvements to interrupt handling in gpio-rcar and gpio-rockchip
 - updates to intel drivers from Andy (details in the merge commit)
 - some minor tweaks, improvements and coding-style fixes all around the
   subsystem
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmHdpawACgkQEacuoBRx
 13KBTxAA1uB3zOqq5L9gn7cLR8Pi1/N4o7ltB0uwIFGJ8X5+jkHqkEi2TRa7Nyv1
 OODt/C2g8iguhynQJ1g//ZW12tzoThwI9fUzixZ9FRBMmX5oHeCcrS/YAYP4GDJY
 T9KOiXPDJ+vHV7SbM4k8gIlMHFk5Uq1jjvNnDIebzyBlyzAKxH9dIY3r1zt0Y4BR
 aKlAD5pxmLDAMAWVlTRo5e/W/Xd0ob0LCkDwlgozb3gwoPQbQQIPHuw+jPl5cMR2
 wBRNVFuJLi5dnpyrOoCXWWDQzeQzw8x+5vlwZfLkr2pF4FfDWoxefmbrDulzU+Au
 t6TULGcFKhLalyozY2D2mWNo8lMs4fDt/SXrDHwgS/cmGpq7RUGfvFuV6a9IOukP
 /uqoMYviIRswJuvPBs6dBNFaZxJkw4cWzd9tIzywb07mpkUCwX8wARwg+dZGvdQt
 4aAJwkJHuR29bEpDVfWwd2UV+fdAX5RiVQqLznNzGK51O+vS4UklYyWtO44R+fgm
 F81y2zOo0ly9xA6YkGjoSATnWDTmzTQSrnwcFv9J9UewY3PJpQc4xgqvZysur5cb
 0k/kuf9eWazmo46gW3ztv8GfXogDko8DEKrEgGs47tg97RDR5YbzOkOmnsqWvoUd
 nSVyx6vs2ijXsEi96FKhfTrU0AT2YcAIbEWjQoQvBR+3zkase7I=
 =OUhL
 -----END PGP SIGNATURE-----

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

Pull gpio updates from Bartosz Golaszewski:
 "The gpio-sim module is back, this time without any changes to
  configfs. This results in a less elegant user-space interface but I
  never got any follow-up on the committable items and didn't want to
  delay this module for several more months.

  Other than that we have support for several new models and some
  support going away. We started working on converting GPIO drivers to
  using fwnode exclusively in order to limit references to OF symbols to
  gpiolib-of.c exclusively. We also have regular tweaks and improvements
  all over the place.

  Summary:

   - new testing module: gpio-sim that is scheduled to replace
     gpio-mockup

   - initial changes aiming at converting all GPIO drivers to using the
     fwnode interface and limiting any references to OF symbols to
     gpiolib-of.c

   - add support for Tegra234 and Tegra241 to gpio-tegra186

   - add support for new models (SSD201 and SSD202D) to gpio-msc313

   - add basic support for interrupts to gpio-aggregator

   - add support for AMDIF031 HID device to gpio-amdpt

   - drop support for unused platforms in gpio-xlp

   - cleanup leftovers from the removal of the legacy Samsung Exynos
     GPIO driver

   - use raw spinlocks in gpio-aspeed and gpio-aspeed-sgpio to make
     PREEMPT_RT happy

   - generalize the common 'ngpios' device property by reading it in the
     core gpiolib code so that we can remove duplicate reads from
     drivers

   - allow line names from device properties to override names set by
     drivers

   - code shrink in gpiod_add_lookup_table()

   - add new model to the DT bindings for gpio-vf610

   - convert DT bindings for tegra devices to YAML

   - improvements to interrupt handling in gpio-rcar and gpio-rockchip

   - updates to intel drivers from Andy (details in the merge commit)

   - some minor tweaks, improvements and coding-style fixes all around
     the subsystem"

* tag 'gpio-updates-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (59 commits)
  gpio: rcar: Propagate errors from devm_request_irq()
  gpio: rcar: Use platform_get_irq() to get the interrupt
  gpio: ts5500: Use platform_get_irq() to get the interrupt
  gpio: dwapb: Switch to use fwnode instead of of_node
  gpiolib: acpi: make fwnode take precedence in struct gpio_chip
  dt-bindings: gpio: samsung: drop unused bindings
  gpio: max3191x: Use bitmap_free() to free bitmap
  gpio: regmap: Switch to use fwnode instead of of_node
  gpio: tegra186: Add support for Tegra241
  dt-bindings: gpio: Add Tegra241 support
  gpio: brcmstb: Use local variable to access OF node
  gpio: Remove unused local OF node pointers
  gpio: sim: add missing fwnode_handle_put() in gpio_sim_probe()
  gpio: msc313: Add support for SSD201 and SSD202D
  gpio: msc313: Code clean ups
  dt-bindings: gpio: msc313: Add offsets for ssd20xd
  dt-bindings: gpio: msc313: Add compatible for ssd20xd
  gpio: sim: fix uninitialized ret variable
  gpio: Propagate firmware node from a parent device
  gpio: Setup parent device and get rid of unnecessary of_node assignment
  ...
2022-01-11 12:31:35 -08:00
Linus Torvalds
fa722ecb93 - New Device Support
- Add support for Lakefield PCH to Intel LPSS PCI
 
  - Remove Device Support
    - Remove support for ROHM BD70528 Power Management IC
 
  - New Functionality
    - Add support for SMBus and I2C mode to Dialog DA9062/61 PMIC
    - Enable I2C4 on Microsoft Surface Go & Go 2
 
  - Fix-ups
    - Device Tree changes (inc. YAML conversion); maxim,max77686,
                           rohm,bd9571mwv, syscon, brcm,twd, google,cros-ec
    - Use __maybe_unused instead of #ifery; atmel-flexcom
    - Allow the Regmap API to handle endianess internally; ntxec
    - Utilise I2C's .resume_noirq call-back; atmel-flexcom
    - Remove unused code; ti_am335x_tscadc
    - Use CPU-id instead of ACPI _HRV to ID variants; intel_soc_pmic_core
    - Allow device to power-off right from .probe(); tps65910
    - Trivial (whitespace, typos, etc); da9063
 
  - Bug Fixes
    - Fix ordering issues during probe; intel-lpss-acpi
    - Fix correct clock speed; intel-lpss-pci
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmHddokACgkQUa+KL4f8
 d2EWoRAAk3RX5VEsHO3yu5P5ElEz95BpXnyZDI3/C5a2DNPLnatqb0ATqEuEgBaC
 VP3QEF3N+7vMPQBe7Bh3WOS+sFNAciAg3cudP7dwxQUeb/Yh8Vv1vTPFenJ23Ygh
 ETZ2NDSnQnBRa2spg3aYnFG45r7Hao2froxF4il9Lu5Vx6nBMqnK/WGEWBhbuldq
 6E30RLHjLyFGO7QP7gjliBIa/4b0Qj8JkzpiXR6wfEAZBBxOTk23cNnFtiwTsWg+
 KBpoPzcUimIcpz4urAGhGbkONy8GojKkNbDvxXuntIAenTnCOkcb9ADxxuXRSAMi
 rG2pt/57DDT03qCwHVnRGw+0YAUoaWq96VKqkjoIzlaXZ8j/8wLSG1ZXDaqPR0Ds
 lEdi9QcAruzffpRJUIy6YgVy5wLdRaBNXOZfv5ADJPJaodq2koXtoY5s372dL+i7
 cneA1w79RcfjJDQ3P8zBs4We0eEdesIyqbVYLq4E0GGrG3ck4+sCEEiHxUcFGeS9
 XkYHaB2VU1PAXa5qqmJSdm+qw6yK0ls5BpORGV9hizy/iMvjOnHCX/k0kmgfNlVi
 y7lsrv2hKSqXGEENU1YY4Ah0gotop8l6ck6drWme5eWvGXmciNQWtiY7VxMFV4fT
 FIqVNKxxh5W/EHMFrFk3Wl17tEDL3biwIFiUlxPs1a2JWcilwrI=
 =acuh
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "New Device Support:
   - Add support for Lakefield PCH to Intel LPSS PCI

  Remove Device Support:
   - Remove support for ROHM BD70528 Power Management IC

  New Functionality:
   - Add support for SMBus and I2C mode to Dialog DA9062/61 PMIC
   - Enable I2C4 on Microsoft Surface Go & Go 2

  Fix-ups:
   - Device Tree changes (inc. YAML conversion); maxim,max77686,
     rohm,bd9571mwv, syscon, brcm,twd, google,cros-ec
   - Use __maybe_unused instead of #ifery; atmel-flexcom
   - Allow the Regmap API to handle endianess internally; ntxec
   - Utilise I2C's .resume_noirq call-back; atmel-flexcom
   - Remove unused code; ti_am335x_tscadc
   - Use CPU-id instead of ACPI _HRV to ID variants; intel_soc_pmic_core
   - Allow device to power-off right from .probe(); tps65910
   - Trivial (whitespace, typos, etc); da9063

  Bug Fixes:
   - Fix ordering issues during probe; intel-lpss-acpi
   - Fix correct clock speed; intel-lpss-pci"

* tag 'mfd-next-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (25 commits)
  mfd: google,cros-ec: Fix property name for MediaTek rpmsg
  dt-bindings: mfd: Fix typo "DA9093" -> "DA9063"
  mfd: ntxec: Change return type of ntxec_reg8 from __be16 to u16
  mfd: tps65910: Set PWR_OFF bit during driver probe
  mfd: intel_soc_pmic: Use CPU-id check instead of _HRV check to differentiate variants
  mfd: intel-lpss: Fix I2C4 not being available on the Microsoft Surface Go & Go 2
  dt-bindings: mfd: Add Broadcom's Timer-Watchdog block
  dt-bindings: mfd: Add Freecom system controller
  mfd: Kconfig: Change INTEL_SOC_PMIC_CHTDC_TI to bool
  dt-bindings: mfd: syscon: Add samsung,exynos850-sysreg
  mfd: da9062: Support SMBus and I2C mode
  mfd: intel-lpss-pci: Fix clock speed for 38a8 UART
  mfd: intel-lpss: Fix too early PM enablement in the ACPI ->probe()
  mfd: ti_am335x_tscadc: Drop the CNTRLREG_TSC_8WIRE macro
  mfd: stmpe: Support disabling sub-functions
  mfd: atmel-flexcom: Use .resume_noirq
  mfd: atmel-flexcom: Remove #ifdef CONFIG_PM_SLEEP
  dt-bindings: mfd: bd9571mwv: Convert to json-schema
  mfd: intel-lpss: Add Intel Lakefield PCH PCI IDs
  dt-bindings: mfd: maxim,max77686: Convert to dtschema
  ...
2022-01-11 12:22:06 -08:00
Lad Prabhakar
ffe31c9ed3 gpio: rcar: Propagate errors from devm_request_irq()
The driver overrides the error code returned by devm_request_irq() to
-ENOENT. Switch to propagating the error code upstream.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-01-05 09:57:34 +01:00
Lad Prabhakar
f1ff272c60 gpio: rcar: Use platform_get_irq() to get the interrupt
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypassed the hierarchical setup and messed up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq().

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-01-05 09:57:20 +01:00
Lad Prabhakar
6408693f95 gpio: ts5500: Use platform_get_irq() to get the interrupt
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypassed the hierarchical setup and messed up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq().

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-01-05 09:57:06 +01:00
Andy Shevchenko
80f60eba9c gpio: dwapb: Switch to use fwnode instead of of_node
GPIO library now accepts fwnode as a firmware node, so
switch the driver to use it and hence rectify the ACPI
case which uses software nodes.

Note, in this case it's rather logical fix that doesn't
affect functionality, thus no backporting required.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-01-03 11:06:18 +01:00
Andy Shevchenko
4a08d63c24 gpiolib: acpi: make fwnode take precedence in struct gpio_chip
If the driver sets the fwnode in struct gpio_chip, let it take
precedence over the parent's fwnode.

This is a follow up to the commit 9126a738edc1 ("gpiolib: of: make
fwnode take precedence in struct gpio_chip").

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-01-03 11:06:15 +01:00
Steven Lee
e5a7431f5a gpio: gpio-aspeed-sgpio: Fix wrong hwirq base in irq handler
Each aspeed sgpio bank has 64 gpio pins(32 input pins and 32 output pins).
The hwirq base for each sgpio bank should be multiples of 64 rather than
multiples of 32.

Signed-off-by: Steven Lee <steven_lee@aspeedtech.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-01-03 10:50:12 +01:00
Christophe JAILLET
01d130a31a gpio: max3191x: Use bitmap_free() to free bitmap
kfree() and bitmap_free() are the same. But using the later is more
consistent when freeing memory allocated with bitmap_alloc().

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-01-03 10:43:00 +01:00
Andy Shevchenko
f21ecad451 gpio: regmap: Switch to use fwnode instead of of_node
GPIO library now accepts fwnode as a firmware node, so
switch the driver to use it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Michael Walle <michael@walle.cc>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-23 17:14:19 +01:00
Akhil R
d1056b771d gpio: tegra186: Add support for Tegra241
Extend the existing Tegra186 GPIO controller driver with support for the
GPIO controller found on Tegra241 (Grace). While the programming model
remains the same, the number of pins has slightly changed.

Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-23 17:12:26 +01:00
Andy Shevchenko
e85dd53a38 gpio: brcmstb: Use local variable to access OF node
We already have a local variable that contains a copy of OF node pointer.
Use it instead of dereferencing it again from struct device.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-23 17:08:53 +01:00
Andy Shevchenko
9804456e60 gpio: Remove unused local OF node pointers
After the commit 448cf90513 ("gpio: Get rid of duplicate of_node
assignment in the drivers") the OF node local pointers become unused.
Remove them for good and make compiler happy about.

Fixes: 448cf90513 ("gpio: Get rid of duplicate of_node assignment in the drivers")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
[Bart: removed unrelated change in gpio-brcmstb]
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-22 10:05:26 +01:00
Vincent Whitchurch
3e4d9a4850 gpio: virtio: remove timeout
The driver imposes an arbitrary one second timeout on virtio requests,
but the specification doesn't prevent the virtio device from taking
longer to process requests, so remove this timeout to support all
systems and device implementations.

Fixes: 3a29355a22 ("gpio: Add virtio-gpio driver")
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-21 16:22:58 +01:00
Yang Yingliang
a2d05fb734 gpio: sim: add missing fwnode_handle_put() in gpio_sim_probe()
Calling fwnode_handle_put() when break out of device_for_each_child_node(),
or the device node reference will be leakd.

Fixes: 83960fcf4818 ("gpio: sim: new testing module")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-21 16:19:14 +01:00
Daniel Palmer
572006bce3 gpio: msc313: Add support for SSD201 and SSD202D
This adds GPIO support for the SSD201 and SSD202D chips.

Signed-off-by: Daniel Palmer <daniel@0x0f.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-20 16:07:22 +01:00
Daniel Palmer
bef4460b85 gpio: msc313: Code clean ups
- Remove the unneeded assignment of ret before returning it.
- Remove an unneeded blank line

Signed-off-by: Daniel Palmer <daniel@0x0f.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-20 15:48:58 +01:00
Noralf Trønnes
9a5875f14b gpio: dln2: Fix interrupts when replugging the device
When replugging the device the following message shows up:

gpio gpiochip2: (dln2): detected irqchip that is shared with multiple gpiochips: please fix the driver.

This also has the effect that interrupts won't work.
The same problem would also show up if multiple devices where plugged in.

Fix this by allocating the irq_chip data structure per instance like other
drivers do.

I don't know when this problem appeared, but it is present in 5.10.

Cc: <stable@vger.kernel.org> # 5.10+
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-19 15:03:30 +01:00
Tom Rix
c08995bff2 gpio: sim: fix uninitialized ret variable
Building with clang returns this error:

gpio-sim.c:889:7: error: variable 'ret' is uninitialized
  when used here

ret should be the status of the call to
gpio_sim_make_bank_swnode stored in bank->swnode.

Fixes: 83960fcf4818 ("gpio: sim: new testing module")
Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-19 14:47:30 +01:00
Andy Shevchenko
6dbe6c07f9 gpio: Propagate firmware node from a parent device
When creating MFD platform devices the firmware node is left unset.
This, in particular, prevents GPIO library to use it for different
purposes. Propagate firmware node from the parent device and let
GPIO library do the right thing.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-17 17:50:46 +01:00
Andy Shevchenko
45a541a610 gpio: Setup parent device and get rid of unnecessary of_node assignment
Some of the drivers do not set parent device. This may lead to obstacles
during debugging or understanding the device relations from the Linux
point of view. Assign parent device for GPIO chips created by these
drivers.

While at it, let GPIO library to assign of_node from the parent device.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-17 17:44:19 +01:00
Andy Shevchenko
448cf90513 gpio: Get rid of duplicate of_node assignment in the drivers
GPIO library does copy the of_node from the parent device of
the GPIO chip, there is no need to repeat this in the individual
drivers. Remove these assignment all at once.

For the details one may look into the of_gpio_dev_init() implementation.

While at it, remove duplicate parent device assignment where it is the case.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-By: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-17 17:39:35 +01:00
Bartosz Golaszewski
ca7e7822d1 Merge tag 'intel-gpio-v5.17-1' of gitolite.kernel.org:pub/scm/linux/kernel/git/andy/linux-gpio-intel into gpio/for-next
intel-gpio for v5.17-1

- Don't set type for IRQ already in use in case of ACPI
- Drop unused call from GPIO ACPI library
- Clean up ML IOH and PCH GPIO drivers to make it closer to each other
- Clarify use of register file version in DesignWare driver
- other minor tweaks
2021-12-17 12:26:14 +01:00
Peter Rosin
c73960bb0a gpiolib: allow line names from device props to override driver names
Some GPIO providers set names for GPIO lines that match the names of
the pins on the SoC, or variations on that theme. These names are
generic more often that not, such as pioC12 in the at91 case. These
generic names block the possibility to set more useful GPIO line
names with device properties (i.e. gpio-line-names).

Allow overriding a generic name given by the GPIO driver if there is
a name given to the GPIO line using device properties, but leave the
generic name alone if no better name is available.

However, there is a risk. If user space is depending on the above
mentioned fixed GPIO names, AND there are device properties that
previously did not reach the surface, the name change might cause
regressions. But hopefully this stays below the radar...

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Tested-by: Alexander Dahl <ada@thorsis.com>
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-17 12:26:14 +01:00
Hsu Yuchang
2ac5eb840f gpio: amdpt: add new device ID and 24-pin support
Add an ACPI HID(AMDIF031) and pin number in the pt_gpio_acpi_match.

Signed-off-by: Yuchang Hsu <Richard_Hsu@asmedia.com.tw>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-17 12:26:13 +01:00
Prathamesh Shete
1db9b241bb gpio: tegra186: Add support for Tegra234
Extend the existing Tegra186 GPIO controller driver with support for the
GPIO controller found on Tegra234. While the programming model remains
the same, the number of pins has slightly changed.

Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-17 12:26:13 +01:00
Jason Wang
34d9841b4b gpio: sta2x11: fix typo in a comment
The double `all' in the comment in line 327 is repeated. Remove one
of them from the comment.

Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-17 12:26:13 +01:00
Bartosz Golaszewski
cb8c474e79 gpio: sim: new testing module
Implement a new, modern GPIO testing module controlled by configfs
attributes instead of module parameters. The goal of this driver is
to provide a replacement for gpio-mockup that will be easily extensible
with new features and doesn't require reloading the module to change
the setup.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2021-12-17 12:26:13 +01:00
Bartosz Golaszewski
ac627260cf gpiolib: of: make fwnode take precedence in struct gpio_chip
If the driver sets the fwnode in struct gpio_chip, let it take
precedence over the of_node. This only affects OF-based systems,
ACPI needs to be converted separately.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2021-12-17 12:26:13 +01:00
Bartosz Golaszewski
990f6756bb gpiolib: allow to specify the firmware node in struct gpio_chip
Software nodes allow us to represent hierarchies for device components
that don't have their struct device representation yet - for instance:
banks of GPIOs under a common GPIO expander. The core gpiolib core
however doesn't offer any way of passing this information from the
drivers.

This extends struct gpio_chip with a pointer to fwnode that can be set
by the driver and used to pass device properties for child nodes.

This is similar to how we handle device-tree sub-nodes with
CONFIG_OF_GPIO enabled.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2021-12-17 12:26:12 +01:00
Bartosz Golaszewski
dd61b29207 gpiolib: provide gpiod_remove_hogs()
Currently all users of gpiod_add_hogs() call it only once at system
init so there never was any need for a mechanism allowing to remove
them. Now the upcoming gpio-sim will need to tear down chips with hogged
lines so provide a function that allows to remove hogs.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2021-12-17 12:26:12 +01:00
Jason Wang
9d5f0f6644 gpio: sch: fix typo in a comment
The double `the' in the comment in line 142 is repeated. Remove one
of them from the comment.

Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2021-12-13 13:29:09 +02:00
Iwona Winiarska
ab39d6988d gpio: aspeed-sgpio: Convert aspeed_sgpio.lock to raw_spinlock
The gpio-aspeed-sgpio driver implements an irq_chip which need to be
invoked from hardirq context. Since spin_lock() can sleep with
PREEMPT_RT, it is no longer legal to invoke it while interrupts are
disabled.
This also causes lockdep to complain about:
[   25.919465] [ BUG: Invalid wait context ]
because aspeed_sgpio.lock (spin_lock_t) is taken under irq_desc.lock
(raw_spinlock_t).
Let's use of raw_spinlock_t instead of spinlock_t.

Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-10 16:14:51 +01:00
Iwona Winiarska
61a7904b6a gpio: aspeed: Convert aspeed_gpio.lock to raw_spinlock
The gpio-aspeed driver implements an irq_chip which need to be invoked
from hardirq context. Since spin_lock() can sleep with PREEMPT_RT, it is
no longer legal to invoke it while interrupts are disabled.
This also causes lockdep to complain about:
[    0.649797] [ BUG: Invalid wait context ]
because aspeed_gpio.lock (spin_lock_t) is taken under irq_desc.lock
(raw_spinlock_t).
Let's use of raw_spinlock_t instead of spinlock_t.

Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-10 16:14:40 +01:00
Bartosz Golaszewski
9dbd1ab205 gpiolib: check the 'ngpios' property in core gpiolib code
Several drivers read the 'ngpios' device property on their own, but
since it's defined as a standard GPIO property in the device tree bindings
anyway, it's a good candidate for generalization. If the driver didn't
set its gc->ngpio, try to read the 'ngpios' property from the GPIO
device's firmware node before bailing out.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2021-12-06 16:02:17 +01:00
Bartosz Golaszewski
e5ab49cd3d gpiolib: improve coding style for local variables
Drop unneeded whitespaces and put the variables of the same type
together for consistency with the rest of the code.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2021-12-06 15:58:46 +01:00
Rob Herring
e320d9c2e9 gpio: xlp: Fix build errors from Netlogic XLP removal
Commit ea708ac5bf ("gpio: xlp: Remove Netlogic XLP variants") has
build errors with CONFIG_ACPI:

drivers/gpio/gpio-xlp.c:300:23: error: 'GPIO_VARIANT_VULCAN' undeclared here (not in a function)

and !CONFIG_OF:

drivers/gpio/gpio-xlp.c:267:11: error: 'struct gpio_chip' has no member named 'of_node'

Fix these errors.

Fixes: ea708ac5bf ("gpio: xlp: Remove Netlogic XLP variants")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-03 16:00:40 +01:00
John Keeping
adc8b4bf2a gpio: rockchip: lock GPIOs used as interrupts
Use the standard gpiochip request/release resource functions so that any
GPIOs used as interrupts are properly locked.  This allows libgpiod to
correctly show these GPIOs as in-use.

Signed-off-by: John Keeping <john@metanate.com>
Tested-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-03 15:59:10 +01:00
Geert Uytterhoeven
a00128dfc8 gpio: aggregator: Add interrupt support
Currently the GPIO Aggregator does not support interrupts.  This means
that kernel drivers going from a GPIO to an IRQ using gpiod_to_irq(),
and userspace applications using line events do not work.

Add interrupt support by providing a gpio_chip.to_irq() callback, which
just calls into the parent GPIO controller.

Note that this does not implement full interrupt controller (irq_chip)
support, so using e.g. gpio-keys with "interrupts" instead of "gpios"
still does not work.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-03 15:54:31 +01:00
Geert Uytterhoeven
49fdfe6640 gpiolib: Let gpiod_add_lookup_table() call gpiod_add_lookup_tables()
This saves 20 bytes on arm32, and 44 bytes on arm64.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-03 15:47:16 +01:00
Andy Shevchenko
e1610431b9 gpio: dwapb: clarify usage of the register file version
First of all, it's obvious that different versions can't be provided
simultaneously. Hence, versions can't be bit masks.

Second, due to above we have to mask out the version field in the flags
and only that can be evaluated against the certain version.

Clarify all above by:
 - introducing GPIO_REG_OFFSET_V1 and GPIO_REG_OFFSET_MASK
 - replacing conditional to mask out bits and compare to a version

Luckily there is no functional change, so no need to backport this.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Serge Semin <fancer.lancer@gmail.com>
Reviewed-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-01 15:13:05 +02:00
Bjorn Helgaas
7bc14ff295 gpio: ml-ioh: Change whitespace to match gpio-pch.c
The ML IOH driver is very similar to the PCH driver.  To make it more
similar, tweak the whitespace in ioh_gpio_direction_output() and
ioh_gpio_direction_input().  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2021-12-01 15:10:26 +02:00