summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-xra1403.c
Commit message (Collapse)AuthorAgeFilesLines
* gpio: xra1403: remove redundant of_match_ptr()Zhu Wang2023-08-031-2/+2
| | | | | | | | | | | | | | The driver depends on CONFIG_OF, so it is not necessary to use of_match_ptr() here, and __maybe_unused can also be removed. Even for drivers that do not depend on CONFIG_OF, it's almost always better to leave out the of_match_ptr(), since the only thing it can possibly do is to save a few bytes of .text if a driver can be used both with and without it. Signed-off-by: Zhu Wang <wangzhu9@huawei.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
* gpio: Explicitly include correct DT includesRob Herring2023-07-191-1/+1
| | | | | | | | | | | | | | | | The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Romain Perier <romain.perier@gmail.com> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
* gpio: xra1403: Remove unused of_gpio.h inclusionAndy Shevchenko2023-06-191-1/+0
| | | | | | | | of_gpio.h shouldn't be used in GPIO drivers. Remove it. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
* gpio: xra1403: mark OF related data as maybe unusedKrzysztof Kozlowski2023-03-151-1/+1
| | | | | | | | | | | The driver can be compile tested with !CONFIG_OF making certain data unused: drivers/gpio/gpio-xra1403.c:198:34: error: ‘xra1403_spi_of_match’ defined but not used [-Werror=unused-const-variable=] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
* gpio: xra1403: remove unneeded spi_set_drvdata()Alexandru Ardelean2020-11-301-9/+1
| | | | | | | | | | There is no matching spi_get_drvdata() call in the driver, so there is no need to do spi_set_drvdata(). This looks like it probably was copied from a driver that used both spi_set_drvdata() & spi_get_drvdata(). Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
* gpio: xra1403: Make use of for_each_requested_gpio()Andy Shevchenko2020-06-201-6/+2
| | | | | | | | | | Make use of for_each_requested_gpio() instead of home grown analogue. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Nandor Han <nandor.han@ge.com> Cc: Semi Malinen <semi.malinen@ge.com> Link: https://lore.kernel.org/r/20200615150545.87964-5-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: Use new GPIO_LINE_DIRECTIONMatti Vaittinen2019-11-071-1/+4
| | | | | | | | | | | | | | | | | | | | | It's hard for occasional GPIO code reader/writer to know if values 0/1 equal to IN or OUT. Use defined GPIO_LINE_DIRECTION_IN and GPIO_LINE_DIRECTION_OUT to help them out. NOTE - for gpio-amd-fch and gpio-bd9571mwv: This commit also changes the return value for direction get to equal 1 for direction INPUT. Prior this commit these drivers might have returned some other positive value but 1 for INPUT. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Acked-by: Scott Branden <scott.branden@broadcom.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com> Reviewed-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com> Acked-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201Thomas Gleixner2019-05-301-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms and conditions of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not see http www gnu org licenses extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 228 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Steve Winslow <swinslow@gmail.com> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190528171438.107155473@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* gpio: xra1403: Switch to a fixed upper bound for registersLaura Abbott2018-04-271-10/+5
| | | | | | | | | | | Geert Uytterhoeven pointed out that the number of register was a fixed upper bound so there's no need to use a dynamically allocated array in place of a VLA. Use the defined upper bound. Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Laura Abbott <labbott@redhat.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: Remove VLA from xra1403 driverLaura Abbott2018-03-271-1/+7
| | | | | | | | | | | The new challenge is to remove VLAs from the kernel (see https://lkml.org/lkml/2018/3/7/621) This patch replaces a VLA with an appropriate call to kmalloc_array. Signed-off-by: Laura Abbott <labbott@redhat.com> Reviewed-by: Nandor Han <nandor.han@ge.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: xra1403: Add EXAR XRA1403 SPI GPIO expander driverNandor Han2017-05-221-0/+237
This driver support basic XRA1403 functionalities: - set gpio direction - get gpio direction - set gpio high/low - get gpio status Signed-off-by: Nandor Han <nandor.han@ge.com> Signed-off-by: Semi Malinen <semi.malinen@ge.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>