History log of /linux-master/drivers/gpio/gpio-sch311x.c
Revision Date Author Comments
# 4cf381bf 14-May-2023 Andrew Davis <afd@ti.com>

gpio: sch311x: Use devm_gpiochip_add_data() to simplify remove path

Use devm version of gpiochip_add() function to handle removal for us.

Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


# e42615ec 06-Nov-2019 Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>

gpio: Use new GPIO_LINE_DIRECTION

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>


# 2874c5fd 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152

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>


# 02cb87f7 30-Oct-2018 Colin Ian King <colin.king@canonical.com>

gpio: sch311x: clean an indentation issue, remove extraneous space

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>


# eb452a84 27-Jun-2018 Linus Walleij <linus.walleij@linaro.org>

gpio: sch311x: Replace unsigned char with u8

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>


# 4455a82a 27-Jun-2018 Linus Walleij <linus.walleij@linaro.org>

gpio: sch311x: Implement open drain support

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>


# 4a2398d7 27-Jun-2018 Linus Walleij <linus.walleij@linaro.org>

gpio: sch311x: Use RMW to change direction

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>


# f9e03b0e 27-Jun-2018 Linus Walleij <linus.walleij@linaro.org>

gpio: sch311x: Implement .get_direction()

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>


# 30467c19 27-Jun-2018 Linus Walleij <linus.walleij@linaro.org>

gpio: sch311x: Include the right header

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>


# 2ec64c9d 22-May-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

gpio: remove redundant owner assignments of drivers

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>


# 13441457 03-Feb-2016 William Breathitt Gray <vilhelm.gray@gmail.com>

gpio: sch311x: Use devm_request_region

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>


# 8ca7f1fa 07-Dec-2015 Linus Walleij <linus.walleij@linaro.org>

gpio: sch311x: use gpiochip data pointer

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>


# ab128afc 23-Nov-2015 Nizam Haider <nizamhaider786@gmail.com>

gpio: use dev_get_platdata()

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>


# 58383c78 04-Nov-2015 Linus Walleij <linus.walleij@linaro.org>

gpio: change member .dev to .parent

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>


# 9f5132ae 12-Jul-2014 abdoulaye berthe <berthe.ab@gmail.com>

gpio: remove all usage of gpio_remove retval in driver/gpio

Signed-off-by: abdoulaye berthe <berthe.ab@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


# 7e9fcc9d 14-Apr-2014 Axel Lin <axel.lin@ingics.com>

gpio: sch311x: Slightly refactor sch311x_detect for better readability

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


# 523639e6 23-Dec-2013 Linus Walleij <linus.walleij@linaro.org>

gpio: sch311x: fix compilation error

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>


# 12262bef 04-Dec-2013 Bruno Randolf <br1@einfach.org>

gpio: add GPIO support for SMSC SCH311x

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>