- 13 7月, 2018 3 次提交
-
-
由 Arnd Bergmann 提交于
Gcc cannot always see that BUG_ON(1) is guaranteed to not return, so we get a warning message in some configurations: drivers/gpio/gpio-aspeed.c: In function 'bank_reg': drivers/gpio/gpio-aspeed.c:244:1: error: control reaches end of non-void function [-Werror=return-type] Using a plain BUG() is easier here and avoids the problem. Fixes: 44ddf559 ("gpio: aspeed: Rework register type accessors") Signed-off-by: NArnd Bergmann <arnd@arndb.de> Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Andy Shevchenko 提交于
Two out of three calls to ->get_direction (excluding, of course, gpiod_get_direction() itself) are using gpiod_get_direction() and one is still open coded. Replace the latter one to use same API for sake of consistency. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Andy Shevchenko 提交于
Since we put static variable to a header file it's copied to each module that includes the header. But not all of them are actually used it. Mark gpio_suffixes array with __maybe_unused to hide a compiler warning: In file included from drivers/gpio/gpiolib-legacy.c:6:0: drivers/gpio/gpiolib.h:95:27: warning: ‘gpio_suffixes’ defined but not used [-Wunused-const-variable=] static const char * const gpio_suffixes[] = { "gpios", "gpio" }; ^~~~~~~~~~~~~ In file included from drivers/gpio/gpiolib-devprop.c:17:0: drivers/gpio/gpiolib.h:95:27: warning: ‘gpio_suffixes’ defined but not used [-Wunused-const-variable=] static const char * const gpio_suffixes[] = { "gpios", "gpio" }; ^~~~~~~~~~~~~ Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 09 7月, 2018 8 次提交
-
-
由 Rafael David Tinoco 提交于
Following logic from commit: 22f6592b, GPIOHANDLE_REQUEST_OUTPUT should handle errors same way as GPIOHANDLE_REQUEST_INPUT does, or else the following error occurs: gpio-mockup-chardev: gpio<gpiochip1> line<0> test flag<0x2> value<0>: No such file or directory despite the real result of gpio_pin_test(), gpio_debugfs_get() and gpiotools_request_linehandle() functions. Signed-off-by: NRafael David Tinoco <rafael.tinoco@linaro.org> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Janusz Krzysztofik 提交于
Avoid replication of error code conversion in non-DT GPIO consumers' code by returning -EPROBE_DEFER from gpiod_find() in case a chip identified by its label in a registered lookup table is not ready. See https://lkml.org/lkml/2018/5/30/176 for example case. Suggested-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com> Reviewed-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Andy Shevchenko 提交于
In case we try to lock GPIO pin as IRQ when something going wrong we print a misleading message. Correct this by checking an error code from ->get_direction() in gpiochip_lock_as_irq() and printing a corresponding message. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Anson Huang 提交于
Some i.MX SoCs have GPIO clock gate in CCM, accessing GPIO registers needs to enable GPIO clock gate first, i.MX GPIO driver will enable clock gate if there is clock property in GPIO node of dtb, add optional property to i.MX GPIO binding doc. Signed-off-by: NAnson Huang <Anson.Huang@nxp.com> Reviewed-by: NFabio Estevam <fabio.estevam@nxp.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This fixes some syntactic nits that makes the GPIO maintainer happier. It is way easier to show by example and do it myself than to try to explain it with comments. It's just my personal taste of minimalism. Cc: Sergio Paracuellos <sergio.paracuellos@gmail.com> Cc: NeilBrown <neil@brown.name> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Sergio Paracuellos 提交于
Add driver support for gpio of MT7621 SoC. Signed-off-by: NSergio Paracuellos <sergio.paracuellos@gmail.com> Reviewed-by: NNeilBrown <neil@brown.name> [Switched wording WIDTH to STRIDE] Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Sergio Paracuellos 提交于
Add a devicetree binding documentation for the mt7621 gpio. Signed-off-by: NSergio Paracuellos <sergio.paracuellos@gmail.com> Reviewed-by: NNeilBrown <neil@brown.name> Reviewed-by: NRob Herring <robh@kernel.org> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Andy Shevchenko 提交于
For easy grepping on debug purposes join string literals back in the messages. While here, fix couple of small indentation issues. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 02 7月, 2018 27 次提交
-
-
由 Linus Walleij 提交于
-
由 Benjamin Herrenschmidt 提交于
On the Aspeed chip, the GPIOs can be under control of the ARM chip or of the ColdFire coprocessor. (There's a third command source, the LPC bus, which we don't use or support yet). The control of which master is allowed to modify a given GPIO is per-bank (8 GPIOs). Unfortunately, systems already exist for which we want to use GPIOs of both sources in the same bank. This provides an API exported by the gpio-aspeed driver that an aspeed coprocessor driver can use to "grab" some GPIOs for use by the coprocessor, and allow the coprocessor driver to provide callbacks for arbitrating access. Once at least one GPIO of a given bank has been "grabbed" by the coprocessor, the entire bank is marked as being under coprocessor control. It's command source is switched to the coprocessor. If the ARM then tries to write to a GPIO in such a marked bank, the provided callbacks are used to request access from the coprocessor driver, which is responsible to doing whatever is necessary to "pause" the coprocessor or prevent it from trying to use the GPIOs while the ARM is doing its accesses. During that time, the command source for the bank is temporarily switched back to the ARM. Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org> Reviewed-by: NJoel Stanley <joel@jms.id.au> Reviewed-by: NAndrew Jeffery <andrew@aj.id.au> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Benjamin Herrenschmidt 提交于
This adds the definitions for the command source registers and a helper to set them. Those registers allow to control which bus master on the SoC is allowed to modify a given bank of GPIOs and will be used by subsequent patches. Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org> Reviewed-by: NJoel Stanley <joel@jms.id.au> Reviewed-by: NAndrew Jeffery <andrew@aj.id.au> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Benjamin Herrenschmidt 提交于
The Aspeed GPIO hardware has a quirk: the value register, for an output GPIO, doesn't contain the last value written (the write latch content) but the sampled input value. This means that when reading back shortly after writing, you can get an incorrect value as the input value is delayed by a few synchronizers. The HW supports a separate read-only register "Data Read Register" which allows you to read the write latch instead. This adds the definition for it, and uses it for the initial population of the GPIO value cache. It will be used more in subsequent patches. Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org> Reviewed-by: NJoel Stanley <joel@jms.id.au> Reviewed-by: NAndrew Jeffery <andrew@aj.id.au> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Benjamin Herrenschmidt 提交于
Use a single accessor function for all register types instead of several spread around. This will make it easier/cleaner to introduce new registers and keep the mechanism in one place. The big switch/case is optimized at compile time since the switch value is a constant. Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org> Reviewed-by: NJoel Stanley <joel@jms.id.au> Reviewed-by: NAndrew Jeffery <andrew@aj.id.au> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Baruch Siach 提交于
Don't warn about missing interrupts support when the parent interrupt is not defined. Enabling interrupts support would not make it work anyway. Signed-off-by: NBaruch Siach <baruch@tkos.co.il> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This is a GPIO driver, include only <linux/gpio/driver.h>. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This is a GPIO driver, include only <linux/gpio/driver.h>. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This is a GPIO driver, include only <linux/gpio/driver.h>. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
I don't like the __namespace and this is simple enough to just inline at all sites. Cc: Bartosz Golaszewski <brgl@bgdev.pl> Acked-by: NAlessandro Rubini <rubini@gnudd.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This removes the custom implementation of the BIT() macro and inlines all calls to the helper. Cc: Bartosz Golaszewski <brgl@bgdev.pl> Acked-by: NAlessandro Rubini <rubini@gnudd.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This is a GPIO driver, include only <linux/gpio/driver.h>. Cc: Bartosz Golaszewski <brgl@bgdev.pl> Acked-by: NAlessandro Rubini <rubini@gnudd.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This is a GPIO driver, include only <linux/gpio/driver.h>. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This purely syntactic change switches unsigned char to u8 in the driver. Cc: Bruno Randolf <br1@einfach.org> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
The chip has a bit for controlling open drain, and it is easy to implement the callback to support open drain when needed, so let's implement it. Cc: Bruno Randolf <br1@einfach.org> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
Bit 0 in the config register obviously controls the direction of the GPIO so instead of hammering 0x0/0x1 into that register, use read-modify-write so that we can also alter the other bits in the register. Cc: Bruno Randolf <br1@einfach.org> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
It's pretty simple to implement the .get_direction() for this chip, so let's just do it. Cc: Bruno Randolf <br1@einfach.org> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This is a GPIO driver, include only <linux/gpio/driver.h>. Cc: Bruno Randolf <br1@einfach.org> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
It's pretty simple to implement the .get_direction() for this chip, so let's just do it. Cc: Denis Turischev <denis.turischev@compulab.co.il> Cc: Daniel Krueger <daniel.krueger@systec-electronic.com> Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This is a GPIO driver, include only <linux/gpio/driver.h>. Cc: Denis Turischev <denis.turischev@compulab.co.il> Cc: Daniel Krueger <daniel.krueger@systec-electronic.com> Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This is a GPIO driver, include only <linux/gpio/driver.h>. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This is a GPIO driver, include only <linux/gpio/driver.h>. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This is a GPIO driver, include only <linux/gpio/driver.h>. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This is a GPIO driver, include only <linux/gpio/driver.h>. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Mathias Kresin 提交于
Add an implementation to get the current GPIO state. The callback is used by the leds-gpio driver for example, in case the current LED/GPIO state should be kept during driver load. Signed-off-by: NMathias Kresin <dev@kresin.me> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Mikko Perttunen 提交于
Add support for the Tegra194 GPIO bank configuration. Signed-off-by: NMikko Perttunen <mperttunen@nvidia.com> Acked-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Mikko Perttunen 提交于
The Tegra194 GPIO controller is similar to the one in Tegra186. Add relevant information to the device tree binding documentation. Signed-off-by: NMikko Perttunen <mperttunen@nvidia.com> Reviewed-by: NRob Herring <robh@kernel.org> Acked-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 26 6月, 2018 1 次提交
-
-
由 Geert Uytterhoeven 提交于
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer functionality only, can still be compiled if GPIOLIB is not enabled. Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where appropriate. Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org> Acked-by: NLinus Walleij <linus.walleij@linaro.org> Acked-by: NEvgeniy Polyakov <zbr@ioremap.net> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 18 6月, 2018 1 次提交
-
-
由 Linus Walleij 提交于
The GPIO (descriptor) API registers a "label" naming what is currently using the GPIO line. Typically this is taken from things like the device tree node, so "reset-gpios" will result in he line being labeled "reset". The technical effect is pretty much zero: the use is for debug and introspection, such as "lsgpio" and debugfs files. However sometimes the user want this cuddly feeling of listing all GPIO lines and seeing exactly what they are for and it gives a very fulfilling sense of control. Especially in the cases when the device tree node doesn't provide a good name, or anonymous GPIO lines assigned just to "gpios" in the device tree because the usage is implicit. For these cases it may be nice to be able to label the line directly and explicitly. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-