- 11 8月, 2018 8 次提交
-
-
由 Ivan Podovalov 提交于
The DIO connector on the WAFER-945GSE is interfaced to GPIO ports on the ITE IT8718F Super I/O chipset. From the datasheet of ITE IT8718F, the GPIO interface is identical to IT8728, so just add it to the same case as the other chip. Signed-off-by: NIvan Podovalov <ipodovalov@gmail.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Biju Das 提交于
Add a check for unused gpios to avoid chip->request() call to client driver for unused gpios. Signed-off-by: NBiju Das <biju.das@bp.renesas.com> Reviewed-by: NFabrizio Castro <fabrizio.castro@bp.renesas.com> Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This is a GPIO driver so include only <linux/gpio/driver.h>. Drop the use of GPIOF_* flags: these are for consumers, not drivers. Just return 0/1. Cc: Stefan Agner <stefan@agner.ch> Cc: Thierry Reding <treding@nvidia.com> Reviewed-by: NDmitry Osipenko <digetx@gmail.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
The bgpio_init() takes one of two arguments to specify a register to set the direction of the GPIO line: either dirout that indicates that a 1 in the bit in that register sets the corresponding line to output, or dirin which indicates that a 1 in the bit in that register sets the corresponding line to input. Conversely setting the bit to 0 on these will turn the line into input and output respectively. One of these can be defined but not both. This means that a platform that sets a bit to 1 for output only defines dirout and a platform that sets a bit to 0 for output only defines dirin. In short this defines the polarity of the direction register. Both can also be left as NULL meaning the GPIO chip is either input only or output only. Tomer Maimon discovered that for get/set chips (those where the get and set registers are defined but no separate clear register, and specifying BGPIOF_READ_OUTPUT_REG_SET so that we say we want to read the output value from the SET register) we are unconditionally reading the value from the SET register when the direction bit is 1 and from the DAT register when the direction bit is 0, not taking the direction bit polarity into account. It would be expected that when the direction bit is inverted (dirin is defined but not dirout) we read the current value from the DAT register when the bit is 1 and from the SET register when the bit is 0. Currently only some versions of ATH79, brcmstb, some versions of CLP711x, GE, IOP and Loongson use the dirin mode (a 1 in the register means input). They are unaffected because BGPIOF_READ_OUTPUT_REG_SET is not set on any of them. (They do not read back the SET register to figure out the output value.) So this is no regression with current drivers. However the behaviour is wrong and does not work with Tomer's new driver where he needs to use the BGIOF_READ_OUTPUT_REG_SET. This fixes the above issue by: - Instead of defining separate functions for the inverted case, set up a flag in the gpio_chip that indicates that the direction is inverted. - Remove the special inverted functions for setting input/output and getting the direction, rely on the flag instead. - Respect this flag in bgpio_get_set() and bgpio_get_set_multiple() Reported-by: NTomer Maimon <tmaimon77@gmail.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This is a GPIO driver so use only <linux/gpio/driver.h>. Acked-by: NMichal Simek <michal.simek@xilinx.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: Richard Röjfors <richard.rojfors@gmail.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This driver includes the legacy <linux/gpio.h> and <linux/of_gpio.h> but all it needs is really <linux/gpio/driver.h>. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Biju Das 提交于
Some platforms are not setting of_node in the driver. On these platforms defining gpio-reserved-ranges on device tree leads to kernel crash. It is due to some parts of the gpio core relying on the driver to set up of_node,while other parts do themselves.This inconsistent behaviour leads to a crash. gpiochip_add_data_with_key() calls gpiochip_init_valid_mask() with of_node as NULL. of_gpiochip_add() fills "of_node" and calls of_gpiochip_init_valid_mask(). The fix is to move the assignment to chip->of_node from of_gpiochip_add() to gpiochip_add_data_with_key(). Signed-off-by: NBiju Das <biju.das@bp.renesas.com> Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be> Tested-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 07 8月, 2018 9 次提交
-
-
由 Andy Shevchenko 提交于
gpiochip_lock_as_irq() may return a few error codes, bail out if it fails with corresponding returned code. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Andy Shevchenko 提交于
gpiochip_lock_as_irq() may return a few error codes, bail out if it fails with corresponding returned code. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Andy Shevchenko 提交于
gpiochip_lock_as_irq() may return a few error codes, do not shadow them by -ENOSPC and let caller to decide. No functional change intended. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Andy Shevchenko 提交于
gpiochip_lock_as_irq() may return a few error codes, do not shadow them by -EINVAL and let caller to decide. No functional change intended. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Andy Shevchenko 提交于
gpiochip_lock_as_irq() may return a few error codes, do not shadow them by -EINVAL and let caller to decide. No functional change intended. Cc: Hoan Tran <hotran@apm.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Andy Shevchenko 提交于
gpiochip_lock_as_irq() may return a few error codes, do not shadow them by -EINVAL and let caller to decide. No functional change intended. Cc: Ray Jui <rjui@broadcom.com> Cc: Scott Branden <sbranden@broadcom.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Andy Shevchenko 提交于
gpiochip_lock_as_irq() may return a few error codes, do not shadow them by -EINVAL and let caller to decide. No functional change intended. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Levin Du 提交于
In Rockchip RK3328, the output only GPIO_MUTE pin, originally for codec mute control, can also be used for general purpose. It is manipulated by the GRF_SOC_CON10 register in GRF. Aside from the GPIO_MUTE pin, the HDMI pins can also be set in the same way. Currently this GRF GPIO controller only supports the mute pin. If needed in the future, the HDMI pins support can also be added. Signed-off-by: NLevin Du <djw@t-chip.com.cn> Reviewed-by: NRob Herring <robh@kernel.org> Reviewed-by: NHeiko Stuebner <heiko@sntech.de> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Janusz Krzysztofik 提交于
This should make applications utilizing whole banks work faster. Signed-off-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com> Acked-by: NGrygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 03 8月, 2018 1 次提交
-
-
由 Wei Yongjun 提交于
Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpio/gpio-pxa.c: In function "pxa_gpio_probe": drivers/gpio/gpio-pxa.c:629:35: warning: variable "gpio_offset" set but not used [-Wunused-but-set-variable] int irq0 = 0, irq1 = 0, irq_mux, gpio_offset = 0; ^ Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com> Acked-by: NRobert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 30 7月, 2018 11 次提交
-
-
由 Vincent Prince 提交于
From the datasheet, the GPIO interface is identical to IT8728 (same description), so just add it to the same case as the other chip. Signed-off-by: NVincent Prince <vincent.prince.fr@gmail.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Andy Shevchenko 提交于
There should not be anything more than stated by the name of newly introduced constants, i.e. GPIOD_OUT_LOW_OPEN_DRAIN == GPIOD_OUT_LOW + open drain and nothing more. Make it better to read and slightly more robust by using GPIOD_OUT_LOW and GPIOD_OUT_HIGH constants with open drain flag. No functional change intended. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Stefan Agner 提交于
Since commit e45d1c80 ("gpio: put GPIO IRQs into their own lock class") and commit a0a8bcf4 ("gpiolib: irqchip: use different lockdep class for each gpio irqchip") GPIO lib takes care of lockdep classes. In fact, gpiochip_irq_map() overwrites the class anyway, so the lockdep class set by the driver is useless. Remove it. Signed-off-by: NStefan Agner <stefan@agner.ch> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 zhong jiang 提交于
Fix the following sparse error: drivers/gpio/gpio-ath79.c:54:16: error: return expression in void function Signed-off-by: Nzhong jiang <zhongjiang@huawei.com> Acked-by: NAlban Bedel <albeu@free.fr> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Fabio Estevam 提交于
There is no need for splitting the writel() call in two lines. Make it fit into a single line instead. Signed-off-by: NFabio Estevam <fabio.estevam@nxp.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Daniel Mack 提交于
The pxa3xx driver uses the pinctrl-single driver since a while which does not implement a .gpio_set_direction() callback. The pinmux core will simply return 0 in this case, and the pxa3xx gpio driver hence believes the pinctrl driver did its job and returns as well. This effectively makes pxa_gpio_direction_{input,output} no-ops. To fix this, do not call into the pinctrl subsystem for the PXA3xx platform for now. We can revert this once the pinctrl-single driver learned to support setting pin directions. Signed-off-by: NDaniel Mack <daniel@zonque.org> Acked-by: NRobert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Anton Vasilyev 提交于
If ioh_gpio_probe() fails on devm_irq_alloc_descs() then chip may point to any element of chip_save array, so reverse iteration from pointer chip may become chip_save[-1] and gpiochip_remove() will operate with wrong memory. The patch fix the error path of ioh_gpio_probe() to correctly bypass chip_save array. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: NAnton Vasilyev <vasilyev@ispras.ru> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Marcel Ziswiler 提交于
Actually report the error code from devm_regulator_get() which may as well just be a probe deferral. This is e.g. what one gets upon booting a Colibri T20: gpiochip_add_data_with_key: GPIOs 0..223 (tegra-gpio) failed to register Signed-off-by: NMarcel Ziswiler <marcel.ziswiler@toradex.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Dmitry Osipenko 提交于
Commit 36b31279 ("gpiolib: Respect error code of ->get_direction()") broke tegra_gpio_irq_set_type() because requesting of GPIO direction must be done after enabling GPIO function for a pin. This patch fixes drivers probe failure like this: gpio gpiochip0: (tegra-gpio): gpiochip_lock_as_irq: cannot get GPIO direction tegra-gpio 6000d000.gpio: unable to lock Tegra GPIO 144 as IRQ Fixes: 36b31279 ("gpiolib: Respect error code of ->get_direction()") Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Tested-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Anson Huang 提交于
GPIO registers could lose context on i.MX7D, when enter LPSR mode, the whole SoC will be powered off except LPSR domain, GPIO banks will lose context in this case, need to restore the context after resume from LPSR mode. This patch adds new compatible string for i.MX7D which supports GPIO power off feature in suspend, and adds the GPIO save/restore operations in noirq suspend/resume phase, since GPIO is fundamental module which could be used by other peripherals' resume phase. 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>
-
由 Morten Hein Tiljeset 提交于
Signed-off-by: NMorten Hein Tiljeset <morten.tiljeset@prevas.dk> Reviewed-by: NSean Nyekjaer <sean.nyekjaer@prevas.dk> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 16 7月, 2018 2 次提交
-
-
由 Bartosz Golaszewski 提交于
It's actually fine to read values of output lines. This was also allowed by the legacy sysfs interface. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Bartosz Golaszewski 提交于
User space can currently both read and set values of input lines using the character device. This was not allowed by the old sysfs interface nor is it a correct behavior. Check the first descriptor in the set for the OUT flag when asked to set values and return -EPERM if the line is input. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 13 7月, 2018 7 次提交
-
-
由 Geert Uytterhoeven 提交于
Allow gpiolib to read back the current I/O direction configuration by implementing the .get_direction() callback. Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: NSimon Horman <horms+renesas@verge.net.au> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Andy Shevchenko 提交于
One line in gpiolib_dbg_show() still fits 80 characters, so, join it to be like that in order to increase readability. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Wei Yongjun 提交于
platform_get_resource() may fail and return NULL, so we should better check it's return value to avoid a NULL pointer dereference a bit later in the code. This is detected by Coccinelle semantic patch. @@ expression pdev, res, n, t, e, e1, e2; @@ res = platform_get_resource(pdev, t, n); + if (!res) + return -EINVAL; ... when != res == NULL e = devm_ioremap(e1, res->start, e2); Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com> Acked-by: NRobert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Arnd Bergmann 提交于
Compile-testing the driver fails unless OF_GPIO is enabled: drivers/gpio/gpio-mt7621.c: In function 'mediatek_gpio_bank_probe': drivers/gpio/gpio-mt7621.c:228:10: error: 'struct gpio_chip' has no member named 'of_node' Fixes: 4ba9c3af ("gpio: mt7621: Add a driver for MT7621") Signed-off-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 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 2 次提交
-
-
由 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>
-