History log of /drivers/gpio/gpio-pca953x.c
Revision Date Author Comments
4bb93349d9d001f565aafe2a1890cbb6e4476b58 29-Jul-2014 Markus Pargmann <mpa@pengutronix.de> gpio: pca953x: Drop deprecated DT bindings

Drop deprecated DT bindings and use automaticly assigned gpio and irq
bases.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
9f5132ae82fdbb047cc187bf689a81c8cc0de7fa 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>
7bcbce55f20e41c014df4d5d9c8448f7b5e49d79 09-May-2014 Linus Walleij <linus.walleij@linaro.org> gpio: pca953x: use gpiolib irqchip helpers

This switches the PCA953x driver over to using the gpiolib irqchip
helpers to handle the threaded interrups cascaded off this
GPIO chip.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
91329132c909bbeb27699556b98b7f745ddb2ed9 30-Apr-2014 Toby Smith <toby@tismith.id.au> gpio: pca953x: request a shared interrupt

Request a shared interrupt when requesting a pca953x GPIO interrupt

Signed-off-by: Toby Smith <toby@tismith.id.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3275d0723a4cfad2199905623202edaa1ecba8c2 30-Apr-2014 Toby Smith <toby@tismith.id.au> gpio: pca953x: return IRQ_NONE when appropriate

The irq handler should return IRQ_NONE or IRQ_HANDLED to report
if we have handled the interrupt.

Signed-off-by: Toby Smith <toby@tismith.id.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2b1f597f7f40f8f289489eaa1a973254afc2a632 08-Feb-2014 Aaron Sierra <asierra@xes-inc.com> gpio: pca953x: Fix gpio_base may not default to -1

If no device tree node existed for a device when CONFIG_OF_GPIO was
defined, then gpio_base would not default to -1.

Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
e73760a60582b667cfe6d2ba70b74d5297419c42 07-Feb-2014 Aaron Sierra <asierra@xes-inc.com> gpio: pca953x: Add Exar XRA1202

Add Exar XRA1202 8-bit GPIO expander to supported list.

Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Acked-by: Graeme Smecher <gsmecher@threespeedlogic.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
eb32b5aae92176e7a00411082955dab8c62761ee 13-Feb-2014 Aaron Sierra <asierra@xes-inc.com> gpio: pca953x: Add NXP PCA9698

Add the NXP PCA9698 40-bit GPIO expander to the supported list.
Note: This only enables GPIO functionality.

Tested-by: Bob Schmitz <bschmitz@xes-inc.com>
Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Acked-by: Graeme Smecher <gsmecher@threespeedlogic.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1e1916950b00838226295e2600496040276a949f 07-Feb-2014 Aaron Sierra <asierra@xes-inc.com> gpio: pca953x: Add devices to Kconfig help

The pca953x driver supports tca6424 (24-bit) and pca9505 (40-bit)
devices. They were the only supported devices not mentioned in the
Kconfig help.

Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Acked-by: Graeme Smecher <gsmecher@threespeedlogic.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
9fb1f39eb2d6707d265087ee186376e24995f55a 04-Dec-2013 Linus Walleij <linus.walleij@linaro.org> gpio/pinctrl: make gpio_chip members typed boolean

This switches the two members of struct gpio_chip that were
defined as unsigned foo:1 to bool, because that is indeed what
they are. Switch all users in the gpio and pinctrl subsystems
to assign these values with true/false instead of 0/1. The
users outside these subsystems will survive since true/false
is 1/0, atleast we set some kind of more strict typing example.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
e5304db8d7541c1338a6313ae951355b5a72cd19 13-Sep-2013 Graeme Smecher <gsmecher@threespeedlogic.com> gpio: pca953x: Don't flip bits on PCA957x GPIO expanders when probing them.

The pca957x driver supports a handful of I2C GPIO expanders from NXP, Maxim,
and TI. For the PCA9574 and PCA9575 devices only, the driver resets the GPIO
level and direction in the pca957x_probe function. This seems like the wrong
thing to do, since it can cause hardware bit twiddles during warm reboots when
the chip state and reset values don't match.

