aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-02-19gpio: mockup: add lockingBartosz Golaszewski1-7/+43
While no user reported any race condition problems with gpio-mockup, let's be on the safe side and use a mutex when performing any changes on the dummy chip structures. Suggested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-02-17gpio: of: Apply regulator-gpio quirk only to enable-gpiosMarek Vasut1-0/+1
Since commit d6cd33ad7102 ("regulator: gpio: Convert to use descriptors") the GPIO regulator had inverted the polarity of the control GPIO. This problem manifested itself on systems with DT containing the following description (snippet from salvator-common.dtsi): gpios = <&gpio5 1 GPIO_ACTIVE_HIGH>; gpios-states = <1>; states = <3300000 1 1800000 0>; Prior to the aforementioned commit, the gpio-regulator code used gpio_request_array() to claim the GPIO(s) specified in the "gpios" DT node, while the commit changed that to devm_gpiod_get_index(). The legacy gpio_request_array() calls gpio_request_one() and then gpiod_request(), which parses the DT flags of the "gpios" node and populates the GPIO descriptor flags field accordingly. The new devm_gpiod_get_index() calls gpiod_get_index(), then of_find_gpio(), of_get_named_gpiod_flags() with flags != NULL, and then of_gpio_flags_quirks(). Since commit a603a2b8d86e ("gpio: of: Add special quirk to parse regulator flags"), of_gpio_flags_quirks() contains a quirk for regulator-gpio which was never triggered by the legacy gpio_request_array() code path, but is triggered by devm_gpiod_get_index() code path. This quirk checks whether a GPIO is associated with a fixed or gpio-regulator and if so, checks two additional conditions. First, whether such GPIO is active-low, and if so, ignores the active-low flag. Second, whether the regulator DT node does have an "enable-active-high" property and if the property is NOT present, sets the GPIO flags as active-low. The second check triggers a problem, since it is applied to all GPIOs associated with a gpio-regulator, rather than only on the "enable" GPIOs, as the old code did. This changes the way the gpio-regulator interprets the DT description of the control GPIOs. The old code using gpio_request_array() explicitly parsed the "enable-active-high" DT property and only applied it to the GPIOs described in the "enable-gpios" DT node, and only if those were present. This patch fixes the quirk code by only applying the quirk to "enable-gpios", thus restoring the old behavior. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Geert Uytterhoeven <geert+renesas@glider.be> Cc: Jan Kotas <jank@cadence.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Mark Brown <broonie@kernel.org> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com> Cc: linux-renesas-soc@vger.kernel.org To: linux-gpio@vger.kernel.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-02-17Merge tag 'intel-gpio-v5.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel into develLinus Walleij3-64/+29
intel-gpio for v5.1-1 Small clean up for Intel PMIC GPIO drivers, includes: - optimizing IRQ handlers by usage of for_each_set_bit() - sorting headers alphabetically for better maintenance - conversion to SPDX identifier The following is an automated git shortlog grouped by driver: crystalcove: - Convert to use SPDX identifier - Sort headers alphabetically - Use for_each_set_bit() in IRQ handler msic: - Convert to use SPDX identifier - Sort headers alphabetically - Remove duplicate check in IRQ handler wcove: - Convert to use SPDX identifier - Fix indentation - Sort headers alphabetically - Allow return negative error code from to_reg()
2019-02-17Merge tag 'gpio-v5.1-updates-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into develLinus Walleij9-65/+86
gpio updates for v5.1 - support for a new variant of pca953x - documentation fix from Wolfram - some tegra186 name changes - two minor fixes for madera and altera-a10sr
2019-02-14gpio: altera-a10sr: Trivial coding style fixAxel Lin1-8/+9
Change the coding style to make it does error checking first. This also fixes checkpatch warning about line over 80 characters. Signed-off-by: Axel Lin <axel.lin@ingics.com> Tested by: Thor Thayer <thor.thayer@linux.intel.com> Reviewed by: Thor Thayer <thor.thayer@linux.intel.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-02-14gpio: tegra186: Use TEGRA186_ prefix for GPIO namesThierry Reding1-35/+35
The new prefix allows the GPIOs to be uniquely identified on a per-chip basis, which makes it easier to distinguish Tegra186 specific GPIOs from those of later chips such as Tegra194 which supports a very different set of GPIOs. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-02-14gpio: madera: Add missing constCharles Keepax1-1/+1
madera_gpio_chip is only used as a template so it can be marked as const. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-02-14gpio: pca953x: add support for pcal6416 typeThomas Petazzoni1-0/+1
The NXP PCAL6416, documented at [1], is a variant of the PCA GPIO expander with 16 GPIOs, and supporting an interrupt and the "extended" features for interrupt, pull-up/pull-down configuration, etc. [1] https://www.nxp.com/docs/en/data-sheet/PCAL6416A.pdf Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-02-14gpio: pxa: avoid attempting to set pin direction via pinctrl on MMP2Lubomir Rintel1-0/+1
Similarly to PXA3xx, pinctrl-single can't set pin direction on MMP2 either. See also: commit 9dabfdd84bdfa ("gpio: pxa: disable pinctrl calls for PXA3xx") Cc: stable@vger.kernel.org Fixes: a770d946371e ("gpio: pxa: add pin control gpio direction and request") Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-02-14gpio: pcf857x: Simpify wake-up handlingGeert Uytterhoeven1-14/+1
Unlike gpio_rcar_irq_set_wake(), which this solution was based on, pcf857x_irq_set_wake() does not need to do anything else than calling irq_set_irq_wake() for the upstream interrupt controller. Hence there is no reason for making this call conditional, and no longer a need for keeping a copy of the interrupt number that also serves as a flag. Just propagate irq_set_irq_wake() to the upstream interrupt controller, using the original interrupt number. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-02-14Merge branch 'ib-pca953x-config' into develLinus Walleij4-18/+105
2019-02-13gpio: sprd: Add missing break in switch statementGustavo A. R. Silva1-0/+1
Fix the following warning by adding a missing break: drivers/gpio/gpio-eic-sprd.c: In function ‘sprd_eic_irq_set_type’: drivers/gpio/gpio-eic-sprd.c:403:3: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (flow_type) { ^~~~~~ drivers/gpio/gpio-eic-sprd.c:435:2: note: here default: ^~~~~~~ This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Reviewed-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-02-13gpio: zynq: properly support runtime PM for GPIO used as interruptsThomas Petazzoni1-0/+24
The Zynq GPIO driver currently implements runtime PM by: - Enabling runtime PM support in ->probe() and letting the runtime PM reference counter drop to zero at the end of ->probe(). - Increasing the runtime PM reference counter in ->request() and decreasing it in ->free(). However, the latter is not sufficient: when a GPIO is used as an interrupt, ->request() and ->free() are not called. Due to this, the runtime PM counter remains to zero when the only GPIOs in use are used as interrupts, causing them to simply not work. To address this problem, this commit implement the ->irq_request_resources() and ->irq_release_resources() hooks, ensuring that the runtime PM counter is properly incremented/decremented. Since we override the default hooks, we keep the existing behavior by making sure they call gpiochip_reqres_irq() / gpiochip_relres_irq() respectively. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Reviewed-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-02-13gpio: pca953x: add ->set_config implementationThomas Petazzoni1-2/+64
This commit adds a minimal implementation of the ->set_config() hook, with support for the PIN_CONFIG_BIAS_PULL_UP and PIN_CONFIG_BIAS_PULL_DOWN configurations. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-02-13gpio: add core support for pull-up/pull-down configurationThomas Petazzoni3-0/+25
This commit adds support for configuring the pull-up and pull-down resistors available in some GPIO controllers. While configuring pull-up/pull-down is already possible through the pinctrl subsystem, some GPIO controllers, especially simple ones such as GPIO expanders on I2C, don't have any pinmuxing capability and therefore do not use the pinctrl subsystem. This commit implements the GPIO_PULL_UP and GPIO_PULL_DOWN flags, which can be used from the Device Tree, to enable a pull-up or pull-down resistor on a given GPIO. The flag is simply propagated all the way to the core GPIO subsystem, where it is used to call the gpio_chip ->set_config callback with the appropriate existing PIN_CONFIG_BIAS_* values. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-02-13gpio: use new gpio_set_config() helper in more placesThomas Petazzoni1-2/+2
As suggested by Linus Walleij, let's use the new gpio_set_config() helper in gpiod_set_debounce() and gpiod_set_transitory(). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-02-13gpio: rename gpio_set_drive_single_ended() to gpio_set_config()Thomas Petazzoni1-14/+14
This commit simply renames gpio_set_drive_single_ended() to gpio_set_config(), as the function is not specific to setting the GPIO drive type, and will be used for other purposes in followup commits. In addition, it moves the function above gpiod_direction_input(), as it will be used from gpiod_direction_input(). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-02-09gpio: adp5588.c: Switch to events systemNikolaus Voss1-56/+35
Interupts were generated using GPIN interrupts of ADP5588. These interrupts have two important limitations: 1. Interrupts can only be generated for either rising or falling edges but not both. 2. Interrupts are reasserted as long as the interrupt condition persists (i.e. high or low level on that GPIN). This generates lots of interrupts unless the event is very short. To overcome this, ADP5588 provides an event system which queues up to 10 events in a buffer. GPIN events are queued whenever the GPIN is asserted or deasserted. This makes it possible to support generating GPIN interrupts for both edges and to generate only one interrupt per state change. Thus it is possible to chain the gpio-keys driver for some GPIOs. Signed-off-by: Nikolaus Voss <nikolaus.voss@loewensteinmedical.de> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-02-09gpio: adp5588: Add device tree supportNikolaus Voss1-83/+68
Make platform data optional and add DT id table. Switch to dynamically mapped GPIOs and IRQs if not provided via platform data. Signed-off-by: Nikolaus Voss <nikolaus.voss@loewensteinmedical.de> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-02-09gpio: tqmx86: Drop unnecessary gpiochip_remove in tqmx86_gpio_probe()Wei Yongjun1-3/+1
It's not necessary to remove gpio_chip which added with devm_gpiochip_add_data(). Fixes: b868db94a6a7 ("gpio: tqmx86: Add GPIO from for this IO controller") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-02-09gpio: Add a Gateworks PLD GPIO driverLinus Walleij3-0/+145
This adds a driver for Gateworks PLD GPIO, that exist in two instances on the Gateworks Cambria GW2358-4 router platform at least. Cc: Imre Kaloz <kaloz@openwrt.org> Cc: Tim Harvey <tharvey@gateworks.com> Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-02-08gpiolib: acpi: Introduce ACPI_GPIO_QUIRK_ONLY_GPIOIOAndy Shevchenko1-4/+11
New quirk enforces search for GPIO based on its type, i.e. iterate over GpioIo resources only. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08gpio: wcove: Convert to use SPDX identifierAndy Shevchenko1-9/+1
Reduce size of duplicated comments by switching to use SPDX identifier. No functional change. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-02-08gpio: msic: Convert to use SPDX identifierAndy Shevchenko1-14/+1
Reduce size of duplicated comments by switching to use SPDX identifier. No functional change. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-02-08gpio: crystalcove: Convert to use SPDX identifierAndy Shevchenko1-10/+2
Reduce size of duplicated comments by switching to use SPDX identifier. No functional change. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
2019-02-08gpio: wcove: Fix indentationAndy Shevchenko1-7/+6
In some cases the indentation is inconsistent. Fix it accordingly. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-02-08gpio: wcove: Sort headers alphabeticallyAndy Shevchenko1-2/+2
Sort header block alphabetically for easy maintenance. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-02-08gpio: msic: Sort headers alphabeticallyAndy Shevchenko1-5/+5
Sort header block alphabetically for easy maintenance. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-02-08gpio: crystalcove: Sort headers alphabeticallyAndy Shevchenko1-4/+4
Sort header block alphabetically for easy maintenance. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
2019-02-08gpio: msic: Remove duplicate check in IRQ handlerAndy Shevchenko1-6/+3
There is no need to check for non-zero pending since for_each_set_bit() does it on the first iteration. While here, drop redundant assignment. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-02-08gpio: wcove: Allow return negative error code from to_reg()Andy Shevchenko1-1/+1
The type of to_reg() is unsigned int while it might return a negative error code. Callers are also expecting a signed type. For sake of type consistency replace unsigned int with plain int. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-02-08gpio: crystalcove: Use for_each_set_bit() in IRQ handlerAndy Shevchenko1-6/+4
This simplifies and standardizes the AB IRQ handler by using the for_each_set_bit() library function. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
2019-02-08gpio: MT7621: use a per instance irq_chip structureRené van Dorst1-10/+10
This fixes the kernel complains: gpio gpiochip1: (1e000600.gpio-bank1): detected irqchip that is shared with multiple gpiochips: please fix the driver. gpio gpiochip2: (1e000600.gpio-bank2): detected irqchip that is shared with multiple gpiochips: please fix the driver. Fixes: 4ba9c3afda41 ("gpio: mt7621: Add a driver for MT7621") Cc: stable@vger.kernel.org Signed-off-by: René van Dorst <opensource@vdorst.com> Cc: linux-gpio@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Tested-by: Greg Ungerer <gerg@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-02-01PCI: Move Rohm Vendor ID to generic listAndy Shevchenko2-3/+0
Move the Rohm Vendor ID to pci_ids.h instead of defining it in several drivers. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Linus Walleij <linus.walleij@linaro.org>
2019-01-28gpio: vf610: Mask all GPIO interruptsAndrew Lunn1-0/+5
On SoC reset all GPIO interrupts are disable. However, if kexec is used to boot into a new kernel, the SoC does not experience a reset. Hence GPIO interrupts can be left enabled from the previous kernel. It is then possible for the interrupt to fire before an interrupt handler is registered, resulting in the kernel complaining of an "unexpected IRQ trap", the interrupt is never cleared, and so fires again, resulting in an interrupt storm. Disable all GPIO interrupts before registering the GPIO IRQ chip. Fixes: 7f2691a19627 ("gpio: vf610: add gpiolib/IRQ chip driver for Vybrid") Signed-off-by: Andrew Lunn <andrew@lunn.ch> Acked-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-01-28gpiolib: acpi: Correct kernel doc of struct acpi_gpio_eventAndy Shevchenko1-1/+1
The checker complains during build gpiolib-acpi.c:45: warning: Function parameter or member 'irq_requested' not described in 'acpi_gpio_event' because the typo in the field description. Fix the name to have documentation up-to-date. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-01-28gpio: tqmx86: Add GPIO from for this IO controllerAndrew Lunn3-0/+341
Some TQ-Systems ComExpress modules contain an IO controller with 8 GPIO lines. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-01-28gpio: altera: Fixup block comment stylePhil Reid1-2/+2
Add missing '*' char to the start of the comment lines. Signed-off-by: Phil Reid <preid@electromag.com.au> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-01-24gpio: of: Fix logic inversionLinus Walleij1-1/+1
The SPI chip selects were not properly inspected due to a logic inversion. This made SPI GPIOs not work. Cc: Jan Kotas <jank@cadence.com> Reported-by: Jan Kotas <jank@cadence.com> Tested-by: Jan Kotas <jank@cadence.com> Fixes: f3186dd87669 ("spi: Optionally use GPIO descriptors for CS GPIOs") Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-24Merge branch 'ib-qcom-spmi' into develLinus Walleij1-0/+37
2019-01-24gpio: add irq domain activate/deactivate functionsBrian Masney1-0/+37
This adds the two new functions gpiochip_irq_domain_activate and gpiochip_irq_domain_deactivate that can be used as the activate and deactivate functions in the struct irq_domain_ops. This is for situations where only gpiochip_{lock,unlock}_as_irq needs to be called. SPMI and SSBI GPIO are two users that will initially use these functions. Signed-off-by: Brian Masney <masneyb@onstation.org> Suggested-by: Stephen Boyd <sboyd@kernel.org> Reviewed-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-01-23gpio: altera-a10sr: Set proper output level for direction_outputAxel Lin1-1/+3
The altr_a10sr_gpio_direction_output should set proper output level based on the value argument. Fixes: 26a48c4cc2f1 ("gpio: altera-a10sr: Add A10 System Resource Chip GPIO support.") Cc: <stable@vger.kernel.org> Signed-off-by: Axel Lin <axel.lin@ingics.com> Tested by: Thor Thayer <thor.thayer@linux.intel.com> Reviewed by: Thor Thayer <thor.thayer@linux.intel.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-01-23gpio: sprd: Fix incorrect irq type setting for the async EICNeo Hou1-0/+1
When setting async EIC as IRQ_TYPE_EDGE_BOTH type, we missed to set the SPRD_EIC_ASYNC_INTMODE register to 0, which means detecting edge signals. Thus this patch fixes the issue. Fixes: 25518e024e3a ("gpio: Add Spreadtrum EIC driver support") Cc: <stable@vger.kernel.org> Signed-off-by: Neo Hou <neo.hou@unisoc.com> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-01-23gpio: sprd: Fix the incorrect data registerNeo Hou1-1/+12
Since differnt type EICs have its own data register to read, thus fix the incorrect data register. Fixes: 25518e024e3a ("gpio: Add Spreadtrum EIC driver support") Cc: <stable@vger.kernel.org> Signed-off-by: Neo Hou <neo.hou@unisoc.com> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-01-23gpiolib: fix line event timestamps for nested irqsBartosz Golaszewski1-1/+8
Nested interrupts run inside the calling thread's context and the top half handler is never called which means that we never read the timestamp. This issue came up when trying to read line events from a gpiochip using regmap_irq_chip for interrupts. Fix it by reading the timestamp from the irq thread function if it's still 0 by the time the second handler is called. Fixes: d58f2bf261fd ("gpio: Timestamp events in hardirq handler") Cc: stable@vger.kernel.org Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-01-23gpio: pcf857x: Fix interrupts on multiple instancesRoger Quadros1-14/+12
When multiple instances of pcf857x chips are present, a fix up message [1] is printed during the probe of the 2nd and later instances. The issue is that the driver is using the same irq_chip data structure between multiple instances. Fix this by allocating the irq_chip data structure per instance. [1] fix up message addressed by this patch [ 1.212100] gpio gpiochip9: (pcf8575): detected irqchip that is shared with multiple gpiochips: please fix the driver. Cc: Stable <stable@vger.kernel.org> Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-01-22gpio-f7188x: add support Fintek F81804 & F81966Steffen Kothe1-1/+23
Basic implementation of driver is used to support Fintek F81804 & F81966 gpios with custom register set. Signed-off-by: Steffen Kothe <steffen.kothe.gc1993@googlemail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-01-21gpio: rcar: select General Output Register to set output statesVladimir Zapolskiy1-1/+11
R-Car GPIO controller provides two interfaces to set GPIO line output signal state, and for a particular GPIO line the selected interface is determined by OUTDTSEL bit value. At the moment the driver supports only one of two interfaces, namely OUTDT General Output Register is used to control the output signal. While this selection is the default one on reset, it is not explicitly configured on probe, thus it might be possible that kernel and userspace consumers of a GPIO won't be able to set the wanted GPIO output signal. Below is a simple test case to reproduce the described problem and verify this fix in the kernel on H3 ULCB by setting non-default OUTDTSEL configuration from a bootloader: u-boot > mw.l 0xe6055440 0x3000 1 ... userspace > echo default-on > /sys/devices/platform/leds/leds/led5/trigger userspace > echo default-on > /sys/devices/platform/leds/leds/led6/trigger Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-01-21gpio: hlwd: Implement edge trigger emulationJonathan Neuschäfer1-0/+56
Like the Spreadtrum EIC driver[1], this driver needs to emulate edge triggered interrupts to support the generic gpio-keys driver. [1]: https://www.spinics.net/lists/kernel/msg2764576.html Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-01-21gpio: hlwd: Add basic IRQ supportJonathan Neuschäfer2-1/+136
This patch implements level-triggered IRQs in the Hollywood GPIO driver. Edge triggered interrupts are not supported in this GPIO controller, so I moved their emulation into a separate patch. Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>