Commit Graph

303 Commits (06296a1e684bcd40b9a28d5d8030809e4295528b)

Author SHA1 Message Date
Axel Lin 164d5c3988 gpio: wm831x: add a missing break in wm831x_gpio_dbg_show
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-07-15 14:03:30 -06:00
Mathias Nyman 2345b20fd9 gpio/langwell_gpio: ack the correct bit for langwell gpio interrupts
The wrong bit was masked when acking langwell gpio interrupts.

Reason for maskig the wrong bit was probably because__ffs() and ffs() functions
return bit indexes differently (0..31 vs 1..32)

This fixes langwell based devices from hanging when a gpio interrupt is
triggered and undoes the breakage which occurred in change set
732063b92b

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-07-08 09:32:01 -06:00
Axel Lin 58956ba23e gpio: tps65910: add missing breaks in tps65910_gpio_init
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-07-05 23:17:08 -06:00
Ambresh K 55b220cafa gpio/omap4: Fix missing interrupts during device wakeup due to IOPAD.
If gpio pins from bank[2-5] are marked as wakeup enable and if the wake is
through gpio IO pad wakeup, then that wakeup gpio interrupt is lost.

In the current implementation, GPIO driver stores the context of DATAIN of
all the gpio in the bank. During GPIO resuming, it checks DATAIN with wakeup
enabled pins of gpio bank. If there is status change, then manually toggle
GPIO_LEVELDETECT to generate pseudo interrupt.

Reported-by: Philippe Mazet <p-mazet@ti.com>
Tested-by: Philippe Mazet <p-mazet@ti.com>
Signed-off-by: Ambresh K <ambresh@ti.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-06-16 08:40:43 -06:00
Linus Walleij 33d78647dc gpio/nomadik: fix sleepmode for elder Nomadik
The mach-nomadik machine did not compile properly due to bad
ux500-specific functions being called. Introduce new state
variables to fix this up.

Reported-by: Axel Lin <axel.lin@gmail.com>
Cc: Alessandro Rubini <rubini@unipv.it>
Cc: Prafulla Wadaskar <prafulla.wadaskar@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-06-09 15:03:38 -06:00
Grant Likely c226feb013 Merge branch 'for_3.0/gpio-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into gpio/merge 2011-06-08 09:12:16 -06:00
H Hartley Sweeten 32919a28cc gpio/samsung: make Kconfig options def_bool
The Samsung GPIO drivers are always built-in when the relevant
platform is selected.  Change the Kconfig symbol to def_bool y
dependant on the platform.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-06-07 14:37:27 -06:00
Thomas Abraham 0bf8fa04e8 gpio/exynos4: Fix incorrect mapping of gpio pull-up macro to register setting
The S3C_GPIO_PULL_UP macro value incorrectly maps to a reserved setting of GPIO
pull up/down registers on Exynos4 platform. Fix this incorrect mapping by adding
wrappers to the s3c_gpio_setpull_updown and s3c_gpio_getpull_updown functions.

Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-06-07 11:10:01 -06:00
Colin Cross 85ec7b9705 GPIO: OMAP: add locking around calls to _set_gpio_triggering
_set_gpio_triggering uses read-modify-write on bank registers,
lock bank->lock around all calls to it to prevent register
corruption if two cpus access gpios in the same bank at the
same time.

Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2011-06-06 16:12:34 -07:00
Colin Cross 0622b25bf0 GPIO: OMAP: fix setting IRQWAKEN bits for OMAP4
Setting the IRQWAKEN bit was overwriting previous IRQWAKEN bits,
causing only the last bit set to take effect, resulting in lost
wakeups when the GPIO controller is in idle.

Replace direct writes to IRQWAKEN with MOD_REG_BIT calls to
perform a read-modify-write on the register.

Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2011-06-06 16:12:23 -07:00
Russell King d52b31deff GPIO: OMAP: fix section mismatch warnings
WARNING: arch/arm/plat-omap/built-in.o(.devinit.text+0x46c): Section mismatch in reference from the function omap_gpio_probe() to the function .init.text:omap_gpio_chip_init()
The function __devinit omap_gpio_probe() references
a function __init omap_gpio_chip_init().
If omap_gpio_chip_init is only used by omap_gpio_probe then
annotate omap_gpio_chip_init with a matching annotation.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2011-06-06 16:11:55 -07:00
Kyungmin Park 27721a52d6 gpio: Fix gpio-exynos4 build fails in mainline
After the GPIO driver move, some symbols became selectable when they
shouldn't be.  Tighten the dependencies.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-29 23:53:20 -06:00
Linus Torvalds fac04863ce arm gpio drivers: make them 'depends on ARM'
We had a few drivers move from arch/arm into drivers/gpio, but they
don't actually compile without the ARM platform headers etc.  As a
result they were messing up allyesconfig on x86.