This kind of initialization is best left upstream (in a bootloader) or
downstream (in userspace). It's also an inconsistency across devices supported
by this driver.

This patch is NOT boot-tested: the SoC I'm using is stuck on 2.6.37, and the
patch doesn't apply trivially.

Signed-off-by: Graeme Smecher <gsmecher@threespeedlogic.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Tested-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5877457a96e5f89567d2eea092ec28db5d55fc06 29-Aug-2013 Vivien Didelot <vivien.didelot@savoirfairelinux.com> gpio: (gpio-pca953x) move header to linux/platform_data/

This patch moves the pca953x.h header from include/linux/i2c to
include/linux/platform_data and updates existing support accordingly.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
40a625daa88653d7942dc85483f6f289cd687cb7 07-Aug-2013 Andrew Ruder <andy@aeruder.net> gpio: pca953x: fix gpio input on gpio offsets >= 8

This change fixes a regression introduced by commit
f5f0b7aa8 (gpio: pca953x: make the register access by GPIO bank)

When the pca953x driver was converted to using 8-bit reads/writes
the bitmask in pca953x_gpio_get_value wasn't adjusted with a
modulus BANK_SZ and consequently looks at the wrong bits in the
input register.

Signed-off-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
e56aee1897fd27631c1cb28e12b0fb8f8f9736f7 30-Jul-2013 Jingoo Han <jg1.han@samsung.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: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
e7a7f972f9120a7985d38a2be8c540047c94392f 03-Apr-2013 Alexandre Belloni <alexandre.belloni@free-electrons.com> gpio: pca953x: fix irq_domain_add_simple usage

We actually have to pass chip as the host_data parameter of
irq_domain_add_simple() as later on, it is used to initialize chip_data
in pca953x_gpio_irq_map(). Failing to do so is leading to a NULL pointer
dereference after calling irq_data_get_irq_chip_data() in
pca953x_irq_mask(), pca953x_irq_unmask(), pca953x_irq_bus_lock(),
pca953x_irq_bus_sync_unlock() and pca953x_irq_set_type().

Fixes regression introduced by commit
0e8f2fdacf1d44651aa7e57063c76142d1f4988b (gpio: pca953x: use simple
irqdomain)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
50e44430c6c1872a761c57161338dea069dc36db 20-Mar-2013 Laurent Navet <laurent.navet@gmail.com> gpio: gpio-pca953x.c: fix checkpatch error

Fix :
gpio/gpio-pca953x.c:150: ERROR: else should follow close brace '}'

Signed-off-by: Laurent Navet <laurent.navet@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
b42748c970d1865685749960cb23f08e259a9f86 25-Jan-2013 Linus Walleij <linus.walleij@linaro.org> gpio: pca953x: use managed resources

Using the devm_* managed resources the pca driver can be simplified
and cut down on boilerplate code.

[gcl: fixed a inccorect reference to a removed label, "goto fail_out"
became "return ret"]

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
0e8f2fdacf1d44651aa7e57063c76142d1f4988b 25-Jan-2013 Gregory CLEMENT <gregory.clement@free-electrons.com> gpio: pca953x: use simple irqdomain

This switches the legacy irqdomain to the simple one, which will
auto-allocate descriptors, and also make sure that we use
irq_create_mapping() in the to_irq function. Also use the map function
of irq_domain_ops to setup the irq configuration on demand and no more
statically during the initialization of the driver.

Based on a initial patch from Linus Walleij <linus.walleij@linaro.org>

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
89f5df01c6b7f2471267bc55b1ecb196c98e195f 22-Jan-2013 Gregory CLEMENT <gregory.clement@free-electrons.com> gpio: pca953x: add support for pca9505

Now that pca953x driver can handle GPIO expanders with more than 32
bits this patch adds the support for the pca9505 which cam with 40
GPIOs.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
f5f0b7aa897ebf6b0d077356a787526212460dd7 22-Jan-2013 Gregory CLEMENT <gregory.clement@free-electrons.com> gpio: pca953x: make the register access by GPIO bank

