05 Jan, 2016
1 commit
-
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().Cc: Nicholas Krause
Cc: Marek Vasut
Cc: Semen Protsenko
Signed-off-by: Linus Walleij
27 Dec, 2015
1 commit
-
As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.Also start to propagate the error code here as the end of the
series fixes this to work for all drivers.Cc: Semen Protsenko
Reviewed-by: Marek Vasut
Reviewed-by:Nicholas Krause
Signed-off-by: Linus Walleij
30 Nov, 2015
1 commit
-
i2c_driver does not need to set an owner because i2c_register_driver()
will set it.Signed-off-by: Krzysztof Kozlowski
Signed-off-by: Linus Walleij
19 Nov, 2015
1 commit
-
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->parentand:
@@
struct gpio_chip var;
@@
-var.dev
+var.parentand:
@@
struct bgpio_chip *var;
@@
-var->gc.dev
+var->gc.parentPlus 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
Cc: Rafał Miłecki
Cc: Richard Purdie
Cc: Mauro Carvalho Chehab
Cc: Alek Du
Cc: Jaroslav Kysela
Cc: Takashi Iwai
Acked-by: Dmitry Torokhov
Acked-by: Greg Kroah-Hartman
Acked-by: Lee Jones
Acked-by: Jiri Kosina
Acked-by: Hans-Christian Egtvedt
Acked-by: Jacek Anaszewski
Signed-off-by: Linus Walleij
26 Aug, 2015
1 commit
-
This fixes error handling in the function max732x_probe by checking
if the calls to the function max732x_readb fail by returning a error
code.Signed-off-by: Nicholas Krause
Signed-off-by: Linus Walleij
16 Jul, 2015
1 commit
-
In case the gpiochip doesn't have the .dev field set, as is the case
in here, it is not possible to reference this device in DT as a GPIO
controller. A good example of this problem is that gpio-leds can not
be used when connected to this chip, the gpio-leds driver bails out
with -EPROBE_DEFER.Fix this problem by setting the .dev field of the gpio_chip to the
parent i2c device.Signed-off-by: Marek Vasut
Cc: Alexandre Courbot
Cc: Linus Walleij
Cc: Mans Rullgard
Cc: Olaf Mandel
Cc: Semen Protsenko
Signed-off-by: Linus Walleij
06 May, 2015
2 commits
-
MAX732X clears all pending interrupts on I2C read (when interrupts
register is being read). Driver doesn't need to send any ACKs when
interrupt was handled. So replace handle_edge_irq() with
handle_simple_irq().Using handle_edge_irq() (w/o .irq_ack callback set) may lead to NULL
pointer dereference in some cases. E.g. this was observed on
hibernation process:Unable to handle kernel NULL pointer dereference at virtual address 0
Backtrace:
(handle_edge_irq) from (resend_irqs)
(resend_irqs) from (tasklet_action)
(tasklet_action) from (__do_softirq)
(__do_softirq) from (run_ksoftirqd)
(run_ksoftirqd) from (smpboot_thread_fn)
(smpboot_thread_fn) from (kthread)
(kthread) from (ret_from_fork)Signed-off-by: Semen Protsenko
Reviewed-by: Grygorii Strashko
Signed-off-by: Linus Walleij -
It's possible that multiple MAX732X can be hooked up to the same
interrupt line with the processor. So add IRQF_SHARED in requesting irq.Signed-off-by: Semen Protsenko
Signed-off-by: Linus Walleij
04 May, 2015
1 commit
-
Set .irq_set_wake callback to prevent possible issues on wake-up.
This patch was inspired by this commit:
b80eef95beb04760629822fa130aeed54cdfafcaSigned-off-by: Semen Protsenko
Signed-off-by: Linus Walleij
02 Mar, 2015
1 commit
-
Take a sweep to bring the irq support for the MAX732x expanders
into the gpiolib core to cut down on duplicated code.Only compile tested! I need some feedback from people using this
expander with interrupts to tell me if things go right or
wrong when I do this.Cc: Semen Protsenko
Cc: Mans Rullgard
Signed-off-by: Linus Walleij
03 Feb, 2015
1 commit
-
Cast the struct gpio_chip into a max732x_chip using an inline
macro and move the assignment to the variable declaration
to save lines and simplify things.Cc: Semen Protsenko
Acked-by: Mans Rullgard
Signed-off-by: Linus Walleij
30 Jan, 2015
1 commit
-
This adds a set_multiple function to the MAX732x GPIO driver,
allowing for performance gains when using gpiod_set_array().Signed-off-by: Mans Rullgard
Signed-off-by: Linus Walleij
16 Jan, 2015
3 commits
-
This patch was derived from next one:
"gpio: fix pca953x set_type 'scheduling while atomic' bug".After adding entry that consumes max732x GPIO as interrupt line to dts
file, deadlock appears somewhere in max732x probe function.Deadlock caught by lockdep (from kernel log):
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< cut here >>>>>>>>>>>>>>>>>>>>>>>>>>>
[ 0.473419] ======================================================
[ 0.473419] [ INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected ]
[ 0.473449] 3.x.xx-xxxxx-xxxxxxxx-dirty #2 Tainted: G W
[ 0.473449] ------------------------------------------------------
[ 0.473449] swapper/0/1 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
[ 0.473449] (&lock->wait_lock){+.+...}, at: [] rt_mutex_trylock+0xc/0x74
[ 0.473480]
[ 0.473480] and this task is already holding:
[ 0.473510] (&chip->lock){......}, at: [] max732x_gpio_set_value+0x2c/0xa4
[ 0.473541] which would create a new lock dependency:
[ 0.473541] (&chip->lock){......} -> (&lock->wait_lock){+.+...}...
[ 0.474273] *** DEADLOCK ***
[ 0.474273]
[ 0.474273] 5 locks held by swapper/0/1:
[ 0.474273] #0: (&__lockdep_no_validate__){......}, at: [] __driver_attach+0x48/0x98
[ 0.474304] #1: (&__lockdep_no_validate__){......}, at: [] __driver_attach+0x58/0x98
[ 0.474334] #2: (&chip->irq_lock){+.+...}, at: [] max732x_irq_bus_lock+0x14/0x20
[ 0.474365] #3: (&irq_desc_lock_class){-.....}, at: [] __irq_get_desc_lock+0x48/0x88
[ 0.474365] #4: (&chip->lock){......}, at: [] max732x_gpio
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< cut here >>>>>>>>>>>>>>>>>>>>>>>>>>>Signed-off-by: Semen Protsenko
Signed-off-by: Linus Walleij -
Signed-off-by: Semen Protsenko
Signed-off-by: Linus Walleij -
Signed-off-by: Semen Protsenko
Signed-off-by: Linus Walleij
22 Jul, 2014
1 commit
-
Signed-off-by: abdoulaye berthe
Signed-off-by: Linus Walleij
12 Mar, 2014
2 commits
-
In max732x_probe() driver allocates dummy I2C device (if number of ports
is greater than 8) with i2c_new_dummy() but it does not check the return
value of this call.In case of error (i2c_new_device(): memory allocation failure or I2C
address cannot be used) this function returns NULL which is later
dereferenced by i2c_smbus_read_byte() (called from max732x_readb()).Signed-off-by: Krzysztof Kozlowski
Signed-off-by: Linus Walleij -
In max732x_probe() driver allocates dummy I2C device (if number of ports
is greater than 8) however it is not unregistered if probe fails later.
Fix the leak by unregistering dummy I2C device if it was allocated.Signed-off-by: Krzysztof Kozlowski
Signed-off-by: Linus Walleij
04 Dec, 2013
1 commit
-
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
16 Aug, 2013
1 commit
-
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.Signed-off-by: Jingoo Han
Signed-off-by: Linus Walleij
27 Mar, 2013
1 commit
-
Use devm_kzalloc() to make cleanup paths simpler.
Signed-off-by: Jingoo Han
Signed-off-by: Linus Walleij
29 Nov, 2012
3 commits
-
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.Signed-off-by: Bill Pemberton
Cc: Grant Likely
Acked-by: Linus Walleij
Cc: Peter Tyser
Acked-by: Mark Brown
Signed-off-by: Greg Kroah-Hartman -
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.Signed-off-by: Bill Pemberton
Cc: Grant Likely
Cc: Peter Tyser
Cc: Santosh Shilimkar
Cc: Kevin Hilman
Acked-by: Linus Walleij
Acked-by: Mark Brown
Signed-off-by: Greg Kroah-Hartman -
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.Signed-off-by: Bill Pemberton
Cc: Grant Likely
Cc: Peter Tyser
Acked-by: Linus Walleij
Acked-by: Mark Brown
Signed-off-by: Greg Kroah-Hartman
07 Jun, 2011
1 commit
-
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 mxcSigned-off-by: Grant Likely