Commit graph

984286 commits

Author SHA1 Message Date
Nikita Shubin 35d9e69592 gpio: ep93xx: refactor base IRQ number
- use predefined constants instead of plain numbers
- use provided bank IRQ number instead of defined constant
  for port F

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:34 +01:00
Nikita Shubin f6b6154186 gpio: ep93xx: refactor ep93xx_gpio_add_bank
- replace plain numbers with girq->num_parents in devm_kcalloc
- replace plain numbers with girq->num_parents for port F
- refactor i - 1 to i + 1 to make loop more readable
- combine getting IRQ's loop and setting handler's into single loop

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:34 +01:00
Nikita Shubin 78f85c73e6 gpio: ep93xx: Fix typo s/hierarchial/hierarchical
Fix typo in comment.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:34 +01:00
Nikita Shubin 193f1b7468 gpio: ep93xx: drop to_irq binding
As ->to_irq is redefined in gpiochip_add_irqchip, having it defined in
driver is useless, so let's drop it.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:34 +01:00
Nikita Shubin 1827a8978d gpio: ep93xx: Fix wrong irq numbers in port F
Port F IRQ's should be statically mapped to EP93XX_GPIO_F_IRQ_BASE.

So we need to specify girq->first otherwise:

"If device tree is used, then first_irq will be 0 and
IRQ's get mapped dynamically on the fly"

And that's not the thing we want.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:33 +01:00
Bartosz Golaszewski 50f9a6c254 gpio: uapi: use the preferred SPDX license identifier
GPL-2.0 license identifier is deprecated. User-space projects that want
to include the kernel header with their source-code will be unable to
become fully REUSE compliant due to the reuse tool complaining about
deprecated licenses. Change the SPDX identifier to GPL-2.0-only.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:33 +01:00
Srinivas Neeli 6e551bfa98 gpio: gpio-xilinx: Add check if width exceeds 32
Add check to see if gpio-width property does not exceed 32.
If it exceeds then return -EINVAL.

Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:33 +01:00
Srinivas Neeli 26b0477462 gpio: gpio-xilinx: Add support for suspend and resume
Add support for suspend and resume, pm runtime suspend and resume.
Added free and request calls.

Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:33 +01:00
Srinivas Neeli a32c7caea2 gpio: gpio-xilinx: Add interrupt support
Adds interrupt support to the Xilinx GPIO driver so that rising and
falling edge line events can be supported. Since interrupt support is
an optional feature in the Xilinx IP, the driver continues to support
devices which have no interrupt provided.
Depends on OF_GPIO framework for of_xlate function to translate
gpiospec to the GPIO number and flags.

Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:33 +01:00
Srinivas Neeli 37ef334680 gpio: gpio-xilinx: Reduce spinlock array to array
Changed spinlock array to single. It is preparation for irq support which
is shared between two channels that's why spinlock should be only one.

Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:33 +01:00
Srinivas Neeli 45c5277f34 gpio: gpio-xilinx: Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.

Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:33 +01:00
Andy Shevchenko 78034b8e07 gpio: msic: Drop driver from Makefile
Driver is gone, no need to keep a Makefile entry for it. Remove.

Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2021-02-15 11:43:33 +01:00
Andy Shevchenko 5a2a46ae4b gpio: wcove: Split out to_ireg() helper and deduplicate the code
There are a few places in the code where IRQ status and mask register
values are being updated. Use a new exctracted helper to deduplicate
the code.

While at it, get rid of unnecessary divisions.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2021-02-15 11:43:32 +01:00
Andy Shevchenko 9fe5fcd640 gpio: wcove: Switch to use regmap_set_bits(), regmap_clear_bits()
the regmap_set_bits(), regmap_clear_bits() API makes code better to understand.
Switch the driver to use them,

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2021-02-15 11:43:32 +01:00
Andy Shevchenko 2edba74c9d gpio: wcove: Get rid of error prone casting in IRQ handler
The casting from int to long on 64-bit platform is error prone.
Replace it with proper type of the variable on stack.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2021-02-15 11:43:32 +01:00
Andy Shevchenko 944dcbe84b gpio: intel-mid: Remove driver for deprecated platform
Intel Moorestown and Medfield are quite old Intel Atom based
32-bit platforms, which were in limited use in some Android phones,
tablets and consumer electronics more than eight years ago.