Until now the pca953x driver accessed all the bank of a given register
in a single command using only a 32 bits variable. New expanders from
the pca53x family come with 40 GPIOs which no more fit in a 32
variable. This patch make access to the registers more generic by
relying on an array of u8 variables. This fits exactly the way the
registers are represented in the hardware.

It also adds helpers to access to a single register of a bank instead
of reading or writing all the banks for a given register.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Tested-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3836309d93462bbf34851c078be6e5e77d888e3d 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu> gpio: remove use of __devinit

CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Peter Tyser <ptyser@xes-inc.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ed32620ea72889c8a9dda278a960bce01136d9a4 08-Nov-2012 Maxime Ripard <maxime.ripard@free-electrons.com> gpio: pca953x: Add compatible strings to gpio-pca953x driver

Even though the device tree binding code was already written, the
compatible strings were not yet in the driver.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
55ecd26373bc995c279a5d988ee36c2767e4f3ca 08-Nov-2012 Maxime Ripard <maxime.ripard@free-electrons.com> gpio: pca953x: Register an IRQ domain

The PCA953x used to register no IRQ domain, which made it impossible to
use it as an interrupt-parent from the device tree.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
ca3ffe910f9935d24e02bb5628a8cbcab119fd9a 10-Jul-2012 Leed Aguilar <leed.aguilar@ti.com> gpio/pca953x: increase variables size to support 24 bit of data

Increase variable size from u16 to u32 to allocate 24 bit of data required for
the TCA6424 I/O expander device type.

Signed-off-by: Leed Aguilar <leed.aguilar@ti.com>
Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
6a7b36aa4b0afbe7a9798feac16de47ad856f358 10-Jul-2012 Chandrabhanu Mahapatra <cmahapatra@ti.com> GPIO: PCA953X: Increase size of invert variable to support 24 bit

TCA6424 is a low voltage 24 bit I2C and SMBus I/O expander of pca953x family
similar to its 16 bit predecessor TCA6416. It comes with three 8-bit active
Input, Output, Polarity Inversion and Configuration registers each. The polarity
of Input ports can be reversed by setting the appropiate bit in Polarity
Inversion registers.

The variables corresponding to Input, Output and Configuration registers have
already been updated to support 24 bit values. This patch thus updates the
invert variable of PCA953X platform data to support 24 bit.

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
96b70641b937e99c1579cb6ebbcdb7b0af98cdd0 21-May-2012 Andreas Schallenberg <Andreas.Schallenberg@3alitytechnica.com> gpio/tca6424: merge I2C transactions, remove cast

This is a follow-up to ae79c1904 "[PATCH v2] Add support for TCA6424"
merged in the v3.5 merge window. It fixes comments made when the
patch was merged.
- Use 3 byte transfers instead of two separate transfers (2+1 byte)
- An unnecessary cast removed

Signed-off-by: Andreas Schallenberg <Andreas.Schallenberg@3alitytechnica.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
ae79c19049b75af476adcbcfda6fc29bd93fc6f8 09-May-2012 Andreas Schallenberg <Andreas.Schallenberg@3alitytechnica.com> Add support for TCA6424A

This patch extends the PCA953x driver to support TI's TCA6424A 24 bit I2C I/O expander. The patch is based on code by Michele
Bevilacqua.

Changes in v2:
- Compare ngpio against 24 in both places, not >16
- Larger datatype now u32 instead of uint.
Bit fields not used for struct members since their address is taken.
- Be precise: TCA6424A (untested for older TCA6424)

Signed-off-by: Andreas Schallenberg<Andreas.Schallenberg@3alitytechnica.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
404ba2b8f611bea3228daf031f03901d0c34ecd7 21-Nov-2011 Mark Brown <broonie@opensource.wolfsonmicro.com> gpio: pca953x: Staticise pca953x_get_altdata()

