- 11 9月, 2018 1 次提交
-
-
由 Linus Walleij 提交于
The SPI chipselects are assumed to be active low in the current binding, so when we want to use GPIO descriptors and handle the active low/high semantics in gpiolib, we need a special parsing quirk to deal with this. We check for the property "spi-cs-high" and if that is NOT present we assume the CS line is active low. If the line is tagged as active low in the device tree and has no "spi-cs-high" property all is fine, the device tree and the SPI bindings are in agreement. If the line is tagged as active high in the device tree with the second cell flag and has no "spi-cs-high" property we enforce active low semantics (as this is the exception we can just tag on the flag). If the line is tagged as active low with the second cell flag AND tagged with "spi-cs-high" the SPI active high property takes precedence and we print a warning. Cc: Mark Brown <broonie@kernel.org> Cc: linux-spi@vger.kernel.org Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 10 9月, 2018 16 次提交
-
-
由 Hans Verkuil 提交于
Since this driver does not use the gpiolib irqchip helpers it will have to allocate the irq resources and irq_en/disable itself. Use the new gpiochip_req/relres_irq helpers to request/release all the resources. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Cc: Ray Jui <rjui@broadcom.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Hans Verkuil 提交于
Document these new functions. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Hans Verkuil 提交于
When using the gpiolib irqchip helpers install irq_enable/disable hooks for the irqchip to ensure that gpiolib knows when the irq is enabled or disabled, allowing drivers to disable the irq and then use it as an output pin, and later switch the direction to input and re-enable the irq. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Hans Verkuil 提交于
GPIO drivers call gpiochip_(un)lock_as_irq whenever they want to use a gpio as an interrupt. This is done when the irq is requested and it marks the gpio as in use by an interrupt. This is problematic for cases where a gpio pin is used as an interrupt pin, then, after the irq is disabled, is used as a regular gpio pin. Currently it is not possible to do this other than by first freeing the interrupt so gpiochip_unlock_as_irq is called, since an attempt to switch the gpio direction for output will fail since gpiolib believes that the gpio is in use for an interrupt and it does not know that it the irq is actually disabled. There are currently two drivers that would like to be able to do this: the tda998x_drv.c driver where a regular gpio pin needs to be temporarily reconfigured as an interrupt pin during CEC calibration, and the cec-gpio driver where you want to configure the gpio pin as an interrupt while waiting for traffic over the CEC bus, or as a regular pin when receiving or transmitting a CEC message. The solution is to add a new flag that is set when the irq is enabled, and have gpiod_direction_output check for that flag. We also add functions that drivers that do not use GPIOLIB_IRQCHIP can call when they enable/disable the irq. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Hans Verkuil 提交于
Centralize setting the irq_request/release_resources callbacks in one function since we'll be adding more callbacks to that. Also fix the removal of the callback overrides: this should only be done if we actually installed our own callback there. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Hans Verkuil 提交于
GPIO drivers that do not use GPIOLIB_IRQCHIP can hook these into the irq_request_resource and irq_release_resource callbacks of the irq_chip so they correctly 'get' the module and lock the gpio line for IRQ use. This will simplify driver code. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Dan Carpenter 提交于
The problem is that if port == ARRAY_SIZE() and "gc == &epg->gc[port]" then that should be treated as invalid. Fixes: fd935fc4 ("gpio: ep93xx: Do not pingpong irq numbers") Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Colin Ian King 提交于
Currently the while loop checks for the end of the array using the size of egp->gc rather that the number of elements in the array, so fix this. Also, perform the array size check first as stylistically it is always good to bounds check on an array first before referencing the array (in this case, we're just computing the address of an element in an array so this is a moot point). Fixes: fd935fc4 ("gpio: ep93xx: Do not pingpong irq numbers") Signed-off-by: NColin Ian King <colin.king@canonical.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Randy Dunlap 提交于
Fix kernel-doc warning for missing struct member 'request_key': ../include/linux/gpio/driver.h:142: warning: Function parameter or member 'request_key' not described in 'gpio_irq_chip' Fixes: 39c3fd58 ("kernel/irq: Extend lockdep class for request mutex") Signed-off-by: NRandy Dunlap <rdunlap@infradead.org> Cc: Andrew Lunn <andrew@lunn.ch> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: linux-gpio@vger.kernel.org Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
The gpiolib cannot deduce the fact that every line is output by itself, implement a .get_direction() callback so we can inspect this. Acked-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
It's nice to use BIT() macros rather than open coding the same. It's good practice as sometimes people use BIT(31) and forget that the constant must be cast unsigned long. Acked-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
Use the SPDX header to indicate the license for this driver. Acked-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This is a GPIO driver so include only <linux/gpio/driver.h>. Acked-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
It's nice to be able to read back the direction of the GPIO line from the hardware so implement .get_direction() for twl4030. Acked-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
Use the SPDX header to indicate the license for this driver. Acked-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This is a GPIO driver so include only <linux/gpio/driver.h>. Acked-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 04 9月, 2018 7 次提交
-
-
由 Linus Walleij 提交于
This is a driver so include only <linux/gpio/driver.h>. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
The TS5500 GPIO driver apparently supports platform data without making any use of it whatsoever. Delete this code, last chance to speak up if you think it is needed. Cc: kernel@savoirfairelinux.com Cc: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Cc: Jerome Oufella <jerome.oufella@savoirfairelinux.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
Cut some boilerplate, use the SPDX license identifier. Cc: kernel@savoirfairelinux.com Cc: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Cc: Jerome Oufella <jerome.oufella@savoirfairelinux.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This is a GPIO driver so include only <linux/gpio/driver.h>. Cc: kernel@savoirfairelinux.com Cc: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Cc: Jerome Oufella <jerome.oufella@savoirfairelinux.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
The MXS driver was calling back into the GPIO API from its irqchip. This is not very elegant, as we are a driver, let's just shortcut back into the gpio_chip .get() function instead. This is a tricky case since the .get() callback is not in this file, instead assigned by bgpio_init(). Calling the function direcly in the gpio_chip is however the lesser evil. Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Janusz Uzycki <j.uzycki@elproma.com.pl> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
I'm tired of boilerplate, use the SPDX tag. Acked-by: NAndrew F. Davis <afd@ti.com> Reviewed-by: NKeerthy <j-keerthy@ti.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
These are drivers so include only <linux/gpio/driver.h>. Acked-by: NAndrew F. Davis <afd@ti.com> Reviewed-by: NKeerthy <j-keerthy@ti.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 31 8月, 2018 1 次提交
-
-
由 Andy Shevchenko 提交于
There are few Intel PMIC GPIO device drivers which I would like to review. Note, Intel MSIC is old system controller that based mostly on PMIC integrated in it. Thus, I included it as well. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 30 8月, 2018 3 次提交
-
-
由 Justin Chen 提交于
Sometimes we have empty banks within the GPIO block. This commit allows proper handling of 0 width GPIO banks. We handle 0 width GPIO banks by incrementing the bank and number of GPIOs, but not initializing them. This will mean a call into the non-existent GPIOs will return an error. Also remove "GPIO registered" dev print. This information is misleading since the incremented banks and gpio_base do not reflect the actual GPIOs that get initialized. We leave this information out since it is already printed with dev_dbg. Signed-off-by: NJustin Chen <justinpopo6@gmail.com> Acked-by: NFlorian Fainelli <f.fainelli@gmail.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
The FTGPIO010 has a debounce timer or rather prescaler that will affect interrupts fireing off the block. We can support this to get proper debounce on e.g. keypresses. Since the same prescaler is used across all GPIO lines of the silicon block, we need to bail out if the prescaler is already set and in use by another line. If the prescaler is already set to what we need, fine, we reuse it. This happens more often than not when the same debounce time is set for several GPIO keys, so we support that usecase easily with this code. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
The GPIO silicon is clocked with a PCLK (peripheral clock) on all systems, however not all platforms model it and include it in e.g. the device tree, so add clock handling but make it optional so we bail out safely if it is e.g. always on. Reviewed-by: NAndrew Lunn <andrew@lunn.ch> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 29 8月, 2018 12 次提交
-
-
由 Linus Walleij 提交于
-
由 Rob Herring 提交于
In preparation to remove the node name pointer from struct device_node, convert printf users to use the %pOFn format specifier. Cc: Linus Walleij <linus.walleij@linaro.org> Cc: linux-gpio@vger.kernel.org Signed-off-by: NRob Herring <robh@kernel.org> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Robert Jarzmik 提交于
In the corner case where the gpio driver probe fails, for whatever reason, the suspend and resume handlers will still be called as they have to be registered as syscore operations. This applies as well when no probe was called while the driver has been built in the kernel. Nicolas tracked this in : https://bugzilla.kernel.org/show_bug.cgi?id=200905 Therefore, add a failsafe in these function, and test if a proper probe succeeded and the driver is functional. Signed-off-by: NRobert Jarzmik <robert.jarzmik@free.fr> Reported-by: NNicolas Chauvet <kwizart@gmail.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Fabrizio Castro 提交于
Document Renesas' RZ/G2M (R8A774A1) GPIO blocks compatibility within the relevant dt-bindings. Signed-off-by: NFabrizio Castro <fabrizio.castro@bp.renesas.com> Reviewed-by: NBiju Das <biju.das@bp.renesas.com> Reviewed-by: NRob Herring <robh@kernel.org> Reviewed-by: NSimon Horman <horms+renesas@verge.net.au> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This is a GPIO driver so only include <linux/gpio/driver.h> Cc: Paul Cercueil <paul@crapouillou.net> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Paul Cercueil 提交于
The pinctrl-ingenic driver is now handling the GPIO chips directly. Signed-off-by: NPaul Cercueil <paul@crapouillou.net> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Paul Cercueil 提交于
Depending on MACH_INGENIC prevent us from creating a generic kernel that works on more than one MIPS board. Instead, we just depend on MIPS being set. Signed-off-by: NPaul Cercueil <paul@crapouillou.net> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Paul Cercueil 提交于
Add support for the JZ4725B and compatible SoCs from Ingenic. Signed-off-by: NPaul Cercueil <paul@crapouillou.net> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Paul Cercueil 提交于
This allows to read from debugfs whether the GPIOs requested are set as input or output. Signed-off-by: NPaul Cercueil <paul@crapouillou.net> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Paul Cercueil 提交于
Merge the code of the gpio-ingenic driver into the pinctrl-ingenic driver. The reason behind this, is that the same hardware block handles both pin config / muxing and GPIO. ingenic_gpio_probe() have been marked as __init, but for the most part, the code is the exact same as what it was in the gpio-ingenic driver. Signed-off-by: NPaul Cercueil <paul@crapouillou.net> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Paul Cercueil 提交于
By using platform_driver_probe() instead of platform_driver_register(), we can mark the ingenic_pinctrl_probe() function as __init. Signed-off-by: NPaul Cercueil <paul@crapouillou.net> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Paul Cercueil 提交于
Using postcore_initcall() makes the driver try to initialize way too early. Signed-off-by: NPaul Cercueil <paul@crapouillou.net> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-