There are no bugs or problems ever reported outside from Intel
for breaking any of that platforms for years. It seems no real
users exists who run more or less fresh kernel on it. The commit
05f4434bc1 ("ASoC: Intel: remove mfld_machine") also in align
with this theory.

Due to above and to reduce a burden of supporting outdated drivers
we remove the support of outdated platforms completely.

Moreover this code duplicates gpio-pxa since the IP has been derived
from XScale implementation. If anybody wants to resurrect this
it has to be part of gpio-pxa.c.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2021-02-15 11:43:32 +01:00
Andy Shevchenko fe08e9e26a gpio: msic: Remove driver for deprecated platform
Intel Moorestown and Medfield are quite old Intel Atom based
32-bit platforms, which were in limited use in some Android phones,
tablets and consumer electronics more than eight years ago.

There are no bugs or problems ever reported outside from Intel
for breaking any of that platforms for years. It seems no real
users exists who run more or less fresh kernel on it. The commit
05f4434bc1 ("ASoC: Intel: remove mfld_machine") also in align
with this theory.

Due to above and to reduce a burden of supporting outdated drivers
we remove the support of outdated platforms completely.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2021-02-15 11:43:32 +01:00
Andy Shevchenko 6e004a9829 gpio: aggregator: Remove trailing comma in terminator entries
Remove trailing comma in terminator entries to avoid potential
expanding an array behind it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-02-15 11:43:32 +01:00
Andy Shevchenko b2498cb87c gpio: aggregator: Use compound literal from the header
Instead of doing it in place, convert GPIO_LOOKUP_IDX() and GPIO_HOG()
to be compund literals that's allow to use them as rvalue in assignments.

Due to above conversion, use compound literal from the header
in the gpio-aggregator.c.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-02-15 11:43:32 +01:00
Andy Shevchenko deb631c401 gpio: aggregator: Replace isrange() by using get_options()
We already have a nice helper called get_options() which can be used
to validate the input format. Replace isrange() by using it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-02-15 11:43:31 +01:00
Andy Shevchenko 0ea0908311 lib/cmdline: Allow get_options() to take 0 to validate the input
Allow get_options() to take 0 as a number of integers parameter to validate
the input.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-02-15 11:43:31 +01:00
Andy Shevchenko f1f405c35e lib/cmdline: Update documentation to reflect behaviour
get_options() API has some tricks to optimize that may be not so obvious
to the caller. Update documentation to reflect current behaviour.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
2021-02-15 11:43:31 +01:00
Andy Shevchenko d3c7cfc6d3 lib/cmdline_kunit: add a new test case for get_options()
Add a test case for get_options() which is provided by cmdline.c.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2021-02-15 11:43:31 +01:00
Andy Shevchenko 1d10243dc2 gpio: merrifield: Make bias configuration available for GPIOs
If we get bias set request, for example, from GpioIo() resource,
we silently ignore it. Make bias configuration available for GPIOs.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2021-02-15 11:43:31 +01:00
Baruch Siach ea6fe47f3e dt-bindings: ap806: document gpio marvell,pwm-offset property
Update the example as well. Add the '#pwm-cells' and 'clocks' properties
for a complete working example.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:31 +01:00
Baruch Siach 85b7d8abfe gpio: mvebu: add pwm support for Armada 8K/7K
Use the marvell,pwm-offset DT property to store the location of PWM
signal duration registers.

