- 31 Aug, 2021 6 commits
-
-
Christophe JAILLET authored
If an error occurs after a 'gpiochip_add_data()' call it must be undone by a corresponding 'gpiochip_remove()' as already done in the remove function. To simplify the code a fix a leak in the error handling path of the probe, use the managed version instead (i.e. 'devm_gpiochip_add_data()') Fixes: 698b8eea ("gpio/mpc8xxx: change irq handler from chained to normal") Signed-off-by:
Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Christophe JAILLET authored
Commit 76c47d14 ("gpio: mpc8xxx: Add ACPI support") has switched to a managed version when dealing with 'mpc8xxx_gc->regs'. So the corresponding 'iounmap()' call in the error handling path and in the remove should be removed to avoid a double unmap. This also allows some simplification in the probe. All the error handling paths related to managed resources can be direct returns and a NULL check in what remains in the error handling path can be removed. Fixes: 76c47d14 ("gpio: mpc8xxx: Add ACPI support") Signed-off-by:
Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Christophe JAILLET authored
Commit 698b8eea ("gpio/mpc8xxx: change irq handler from chained to normal") has introduced a new 'goto err;' at the very end of the function, but has not updated the error handling path accordingly. Add the now missing 'irq_domain_remove()' call which balances a previous 'irq_domain_create_linear() call. Fixes: 698b8eea ("gpio/mpc8xxx: change irq handler from chained to normal") Signed-off-by:
Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Alexandru Ardelean authored
The platform_set_drvdata() call is only useful if we need to retrieve back the private information. Since the driver doesn't do that, it's not useful to have it. This change removes it. Also removing with this change is some logging about the failure to init the gpio chip data. There are other logging methods to view that this failed. Signed-off-by:
Alexandru Ardelean <aardelean@deviqon.com> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Viresh Kumar authored
Add gpio and virtualization lists in the MAINTAINERS entry for Virtio gpio driver. Reported-by:
"Michael S. Tsirkin" <mst@redhat.com> Signed-off-by:
Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Viresh Kumar authored
Fix warnings reported by sparse, related to type mismatch between u16 and __le16. Reported-by:
kernel test robot <lkp@intel.com> Fixes: 3a29355a ("gpio: Add virtio-gpio driver") Signed-off-by:
Viresh Kumar <viresh.kumar@linaro.org> Acked-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
- 23 Aug, 2021 4 commits
-
-
Bartosz Golaszewski authored
Merge branch 'ib-rockchip' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl into gpio/for-next
-
Lukas Bulwahn authored
Commit e1324ece ("ARM: imx: Remove i.MX35 board files") removes the config MACH_MX35_3DS in arch/arm/mach-imx/Kconfig. Hence, since then, the MX35 3DS BOARD MC9S08DZ60 GPIO functions are dead code as its config GPIO_MC9S08DZ60 depends on the config MACH_MX35_3DS. Luckily, ./scripts/checkkconfigsymbols.py warns on non-existing configs: MACH_MX35_3DS Referencing files: drivers/gpio/Kconfig Remove the obsolete MX35 3DS BOARD MC9S08DZ60 GPIO functions. Signed-off-by:
Lukas Bulwahn <lukas.bulwahn@gmail.com> Reviewed-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Fabio Estevam <festevam@gmail.com> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Linus Walleij authored
<linux/spi/max7301.h> despite the placement of the header, is used by drivers/gpio/gpio-max730*. The include needs struct gpio_chip and needs to include <linux/gpio/driver.h> not the legacy <linux/gpio.h> include. Signed-off-by:
Linus Walleij <linus.walleij@linaro.org> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Viresh Kumar authored
This patch adds a new driver for Virtio based GPIO devices. This allows a guest VM running Linux to access GPIO lines provided by the host. It supports all basic operations, except interrupts for the GPIO lines. Based on the initial work posted by: "Enrico Weigelt, metux IT consult" <lkml@metux.net>. Reviewed-by:
Linus Walleij <linus.walleij@linaro.org> Signed-off-by:
Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
- 16 Aug, 2021 13 commits
-
-
Jianqun Xu authored
With the patch to separate the gpio driver from the pinctrl driver, now the pinctrl-rockchip can drop the gpio related codes now. Signed-off-by:
Jianqun Xu <jay.xu@rock-chips.com> Link: https://lore.kernel.org/r/20210816012146.1119289-1-jay.xu@rock-chips.comSigned-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
Jianqun Xu authored
There has spin lock for irq set type already, so drop irq_gc_lock and irq_gc_unlock. Reviewed-by:
Heiko Stuebner <heiko@sntech.de> Signed-off-by:
Jianqun Xu <jay.xu@rock-chips.com> Link: https://lore.kernel.org/r/20210816012135.1119234-1-jay.xu@rock-chips.comSigned-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
Jianqun Xu authored
The next version gpio controller on SoCs like rk3568 have more write mask bits for registers. Signed-off-by:
Jianqun Xu <jay.xu@rock-chips.com> Link: https://lore.kernel.org/r/20210816012123.1119179-1-jay.xu@rock-chips.comSigned-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
Jianqun Xu authored
Store register offsets in the struct rockchip_gpio_regs, this patch prepare for the driver update for new gpio controller. Reviewed-by:
Heiko Stuebner <heiko@sntech.de> Signed-off-by:
Jianqun Xu <jay.xu@rock-chips.com> Link: https://lore.kernel.org/r/20210816012111.1119125-1-jay.xu@rock-chips.comSigned-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
Jianqun Xu authored
This patch add support for rockchip gpio controller, which is supported in pinctrl driver in the past. With this patch, the pinctrl-rockchip driver will drop gpio related codes and populate platform driver to gpio-rockchip. Signed-off-by:
Jianqun Xu <jay.xu@rock-chips.com> Link: https://lore.kernel.org/r/20210816012053.1119069-1-jay.xu@rock-chips.comSigned-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
Jianqun Xu authored
In the past we only need on clock which name "pclk" for a gpio controller. In the new version gpio controller, there add some register to change debounce clock dynamic, so the dt node needs to add the second clock, we call it "dbclk". The clock property need 2 items on some rockchip chips such as RK3568 SoCs. Signed-off-by:
Jianqun Xu <jay.xu@rock-chips.com> Link: https://lore.kernel.org/r/20210816011948.1118959-5-jay.xu@rock-chips.comSigned-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
Jianqun Xu authored
Store a pointer from the pinctrl device for the gpio bank. Signed-off-by:
Jianqun Xu <jay.xu@rock-chips.com> Link: https://lore.kernel.org/r/20210816011948.1118959-4-jay.xu@rock-chips.comSigned-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
Jianqun Xu authored
Separate struct rockchip_pin_bank to pinctrl-rockchip.h file, which will be used by gpio-rockchip driver in the future. Signed-off-by:
Jianqun Xu <jay.xu@rock-chips.com> Link: https://lore.kernel.org/r/20210816011948.1118959-3-jay.xu@rock-chips.comSigned-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
Jianqun Xu authored
Since gate and ungate pclk of gpio has very litte benifit for system power consumption, just keep it always ungate. Signed-off-by:
Jianqun Xu <jay.xu@rock-chips.com> Link: https://lore.kernel.org/r/20210816011948.1118959-2-jay.xu@rock-chips.comSigned-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
Andy Shevchenko authored
Use DEFINE_RES_MEM_NAMED() to save a couple of lines of code, which makes the code a bit shorter and easier to read. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Asmaa Mnebhi <asmaa@nvidia.com> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Andy Shevchenko authored
Simplify the platform_get_resource() and devm_ioremap_resource() calls with devm_platform_ioremap_resource(). Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Asmaa Mnebhi <asmaa@nvidia.com> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Andy Shevchenko authored
ACPI_PTR() is more harmful than helpful. For example, in this case if CONFIG_ACPI=n, the ID table left unused which is not what we want. Instead of adding ifdeffery here and there, drop ACPI_PTR() and replace acpi.h with mod_devicetable.h. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Asmaa Mnehi <asmaa@nvidia.com> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Andy Shevchenko authored
Convert driver to use modern device PM ops interface. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Asmaa Mnebhi <asmaa@nvidia.com> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
- 13 Aug, 2021 1 commit
-
-
Bartosz Golaszewski authored
Merge tag 'intel-gpio-v5.15-1' of gitolite.kernel.org:pub/scm/linux/kernel/git/andy/linux-gpio-intel into gpio/for-next intel-gpio for v5.15-1 * Rework DesignWare driver to use software nodes instead of platform data * Drop duplication of forward declaration for ACPI in consumer.h * Get rid of legacy PCI PM code in ML IOH driver The following is an automated git shortlog grouped by driver: dwapb: - Get rid of legacy platform data - Read GPIO base from gpio-base property - Unify ACPI enumeration checks in get_irq() and configure_irqs() gpiolib: - Deduplicate forward declaration in the consumer.h header mfd: - intel_quark_i2c_gpio: Convert GPIO to use software nodes ml-ioh: - Convert to dev_pm_ops
-
- 11 Aug, 2021 5 commits
-
-
Andy Shevchenko authored
Platform data is a legacy interface to supply device properties to the driver. In this case we don't have anymore in-kernel users for it. Just remove it for good. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Serge Semin <fancer.lancer@gmail.com> Tested-by:
Serge Semin <fancer.lancer@gmail.com>
-
Andy Shevchenko authored
The driver can provide a software node group instead of passing legacy platform data. This will allow to drop the legacy platform data structures along with unifying a child device driver to use same interface for all property providers, i.e. Device Tree, ACPI, and board files. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by:
Serge Semin <fancer.lancer@gmail.com> Acked-for-MFD-by:
Lee Jones <lee.jones@linaro.org> Reviewed-by:
Linus Walleij <linus.walleij@linaro.org>
-
Andy Shevchenko authored
For backward compatibility with some legacy devices introduce a new (*) property gpio-base to read GPIO base. This will allow further cleaning up of the driver. *) Note, it's not new for the GPIO library since the mockup driver is using it already. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by:
Serge Semin <fancer.lancer@gmail.com> Acked-by:
Serge Semin <fancer.lancer@gmail.com> Reviewed-by:
Linus Walleij <linus.walleij@linaro.org>
-
Andy Shevchenko authored
Shared IRQ is only enabled for ACPI enumeration, there is no need to have a special flag for that, since we simple can test if device has been enumerated by ACPI. This unifies the checks in dwapb_get_irq() and dwapb_configure_irqs(). Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Lee Jones <lee.jones@linaro.org> Acked-by:
Serge Semin <fancer.lancer@gmail.com> Tested-by:
Serge Semin <fancer.lancer@gmail.com>
-
Andy Shevchenko authored
struct acpi_device is repeated in two branches of ifdeffery. Move it out and hence deduplicate. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by:
Linus Walleij <linus.walleij@linaro.org>
-
- 05 Aug, 2021 10 commits
-
-
Mauro Carvalho Chehab authored
Changeset 45ca1607 ("dt-bindings: gpio: zynq: convert bindings to YAML") renamed: Documentation/devicetree/bindings/gpio/gpio-zynq.txt to: Documentation/devicetree/bindings/gpio/gpio-zynq.yaml. Update its cross-reference accordingly. Fixes: 45ca1607 ("dt-bindings: gpio: zynq: convert bindings to YAML") Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Akhil R authored
Add ACPI module ID to probe the driver from the ACPI based bootloader firmware. Signed-off-by:
Akhil R <akhilrajeev@nvidia.com> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by:
Jon Hunter <jonathanh@nvidia.com> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Krzysztof Kozlowski authored
gpiolib does not modify struct device_node, so few local pointers can point to a const data. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by:
Rob Herring <robh@kernel.org> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Krzysztof Kozlowski authored
Several gpiolib functions receive pointer to struct device_node which is later passed to OF functions. These OF functions accept already pointer to const, so gpiolib can follow similar approach to indicate they are not modifying the struct device_node. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by:
Rob Herring <robh@kernel.org> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Krzysztof Kozlowski authored
Unify the declaration of of_count_phandle_with_args() between enabled and disabled OF by making constifying pointed device_node. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by:
Rob Herring <robh@kernel.org> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Steven Lee authored
Add an else-if condition in the probe function to check whether ngpios is multiple of 8. Per AST datasheet, numbers of available serial GPIO pins in Serial GPIO Configuration Register must be n bytes. For instance, if n = 1, it means AST SoC supports 8 GPIO pins. Signed-off-by:
Steven Lee <steven_lee@aspeedtech.com> Reviewed-by:
Andrew Jeffery <andrew@aj.id.au> Reviewed-by:
Linus Walleij <linus.walleij@linaro.org> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Steven Lee authored
Replace all of_property_read_u32() with device_property_read_u32(). Signed-off-by:
Steven Lee <steven_lee@aspeedtech.com> Acked-by:
Andrew Jeffery <andrew@aj.id.au> Reviewed-by:
Linus Walleij <linus.walleij@linaro.org> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Steven Lee authored
The current design initializes irq->chip from a global irqchip struct, which causes multiple sgpio devices use the same irq_chip. The patch moves irq_chip to aspeed_sgpio struct for initializing irq_chip from their private gpio struct. Signed-off-by:
Steven Lee <steven_lee@aspeedtech.com> Reviewed-by:
Andrew Jeffery <andrew@aj.id.au> Reviewed-by:
Linus Walleij <linus.walleij@linaro.org> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Steven Lee authored
AST SoC supports *retain pin state* function when wdt reset. The patch adds set_config function for handling sgpio reset tolerance register. Signed-off-by:
Steven Lee <steven_lee@aspeedtech.com> Reviewed-by:
Andrew Jeffery <andrew@aj.id.au> Reviewed-by:
Linus Walleij <linus.walleij@linaro.org> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Steven Lee authored
The maximum number of gpio pins of SoC is hardcoded as 80 and the gpio pin count mask for GPIO Configuration register is hardcode as GENMASK(9,6). However, AST2600 has 2 sgpio master interfaces, one of them supports up to 128 gpio pins and pin count mask of GPIO Configuration Register is 5 bits. The patch adds ast2600 compatibles, removes MAX_NR_HW_SGPIO and corresponding design to make the gpio input/output pin base are determined by ngpios. The patch also removed hardcoded pin mask and adds ast2400, ast2500, ast2600 platform data that include gpio pin count mask for GPIO Configuration Register. The original pin order is as follows: (suppose MAX_NR_HW_SGPIO is 80 and ngpios is 10 as well) Input: 0 1 2 3 ... 9 Output: 80 81 82 ... 89 The new pin order is as follows: Input: 0 2 4 6 ... 18 Output: 1 3 5 7 ... 19 SGPIO pin id and input/output pin mapping is as follows: SGPIO0(0,1), SGPIO1(2,3), ..., SGPIO79(158,159) For example: Access SGPIO5(10,11) Get SGPIO pin 5 (suppose sgpio chip id is 2) gpioget 2 10 Set SGPIO pin 5 (suppose sgpio chip id is 2) gpioset 2 11=1 gpioset 2 11=0 Signed-off-by:
Steven Lee <steven_lee@aspeedtech.com> Reviewed-by:
Linus Walleij <linus.walleij@linaro.org> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
- 29 Jul, 2021 1 commit
-
-
Sergio Paracuellos authored
Gpiolib core code has been updated to support setting friendly names through properly 'gpio-line-names'. Instead of redefine behaviour here to skip the core to be executed, just properly assign the desired offset per bank to get in the core the expected behaviour. Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by:
Gregory Fong <gregory.0xf0@gmail.com> Signed-off-by:
Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-