summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-sch311x.c
Commit message (Collapse)AuthorAgeFilesLines
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152Thomas Gleixner2019-05-301-5/+1Star
| | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 3029 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* gpio: sch311x: clean an indentation issue, remove extraneous spaceColin Ian King2018-11-051-1/+1
| | | | | | | Trivial fix to clean up an indentation issue, remove space Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: sch311x: Replace unsigned char with u8Linus Walleij2018-07-021-7/+7
| | | | | | | | This purely syntactic change switches unsigned char to u8 in the driver. Cc: Bruno Randolf <br1@einfach.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: sch311x: Implement open drain supportLinus Walleij2018-07-021-0/+29
| | | | | | | | | 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: Linus Walleij <linus.walleij@linaro.org>
* gpio: sch311x: Use RMW to change directionLinus Walleij2018-07-021-10/+12
| | | | | | | | | | 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: Linus Walleij <linus.walleij@linaro.org>
* gpio: sch311x: Implement .get_direction()Linus Walleij2018-07-021-0/+13
| | | | | | | | 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: Linus Walleij <linus.walleij@linaro.org>
* gpio: sch311x: Include the right headerLinus Walleij2018-07-021-1/+1
| | | | | | | This is a GPIO driver, include only <linux/gpio/driver.h>. Cc: Bruno Randolf <br1@einfach.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: remove redundant owner assignments of driversMasahiro Yamada2016-06-071-1/+0Star
| | | | | | | | | | A platform_driver need not set an owner since it will be populated by platform_driver_register(). Likewise for mcb_driver (gpio-menz127.c). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: sch311x: Use devm_request_regionWilliam Breathitt Gray2016-02-161-5/+3Star
| | | | | | | | | | | By the time request_region is called in the SMSC SCH311x GPIO driver, a corresponding device structure has already been allocated. The devm_request_region function should be used to help simplify the cleanup code and reduce the possible points of failure. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: sch311x: use gpiochip data pointerLinus Walleij2016-01-051-14/+7Star
| | | | | | | | | This makes the driver use the data pointer added to the gpio_chip to store a pointer to the state container instead of relying on container_of(). Acked-by: Bruno Randolf <br1@einfach.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: use dev_get_platdata()Nizam Haider2015-11-301-2/+2
| | | | | | | | Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Nizam Haider <nijamh@cdac.in> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: change member .dev to .parentLinus Walleij2015-11-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The name .dev in a struct is normally reserved for a struct device that is let us say a superclass to the thing described by the struct. struct gpio_chip stands out by confusingly using a struct device *dev to point to the parent device (such as a platform_device) that represents the hardware. As we want to give gpio_chip:s real devices, this is not working. We need to rename this member to parent. This was done by two coccinelle scripts, I guess it is possible to combine them into one, but I don't know such stuff. They look like this: @@ struct gpio_chip *var; @@ -var->dev +var->parent and: @@ struct gpio_chip var; @@ -var.dev +var.parent and: @@ struct bgpio_chip *var; @@ -var->gc.dev +var->gc.parent Plus a few instances of bgpio that I couldn't figure out how to teach Coccinelle to rewrite. This patch hits all over the place, but I *strongly* prefer this solution to any piecemal approaches that just exercise patch mechanics all over the place. It mainly hits drivers/gpio and drivers/pinctrl which is my own backyard anyway. Cc: Haavard Skinnemoen <hskinnemoen@gmail.com> Cc: Rafał Miłecki <zajec5@gmail.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Cc: Alek Du <alek.du@intel.com> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Jiri Kosina <jkosina@suse.cz> Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no> Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: remove all usage of gpio_remove retval in driver/gpioabdoulaye berthe2014-07-221-4/+2Star
| | | | | Signed-off-by: abdoulaye berthe <berthe.ab@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: sch311x: Slightly refactor sch311x_detect for better readabilityAxel Lin2014-04-281-4/+12
| | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: sch311x: fix compilation errorLinus Walleij2013-12-231-0/+1
| | | | | | | Compilation failed on some platforms due to implicit inclusion of <linux/io.h>, make this dependency explicit. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: add GPIO support for SMSC SCH311xBruno Randolf2013-12-201-0/+431
This patch adds support for the GPIOs found on the SMSC "Super I/ SCH311x. The chip detection and I/O functions are copied from sch311x_wdt. Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>