23 Sep, 2016
4 commits
-
Remove unneeded error handling on the result of a call
to platform_get_resource() when the value is passed to
devm_ioremap_resource().Signed-off-by: Wei Yongjun
Signed-off-by: Linus Walleij -
When using GPIO irqchip helpers to setup irqchip for a gpiolib based
driver, it is not possible to select which GPIOs to add to the IRQ domain.
Instead it just adds all GPIOs which is not always desired. For example
there might be GPIOs that for some reason cannot generated normal
interrupts at all.To support this we add a flag irq_need_valid_mask to struct gpio_chip. When
this flag is set the core allocates irq_valid_mask that holds one bit for
each GPIO the chip has. By default all bits are set but drivers can
manipulate this using set_bit() and clear_bit() accordingly.Then when gpiochip_irqchip_add() is called, this mask is checked and all
GPIOs with bit is set are added to the IRQ domain created for the GPIO
chip.Suggested-by: Linus Walleij
Signed-off-by: Mika Westerberg
Signed-off-by: Linus Walleij -
commit d47529b2e9fe
"gpio: don't include module.h in shared driver header"
removed from the header.It seems arch/arm/mach-omap2/board-rx51-peripherals.c
is using __initdata_or_module from through
to , so break this dependency
so that we get a clean compile.Cc: Paul Gortmaker
Cc: Tony Lindgren
Fixes: d47529b2e9fe ("gpio: don't include module.h in shared driver header")
Signed-off-by: Linus Walleij
19 Sep, 2016
2 commits
-
A bunch of variables were just declared "unsigned" and should
be "unsigned int". Fix it up for this driver.Signed-off-by: Linus Walleij
-
This adds a .get_direction() callback to the TC3589x and
renames the function for setting single-ended mode to be
more to the point.Signed-off-by: Linus Walleij
18 Sep, 2016
2 commits
-
gpiochip_add_data is already used to add data pointer and chip.
Lets rely on gpiochip_get_data which is getting used in other
gpio_chip functions.Signed-off-by: Amitesh Singh
Signed-off-by: Linus Walleij -
Use devm_gpiochip_add_data() for GPIO registration and remove the need
of driver callback .remove.Signed-off-by: Wei Yongjun
Signed-off-by: Linus Walleij
15 Sep, 2016
9 commits
-
In case of error, the function devm_ioremap_resource() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().Signed-off-by: Wei Yongjun
Acked-by: Joel Stanley
Signed-off-by: Linus Walleij -
Most shared headers in include/linux don't need to know what the
internals of a struct module are; all they care about is that it
is a struct and hence they may require a pointer to one.The advantage in this is that module.h is including a lot of stuff
itself, and an otherwise empty C file that just contains module.h
will result in ~750kB from CPP (compared to say 12kB from init.h)So we have approximately 50 instances of "struct module;" in the
various include/linux headers already that help us keep module.h
out of other headers; here we do the same for gpio.Cc: Linus Walleij
Cc: Alexandre Courbot
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker
Signed-off-by: Linus Walleij -
The Kconfig for this file is:
drivers/gpio/Kconfig:config GPIO_WHISKEY_COVE
drivers/gpio/Kconfig: tristate "GPIO support for Whiskey Cove PMIC"...but however it does not include module.h -- it in turn gets it from
another header (gpio/driver.h) and we'd like to replace that with a
forward delcaration of "struct module;" but if we do, this file will
fail to compile.So we fix this first to avoid putting build failures into the bisect
commit history.Cc: Ajay Thomas
Cc: Bin Gao
Cc: Andy Shevchenko
Cc: Mika Westerberg
Cc: Linus Walleij
Cc: Alexandre Courbot
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker
Signed-off-by: Linus Walleij -
The Kconfig for this file is:
drivers/gpio/Kconfig:config GPIO_LOONGSON1
drivers/gpio/Kconfig: tristate "Loongson1 GPIO support"...but however it does not include module.h -- it in turn gets it from
another header (gpio/driver.h) and we'd like to replace that with a
forward delcaration of "struct module;" but if we do, this file will
fail to compile.So we fix this first to avoid putting build failures into the bisect
commit history.Cc: Keguang Zhang
Cc: Linus Walleij
Cc: Alexandre Courbot
Cc: linux-mips@linux-mips.org
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker
Signed-off-by: Linus Walleij -
The Kconfig for this file is:
drivers/gpio/Kconfig:config GPIO_ATH79
drivers/gpio/Kconfig: tristate "Atheros AR71XX/AR724X/AR913X GPIO support"...but however it does not include module.h -- it in turn gets it from
another header (gpio/driver.h) and we'd like to replace that with a
forward delcaration of "struct module;" but if we do, this file will
fail to compile.So we fix this first to avoid putting build failures into the bisect
commit history.Cc: Linus Walleij
Cc: Alexandre Courbot
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker
Signed-off-by: Linus Walleij -
The Kconfig for this file is:
drivers/gpio/Kconfig:config GPIO_ALTERA
drivers/gpio/Kconfig: tristate "Altera GPIO"...but however it does not include module.h -- it in turn gets it from
another header (gpio/driver.h) and we'd like to replace that with a
forward delcaration of "struct module;" but if we do, this file will
fail to compile.So we fix this first to avoid putting build failures into the bisect
commit history.Cc: Linus Walleij
Cc: Alexandre Courbot
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker
Signed-off-by: Linus Walleij -
The Kconfig for this file is:
drivers/gpio/Kconfig:config GPIO_TS4800
drivers/gpio/Kconfig: tristate "TS-4800 DIO blocks and compatibles"...but however it does not include module.h -- it in turn gets it from
another header (gpio/driver.h) and we'd like to replace that with a
forward delcaration of "struct module;" but if we do, this file will
fail to compile.So we fix this first to avoid putting build failures into the bisect
commit history.Cc: Linus Walleij
Cc: Alexandre Courbot
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker
Signed-off-by: Linus Walleij -
This file is currently getting module.h from a global gpio header
and it will faii to build once we remove module.h from that.However, the driver is controlled with the following Kconfig:
drivers/gpio/Kconfig:config GPIO_SX150X
drivers/gpio/Kconfig: bool "Semtech SX150x I2C GPIO expander"and hence the two lines of MODULE_DEVICE_TABLE are no-ops that
can simply be deleted.Cc: Linus Walleij
Cc: Alexandre Courbot
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker
Signed-off-by: Linus Walleij -
This file is currently getting module.h from a global gpio header
and it will fail to build once we remove module.h from that.However, the driver is controlled with the following Kconfig:
drivers/gpio/Kconfig:config GPIO_PALMAS
drivers/gpio/Kconfig: bool "TI PALMAS series PMICs GPIO"and hence the line of MODULE_DEVICE_TABLE is a no-op that can simply
be deleted. In fact it should have been removed in an earlier commit
that did demodularization, however the unseen include prevented my
build testing from detecting it.Cc: Linus Walleij
Cc: Alexandre Courbot
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker
Signed-off-by: Linus Walleij
13 Sep, 2016
7 commits
-
This reverts commit 313b9a9938bf4076425741121d5d766826793e5d.
This was already fixed by
commit bf62efeb164343916ebb89dca6dfe5e6b6751700
"gpio: pca954x: fix undefined error code from remove"The latter is a better fix since it makes it easier to detect
erronous code by not assigning a default error code.Reported-by: Arnd Bergmann
Signed-off-by: Linus Walleij -
The build complains about missing MODULE_LICENSE() in
the Aspeed GPIO driver. The license is evident from the
file header, put in "GPL".Reported-by: Stephen Rothwell
Cc: Alistair Popple
Cc: Jeremy Kerr
Cc: Andrew Jeffery
Acked-by: Joel Stanley
Signed-off-by: Linus Walleij -
Follow DT and forbid default trigger if the GPIO irqchip device is
enumerated from ACPI. Triggering for these devices will be configured
automatically from ACPI interrupt resources provided by the BIOS.Suggested-by: Linus Walleij
Signed-off-by: Mika Westerberg
Signed-off-by: Linus Walleij -
These structures are only used to copy into other structures, so declare
them as const.The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)//
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct gpio_chip i@p = { ... };@ok@
identifier r.i;
expression e;
position p;
@@
e = i@p;@bad@
position p != {r.p,ok.p};
identifier r.i;
struct gpio_chip e;
@@
e@i@p@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct gpio_chip i = { ... };
//Signed-off-by: Julia Lawall
Acked-by: Joachim Eastwood
Signed-off-by: Linus Walleij -
Use devm_gpiochip_add_data() for GPIO registration and remove the need
of driver callback .remove.Signed-off-by: Wei Yongjun
Signed-off-by: Linus Walleij -
…nel/git/lee/mfd into devel
Immutable branch between MFD, GPIO and Regulator due for the v4.9 merge window
-
Linux 4.8-rc2
12 Sep, 2016
10 commits
-
ret is not initialized so it contains garbage. Ensure garbage
is not returned in the case that pdata && pdata->teardown is false
by initializing ret to 0.Signed-off-by: Colin Ian King
Signed-off-by: Linus Walleij -
This patch switches the driver to use the generic GPIO MMIO functions
that removes a bit of redundant and duplicate code.Signed-off-by: Linus Walleij
-
Both gpio_export and gpio_free APIs are obsolete now.
Signed-off-by: Amitesh Singh
Signed-off-by: Linus Walleij -
pca953x_gpio_set_multiple() has some coding style issues that make it
harder to read. Tweak the code a bit.Signed-off-by: Bartosz Golaszewski
Reviewed-by: Andy Shevchenko
Signed-off-by: Linus Walleij -
The chip_type variable in struct pca953x_chip is no longer required.
Remove it.
Signed-off-by: Bartosz Golaszewski
Reviewed-by: Andy Shevchenko
Signed-off-by: Linus Walleij -
Avoid the unnecessary if-else in pca953x_read_regs() by spltting the
routine into smaller, specialized functions and calling the right one
via a function pointer held in struct pca953x.Signed-off-by: Bartosz Golaszewski
Reviewed-by: Andy Shevchenko
Signed-off-by: Linus Walleij -
Avoid the unnecessary if-else in pca953x_write_regs() by splitting
the routine into smaller, specialized functions and calling the right
one via a function pointer held in struct pca953x_chip.Signed-off-by: Bartosz Golaszewski
Reviewed-by: Andy Shevchenko
Signed-off-by: Linus Walleij -
There are multiple places in the driver code where a
switch (chip->chip_type) is used to determine the proper register
offset.Unduplicate the code by adding a simple structure holding the possible
offsets that differ between the pca953x and pca957x chip families and
use it to avoid the checks.Signed-off-by: Bartosz Golaszewski
Reviewed-by: Andy Shevchenko
Signed-off-by: Linus Walleij -
ARM LPC32xx platform is device-tree only, there is no need to keep
a file with GPIO platform data structures, however some of macro
definitions should be moved to the driver code, which is the only user
of the removed header file.Signed-off-by: Vladimir Zapolskiy
Signed-off-by: Linus Walleij -
Using a default trigger is a bad idea if using DT to configure
interrupts, as the device's interrupt specifier will always contain
the trigger configuration.Let's warn about that particular situation, and revert to not
having a default. Hopefully, the couple of drivers still using
this feature will quickly be fixed.Signed-off-by: Marc Zyngier
Signed-off-by: Linus Walleij
08 Sep, 2016
2 commits
-
R-Car Gen3's GPIO blocks are identical to Gen2's in every respect.
Based on work for the r8a7795 (R-Car H3) by Ulrich Hecht.
Cc: Ulrich Hecht
Signed-off-by: Simon Horman
Reviewed-by: Geert Uytterhoeven
Reviewed-by: Laurent Pinchart
Tested-by: Laurent Pinchart
Signed-off-by: Linus Walleij -
The Orion GPIO controller binding description in mrvl-gpio.txt is obsolete, and
duplicates the description in gpio-mvebu.txt.Signed-off-by: Baruch Siach
Reviewed-by: Andrew Lunn
Signed-off-by: Linus Walleij
07 Sep, 2016
3 commits
-
The Aspeed SoCs contain GPIOs banked by letter, where each bank contains
8 pins. The GPIO banks are then grouped in sets of four in the register
layout.The implementation exposes multiple banks through the one driver and
requests and releases pins via the pinctrl subsystem. The hardware
supports generation of interrupts from all GPIO-capable pins.A number of hardware features are not yet supported: Configuration of
interrupt direction (ARM or LPC), debouncing, and WDT reset tolerance
for output ports.Signed-off-by: Joel Stanley
Signed-off-by: Alistair Popple
Signed-off-by: Jeremy Kerr
Signed-off-by: Andrew Jeffery
Signed-off-by: Linus Walleij -
Signed-off-by: Andrew Jeffery
Acked-by: Joel Stanley
Acked-by: Rob Herring
Signed-off-by: Linus Walleij -
The recent addition of the regulator support has led to the pca953x_remove
function returning uninitialized data when no platform data pointer is
provided, as gcc warns when using -Wmaybe-uninitialized:drivers/gpio/gpio-pca953x.c: In function 'pca953x_remove':
drivers/gpio/gpio-pca953x.c:860:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]This restores the previous behavior, returning 0 on success.
Signed-off-by: Arnd Bergmann
Fixes: e23efa311110 ("gpio: pca954x: Add vcc regulator and enable it")
Acked-by: Phil Reid
Signed-off-by: Linus Walleij
31 Aug, 2016
1 commit
-
Change the MFD config option as per latest naming
Signed-off-by: Keerthy
Acked-by: Mark Brown
Signed-off-by: Lee Jones