Make them depend on ARM.

Reported-by: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-05-29 14:06:42 -07:00
Linus Torvalds 04830fccdc Merge branch 'gpio/next' of git://git.secretlab.ca/git/linux-2.6
* 'gpio/next' of git://git.secretlab.ca/git/linux-2.6:
  gpio/pch_gpio: Support new device ML7223
  gpio: make gpio_{request,free}_array gpio array parameter const
  GPIO: OMAP: move to drivers/gpio
  GPIO: OMAP: move register offset defines into <plat/gpio.h>
  gpio: Convert gpio_is_valid to return bool
  gpio: Move the s5pc100 GPIO to drivers/gpio
  gpio: Move the s5pv210 GPIO to drivers/gpio
  gpio: Move the exynos4 GPIO to drivers/gpio
  gpio: Move to Samsung common GPIO library to drivers/gpio
  gpio/nomadik: add function to read GPIO pull down status
  gpio/nomadik: show all pins in debug
  gpio: move Nomadik GPIO driver to drivers/gpio
  gpio: move U300 GPIO driver to drivers/gpio
  langwell_gpio: add runtime pm support
  gpio/pca953x: Add support for pca9574 and pca9575 devices
  gpio/cs5535: Show explicit dependency between gpio_cs5535 and mfd_cs5535
2011-05-28 10:56:34 -07:00
Grant Likely 1486a7409b Merge branch 'for_2.6.40/gpio-move' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into gpio/next 2011-05-27 23:52:58 -06:00
Tomoya MORINAGA bc786ccead gpio/pch_gpio: Support new device ML7223
Support new device OKI SEMICONDUCTOR ML7223 IOH(Input/Output Hub).
The ML7223 IOH is for MP(Media Phone) use.
The ML7223 is companion chip for Intel Atom E6xx series.
The ML7223 is completely compatible for Intel EG20T PCH.

Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-27 17:56:45 -06:00
Lars-Peter Clausen 7c295975a8 gpio: make gpio_{request,free}_array gpio array parameter const
gpio_{request,free}_array should not (and do not) modify the passed gpio
array, so make the parameter const.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-27 17:56:45 -06:00
Kevin Hilman e5cdb13ff9 GPIO: OMAP: move to drivers/gpio
Move OMAP GPIO driver to drivers/gpio.  Builds whenever
CONFIG_ARCH_OMAP=y.

Signed-off-by: Kevin Hilman <khilman@ti.com>
2011-05-27 08:43:34 -07:00
Jorge Eduardo Candelaria 11ad14f86a TPS65911: Add support for added GPIO lines
GPIO 1 to 8 are added for TPS65911 chip version. The gpio driver
now handles more than one gpio lines. Subsequent versions of the
chip family can add new GPIO lines with minimal driver changes.

Signed-off-by: Jorge Eduardo Candelaria <jedu@slimlogic.co.uk>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27 10:49:29 +01:00
Jorge Eduardo Candelaria 83545d836c GPIO: TPS65910: Move driver to drivers/gpio/
The GPIO driver should reside in drivers/gpio/ for better
organization.

Signed-off-by: Jorge Eduardo Candelaria <jedu@slimlogic.co.uk>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27 10:49:29 +01:00
Kyungmin Park 82ab0f75ee gpio: Move the s5pc100 GPIO to drivers/gpio
Move the Samsung s5pc100 SoC GPIO driver to drivers/gpio

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-26 17:33:41 -06:00
Kyungmin Park 347ec4e47d gpio: Move the s5pv210 GPIO to drivers/gpio
Move the Samsung s5pv210 SoC GPIO driver to drivers/gpio

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-26 17:33:37 -06:00
Kyungmin Park ab48f16137 gpio: Move the exynos4 GPIO to drivers/gpio
Move the Samsung Exynos4 series SoCs GPIO driver to drivers/gpio

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-26 17:32:50 -06:00
Kyungmin Park fed6a02247 gpio: Move to Samsung common GPIO library to drivers/gpio
It's common gpiolib for recent Samsung SoCs. Move to drivers/gpio

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-26 17:31:22 -06:00
Rickard Andersson bc6f5cf648 gpio/nomadik: add function to read GPIO pull down status
Signed-off-by: Rickard Andersson <rickard.andersson@stericsson.com>
Reviewed-by: Martin Persson <martin.persson@stericsson.com>
[Split off from larger patch]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-26 17:30:18 -06:00
Rabin Vincent 8ea72a30a3 gpio/nomadik: show all pins in debug
Useful to check the status of the runtime pin muxing.

Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
[Squashed, modified to use chip-internal IRQ trigger state]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-26 17:30:18 -06:00
Grant Likely 37d7245764 gpio: move Nomadik GPIO driver to drivers/gpio
This moves the Nomadik GPIO driver out of arch/arm/plat-nomadik
and into the desired location indicated by the subsystem
maintainer.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
[grant.likely: squashed with kconfig fixup]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-26 17:30:03 -06:00
Linus Walleij 06caa7ad83 gpio: move U300 GPIO driver to drivers/gpio
This moves the U300 GPIO driver out of arch/arm/mach-u300 and into
the desired location indicated by the subsystem maintainer.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-26 17:29:33 -06:00
Kristen Carlson Accardi 7812803a31 langwell_gpio: add runtime pm support
While this is essentially a no-op for this driver, it has the
side effect of letting the PMU driver snoop D3 requests from
the PCI core for this driver.