Since we have more than two GPIO chips per system, we can't use the
alias id to differentiate between them. Use the offset value for that.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:31 +01:00
Dmitry Osipenko 94de03ccc9 gpio: tegra: Fix irq_set_affinity
The irq_set_affinity callback should not be set if parent IRQ domain
doesn't present because gpio-tegra driver callback fails in this case,
causing a noisy error messages on system suspend:

 Disabling non-boot CPUs ...
 IRQ 26: no longer affine to CPU1
 IRQ128: set affinity failed(-22).
 IRQ130: set affinity failed(-22).
 IRQ131: set affinity failed(-22).
 IRQ 27: no longer affine to CPU2
 IRQ128: set affinity failed(-22).
 IRQ130: set affinity failed(-22).
 IRQ131: set affinity failed(-22).
 IRQ 28: no longer affine to CPU3
 IRQ128: set affinity failed(-22).
 IRQ130: set affinity failed(-22).
 IRQ131: set affinity failed(-22).
 Entering suspend state LP1

Hence just don't specify the irq_set_affinity callback if parent PMC
IRQ domain is missing. Tegra isn't capable of setting affinity per GPIO,
affinity could be set only per GPIO bank, thus there is nothing to do
for gpio-tegra in regards to CPU affinity without the parent IRQ domain.

Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30
Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30
Tested-by: Dmitry Osipenko <digetx@gmail.com> # A500 T20 and Nexus7 T30
Fixes: efcdca286eef ("gpio: tegra: Convert to gpio_irq_chip")
Reported-by: Matt Merhar <mattmerhar@protonmail.com>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:30 +01:00
Dmitry Osipenko 4a6eac2b4b gpio: tegra: Support building driver as a loadable module
Support building driver as a loadable kernel module. This allows to
reduce size of a kernel zImage, which is important for some devices
since size of kernel partition may be limited and since some bootloader
variants have known problems in regards to the initrd placement if kernel
image is too big.

$ lsmod
Module                  Size  Used by
gpio_tegra             16384  27

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:30 +01:00
Dmitry Osipenko 66f7aaa448 gpio: tegra: Clean up whitespaces in tegra_gpio_driver
Clean up inconsistent whitespaces and tabs in the definition of
tegra_gpio_driver to make code look better a tad.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:30 +01:00
Dmitry Osipenko b2a6115f31 gpio: tegra: Use debugfs_create_devm_seqfile()
Use resource-managed variant of debugfs_create_file(0444) to prepare code
for the modularization of the driver.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:30 +01:00
Dmitry Osipenko 718ff94666 gpio: tegra: Improve formatting of the code
Don't cross 80 chars of line length in order to keep formatting of the
code consistent.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:30 +01:00
Baruch Siach 0b68d02b6a gpio: mvebu: improve handling of pwm zero on/off values
Hardware appears to treat zero value as 2^32. Take advantage of this
fact to support on/off values of up to UINT_MAX+1 == 2^32. Adjust both
.apply and .get_state to handle zero as a special case.

Rounded up division result in .get_state can't be zero, since the
dividend is now larger than 0. Remove check for this case.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Analyzed-by: Russell King <linux@armlinux.org.uk>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:30 +01:00
Baruch Siach 2bee255a5e gpio: mvebu: don't limit pwm period/duty_cycle to UINT_MAX
PWM on/off registers are limited to UINT_MAX. However the state period
and duty_cycle fields are ns values of type u64. There is no reason to
limit them to UINT_MAX.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:30 +01:00
Baruch Siach de1eaf6016 gpio: mvebu: make pwm .get_state closer to idempotent
Round up the divisions in .get_state() to make applying the read out
configuration idempotent in most cases as .apply rounds down.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:30 +01:00
Baruch Siach aa37e27f61 gpio: mvebu: improve pwm period calculation accuracy
Change 'off' register value calculation from

  $off = (period - duty_cycle) * clkrate / NSEC_PER_SEC

to

  $off = (period * clkrate / NSEC_PER_SEC) - $on

