04 Oct, 2016
2 commits
-
probe_irq_off() returns '0' on failure, not NO_IRQ, so the check
in this driver is clearly wrong. This replaces it with the
regular '!irq' check used in other drivers.The sa1100 platform that this driver is used on originally numbered
all its interrupts starting at '0', which would have conflicted with
this change, but as of commit 18f3aec ("ARM: 8230/1: sa1100: shift
IRQs by one"), this is not a problem any more.Signed-off-by: Arnd Bergmann
Signed-off-by: Lee Jones -
probe_irq_on() only returns non-zero if it found any interrupts below
IRQ32 which could be probe candidates. If all the probable interrupts
are higher than 32, then this will cause a failure. Fix this.Signed-off-by: Russell King
Signed-off-by: Lee Jones
19 Apr, 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().Signed-off-by: Linus Walleij
Signed-off-by: Lee Jones
18 Jan, 2016
1 commit
-
Pull GPIO updates from Linus Walleij:
"Here is the bulk of GPIO changes for v4.5.Notably there are big refactorings mostly by myself, aimed at getting
the gpio_chip into a shape that makes me believe I can proceed to
preserve state for a proper userspace ABI (character device) that has
already been proposed once, but resulted in the feedback that I need
to go back and restructure stuff. So I've been restructuring stuff.
On the way I ran into brokenness (return code from the get_value()
callback) and had to fix it. Also, refactored generic GPIO to be
simpler.Some of that is still waiting to trickle down from the subsystems all
over the kernel that provide random gpio_chips, I've touched every
single GPIO driver in the kernel now, oh man I didn't know I was
responsible for so much...Apart from that we're churning along as usual.
I took some effort to test and retest so it should merge nicely and we
shook out a couple of bugs in -next.Infrastructural changes:
- In struct gpio_chip, rename the .dev node to .parent to better
reflect the fact that this is not the GPIO struct device
abstraction. We will add that soon so this would be totallt
confusing.- It was noted that the driver .get_value() callbacks was sometimes
reporting negative -ERR values to the gpiolib core, expecting them
to be propagated to consumer gpiod_get_value() and gpio_get_value()
calls. This was not happening, so as there was a mess of drivers
returning negative errors and some returning "anything else than
zero" to indicate that a line was active. As some would have bit
31 set to indicate "line active" it clashed with negative error
codes. This is fixed by the largeish series clamping values in all
drivers with !!value to [0,1] and then augmenting the code to
propagate error codes to consumers. (Includes some ACKed patches
in other subsystems.)- Add a void *data pointer to struct gpio_chip. The container_of()
design pattern is indeed very nice, but we want to reform the
struct gpio_chip to be a non-volative, stateless business, and keep
states internal to the gpiolib to be able to hold on to the state
when adding a proper userspace ABI (character device) further down
the road. To achieve this, drivers need a handle at the internal
state that is not dependent on their struct gpio_chip() so we add
gpiochip_add_data() and gpiochip_get_data() following the pattern
of many other subsystems. All the "use gpiochip data pointer"
patches transforms drivers to this scheme.- The Generic GPIO chip header has been merged into the general
header, and the custom header for that
removed. Instead of having a separate mm_gpio_chip struct for
these generic drivers, merge that into struct gpio_chip,
simplifying the code and removing the need for separate and
confusing includes.Misc improvements:
- Stabilize the way GPIOs are looked up from the ACPI legacy
specification.- Incremental driver features for PXA, PCA953X, Lantiq (patches from
the OpenWRT community), RCAR, Zynq, PL061, 104-idi-48New drivers:
- Add a GPIO chip to the ALSA SoC AC97 driver.
- Add a new Broadcom NSP SoC driver (this lands in the pinctrl dir,
but the branch is merged here too to account for infrastructural
changes).- The sx150x driver now supports the sx1502"
* tag 'gpio-v4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (220 commits)
gpio: generic: make bgpio_pdata always visible
gpiolib: fix chip order in gpio list
gpio: mpc8xxx: Do not use gpiochip_get_data() in mpc8xxx_gpio_save_regs()
gpio: mm-lantiq: Do not use gpiochip_get_data() in ltq_mm_save_regs()
gpio: brcmstb: Allow building driver for BMIPS_GENERIC
gpio: brcmstb: Set endian flags for big-endian MIPS
gpio: moxart: fix build regression
gpio: xilinx: Do not use gpiochip_get_data() in xgpio_save_regs()
leds: pca9532: use gpiochip data pointer
leds: tca6507: use gpiochip data pointer
hid: cp2112: use gpiochip data pointer
bcma: gpio: use gpiochip data pointer
avr32: gpio: use gpiochip data pointer
video: fbdev: via: use gpiochip data pointer
gpio: pch: Optimize pch_gpio_get()
Revert "pinctrl: lantiq: Implement gpio_chip.to_irq"
pinctrl: nsp-gpio: use gpiochip data pointer
pinctrl: vt8500-wmt: use gpiochip data pointer
pinctrl: exynos5440: use gpiochip data pointer
pinctrl: at91-pio4: use gpiochip data pointer
...
11 Jan, 2016
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.Cc: Lee Jones
Signed-off-by: Linus Walleij
Signed-off-by: Lee Jones
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
16 Sep, 2015
1 commit
-
Most interrupt flow handlers do not use the irq argument. Those few
which use it can retrieve the irq number from the irq descriptor.Remove the argument.
Search and replace was done with coccinelle and some extra helper
scripts around it. Thanks to Julia for her help!Signed-off-by: Thomas Gleixner
Cc: Julia Lawall
Cc: Jiang Liu
11 Aug, 2015
2 commits
-
irq is incremented for no value in the for loop. Remove it.
Search and update was done with coccinelle and the invaluable help of
Julia Lawall.Signed-off-by: Thomas Gleixner
Signed-off-by: Lee Jones -
set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOENFor IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also modify IRQ_NOPROBE and this has been maintained although it
is not clear that is really needed. There appears to be a great deal of
blind copy and paste of this code.Signed-off-by: Rob Herring
Acked-by: Linus Walleij
Signed-off-by: Lee Jones
18 Jun, 2015
1 commit
-
Convert SA11x0 (Neponset, SA1111, and UCB1x00 code) to use the new
irq_set_chained_handler_and_data() helper.Signed-off-by: Russell King
Cc: Alexandre Courbot
Cc: Hans Ulli Kroll
Cc: Jason Cooper
Cc: Lee Jones
Cc: Linus Walleij
Cc: Thierry Reding
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/E1Z4yzx-0002S6-7p@rmk-PC.arm.linux.org.uk
Signed-off-by: Thomas Gleixner
19 Sep, 2014
1 commit
-
this remove all reference to gpio_remove retval in all driver
except pinctrl and gpio. the same thing is done for gpio and
pinctrl in two different patches.Signed-off-by: Abdoulaye Berthe
Acked-by: Michael Büsch
Acked-by: Dmitry Torokhov
Acked-by: Mauro Carvalho Chehab
Acked-by: Tomi Valkeinen
Signed-off-by: Linus Walleij
19 Mar, 2014
1 commit
-
Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler.
Signed-off-by: Jingoo Han
Signed-off-by: Lee Jones
23 Oct, 2013
1 commit
-
Fix to return a negative error code in the irq alloc error handling
case instead of 0, as done elsewhere in this function.Signed-off-by: Wei Yongjun
Signed-off-by: Lee Jones
02 Sep, 2013
1 commit
-
Error handling is on-its-head in this function. After invoking a function we
should examine the return code and return the error value if there was one.
Instead, this function checks for success and goes onto provide functionality
if success was received. Not so bad in a simple function like this, but in
a more complex one this could end up drowning in curly brackets.Signed-off-by: Lee Jones
07 Aug, 2013
1 commit
-
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the build
warnings when CONFIG_PM_SLEEP is not selected. This is because
sleep PM callbacks defined by SET_SYSTEM_SLEEP_PM_OPS are only used
when the CONFIG_PM_SLEEP is enabled.drivers/mfd/ucb1x00-core.c:672:12: warning: 'ucb1x00_suspend' defined but not used [-Wunused-function]
drivers/mfd/ucb1x00-core.c:704:12: warning: 'ucb1x00_resume' defined but not used [-Wunused-function]Signed-off-by: Jingoo Han
Signed-off-by: Lee Jones
31 Jul, 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: Lee Jones
19 Feb, 2012
13 commits
-
Add genirq wakeup support for the ucb1x00 device. This allows an
attached gpio_keys driver to wakeup the system. Touchscreen is also
possible.When there are no wakeup sources, ask the platform to assert the reset
signal to avoid any unexpected behaviour; this also puts the reset
signal at the right level when power is removed from the device.Acked-by: Jochen Friedrich
Signed-off-by: Russell King -
Convert the ucb1x00 driver to use genirq's interrupt services, rather
than its own private implementation. This allows a wider range of
drivers to use the GPIO interrupts (such as the gpio_keys driver)
without being aware of the UCB1x00's private IRQ system.This prevents the UCB1x00 core driver from being built as a module,
so adjust the configuration to add that restriction.Acked-by: Jochen Friedrich
Signed-off-by: Russell King -
Convert the ucb1x00-core driver to use dev_pm_ops rather than the legacy
members in the mcp driver.Acked-by: Jochen Friedrich
Signed-off-by: Russell King -
The ucb1x00-core was leaving the mcp clock enabled indefinitely after
probe. This needlessly wastes power. Add the necessary disables to
ensure that the clock remains off when we don't need it.Acked-by: Jochen Friedrich
Signed-off-by: Russell King -
ucb1x00_enable() and ucb1x00_disable() are used for power saving on the
SIB interface, allowing the host supplied clock to be disabled when not
required. We require drivers which access the ucb1x00 to ensure that
they have enabled the clock prior to accessing the device, and they
should disable it once they're done.As we don't expect gpiolib users to be aware of this detail, we must
make these calls in the gpiolib interfaces. Add them.Also add them to the resume method, which needs to re-establish the
GPIO pin settings.Acked-by: Jochen Friedrich
Signed-off-by: Russell King -
Cosmetic patch to scan the list of drivers in the order that the drivers
are registered, rather than the reverse order. This avoids surprises
when drivers get probed in the reverse order, and input devices get
registered in a different order due to bind/unbind than from boot.Acked-by: Jochen Friedrich
Signed-off-by: Russell King -
Register the gpio device with proper .owner and .dev elements set
appropraitely.Acked-by: Jochen Friedrich
Signed-off-by: Russell King -
Clean up the device handling so we can use the struct device sanely.
Acked-by: Jochen Friedrich
Signed-off-by: Russell King -
Convert the ucb1x00 driver to use mutexes rather than the depreciated
semaphores for exclusive access to the ADC.Acked-by: Jochen Friedrich
Signed-off-by: Russell King -
Add a .owner initializer to the UCB1x00 mcp driver structure, and
set an appropriate module alias to identify this driver.Acked-by: Jochen Friedrich
Signed-off-by: Russell King -
Provide a way to handle the software controlled ucb1x00 reset signal
from the ucb1x00-core driver without having to code platform specifics
into these drivers.Acked-by: Jochen Friedrich
Signed-off-by: Russell King -
Nothing in this driver requires anything from the machine/platform
headers, so remove this needless header file.Acked-by: Jochen Friedrich
Signed-off-by: Russell King -
Patch taken from 5dd7bf59e0 (ARM: sa11x0: Implement autoloading of codec
and codec pdata for mcp bus.) by Jochen Friedrich .This adds just the codec data part of the patch.
Acked-by: Jochen Friedrich
Signed-off-by: Russell King
04 Feb, 2012
1 commit
-
The dma_device_t variables are only ever written to by mcp-sa11x0 and
never read. As the old SA11x0 DMA support will be removed, remove
these so that it no longer depends on the old SA11x0 DMA definitions.Acked-by: Jochen Friedrich
Signed-off-by: Russell King
22 Jan, 2012
2 commits
-
gpiolib drivers should first set the output data before setting the
direction to avoid putting glitches on an output signal. As an
additional bonus, we tweak the code to avoid unnecessary register
writes to the output and direction registers if they have no need
to be updated.Signed-off-by: Russell King
-
We were not restoring the UCB1x00 gpio output data on resume, resulting
in incorrect GPIO output data after a resume. Add the missing register
write.Signed-off-by: Russell King
21 Jan, 2012
1 commit
-
This reverts commit 5dd7bf59e0e8563265b3e5b33276099ef628fcc7.
Conflicts:
scripts/mod/file2alias.c
This change is wrong on many levels. First and foremost, it causes a
regression. On boot on Assabet, which this patch gives a codec id of
'ucb1x00', it gives:ucb1x00 ID not found: 1005
0x1005 is a valid ID for the UCB1300 device.
Secondly, this patch is way over the top in terms of complexity. The
only device which has been seen to be connected with this MCP code is
the UCB1x00 (UCB1200, UCB1300 etc) devices, and they all use the same
driver. Adding a match table, requiring the codec string to match the
hardware ID read out of the ID register, etc is completely over the top
when we can just read the hardware ID register.
09 Jan, 2012
1 commit
-
Signed-off-by: Jochen Friedrich
Signed-off-by: Samuel Ortiz
08 Mar, 2010
1 commit
-
This patch fixes a build failure[1], by adding the missing semaphore.h include
References:
[1] http://kisskb.ellerman.id.au/kisskb/buildresult/2234322/Signed-off-by: Peter Huewe
Signed-off-by: Samuel Ortiz
28 Nov, 2009
2 commits
-
The old access methods to the gpios will be removed when
all users has been converted. (mainly ucb1x00-ts) -
So drivers like collie_battery driver can use
those files easier.
12 Oct, 2009
1 commit
-
After m68k's task_thread_info() doesn't refer to current,
it's possible to remove sched.h from interrupt.h and not break m68k!
Many thanks to Heiko Carstens for allowing this.Signed-off-by: Alexey Dobriyan
25 Mar, 2009
1 commit
-
Cc: sameo@openedhand.com
Acked-by: Greg Kroah-Hartman
Signed-off-by: Kay Sievers
30 Nov, 2008
1 commit
-
When ISA_DMA_API is unset, we're not implementing the ISA DMA API,
so there's no point in publishing the prototypes via asm/dma.h, nor
including the machine dependent parts of that API.This allows us to remove a lot of mach/dma.h files which don't contain
any useful code. Unfortunately though, some platforms put their own
private non-ISA definitions into mach/dma.h, so we leave these behind
and fix the appropriate #include statments.Signed-off-by: Russell King