This is only for langwell, not for whitney point.

Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-26 14:24:36 -06:00
Haojian Zhuang 33226ffd07 gpio/pca953x: Add support for pca9574 and pca9575 devices
PCA957x is i2c gpio expander, and similar to PCA953x. Although register
configurations are different between PCA957x and PCA953x. They can share
a lot of components, such as IRQ handling, GPIO IN/OUT. So updating PCA953x
driver to support PCA957x chips.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-26 13:58:30 -06:00
Ed Wildgoose 073cc4e95a gpio/cs5535: Show explicit dependency between gpio_cs5535 and mfd_cs5535
cs5535-gpio.c has been split into two, with various setup moved
into cs5535-mfd.c.  Given that cs5535-gpio will not load without
the -mfd part, lets make that dependency explicit in Kconfig

Signed-off-by: Ed Wildgoose <kernel@wildgooses.com>
Acked-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-26 13:54:18 -06:00
Linus Torvalds 8b29336fe0 Merge branch 'gpio/next' of git://git.secretlab.ca/git/linux-2.6
* 'gpio/next' of git://git.secretlab.ca/git/linux-2.6:
  gpio/via: rename VIA local config struct
  basic_mmio_gpio: split into a gpio library and platform device
  gpio: remove some legacy comments in build files
  gpio: add trace events for setting direction and value
  gpio/pca953x: Use handle_simple_irq instead of handle_edge_irq
  gpiolib: export gpiochip_find
  gpio: remove redundant Kconfig depends on GPIOLIB
  basic_mmio_gpio: convert to non-__raw* accessors
  basic_mmio_gpio: support direction registers
  basic_mmio_gpio: support different input/output registers
  basic_mmio_gpio: detect output method at probe time
  basic_mmio_gpio: request register regions
  basic_mmio_gpio: allow overriding number of gpio
  basic_mmio_gpio: convert to platform_{get,set}_drvdata()
  basic_mmio_gpio: remove runtime width/endianness evaluation
2011-05-26 12:14:41 -07:00
Samuel Ortiz 3d2bdf759f mfd: Use mfd cell platform_data for janz cells platform bits
With the addition of a platform device mfd_cell pointer, MFD drivers
can go back to passing platform data back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.

Cc: Ira W. Snyder <iws@ovro.caltech.edu>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-05-26 19:45:08 +02:00
Samuel Ortiz 9abd768a8d mfd: Use mfd cell platform_data for rdc321x cells platform bits
With the addition of a platform device mfd_cell pointer, MFD drivers
can go back to passing platform data back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.

Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-05-26 19:45:06 +02:00
Samuel Ortiz 3271d382c3 mfd: Use mfd cell platform_data for timberdale cells platform bits
With the addition of a device platform mfd_cell pointer, MFD drivers
can go back to passing platform data back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.

Acked-by: Richard Röjfors <richard.rojfors@pelagicore.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-05-26 19:45:05 +02:00
Andrew Morton 545554e7c5 drivers/gpio/ml_ioh_gpio.c needs slab.h
alpha allmodconfig:

  drivers/gpio/ml_ioh_gpio.c: In function 'ioh_gpio_probe':
  drivers/gpio/ml_ioh_gpio.c:205: error: implicit declaration of function 'kzalloc'
  drivers/gpio/ml_ioh_gpio.c:205: warning: assignment makes pointer from integer without a cast

