History log of /linux-master/drivers/gpio/gpio-amd-fch.c
Revision Date Author Comments
# d25e8fde 28-Sep-2020 Ed Wildgoose <lists@wildgooses.com>

gpio: amd-fch: correct logic of GPIO_LINE_DIRECTION

The original commit appears to have the logic reversed in
amd_fch_gpio_get_direction. Also confirmed by observing the value of
"direction" in the sys tree.

Signed-off-by: Ed Wildgoose <lists@wildgooses.com>
Fixes: e09d168f13f0 ("gpio: AMD G-Series PCH gpio driver")
Cc: stable@vger.kernel.org
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>


# 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>


# 87b70378 17-Jun-2019 Enrico Weigelt <info@metux.net>

drivers: gpio: amd-fch: make resource struct const

The struct resource field is statically initialized
and may never change. Therefore make it const.

Signed-off-by: Enrico Weigelt <info@metux.net>
Link: https://lore.kernel.org/r/1560787211-15443-1-git-send-email-info@metux.net
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


# a1000673 17-Jun-2019 Enrico Weigelt <info@metux.net>

gpio: amd: Drop unused pdev pointer in privata data

The pointer to the struct platform_device in the driver's private
data struct is never used and therefore can be dropped.

Signed-off-by: Enrico Weigelt <info@metux.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


# f777cda3 06-Mar-2019 Axel Lin <axel.lin@ingics.com>

gpio: amd-fch: Set proper output level for direction_output

Current amd_fch_gpio_direction_output implementation ignores the value
argument, fix it so direction_output will set proper output level.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Enrico Weigelt <info@metux.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


# e226e3c3 01-Mar-2019 Linus Walleij <linus.walleij@linaro.org>

gpio: amd-fch: Fix type error found by sparse

Sparse complains:

gpio-amd-fch.c:45:27: sparse: expected void *
gpio-amd-fch.c:45:27: sparse: got void [noderef] <asn:2> *
gpio-amd-fch.c:45:27: sparse: warning: incorrect type in return
expression (different address spaces)
gpio-amd-fch.c:56:9: sparse: expected void const volatile [noderef]
<asn:2> *addr
gpio-amd-fch.c:56:9: sparse: expected void volatile [noderef] <asn:2> *addr
gpio-amd-fch.c:56:9: sparse: got void *ptr
gpio-amd-fch.c:56:9: sparse: warning: incorrect type in argument 1 (different address spaces)

I think it is because void * is returned rather than void __iomem *,
so fix it up.

Cc: Enrico Weigelt <info@metux.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


# c0162a49 25-Feb-2019 Linus Walleij <linus.walleij@linaro.org>

gpio: amd-fch: Drop const from resource

The build servers and linux-next are complaining like this:

drivers/gpio/gpio-amd-fch.c: In function 'amd_fch_gpio_probe':
drivers/gpio/gpio-amd-fch.c:164:49: warning: passing argument 2 of
'devm_ioremap_resource' discards 'const' qualifier from pointer
target type [-Wdiscarded-qualifiers]
priv->base = devm_ioremap_resource(&pdev->dev, &amd_fch_gpio_iores);
^~~~~~~~~~~~~~~~~~~
In file included from include/linux/platform_device.h:14, from
drivers/gpio/gpio-amd-fch.c:15:
include/linux/device.h:709:15: note: expected 'struct resource *'
but argument is of type 'const struct resource *'
void __iomem *devm_ioremap_resource(struct device *dev,struct resource *res);
^~~~~~~~~~~~~~~~~~~~~

Let's just remove "const" for now.

It is possible that devm_ioremap_resource() should rather
be constified so we can pass const resources as arguments.
But right now I just want to get rid of this build warning.

Fixes: e09d168f13f0 ("gpio: AMD G-Series PCH gpio driver")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Anders Roxell <anders.roxell@linaro.org>
Cc: Enrico Weigelt <info@metux.net>
Tested-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


# e09d168f 22-Feb-2019 Enrico Weigelt, metux IT consult <info@metux.net>

gpio: AMD G-Series PCH gpio driver

GPIO platform driver for the AMD G-series PCH (eg. on GX-412TC)

This driver doesn't registers itself automatically, as it needs to
be provided with platform specific configuration, provided by some
board driver setup code.

Didn't implement oftree probing yet, as it's rarely found on x86.

Cc: linux-gpio@vger.kernel.org
Cc: linus.walleij@linaro.org
Cc: bgolaszewski@baylibre.com
Cc: dvhart@infradead.org
Cc: platform-driver-x86@vger.kernel.org
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>