aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-11-21gpio/mpc8xxx: fix qoriq GPIO readingRussell King1-0/+3
Qoriq requires the IBE register to be set to enable GPIO inputs to be read. Set it. Signed-off-by: Russell King <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
2019-11-21gpio: mpc8xxx: Don't overwrite default irq_set_type callbackVladimir Oltean1-1/+2
The per-SoC devtype structures can contain their own callbacks that overwrite mpc8xxx_gpio_devtype_default. The clear intention is that mpc8xxx_irq_set_type is used in case the SoC does not specify a more specific callback. But what happens is that if the SoC doesn't specify one, its .irq_set_type is de-facto NULL, and this overwrites mpc8xxx_irq_set_type to a no-op. This means that the following SoCs are affected: - fsl,mpc8572-gpio - fsl,ls1028a-gpio - fsl,ls1088a-gpio On these boards, the irq_set_type does exactly nothing, and the GPIO controller keeps its GPICR register in the hardware-default state. On the LS1028A, that is ACTIVE_BOTH, which means 2 interrupts are raised even if the IRQ client requests LEVEL_HIGH. Another implication is that the IRQs are not checked (e.g. level-triggered interrupts are not rejected, although they are not supported). Fixes: 82e39b0d8566 ("gpio: mpc8xxx: handle differences between incarnations at a single place") Signed-off-by: Vladimir Oltean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Tested-by: Michael Walle <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-11-15gpiolib: acpi: Print pin number on acpi_gpiochip_alloc_event errorsHans de Goede1-3/+9
Print pin number and error-code on acpi_gpiochip_alloc_event errors, to help debugging these. Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Mika Westerberg <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-11-13gpiolib: fix coding style in gpiod_hog()Bartosz Golaszewski1-3/+3
There should be spaces between logical operators and their operands. Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-11-13Merge tag 'intel-gpio-v5.5-1' of ↵Linus Walleij3-30/+61
git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel into devel intel-gpio for v5.5-1 * Prerequisite patch against GPIO library to register pin ranges in time. * Second attempt to fix Intel Merrifield GPIO driver to utilize irqchip. The following is an automated git shortlog grouped by driver: gpiolib: - Introduce ->add_pin_ranges() callback merrifield: - Pass irqchip when adding gpiochip - Add GPIO <-> pin mapping ranges via callback
2019-11-13Merge tag 'gpio-v5.5-updates-for-linus-part-2' of ↵Linus Walleij81-1006/+1984
git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel gpio: updates for v5.5 - add MODULE_ALIAS() for bd70528 (makes it possible to autoload the module from user-space) - use proper irc_chip names in gpio-em and gpio-rcar - expose the line bias settings to user-space in the form of new request flags - expose a new ioctl() to user-space which allows to change certain proprties of requested lines without releasing them first - various updates for gpio-tegra186: debounce support, code simplification and interrupt routing - use platform_get_irq() in gpio-em for some code shrinkage - remove leftovers after recent gpio-mmio changes
2019-11-13drm/bridge: ti-tfp410: switch to using fwnode_gpiod_get_index()Dmitry Torokhov1-2/+2
Instead of fwnode_get_named_gpiod() that I plan to hide away, let's use the new fwnode_gpiod_get_index() that mimics gpiod_get_index(), but works with arbitrary firmware node. Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]> Acked-by: Daniel Vetter <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-11-13gpio: merrifield: Pass irqchip when adding gpiochipAndy Shevchenko1-13/+19
We need to convert all old gpio irqchips to pass the irqchip setup along when adding the gpio_chip. For more info see drivers/gpio/TODO. For chained irqchips this is a pretty straight-forward conversion. Cc: Andy Shevchenko <[email protected]> Cc: Mika Westerberg <[email protected]> Cc: Thierry Reding <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Hans de Goede <[email protected]>
2019-11-13gpio: merrifield: Add GPIO <-> pin mapping ranges via callbackAndy Shevchenko1-17/+25
When IRQ chip is instantiated via GPIO library flow, the few functions, in particular the ACPI event registration mechanism, on some of ACPI based platforms expect that the pin ranges are initialized to that point. Add GPIO <-> pin mapping ranges via callback in the GPIO library flow. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2019-11-13gpiolib: Introduce ->add_pin_ranges() callbackAndy Shevchenko2-0/+17
When IRQ chip is being added by GPIO library, the ACPI based platform expects GPIO <-> pin mapping ranges to be initialized in order to correctly initialize ACPI event mechanism on affected platforms. Unfortunately this step is missed. Introduce ->add_pin_ranges() callback to fill the above mentioned gap. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Tested-by: Hans de Goede <[email protected]>
2019-11-13gpio: mmio: remove untrue leftover commentMatti Vaittinen1-1/+0
The comment should have been removed when new GPIO direction definitions were taken in use as the function logic was changed. It is now perfectly valid and Ok to hit the return from the bottom of the direction getting function. Signed-off-by: Matti Vaittinen <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-11-13gpio: em: Use platform_get_irq() to obtain interruptsGeert Uytterhoeven1-12/+9
Use the platform_get_irq() helper instead of handling resources directly. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-11-12gpio: tegra186: Add debounce supportThierry Reding1-0/+38
The GPIO controller found on Tegra186 and later supports debouncing for inputs for up to 255 ms. Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-11-12gpio: tegra186: Program interrupt route mappingThierry Reding1-0/+46
The controls for the GG port on Tegra194 resides in the power partition of the C5 PCIe controller and its interrupt route mapping can therefore not be programmed by early boot firmware along with that of the other ports. Detect this generically by looking at which controls have already been locked down using the security registers and fill in default values for controls that are unlocked. Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-11-12gpio: tegra186: Derive register offsets from bank/portThierry Reding1-95/+100
The register offsets for a given bank and port can be easily derived from the bank and port indices. Update the port descriptors to list only the bank and port numbers to simplify this. Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-11-12gpio: add new SET_CONFIG ioctl() to gpio chardevKent Gibson2-0/+87
Add the GPIOHANDLE_SET_CONFIG_IOCTL to the gpio chardev. The ioctl allows some of the configuration of a requested handle to be changed without having to release the line. The primary use case is the changing of direction for bi-directional lines. Based on initial work by Bartosz Golaszewski <[email protected]> Signed-off-by: Kent Gibson <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-11-12gpiolib: move validation of line handle flags into helper functionKent Gibson1-42/+51
Move validation of line handle flags into helper function. This reduces the size and complexity of linehandle_create and allows the validation to be reused elsewhere. Signed-off-by: Kent Gibson <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-11-12gpio: mockup: add set_config to support pull up/downKent Gibson1-34/+60
Add support for the pull up/down state set via gpiolib line requests to be reflected in the state of the mockup. Use case is for testing of the GPIO uAPI, specifically the pull up/down flags. Signed-off-by: Kent Gibson <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-11-12gpiolib: add support for biasing output linesKent Gibson1-2/+6
Allow pull up/down bias to be set on output lines. Use case is for open source or open drain applications where internal pull up/down may conflict with external biasing. Signed-off-by: Kent Gibson <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-11-12gpiolib: add support for disabling line biasKent Gibson3-10/+54
Allow pull up/down bias to be disabled, allowing the line to float or to be biased only by external circuitry. Use case is for where the bias has been applied previously, either by default or by the user, but that setting may conflict with the current use of the line. Signed-off-by: Kent Gibson <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-11-12gpiolib: add support for pull up/down to lineevent_createKent Gibson1-0/+4
Add support for pull up/down to lineevent_create. Use cases include receiving asynchronous presses from a push button without an external pull up/down. Signed-off-by: Kent Gibson <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-11-12gpio: expose pull-up/pull-down line flags to userspaceDrew Fustini2-0/+22
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]> [Kent: added BIAS to GPIO flag names and restrict application to input lines] Signed-off-by: Kent Gibson <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-11-12gpio: rcar: Use proper irq_chip nameGeert Uytterhoeven1-1/+1
The irq_chip .name field should contain the device's class name, not the instance's name. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-11-12gpio: em: Use proper irq_chip nameGeert Uytterhoeven1-1/+1
The irq_chip .name field should contain the device's class name, not the instance's name. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-11-12gpio: bd70528: Add MODULE ALIAS to autoload moduleMatti Vaittinen1-0/+1
The bd70528 GPIO driver is probed by MFD driver. Add MODULE_ALIAS in order to allow udev to load the module when MFD sub-device cell for GPIO is added. Signed-off-by: Matti Vaittinen <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-11-12Merge remote-tracking branch 'driver-core/driver-core-next' into gpio/for-nextBartosz Golaszewski71-807/+1506
2019-11-12Merge remote-tracking branch 'linusw/for-next' into gpio/for-nextBartosz Golaszewski80-329/+1334
2019-11-09net: caif: Fix debugfs on 64-bit platformsGeert Uytterhoeven1-2/+2
"ser_device.state" is "unsigned long", i.e. 32-bit or 64-bit, depending on the platform. Hence casting its address to "u32 *", and calling debugfs_create_x32() breaks operation on 64-bit platforms. Fix this by using the new debugfs_create_xul() helper instead. Fixes: 9b27105b4a44c54b ("net-caif-driver: add CAIF serial driver (ldisc)") Signed-off-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-11-09mac80211: Use debugfs_create_xul() helperGeert Uytterhoeven1-14/+3
Use the new debugfs_create_xul() helper instead of open-coding the same operation. Signed-off-by: Geert Uytterhoeven <[email protected]> Acked-by: Johannes Berg <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-11-09media: c8sectpfe: no need to check return value of debugfs_create functionsGreg Kroah-Hartman1-23/+3
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Mauro Carvalho Chehab <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Reviewed-by: Patrice Chotard <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 Walleij739-4016/+7546
2019-11-08Revert "gpio: expose pull-up/pull-down line flags to userspace"Linus Walleij2-16/+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-07Merge tag 'v5.4-rc6' into gpio/for-nextBartosz Golaszewski1519-11656/+15199
Linux 5.4-rc6
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-07of: property: Add device link support for iommus, mboxes and io-channelsSaravana Kannan1-0/+6
Add support for creating device links out of more DT properties. Signed-off-by: Saravana Kannan <[email protected]> Reviewed-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-11-07of: property: Make it easy to add device links from DT propertiesSaravana Kannan1-15/+47
Add a DEFINE_SIMPLE_PROP macro to make it easy to add support for simple properties with fixed names that just list phandles and phandle args. Add a DEFINE_SUFFIX_PROP macro to make it easy to add support for properties with fixes suffix that just list phandles and phandle args. Signed-off-by: Saravana Kannan <[email protected]> Reviewed-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-11-07of: property: Minor style clean up of of_link_to_phandle()Saravana Kannan1-2/+8
Adding a debug log instead of silently ignoring a phandle for an early device. Also, return the right error code instead of 0 even though the actual execution flow won't change. Signed-off-by: Saravana Kannan <[email protected]> Reviewed-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[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: Add definition for GPIO directionMatti Vaittinen1-0/+3
At least for me it is difficult to remember the meaning of GPIO direction values. Define GPIO_LINE_DIRECTION_IN and GPIO_LINE_DIRECTION_OUT so that occasional GPIO contributors would not need to always check the meaning of hard coded values 1 and 0. Signed-off-by: Matti Vaittinen <[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-05drivers: provide devm_platform_ioremap_resource_byname()Bartosz Golaszewski3-0/+24
Provide a variant of devm_platform_ioremap_resource() that allows to lookup resources from platform devices by name rather than by index. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-11-05misc: sram: use devm_platform_ioremap_resource_wc()Bartosz Golaszewski1-20/+8
Use the new devm_platform_ioremap_resource_wc() helper instead of devm_ioremap_wc() combinded with a call to platform_get_resource(). Also use devm_platform_ioremap_resource() where applicable. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-11-05drivers: platform: provide devm_platform_ioremap_resource_wc()Bartosz Golaszewski3-1/+22
Provide a write-combined variant of devm_platform_ioremap_resource(). Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-11-05lib: devres: provide devm_ioremap_resource_wc()Bartosz Golaszewski3-0/+18
Provide a variant of devm_ioremap_resource() for write-combined ioremap. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-11-05lib: devres: prepare devm_ioremap_resource() for more variantsBartosz Golaszewski1-20/+27
We want to add the write-combined variant of devm_ioremap_resource(). Let's first implement __devm_ioremap_resource() which takes an additional argument type. The types are the same as for __devm_ioremap(). The existing devm_ioremap_resource() now simply calls __devm_ioremap_resource() with regular DEVM_IOREMAP type. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-11-05Documentation: devres: add missing entry for devm_platform_ioremap_resource()Bartosz Golaszewski1-0/+1
devm_platform_ioremap_resource() should be documented in devres.rst. Add the missing entry. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Arnd Bergmann <[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]>