also fix this:

  drivers/gpio/ml_ioh_gpio.c:145: warning: 'ioh_gpio_save_reg_conf' defined but not used
  drivers/gpio/ml_ioh_gpio.c:154: warning: 'ioh_gpio_restore_reg_conf' defined but not used

Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-05-25 08:39:57 -07:00
Andrew Morton c5e7043ef7 drivers/gpio/vx855_gpio.c needs slab.h
alpha allmodconfig:

  drivers/gpio/vx855_gpio.c: In function 'vx855gpio_probe':
  drivers/gpio/vx855_gpio.c:233: error: implicit declaration of function 'kzalloc'
  drivers/gpio/vx855_gpio.c:233: warning: assignment makes pointer from integer without a cast

Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-05-25 08:39:56 -07:00
Jamie Iles 280df6b3c3 basic_mmio_gpio: split into a gpio library and platform device
Allow GPIO_BASIC_MMIO_CORE to be used to provide an accessor library
for implementing GPIO drivers whilst abstracting the register access
detail.  Based on a patch from Anton Vorontsov[1] and adapted to allow
bgpio_chip to be embedded in another structure.

Changes since v1:
	- Register the gpio_chip in the platform device probe

1. https://lkml.org/lkml/2011/4/19/401

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-20 00:40:19 -06:00
Linus Walleij e849dc044a gpio: remove some legacy comments in build files
The build files for drivers/gpio has some wording and comments
about the directory being reserved exclusively for GPIO expanders
(according to the gpio.txt file these are on external busses) and
this has been false for some time. We already have PL061 and
Xilinx drivers which are in silicon and now I'm moving more
silicon drivers here, so delete this and reword it a bit.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-20 00:40:19 -06:00
Uwe Kleine-König 3f397c2144 gpio: add trace events for setting direction and value
This patch allows to trace gpio operations using ftrace

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-20 00:40:19 -06:00
Erik Botö cc300d9ead gpio/pca953x: Use handle_simple_irq instead of handle_edge_irq
Make pca953x driver use the simple irq handler since no hardware control
is necessary and the driver lacks an irq_ack function. handle_edge_irq()
calls chip->irq_ack() which crashes since this function does not exist.

Signed-off-by: Erik Botö <erik.boto@pelagicore.com>
Signed-off-by: Richard Röjfors <richard.rojfors@pelagicore.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-20 00:40:18 -06:00
Jean Delvare 8fa0c9bf82 gpiolib: export gpiochip_find
Export function gpiochip_find so that modules can use it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-20 00:40:18 -06:00
H Hartley Sweeten 6cff9e2b34 gpio: remove redundant Kconfig depends on GPIOLIB
Since all the drivers are in a 'if GPIOLIB/endif block', the depends on GPIOLIB
is redundant so remove them.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-20 00:40:17 -06:00
Jamie Iles fd99623521 basic_mmio_gpio: convert to non-__raw* accessors
The __raw_* accessors don't include memory barriers and can cause
problems when writes get stuck in write buffers.

Suggested-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-20 00:40:17 -06:00
Jamie Iles 31029116eb basic_mmio_gpio: support direction registers
Most controllers require the direction of a GPIO to be set by writing to
a direction register.  Add support for either an input direction
register or an output direction register.

Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-20 00:40:17 -06:00
Jamie Iles dd86a0cc5e basic_mmio_gpio: support different input/output registers
Some controllers have separate input and output registers.  For these
controllers, use "set" for the output and "dat" for the input.

Changes since v2: reuse "set" for output and "dat" for input rather than
adding a new "in" register.

Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-20 00:40:16 -06:00
Jamie Iles e027d6f9d5 basic_mmio_gpio: detect output method at probe time
Rather than detecting the output method each time in the .set()
callback, do it at probe time and set the appropriate callback.

Changes since v2: moved the reg_dat initialization into
bgpio_setup_io().

Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-20 00:40:16 -06:00
Jamie Iles 364b5e8718 basic_mmio_gpio: request register regions
Make sure that we get the register regions with request_mem_region()
before ioremap() to make sure we have exclusive access.

Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-20 00:40:16 -06:00
Jamie Iles 924e7a9fc6 basic_mmio_gpio: allow overriding number of gpio
Some platforms may have a number of GPIO that is less than the register
width of the peripheral.

Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-20 00:40:15 -06:00
Jamie Iles 4ddb8ae217 basic_mmio_gpio: convert to platform_{get,set}_drvdata()
Use the platform drvdata helpers rather than working on the struct
device itself.

Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-20 00:40:14 -06:00