It's not used outside of the driver so doesn't need to be exported, and
sparse notices this and complains about it.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
7ea2aa2046a15af1c048115e7c05f1ba1566899d 14-Oct-2011 Wolfram Sang <w.sang@pengutronix.de> gpio: pca953x: propagate the errno from the chip_init functions

Initializing the chips may return with an error, but this error gets
dropped in probe(). Propagate this further to the driver core. Also,
simplify returning the error in one of the init functions.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
f0eb824beee3f596b9799e667a6fdac3116e9f7d 14-Oct-2011 Wolfram Sang <w.sang@pengutronix.de> gpio: pca953x: remove unneeded check for chip type

We can assume our own device_id table is correct, so remove checking if
the chip type is valid. (The check was bogus anyway: If it found an
invalid entry, it returned with 0!) This is in preparation for further
cleanups.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
25fcf2b7f1f65d2cc12182ced3ccd47576970be4 11-Oct-2011 Hartmut Knaack <knaack.h@gmx.de> gpio-pca953x: fix gpio_base

gpio_base was set to 0 if no system platform data or open firmware
platform data was provided. This led to conflicts, if any other gpiochip
with a gpiobase of 0 was instantiated already. Setting it to -1 will
automatically use the first one available.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
a57339b4b5daf23b4cec450b37906d5f8b5fa722 14-Jun-2011 David Jander <david@protonic.nl> gpio/pca953x: Deprecate meaningless device-tree bindings

The property 'polarity' is handled by the GPIO core, and the 'gpio-base'
should be assigned automatically. It is meaningless in the device-tree,
since GPIO's are identified by the "chip-name"/offset pair.
This way, the whole pca953x_get_alt_pdata() can hopefully soon go away.
We still need to check whether we really want GPIO-interrupt functionality
by simply looking if the I2C node has an interrupts property defined, since
this property is not used for anything else.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
c6dcf592437e5919cb03af5dcfe369702e6a4a7c 14-Jun-2011 David Jander <david@protonic.nl> gpio/pca953x: Remove dynamic platform data pointer

In the case that we obtain device-tree data to fill in platform_data, the new
platform data struct was dynamically allocated, but the pointer to it was not
used everywhere it should. It seems easier to fix this issue by removing the
dynamic allocation altogether since its data is only used during driver
probing.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
c609c05db10dcb020f6869186e548a0596a78896 14-Jun-2011 David Jander <david@protonic.nl> gpio/pca953x: Fix IRQ support.

It seems that in the normal case, IRQ_NOREQUEST needs to be explicitly
cleared, otherwise claiming the interrupt fails.
In the case of sparse interrupts, the descriptor needs to be allocated
first.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
6dd599f8af0166805951f4421a78ba716d78321a 08-Jun-2011 David Jander <david@protonic.nl> gpio/pca953x: Fix warning of enabled interrupts in handler

When using nested threaded irqs, use handle_nested_irq(). This function
does not call the chip handler, so no handler is set.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
17e8b42c17c3e9735ea03c4e6b67cedf5de170f4 08-Jun-2011 David Jander <david@protonic.nl> gpio/pca953x: Interrupt pin is active-low

The interrupt pin of the PCA953x is active low, and on the rising edge
no interrupt should be produced.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
910c8fb6b4b8c9e0be576b6a78f4cccf228a4bfd 08-Jun-2011 David Jander <david@protonic.nl> gpio/pca953x: Fix IRQ support.

It seems that in the normal case, IRQ_NOREQUEST needs to be explicitly
cleared, otherwise claiming the interrupt fails.
In the case of sparse interrupts, the descriptor needs to be allocated
first.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
c103de240439dfee24ac50eb99c8be3a30d13323 05-Jun-2011 Grant Likely <grant.likely@secretlab.ca> gpio: reorganize drivers

Sort the gpio makefile and enforce the naming convention gpio-*.c for
gpio drivers.

v2: cleaned up filenames in Kconfig and comment blocks
v3: fixup use of BASIC_MMIO to GENERIC_GPIO for mxc

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>