That is, divide the full period value to reduce rounding error.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:30 +01:00
Bartosz Golaszewski 4bf2426103 gpio: mockup: tweak the Kconfig help text
gpio-mockup doesn't require SYSFS to be selected so drop that bit from
the Kconfig text.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2021-02-15 11:43:29 +01:00
Zheng Yongjun 481a4209de gpio: wcove: convert comma to semicolon
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:29 +01:00
Zheng Yongjun 10c942a157 gpio: vx855: convert comma to semicolon
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:29 +01:00
Zheng Yongjun 7de2e5fc51 gpio: tegra186: convert comma to semicolon
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:29 +01:00
Zheng Yongjun de49e83c21 gpio: max77620: convert comma to semicolon
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:29 +01:00
Arnd Bergmann f0a2c77eb8 gpio: remove zte zx driver
The zte zx platform is getting removed, so this driver is no
longer needed.

Cc: Jun Nie <jun.nie@linaro.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:29 +01:00
Kent Gibson f61d3f0c69 gpio: uapi: fix line info flags description
The description of the flags field of the struct gpio_v2_line_info
mentions "the GPIO lines" while the info only applies to an individual
GPIO line.  This was accidentally changed from "the GPIO line" during
formatting improvements.

Reword to "this GPIO line" to clarify and to be consistent with other
struct gpio_v2_line_info fields.

Fixes: 2cc522d393 ("gpio: uapi: kernel-doc formatting improvements")
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:29 +01:00
Kent Gibson 94329e158e selftests: gpio: add CONFIG_GPIO_CDEV to config
GPIO CDEV is now optional and required for the selftests so add it to
the config.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:29 +01:00
Kent Gibson 10f33652c0 selftests: gpio: port to GPIO uAPI v2
Add a port to the GPIO uAPI v2 interface and make it the default.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:28 +01:00
Kent Gibson ef0d6d9775 tools: gpio: remove uAPI v1 code no longer used by selftests
gpio-mockup-chardev helper has been obsoleted and removed, so also remove
the tools/gpio code that it, and nothing else, was using.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:28 +01:00
Kent Gibson 999e71c351 selftests: remove obsolete gpio references from kselftest_deps.sh
GPIO Makefile has been greatly simplified so remove references to lines
which no longer exist.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:28 +01:00
Kent Gibson 01e1250f13 selftests: remove obsolete build restriction for gpio
Build restrictions related to the gpio-mockup-chardev helper are
no longer relevant so remove them.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:28 +01:00
Kent Gibson e029759861 selftests: gpio: remove obsolete gpio-mockup-chardev.c
GPIO selftests have changed to new gpio-mockup-cdev helper, so remove
old gpio-mockup-chardev helper.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:28 +01:00
Kent Gibson 8bc395a6a2 selftests: gpio: rework and simplify test implementation
The GPIO mockup selftests are overly complicated with separate
implementations of the tests for sysfs and cdev uAPI, and with the cdev
implementation being dependent on tools/gpio and libmount.

Rework the test implementation to provide a common test suite with a
simplified pluggable uAPI interface.  The cdev implementation utilises
the GPIO uAPI directly to remove the dependence on tools/gpio.
The simplified uAPI interface removes the need for any file system mount
checks in C, and so removes the dependence on libmount.

The rework also fixes the sysfs test implementation which has been broken
since the device created in the multiple gpiochip case was split into
separate devices.

Fixes: 8a39f597bc ("gpio: mockup: rework device probing")
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:28 +01:00
Dmitry Osipenko 27f8feea40 gpio: tegra: Fix wake interrupt
The GPIO bank wake interrupt setting was erroneously removed after
conversion to gpio_irq_chip, thus the wake interrupt programming is
broken now. Secondly, the wake_enb of the GPIO driver should be changed
only after the successful toggling of the IRQ wake-state. Restore the wake
interrupt setting and the programming order.

Fixes: efcdca286eef ("gpio: tegra: Convert to gpio_irq_chip")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-02-15 11:43:28 +01:00