aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpio
AgeCommit message (Collapse)AuthorFilesLines
2019-11-08gpio: xgs-iproc: Fix platform_no_drv_owner.cocci warningsYueHaibing1-1/+0
Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: YueHaibing <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-11-08Merge branch 'devel' into for-nextLinus Walleij73-373/+1200
2019-11-08Revert "gpio: expose pull-up/pull-down line flags to userspace"Linus Walleij1-12/+0
This reverts commit 8c550e94b8835170593169a45b5ba30d3fc72a70. This was prematurely applied and we need to back it out to merge a better version of the development track for this feature. Signed-off-by: Linus Walleij <[email protected]>
2019-11-07gpiolib: No need to call gpiochip_remove_pin_ranges() twiceAndy Shevchenko2-5/+3
of_gpiochip_add(), when fails, calls gpiochip_remove_pin_ranges(). ADD: gpiochip_add_data_with_key() -> of_gpiochip_add() -> (ERROR path) gpiochip_remove_pin_ranges() At the same time of_gpiochip_remove() calls exactly the above mentioned function unconditionally and so does gpiochip_remove(). REMOVE: gpiochip_remove() -> gpiochip_remove_pin_ranges() of_gpiochip_remove() -> gpiochip_remove_pin_ranges() Since gpiochip_remove() calls gpiochip_remove_pin_ranges() unconditionally, we have duplicate call to the same function when it's not necessary. Move gpiochip_remove_pin_ranges() from of_gpiochip_add() to gpiochip_add() to avoid duplicate calls and be consistent with the explicit call in gpiochip_remove(). Fixes: e93fa3f24353 ("gpiolib: remove duplicate pin range code") Depends-on: f7299d441a4d ("gpio: of: Fix of_gpiochip_add() error path") Cc: Geert Uytterhoeven <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-11-07gpio: Use new GPIO_LINE_DIRECTIONMatti Vaittinen60-102/+211
It's hard for occasional GPIO code reader/writer to know if values 0/1 equal to IN or OUT. Use defined GPIO_LINE_DIRECTION_IN and GPIO_LINE_DIRECTION_OUT to help them out. NOTE - for gpio-amd-fch and gpio-bd9571mwv: This commit also changes the return value for direction get to equal 1 for direction INPUT. Prior this commit these drivers might have returned some other positive value but 1 for INPUT. Signed-off-by: Matti Vaittinen <[email protected]> Acked-by: Scott Branden <[email protected]> Reviewed-by: Grygorii Strashko <[email protected]> Reviewed-by: Michal Simek <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Acked-by: Andy Shevchenko <[email protected]> Acked-by: William Breathitt Gray <[email protected]> Acked-by: Kuppuswamy Sathyanarayanan <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-11-07gpio: xgs-iproc: Fix section mismatch on device tree match tableMark Brown1-1/+1
The table of devicetree identifiers is annotated as __initconst indicating that it can be discarded after kernel boot but it is referenced from the driver struct which has no init annotation leading to a linker warning: WARNING: vmlinux.o(.data+0x82d58): Section mismatch in reference from the variable bcm_iproc_gpio_driver to the variable .init.rodata:bcm_iproc_gpio_of_match The variable bcm_iproc_gpio_driver references the variable __initconst bcm_iproc_gpio_of_match Since drivers can be probed after init the lack of annotation on the driver struct is correct so remove the annotation from the match table. Fixes: 6a41b6c5fc20 ("gpio: Add xgs-iproc driver") Signed-off-by: Mark Brown <[email protected]> Reviewed-by: Chris Packham <[email protected]> Reviewed-by: Yoshihiro Shimoda <[email protected]> Tested-by: Yoshihiro Shimoda <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-11-05gpio: tegra186: use devm_platform_ioremap_resource_byname()Bartosz Golaszewski1-3/+1
Use the devm_platform_ioremap_resource_byname() helper instead of calling platform_get_resource_byname() and devm_ioremap_resource() separately. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Acked-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-11-05gpio: mvebu: use devm_platform_ioremap_resource_byname()Bartosz Golaszewski1-12/+7
Use devm_platform_ioremap_resource_byname() instead of calling platform_get_resource_byname() and devm_ioremap_resource() separately. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Acked-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-11-05gpiolib: Switch order of valid mask and hw initLinus Walleij1-2/+2
The GPIO irqchip needs to initialize the valid mask before initializing the IRQ hardware, because sometimes the latter require the former to be executed first. Cc: Andy Shevchenko <[email protected]> Cc: Mika Westerberg <[email protected]> Reported-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Hans de Goede <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-11-05Merge tag 'v5.4-rc6' into develLinus Walleij7-26/+66
Linux 5.4-rc6
2019-11-03Revert "gpio: merrifield: Pass irqchip when adding gpiochip"Linus Walleij1-16/+12
This reverts commit 8f86a5b4ad679e4836733b47414226074eee4e4d. It has been established that this causes a boot regression on both Baytrail and Cherrytrail SoCs, and we can't have that in the final kernel release, so we need to revert it. Reported-by: Hans de Goede <[email protected]> Acked-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-11-03Revert "gpio: merrifield: Restore use of irq_base"Linus Walleij1-1/+0
This reverts commit 6658f87f219427ee776c498e07c878eb5cad1be2. This revert is a prerequisite for the later revert of commit 8f86a5b4ad679e4836733b47414226074eee4e4d. Reported-by: Hans de Goede <[email protected]> Acked-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-11-03Revert "gpio: merrifield: Move hardware initialization to callback"Linus Walleij1-5/+3
This reverts commit 4c87540940cbc7ddbe9674087919c605fd5c2ef1. This revert is a prerequisite for the later revert of commit 8f86a5b4ad679e4836733b47414226074eee4e4d. Reported-by: Hans de Goede <[email protected]> Acked-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-11-03drivers: mcb: use symbol namespacesJohannes Thumshirn1-0/+1
Now that we have symbol namespaces, use them in MCB to not pollute the default namespace with MCB internals. Signed-off-by: Johannes Thumshirn <[email protected]> Reviewed-by: Jessica Yu <[email protected]> Reviewed-by: Michael Moese <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-11-01Merge tag 'mips_fixes_5.4_3' into mips-nextPaul Burton4-15/+27
Pull in mips-fixes primarily to gain build fixes in order to allow better testing of mips-next. A few MIPS fixes: - Fix VDSO time-related function behavior for systems where we need to fall back to syscalls, but were instead returning bogus results. - A fix to TLB exception handlers for Cavium Octeon systems where they would inadvertently clobber the $1/$at register. - A build fix for bcm63xx configurations. - Switch to using my @kernel.org email address. Signed-off-by: Paul Burton <[email protected]>
2019-10-31MIPS: Loongson64: Rename CPU TYPESJiaxun Yang2-2/+2
CPU_LOONGSON2 -> CPU_LOONGSON2EF CPU_LOONGSON3 -> CPU_LOONGSON64 As newer loongson-2 products (2G/2H/2K1000) can share kernel implementation with loongson-3 while 2E/2F are less similar with other LOONGSON64 products. Signed-off-by: Jiaxun Yang <[email protected]> Signed-off-by: Paul Burton <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected]
2019-10-29gpio: Add xgs-iproc driverChris Packham3-0/+331
This driver supports the Chip Common A GPIO controller present on a number of Broadcom switch ASICs with integrated SoCs. The controller is similar to the pinctrl-nsp-gpio and pinctrl-iproc-gpio blocks but different enough that a separate driver is required. This has been ported from Broadcom's XLDK 5.0.3 retaining only the CCA support (pinctrl-iproc-gpio covers CCB). Signed-off-by: Chris Packham <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Scott Branden <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-10-29gpio: Add RDA Micro GPIO controller supportManivannan Sadhasivam3-0/+304
Add support for GPIO controller from RDA Micro. This GPIO controller is an in house IP, developed by RDA Micro (now Unisoc) for the use in RDA88* series of SoCs. There are multiple GPIO ports present in all SoCs, each capable of addressing 32 GPIOs. But only first 8 pins have the interrupt capability. Signed-off-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-10-23Merge tag 'gpio-v5.5-updates-for-linus-part-1' of ↵Linus Walleij8-94/+63
git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel gpio updates for v5.5 - only get the second IRQ when there is more than one IRQ in mxc - move the code around in lineevent_create() for some shrinkage - fix formatting for GPIO docs - add DT binding for r8a774b1 - convert drivers that prevously used nocache ioremap() to using regular devm_platform_ioremap_resource() - remove some redundant error messages - shrink object code in 104-idi-48e - drop an unneeded warning from gpiolib-of
2019-10-18gpio: of: don't warn if ignored GPIO flag matches the behaviorLucas Stach1-2/+4
Some devicetrees specify the ACTIVE_LOW flag in the fixed regulator GPIO handle. While this has always been ignored, it's consistent with the behavior of the regulator binding in the absence of the "enable-active-high" DT property. It doesn't make much sense to print a user visible warning for a configuration which is consistent, so only print the warning if the GPIO flag contradicts the behavior dictated by by the enable-active-high property. Signed-off-by: Lucas Stach <[email protected]> [Bartosz: coding style tweak] Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-10-16gpio/mpc8xxx: change irq handler from chained to normalSong Hui1-11/+19
More than one gpio controllers can share one interrupt, change the driver to request shared irq. While this will work, it will mess up userspace accounting of the number of interrupts per second in tools such as vmstat. The reason is that for every GPIO interrupt, /proc/interrupts records the count against GIC interrupt 68 or 69, as well as the GPIO itself. So, for every GPIO interrupt, the total number of interrupts that the system has seen increments by two. Signed-off-by: Laurentiu Tudor <[email protected]> Signed-off-by: Alex Marginean <[email protected]> Signed-off-by: Song Hui <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
2019-10-15gpio: lynxpoint: set default handler to be handle_bad_irq()Andy Shevchenko1-1/+1
We switch the default handler to be handle_bad_irq() instead of handle_simple_irq() (which was not correct anyway). Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-10-15gpio: merrifield: Move hardware initialization to callbackAndy Shevchenko1-3/+5
The driver wants to initialize related registers before IRQ chip will be added. That's why move it to a corresponding callback. It also fixes the NULL pointer dereference. Fixes: 8f86a5b4ad67 ("gpio: merrifield: Pass irqchip when adding gpiochip") Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-10-15gpio: lynxpoint: Move hardware initialization to callbackAndy Shevchenko1-3/+5
The driver wants to initialize related registers before IRQ chip will be added. That's why move it to a corresponding callback. It also fixes the NULL pointer dereference. Fixes: 7b1e889436a1 ("gpio: lynxpoint: Pass irqchip when adding gpiochip") Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-10-15gpio: intel-mid: Move hardware initialization to callbackAndy Shevchenko1-3/+6
The driver wants to initialize related registers before IRQ chip will be added. That's why move it to a corresponding callback. It also fixes the NULL pointer dereference. Fixes: 8069e69a9792 ("gpio: intel-mid: Pass irqchip when adding gpiochip") Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-10-15gpiolib: Initialize the hardware with a callbackAndy Shevchenko1-1/+21
After changing the drivers to use GPIO core to add an IRQ chip it appears that some of them requires a hardware initialization before adding the IRQ chip. Add an optional callback ->init_hw() to allow that drivers to initialize hardware if needed. This change is a part of the fix NULL pointer dereference brought to the several drivers recently. Cc: Hans de Goede <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-10-15gpio: merrifield: Restore use of irq_baseAndy Shevchenko1-0/+1
During conversion to internal IRQ chip initialization the commit 8f86a5b4ad67 ("gpio: merrifield: Pass irqchip when adding gpiochip") lost the irq_base assignment. drivers/gpio/gpio-merrifield.c: In function ‘mrfld_gpio_probe’: drivers/gpio/gpio-merrifield.c:405:17: warning: variable ‘irq_base’ set but not used [-Wunused-but-set-variable] Assign the girq->first to it. Fixes: 8f86a5b4ad67 ("gpio: merrifield: Pass irqchip when adding gpiochip") Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-10-09gpio: 104-idi-48e: make array register_offset static, makes object smallerColin Ian King1-1/+1
Don't populate the array register_offset on the stack but instead make it static. Makes the object code smaller by 63 bytes. Also add the int type specifier to clean up a checkpatch warning. Before: text data bss dec hex filename 9212 5712 1408 16332 3fcc drivers/gpio/gpio-104-idi-48.o After: text data bss dec hex filename 9085 5776 1408 16269 3f8d drivers/gpio/gpio-104-idi-48.o (gcc version 9.2.1, amd64) Signed-off-by: Colin Ian King <[email protected]> Acked-by: William Breathitt Gray <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-10-09gpio: htc-egpio: remove redundant error messageBartosz Golaszewski1-17/+11
There's no need to emit an error message on probe failure unless we're printing some meaningful info. Otherwise the core driver code will inform us about a probe error. Also: the driver currently drops info about errors propagated from called functions by default to returning -EINVAL. This fixes it as well. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]>
2019-10-09gpio: htc-egpio: use devm_platform_ioremap_resource()Bartosz Golaszewski1-7/+2
There's no need to use the nocache variant of ioremap(). Switch to using devm_platform_ioremap_resource(). Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]>
2019-10-09gpio: ath79: use devm_platform_ioremap_resource()Bartosz Golaszewski1-7/+3
There's no need to use the nocache variant of ioremap(). Switch to using devm_platform_ioremap_resource(). Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]>
2019-10-09gpio: em: use devm_platform_ioremap_resource()Bartosz Golaszewski1-12/+8
There's no need to use the nocache variant of ioremap(). Switch to using devm_platform_ioremap_resource(). Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]>
2019-10-09gpio: xgene: use devm_platform_ioremap_resource()Bartosz Golaszewski1-9/+3
There's no need to use the nocache variant of ioremap(). Switch to using devm_platform_ioremap_resource(). Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]>
2019-10-09gpio: xgene: remove redundant error messageBartosz Golaszewski1-16/+7
There's no need to emit an error message on probe failure unless we're printing some meaningful info. Otherwise the core driver code will inform us about a probe error. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]>
2019-10-09docs: driver-api: Move bt8xxgpio to the gpio directoryJonathan Neuschäfer1-1/+1
Let's declutter Documentation/driver-api a bit. Signed-off-by: Jonathan Neuschäfer <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
2019-10-09gpio: fix kernel-doc for of_gpio_need_valid_mask()Randy Dunlap1-2/+3
Fix kernel-doc for of_gpio_need_valid_mask(). Fixes this warning and uses correct Return: format. ../drivers/gpio/gpiolib-of.c:92: warning: Excess function parameter 'dev' description in 'of_gpio_need_valid_mask' Fixes: f626d6dfb709 ("gpio: of: Break out OF-only code") Signed-off-by: Randy Dunlap <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Bartosz Golaszewski <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
2019-10-05gpio: expose pull-up/pull-down line flags to userspaceDrew Fustini1-0/+12
Add pull-up/pull-down flags to the gpio line get and set ioctl() calls. Use cases include a push button that does not have an external resistor. Addition use cases described by Limor Fried (ladyada) of Adafruit in this PR for Adafruit_Blinka Python lib: https://github.com/adafruit/Adafruit_Blinka/pull/59 Signed-off-by: Drew Fustini <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
2019-10-05gpio: tegra186: Implement wake event supportThierry Reding2-18/+80
The GPIO controller doesn't have any controls to enable the system to wake up from low power states based on activity on GPIO pins. An extra hardware block that is part of the power management controller (PMC) contains these controls. In order for the GPIO controller to be able to cooperate with the PMC, obtain a reference to the PMC's IRQ domain and make it a parent to the GPIO controller's IRQ domain. This way the PMC gets an opportunity to program the additional registers required to enable wakeup sources on suspend. Based on additional work by Bitan Biswas <[email protected]>. Signed-off-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
2019-10-05gpio: max77620: Fix interrupt handlingTimo Alho1-114/+117
The interrupt-related register fields on the MAX77620 GPIO controller share registers with GPIO related fields. If the IRQ chip is implemented with regmap-irq, this causes the IRQ controller code to overwrite fields previously configured by the GPIO controller code. Two examples where this causes problems are the NVIDIA Jetson TX1 and Jetson TX2 boards, where some of the GPIOs are used to enable vital power regulators. The MAX77620 GPIO controller also provides the USB OTG ID pin. If configured as an interrupt, this causes some of the regulators to be powered off. Signed-off-by: Timo Alho <[email protected]> Signed-off-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
2019-10-04gpio: max77620: Do not allocate IRQs upfrontThierry Reding1-1/+1
regmap_add_irq_chip() will try to allocate all of the IRQ descriptors upfront if passed a non-zero irq_base parameter. However, the intention is to allocate IRQ descriptors on an as-needed basis if possible. Pass 0 instead of -1 to fix that use-case. Signed-off-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
2019-10-04gpio: max77620: Use correct unit for debounce timesThierry Reding1-3/+3
The gpiod_set_debounce() function takes the debounce time in microseconds. Adjust the switch/case values in the MAX77620 GPIO to use the correct unit. Signed-off-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
2019-10-03Merge branch 'ib-fwnode-gpiod-get-index' into develLinus Walleij2-24/+57
2019-10-03gpiolib: introduce fwnode_gpiod_get_index()Dmitry Torokhov2-15/+49
This introduces fwnode_gpiod_get_index() that iterates through common gpio suffixes when trying to locate a GPIO within a given firmware node. We also switch devm_fwnode_gpiod_get_index() to call fwnode_gpiod_get_index() instead of iterating through GPIO suffixes on its own. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Mika Westerberg <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-10-03gpiolib: introduce devm_fwnode_gpiod_get_index()Dmitry Torokhov1-10/+9
devm_fwnode_get_index_gpiod_from_child() is too long, besides the fwnode in question does not have to be a child of device node. Let's rename it to devm_fwnode_gpiod_get_index() and keep the old name for compatibility for now. Also let's add a devm_fwnode_gpiod_get() wrapper as majority of the callers need a single GPIO. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
2019-10-01gpiolib: sanitize flags before allocating memory in lineevent_create()Bartosz Golaszewski1-24/+18
Move all the flags sanitization before any memory allocation in lineevent_create() in order to remove a couple unneeded gotos. Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-10-01gpio: eic: sprd: Fix the incorrect EIC offset when togglingBruce Chen1-3/+4
When toggling the level trigger to emulate the edge trigger, the EIC offset is incorrect without adding the corresponding bank index, thus fix it. Fixes: 7bf0d7f62282 ("gpio: eic: Add edge trigger emulation for EIC") Cc: [email protected] Signed-off-by: Bruce Chen <[email protected]> Signed-off-by: Baolin Wang <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-10-01gpio: fix getting nonexclusive gpiods from DTMarco Felsch1-1/+1
Since commit ec757001c818 ("gpio: Enable nonexclusive gpiods from DT nodes") we are able to get GPIOD_FLAGS_BIT_NONEXCLUSIVE marked gpios. Currently the gpiolib uses the wrong flags variable for the check. We need to check the gpiod_flags instead of the of_gpio_flags else we return -EBUSY for GPIOD_FLAGS_BIT_NONEXCLUSIVE marked and requested gpiod's. Fixes: ec757001c818 gpio: Enable nonexclusive gpiods from DT nodes Cc: [email protected] Signed-off-by: Marco Felsch <[email protected]> [Bartosz: the function was moved to gpiolib-of.c so updated the patch] Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-10-01gpiolib: don't clear FLAG_IS_OUT when emulating open-drain/open-sourceBartosz Golaszewski1-8/+19
When emulating open-drain/open-source by not actively driving the output lines - we're simply changing their mode to input. This is wrong as it will then make it impossible to change the value of such line - it's now considered to actually be in input mode. If we want to still use the direction_input() callback for simplicity then we need to set FLAG_IS_OUT manually in gpiod_direction_output() and not clear it in gpio_set_open_drain_value_commit() and gpio_set_open_source_value_commit(). Fixes: c663e5f56737 ("gpio: support native single-ended hardware drivers") Cc: [email protected] Reported-by: Kent Gibson <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-10-01gpio: mxc: Only get the second IRQ when there is more than one IRQAnson Huang1-3/+10
On some of i.MX SoCs like i.MX8QXP, there is ONLY one IRQ for each GPIO bank, so it is better to check the IRQ count before getting second IRQ to avoid below error message during probe: [ 1.070908] gpio-mxc 5d080000.gpio: IRQ index 1 not found [ 1.077420] gpio-mxc 5d090000.gpio: IRQ index 1 not found [ 1.083766] gpio-mxc 5d0a0000.gpio: IRQ index 1 not found [ 1.090122] gpio-mxc 5d0b0000.gpio: IRQ index 1 not found [ 1.096470] gpio-mxc 5d0c0000.gpio: IRQ index 1 not found [ 1.102804] gpio-mxc 5d0d0000.gpio: IRQ index 1 not found [ 1.109144] gpio-mxc 5d0e0000.gpio: IRQ index 1 not found [ 1.115475] gpio-mxc 5d0f0000.gpio: IRQ index 1 not found Signed-off-by: Anson Huang <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-09-30gpio: aspeed-sgpio: Rename and add Kconfig/MakefileLinus Walleij3-0/+9
This renames the "gpio-aspeed" driver to conform with other GPIO drivers as "gpio-aspeed-sgpio.c". All GPIO drivers should start with the string "gpio-" no special exceptions. Also the Kconfig and Makefile entries should normally go with the driver but I missed this in my review, sorry for mistake. "CONFIG_GPIO_ASPEED_SGPIO" is used to activate this driver. Cc: Hongwei Zhang <[email protected]> Fixes: 7db47faae79b ("gpio: aspeed: Add SGPIO driver") Signed-off-by: Linus Walleij <[email protected]> Acked-by: Andrew Jeffery <[email protected]> Link: https://lore.kernel.org/r/[email protected]