summaryrefslogtreecommitdiff
path: root/drivers/gpio
AgeCommit message (Collapse)Author
2017-11-29Merge tag 'tegra-l4t-r21.6' into toradex_tk1_l4t_r21.6Marcel Ziswiler
Merge NVIDIA's latest Linux for Tegra aka L4T R21.6 Linux kernel changes from git://nv-tegra.nvidia.com/linux-3.10.git commit: b271e8fa67a6d9c4600274a25636cfe00fdd1b68 Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Dominik Sliwa <dominik.sliwa@toradex.com>
2017-10-06mfd: apalis-tk1-k20: clean-up and fix support for 0.10 k20 fwApalis-TK1_LXDE-Image_2.7b4-20171007Dominik Sliwa
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-10-05mfd: apalis-tk1-k20: support for 0.10 k20 fwDominik Sliwa
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-01-11apalis_tk1: Support for K20 based MFDApalis_TK1_LinuxImageV2.7Beta1_20170112Dominik Sliwa
On Apalis TK1 boards K20 MCU is used for CAN, GPIO, ADC and touch screen. This patch includes support for core MFD device, GPIO, ADC and touch screen. Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2016-11-01gpio: pca953x: fix gpio input on gpio offsets >= 8Martin Chi
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. Bug 1826501 Change-Id: Id9c9d1cab9fb97e2fdf9408b03873722f787fbec 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> (cherry picked from commit 40a625daa88653d7942dc85483f6f289cd687cb7) Signed-off-by: Martin Chi <mchi@nvidia.com> Reviewed-on: http://git-master/r/1241694 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/1242944 GVS: Gerrit_Virtual_Submit
2014-09-15gpio: tegra: call pinctrl dirctions apis on direction input/outputLaxman Dewangan
Set the pins in different direction based on client request from gpio. This will help to non-tristate the pin on gpio output mode or enable input on gpio input mode without any explicit condition. Bug 200033491 Change-Id: I074451e344bfd8465aceb39c1091809da4f58f58 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> (cherry picked from commit c520a6048a942b5870f560979045c74659c8fe76) Reviewed-on: http://git-master/r/#/c/415991/ Reviewed-on: http://git-master/r/498326 Reviewed-by: Winnie Hsu <whsu@nvidia.com> Tested-by: Winnie Hsu <whsu@nvidia.com> Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
2014-09-15gpio: tegra: Enable pinctrl_request_gpioshravanid
Call pinctrl_request_gpio when gpio is requested by tegra_gpio_request Bug 200033491 Change-Id: I0e0a129adf51775edaa5887b11188f0ed1776e0e Signed-off-by: shravanid <shravanid@nvidia.com> Reviewed-on: http://git-master/r/404352 (cherry picked from commit 7ba0a34569bff25730406a4c54967e4e2c470cbc) Reviewed-on: http://git-master/r/498325 GVS: Gerrit_Virtual_Submit Reviewed-by: Bibek Basu <bbasu@nvidia.com> Tested-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: Venkat Moganty <vmoganty@nvidia.com> Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
2014-06-05Merge branch 'linux-3.10.40' into rel-21Ishan Mittal
Bug 200004122 Conflicts: drivers/cpufreq/cpufreq.c drivers/regulator/core.c sound/soc/codecs/max98090.c Change-Id: I9418a05ad5c56b2e902249218bac2fa594d99f56 Signed-off-by: Ishan Mittal <imittal@nvidia.com>
2014-06-03gpio: of: fix memory leak in of_gpiochip_initAllen Yu
propname should be freed if fail to resolve the phandle property. bug 200007297 Change-Id: I26bf03daaca976bea1450d3d4c40b358037d4339 Signed-off-by: Allen Yu <alleny@nvidia.com> Reviewed-on: http://git-master/r/415084 (cherry picked from commit 3673891f9f6f3d372ba5b013b9a335146b14d97e) Reviewed-on: http://git-master/r/416828 Reviewed-by: Mandar Padmawar <mpadmawar@nvidia.com> Tested-by: Mandar Padmawar <mpadmawar@nvidia.com>
2014-05-13gpio: mxs: Allow for recursive enable_irq_wake() callMarek Vasut
commit a585f87c863e4e1d496459d382b802bf5ebe3717 upstream. The scenario here is that someone calls enable_irq_wake() from somewhere in the code. This will result in the lockdep producing a backtrace as can be seen below. In my case, this problem is triggered when using the wl1271 (TI WlCore) driver found in drivers/net/wireless/ti/ . The problem cause is rather obvious from the backtrace, but let's outline the dependency. enable_irq_wake() grabs the IRQ buslock in irq_set_irq_wake(), which in turns calls mxs_gpio_set_wake_irq() . But mxs_gpio_set_wake_irq() calls enable_irq_wake() again on the one-level-higher IRQ , thus it tries to grab the IRQ buslock again in irq_set_irq_wake() . Because the spinlock in irq_set_irq_wake()->irq_get_desc_buslock()->__irq_get_desc_lock() is not marked as recursive, lockdep will spew the stuff below. We know we can safely re-enter the lock, so use IRQ_GC_INIT_NESTED_LOCK to fix the spew. ============================================= [ INFO: possible recursive locking detected ] 3.10.33-00012-gf06b763-dirty #61 Not tainted --------------------------------------------- kworker/0:1/18 is trying to acquire lock: (&irq_desc_lock_class){-.-...}, at: [<c00685f0>] __irq_get_desc_lock+0x48/0x88 but task is already holding lock: (&irq_desc_lock_class){-.-...}, at: [<c00685f0>] __irq_get_desc_lock+0x48/0x88 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&irq_desc_lock_class); lock(&irq_desc_lock_class); *** DEADLOCK *** May be due to missing lock nesting notation 3 locks held by kworker/0:1/18: #0: (events){.+.+.+}, at: [<c0036308>] process_one_work+0x134/0x4a4 #1: ((&fw_work->work)){+.+.+.}, at: [<c0036308>] process_one_work+0x134/0x4a4 #2: (&irq_desc_lock_class){-.-...}, at: [<c00685f0>] __irq_get_desc_lock+0x48/0x88 stack backtrace: CPU: 0 PID: 18 Comm: kworker/0:1 Not tainted 3.10.33-00012-gf06b763-dirty #61 Workqueue: events request_firmware_work_func [<c0013eb4>] (unwind_backtrace+0x0/0xf0) from [<c0011c74>] (show_stack+0x10/0x14) [<c0011c74>] (show_stack+0x10/0x14) from [<c005bb08>] (__lock_acquire+0x140c/0x1a64) [<c005bb08>] (__lock_acquire+0x140c/0x1a64) from [<c005c6a8>] (lock_acquire+0x9c/0x104) [<c005c6a8>] (lock_acquire+0x9c/0x104) from [<c051d5a4>] (_raw_spin_lock_irqsave+0x44/0x58) [<c051d5a4>] (_raw_spin_lock_irqsave+0x44/0x58) from [<c00685f0>] (__irq_get_desc_lock+0x48/0x88) [<c00685f0>] (__irq_get_desc_lock+0x48/0x88) from [<c0068e78>] (irq_set_irq_wake+0x20/0xf4) [<c0068e78>] (irq_set_irq_wake+0x20/0xf4) from [<c027260c>] (mxs_gpio_set_wake_irq+0x1c/0x24) [<c027260c>] (mxs_gpio_set_wake_irq+0x1c/0x24) from [<c0068cf4>] (set_irq_wake_real+0x30/0x44) [<c0068cf4>] (set_irq_wake_real+0x30/0x44) from [<c0068ee4>] (irq_set_irq_wake+0x8c/0xf4) [<c0068ee4>] (irq_set_irq_wake+0x8c/0xf4) from [<c0310748>] (wlcore_nvs_cb+0x10c/0x97c) [<c0310748>] (wlcore_nvs_cb+0x10c/0x97c) from [<c02be5e8>] (request_firmware_work_func+0x38/0x58) [<c02be5e8>] (request_firmware_work_func+0x38/0x58) from [<c0036394>] (process_one_work+0x1c0/0x4a4) [<c0036394>] (process_one_work+0x1c0/0x4a4) from [<c0036a4c>] (worker_thread+0x138/0x394) [<c0036a4c>] (worker_thread+0x138/0x394) from [<c003cb74>] (kthread+0xa4/0xb0) [<c003cb74>] (kthread+0xa4/0xb0) from [<c000ee00>] (ret_from_fork+0x14/0x34) wlcore: loaded Signed-off-by: Marek Vasut <marex@denx.de> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-23gpiolib: avoid sleeping lock from atomic context in gpiochip_addLaxman Dewangan
If GPIO device is added from device tree then gpiochip_add() try to find the aliased base for that device on atomic context. The of_alias_get_id() is sleeping calls, so it dumps warning of sleeping calls from atomic context as: -- [ 6.320139] BUG: sleeping function called from invalid context at kernel/kernel/mutex.c:413 [ 6.332406] in_atomic(): 1, irqs_disabled(): 128, pid: 1, name: swapper/0 [ 6.339157] INFO: lockdep is turned off. [ 6.343058] irq event stamp: 106315 [ 6.346523] hardirqs last enabled at (106315): [<ffffffc0000a6724>] vprintk_emit+0x1ac/0x57c [ 6.355017] hardirqs last disabled at (106314): [<ffffffc0000a65c8>] vprintk_emit+0x50/0x57c [ 6.363423] softirqs last enabled at (105022): [<ffffffc0000ac730>] __do_softirq+0x1b8/0x2c0 [ 6.371917] softirqs last disabled at (105017): [<ffffffc0000ac91c>] do_softirq+0x6c/0x84 [ 6.380074] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 3.10.33-g60742c9-dirty #47 [ 6.388385] Call trace: [ 6.390818] [<ffffffc0000885f4>] dump_backtrace+0x0/0x16c [ 6.396192] [<ffffffc000088770>] show_stack+0x10/0x1c [ 6.401218] [<ffffffc000956a30>] dump_stack+0x1c/0x28 [ 6.406243] [<ffffffc0000d604c>] __might_sleep+0x118/0x120 [ 6.411703] [<ffffffc00095b788>] mutex_lock_nested+0x40/0x350 [ 6.417424] [<ffffffc0006d05f8>] of_alias_get_id+0x2c/0x94 [ 6.422891] [<ffffffc000350170>] gpiochip_add+0x1b8/0x3f0 [ 6.428255] [<ffffffc0003531dc>] pca953x_probe+0x214/0x4fc ---- Rewrite this piece of code such that of_alias_get_id() will get called from non-atomic context to avoid above bug. Change-Id: I0c003f9fbec9661acaa3c5e41c4bc90f6d50729f Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/396957 Reviewed-by: Thomas Cherry <tcherry@nvidia.com> GVS: Gerrit_Virtual_Submit
2014-03-13Merge branch 'linux-3.10.33' into dev-kernel-3.10Deepak Nibade
Bug 1456092 Change-Id: I3021247ec68a3c2dddd9e98cde13d70a45191d53 Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
2014-01-30gpio: tegra: prints gpio port name when taking dumpLaxman Dewangan
When taking dump of tegra gpio through debug FS, also prints the gpio port name like A, B, C, etc. for easy understanding. Change-Id: I38af2f7c696ad7633456be5ca1f8c164edcd94f6 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/361532
2014-01-21drivers: gpio: fix gpio-tegra for arm64Peng Du
Bug 1237374 Change-Id: Id328c81193eb0e2d44123cd45c8de7ce400e95b3 Signed-off-by: Peng Du <pdu@nvidia.com> Reviewed-on: http://git-master/r/200298 Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com>
2014-01-17gpio: pca953x: pass the of_node pointer to gpio chipLaxman Dewangan
Pass of_node pointer to to gpio chip when device registered through DT. Change-Id: Ie5210379789e0b4a2d42ba693601ee528133a99f Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/356510
2014-01-17gpio: alias gpio base number for gpio from DTLaxman Dewangan
Alias the gpio base number when registering the device from DT. This will help on assigning the base gpio number to gpio controller so that non-dt client of gpio can use these gpios. Change-Id: I12ce2108d21d21fa7c9a0c60d498d4136515add2 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/356512
2014-01-17gpio: print the gpio numbers which are allocated for gpio deviceLaxman Dewangan
To help on debugging the gpio device registration, enable prints for alloated range of gpio to the gpio device. Change-Id: I7a0cef54220cf5c4bf1c6bd58d19c0443be8f293 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/356511
2014-01-15gpio-rcar: R-Car GPIO IRQ share interruptKuninori Morimoto
commit c234962b808f289237a40e4ce5fc1c8066d1c9d0 upstream. R-Car H1 or Gen2 GPIO interrupts are assigned per each GPIO domain, but, Gen1 E1/M1 GPIO interrupts are shared for all GPIO domain. gpio-rcar driver needs IRQF_SHARED flags for these. This patch was tested on Bock-W board Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-09gpio: msm: Fix irq mask/unmask by writing bits instead of numbersStephen Boyd
commit 4cc629b7a20945ce35628179180329b6bc9e552b upstream. We should be writing bits here but instead we're writing the numbers that correspond to the bits we want to write. Fix it by wrapping the numbers in the BIT() macro. This fixes gpios acting as interrupts. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-09gpio: twl4030: Fix regression for twl gpio LED outputRoger Quadros
commit f5837ec11f8cfa6d53ebc5806582771b2c9988c6 upstream. Commit 0b2aa8be introduced a regression that causes failure in setting LED GPO direction to OUT. This causes USB host probe failures for Beagleboard C4. platform usb_phy_gen_xceiv.2: Driver usb_phy_gen_xceiv requests probe deferral hsusb2_vcc: Failed to request enable GPIO510: -22 reg-fixed-voltage reg-fixed-voltage.0.auto: Failed to register regulator: -22 reg-fixed-voltage: probe of reg-fixed-voltage.0.auto failed with error -22 direction_out/direction_in must return 0 if the operation succeeded. Also, don't update direction flag and output data if twl4030_set_gpio_direction() failed inside twl_direction_out(); Signed-off-by: Roger Quadros <rogerq@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-30Merge branch 'remotes/android/android-3.10' into dev-kernel-3.10Bharat Nihalani
Change-Id: I0c919e55654e0c224a5f8a5df80d9f49e92dbb37
2013-12-18gpiolib: remove warnning of allocations with IRQs disabledZhangfei Gao
Move of_gpiochip_add outof spin_lock, since kzalloc inside of_gpiochip_add -> of_gpiochip_add_pin_range -> gpiochip_add_pin_range -> kzalloc WARNING: at kernel/lockdep.c:2740 lockdep_trace_alloc+0xf8/0xfc() DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags)) Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-12-17gpiolib: safer implementation of desc_to_gpio()Alexandre Courbot
The current implementation of desc_to_gpio() relies on the chip pointer to be set to a valid value in order to compute the GPIO number. This was done in the hope that we can get rid of the gpio_desc global array, but this is not happening anytime soon. This patch reimplements desc_to_gpio() in a fashion similar to that of gpio_to_desc(). As a result, desc_to_gpio(gpio_to_desc(gpio)) == gpio is now always true. This allows to call desc_to_gpio() on non-initialized descriptors as some error-handling code currently does. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Reported-by: Dr. H. Nikolaus Schaller <hns@goldelico.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-12-16Merge tag 'v3.10.24' into HEADAjay Nandakumar
This is the 3.10.24 stable release Change-Id: Ibd2734f93d44385ab86867272a1359158635133b
2013-12-11powerpc/gpio: Fix the wrong GPIO input data on MPC8572/MPC8536Liu Gang
commit 1aeef303b5d9e243c41d5b80f8bb059366514a10 upstream. For MPC8572/MPC8536, the status of GPIOs defined as output cannot be determined by reading GPDAT register, so the code use shadow data register instead. But the code may give the wrong status of GPIOs defined as input under some scenarios: 1. If some pins were configured as inputs and were asserted high before booting the kernel, the shadow data has been initialized with those pin values. 2. Some pins have been configured as output first and have been set to the high value, then reconfigured as input. The above cases will make the shadow data for those input pins to be set to high. Then reading the pin status will always return high even if the actual pin status is low. The code should eliminate the effects of the shadow data to the input pins, and the status of those pins should be read directly from GPDAT. Acked-by: Scott Wood <scottwood@freescale.com> Acked-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: Liu Gang <Gang.Liu@freescale.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-04gpio: pl061: move irqdomain initializationLinus Walleij
commit 2ba3154d9cb13697b97723cce75633b48adfe826 upstream. The PL061 driver had the irqdomain initialization in an unfortunate place: when used with device tree (and thus passing the base IRQ 0) the driver would work, as this registers an irqdomain and waits for mappings to be done dynamically as the devices request their IRQs, whereas when booting using platform data the irqdomain core would attempt to allocate IRQ descriptors dynamically (which works fine) but also to associate the irq_domain_associate_many() on all IRQs, which in turn will call the mapping function which at this point will try to set the type of the IRQ and then tries to acquire a non-initialized spinlock yielding a backtrace like this: CPU: 0 PID: 1 Comm: swapper Not tainted 3.13.0-rc1+ #652 Backtrace: [<c0016f0c>] (dump_backtrace) from [<c00172ac>] (show_stack+0x18/0x1c) r6:c798ace0 r5:00000000 r4:c78257e0 r3:00200140 [<c0017294>] (show_stack) from [<c0329ea0>] (dump_stack+0x20/0x28) [<c0329e80>] (dump_stack) from [<c004fa80>] (__lock_acquire+0x1c0/0x1b80) [<c004f8c0>] (__lock_acquire) from [<c0051970>] (lock_acquire+0x6c/0x80) r10:00000000 r9:c0455234 r8:00000060 r7:c047d798 r6:600000d3 r5:00000000 r4:c782c000 [<c0051904>] (lock_acquire) from [<c032e484>] (_raw_spin_lock_irqsave+0x60/0x74) r6:c01a1100 r5:800000d3 r4:c798acd0 [<c032e424>] (_raw_spin_lock_irqsave) from [<c01a1100>] (pl061_irq_type+0x28/0x) r6:00000000 r5:00000000 r4:c798acd0 [<c01a10d8>] (pl061_irq_type) from [<c0059ef4>] (__irq_set_trigger+0x70/0x104) r6:00000000 r5:c01a10d8 r4:c046da1c r3:c01a10d8 [<c0059e84>] (__irq_set_trigger) from [<c005b348>] (irq_set_irq_type+0x40/0x60) r10:c043240c r8:00000060 r7:00000000 r6:c046da1c r5:00000060 r4:00000000 [<c005b308>] (irq_set_irq_type) from [<c01a1208>] (pl061_irq_map+0x40/0x54) r6:c79693c0 r5:c798acd0 r4:00000060 [<c01a11c8>] (pl061_irq_map) from [<c005d27c>] (irq_domain_associate+0xc0/0x190) r5:00000060 r4:c046da1c [<c005d1bc>] (irq_domain_associate) from [<c005d604>] (irq_domain_associate_man) r8:00000008 r7:00000000 r6:c79693c0 r5:00000060 r4:00000000 [<c005d5d0>] (irq_domain_associate_many) from [<c005d864>] (irq_domain_add_simp) r8:c046578c r7:c035b72c r6:c79693c0 r5:00000060 r4:00000008 r3:00000008 [<c005d814>] (irq_domain_add_simple) from [<c01a1380>] (pl061_probe+0xc4/0x22c) r6:00000060 r5:c0464380 r4:c798acd0 [<c01a12bc>] (pl061_probe) from [<c01c0450>] (amba_probe+0x74/0xe0) r10:c043240c r9:c0455234 r8:00000000 r7:c047d7f8 r6:c047d744 r5:00000000 r4:c0464380 This moves the irqdomain initialization to a point where the spinlock and GPIO chip are both fully propulated, so the callbacks can be used without crashes. I had some problem reproducing the crash, as the devm_kzalloc():ed zeroed memory would seemingly mask the spinlock as something OK, but by poisoning the lock like this: u32 *dum; dum = (u32 *) &chip->lock; *dum = 0xaaaaaaaaU; I could reproduce, fix and test the patch. Reported-by: Russell King <linux@arm.linux.org.uk> Cc: Rob Herring <robherring2@gmail.com> Cc: Haojian Zhuang <haojian.zhuang@linaro.org> Cc: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-04gpio: rcar: NULL dereference on error in probe()Dan Carpenter
commit 0c8aab8e65e450f2bfea494c1b6a86ded653f88c upstream. It's not obvious from the label name but "err1" tries to release "p->irq_domain" which leads to a NULL dereference. Fixes: 119f5e448d32 ('gpio: Renesas R-Car GPIO driver V3') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-04gpio: mvebu: make mvchip->irqbase signed for error handlingDan Carpenter
commit d535922691fc026479fcc03e78ac3d931a54e75a upstream. There is a bug in mvebu_gpio_probe() where we do: mvchip->irqbase = irq_alloc_descs(-1, 0, ngpios, -1); if (mvchip->irqbase < 0) { The problem is that mvchip->irqbase is unsigned so the error handling doesn't work. I have changed it to be a regular int. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-04gpio: twl4030: Fix regression for twl gpio outputTony Lindgren
commit 0b2aa8bed3e13892fcac77e4f50ec6e80125469d upstream. Commit c111feabe2e2 (gpio: twl4030: Cache the direction and output states in private data) improved things in general, but caused a regression for setting the GPIO output direction. The change reorganized twl_direction_out() and twl_set() and swapped the function names around in the process. While doing that, a bug got introduced that's not obvious while reading the patch as it appears as no change to the code. The bug is we now call function twl4030_set_gpio_dataout() twice in both twl_direction_out() and twl_set(). Instead, we should first call twl_direction_out() in twl_direction_out() followed by twl4030_set_gpio_dataout() in twl_set(). This regression probably has gone unnoticed for a long time as the bootloader may have set the GPIO direction properly in many cases. This fixes at least the LCD panel not turning on omap3 LDP for example. Cc: linux-gpio@vger.kernel.org Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-11gpio: as3722: remove this driverLaxman Dewangan
The ams AS3722 gpio functionality is moved to pinctrl-as3722 driver and hence removing this driver. Change-Id: Iffb9cd047c879ffddd4db484c4db54d6292e7444 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/328692 Reviewed-by: Automatic_Commit_Validation_User
2013-11-07gpio: fix allocation in atomic contextLaxman Dewangan
For initialisation of the GPIO based on DT data, it allocates memory. Hence calling the gpio initialisation based on dt node on non-atomic context. bug 1400884 Change-Id: I69b7a4be980078c1fa5e5e43f9c7bf24ecb97dd2 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/327106 GVS: Gerrit_Virtual_Submit
2013-11-04gpio/lynxpoint: check if the interrupt is enabled in IRQ handlerMika Westerberg
commit 03d152d5582abc8a1c19cb107164c3724bbd4be4 upstream. Checking LP_INT_STAT is not enough in the interrupt handler because its contents get updated regardless of whether the pin has interrupt enabled or not. This causes the driver to loop forever for GPIOs that are pulled up. Fix this by checking the interrupt enable bit for the pin as well. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-31Merge tag 'v3.10.17' into dev-kernel-3.10Ajay Nandakumar
This is the 3.10.17 stable release Conflicts: drivers/usb/host/xhci.c Change-Id: I6bd3b15ff92a0b94568b9d02e9bb1036becfca20
2013-10-28ARM: tegra: Move mach-tegra/{gic.h, pm-irq.h}Ajay Nandakumar
Moving mach-tegra/gic.h and mach-tegra/pm-irq.h to include/linux/irqchip/tegra-irq.h so that it helps faclitate the movement of irq drivers from mach-tegra/ to drivers/. Bug 1379891 Change-Id: Id062ebc16441ac295df78731c1e44b32e75d3286 Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com> Reviewed-on: http://git-master/r/302884 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
2013-10-16arm: tegra: register save and restore opsPrashant Gaikwad
Register syscore ops for modules whose context has to saved/restore during entry/exit to LP0 state from CPU Idle. Bug 1254633 Change-Id: Idf4a67535754db3ccc2fc528469fb17ec198cee0 Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com> Reviewed-on: http://git-master/r/299447 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
2013-10-13gpio/omap: auto-setup a GPIO when used as an IRQJavier Martinez Canillas
commit fac7fa162a19100298d5d91359960037dc5bfca9 upstream. The OMAP GPIO controller HW requires a pin to be configured in GPIO input mode in order to operate as an interrupt input. Since drivers should not be aware of whether an interrupt pin is also a GPIO or not, the HW should be fully configured/enabled as an IRQ if a driver solely uses IRQ APIs such as request_irq(), and never calls any GPIO-related APIs. As such, add the missing HW setup to the OMAP GPIO controller's irq_chip driver. Since this bypasses the GPIO subsystem we have to ensure that another driver won't be able to request the same GPIO pin that is used as an IRQ and set its direction as output. Requesting the GPIO and setting its direction as input is allowed though. This fixes smsc911x ethernet support for tobi and igep OMAP3 boards and OMAP4 SDP SPI based ethernet that use a GPIO as an interrupt line. Acked-by: Stephen Warren <swarren@nvidia.com> Tested-by: George Cherian <george.cherian@ti.com> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi> Tested-by: Lars Poeschel <poeschel@lemonage.de> Reviewed-by: Kevin Hilman <khilman@linaro.org> Tested-by: Kevin Hilman <khilman@linaro.org> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-13gpio/omap: maintain GPIO and IRQ usage separatelyJavier Martinez Canillas
commit fa365e4d729065b5e85165df3dc9699ed47489cc upstream. The GPIO OMAP controller pins can be used as IRQ and GPIO independently so is necessary to keep track GPIO pins and IRQ lines usage separately to make sure that the bank will always be enabled while being used. Also move gpio_is_input() definition in preparation for the next patch that setups the controller's irq_chip driver when a caller requests an interrupt line. Acked-by: Stephen Warren <swarren@nvidia.com> Tested-by: George Cherian <george.cherian@ti.com> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi> Tested-by: Lars Poeschel <poeschel@lemonage.de> Reviewed-by: Kevin Hilman <khilman@linaro.org> Tested-by: Kevin Hilman <khilman@linaro.org> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03gpio: of: add support for configuring GPIOs defaultLaxman Dewangan
Add support to provide the list of GPIOs which need to be set as input, output with low and output with high. These values will be provided from DTS and GPIOs are configured during registration with gpiolibs. Change-Id: If46fa55311265707133eb80ce3fe80684a97af6e Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/280741 (cherry picked from commit 61eef7b8a888337fc451714ef3604fd505002639) Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
2013-10-03gpio: tegra: initialize chip->dev with driver's devLaxman Dewangan
This is used when gpio core wants to print the message using dev_*. Change-Id: I033375b5af8d4df731bf11dba9662798b44dcab8 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/280740 (cherry picked from commit 5b238b4c6d75ea80df5cbdb388fad3fe1e2906c4) Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
2013-09-16gpio: palmas: fix compilation warningLaxman Dewangan
Fix following comiplation warning: --- gpio/gpio-palmas.c: In function 'palmas_gpio_input': gpio/gpio-palmas.c:128:3: warning: format '%d' expects a matching 'int' argument [-Wformat] gpio/gpio-palmas.c: In function 'palmas_gpio_set_debounce': gpio/gpio-palmas.c:159:3: warning: format '%d' expects a matching 'int' argument [-Wformat] gpio/gpio-palmas.c: At top level: gpio/gpio-palmas.c:140:12: warning: 'palmas_gpio_set_debounce' defined but not used [-Wunused-function] --- Change-Id: Ieeec586a9ec084d01d6f62fa1fe01a04c5850d05 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/270072
2013-09-14ARM: tegra: Move platform detect from <mach/hardware.h> to <linux/tegra-soc.h>Dan Willemsen
Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com> Change-Id: I13f3ff891510d2c868f609d507149b32183d34c5
2013-09-14gpio: tps65910: Restore upstream v3.10.10 versionDan Willemsen
We don't use this driver on any supported downstream platforms Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com> Change-Id: I1f082cdb4f14a7e6dfc1d0b4aa07325102d99ab2 Reviewed-on: http://git-master/r/270001
2013-09-14fixup! ARM: tegra: tps6586x: add empty function direction_inputDan Willemsen
Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com> Change-Id: I082f222945f054b585659cbd65d042d45e3cd225 Reviewed-on: http://git-master/r/269997
2013-09-14gpio: palmas: align driver to mainlineLaxman Dewangan
Align the Palmas GPIO driver to mainline and keep porting TPS80036 device on this driver. This will also add DT support on this driver. Change-Id: Ib63050d1cd9fc29c9f9754ff27385b100df6dcc7 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/269138
2013-09-14arm: t124: Add "tegra-gpio" entry for Device Tree.Hayden Du
Bug 1352814 Change-Id: I44752c2f453e9accb594a8c0c250cbd48165c703 Signed-off-by: Hayden Du <haydend@nvidia.com> Reviewed-on: http://git-master/r/264238 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2013-09-14ARM: tegra: gpio: fix build issue with as3722 gpioBibek Basu
fix build issue with as3722 gpio Bug 1275005 Change-Id: Iec79992ad04dd462565906c8eb377c95beec1eec Signed-off-by: Bibek Basu <bbasu@nvidia.com> Reviewed-on: http://git-master/r/232840 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Chao Xu <cxu@nvidia.com>
2013-09-14gpio: Add an AS3722 PMIC gpio driverFlorian Lobmaier
AS3722 is a PMIC with multiple DCDC and LDO power supplies, GPIOs, an RTC, WDT. This patch adds support for gpio Change-Id: Iac350b2942b5b07f7355b7abd8acb22ae5dc5a04 Signed-off-by: Florian Lobmaier <florian.lobmaier@ams.com> Signed-off-by: Bibek Basu <bbasu@nvidia.com> Reviewed-on: http://git-master/r/225578 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Chao Xu <cxu@nvidia.com>
2013-09-14gpio: tegra: Moved tegra gpio suspend/resumeAjay Nandakumar
Moving tegra gpio suspend/resume from platform suspend to syscore suspend/resume.Since GPIO's are need by other modules in the kernel and it state cannot be maintained across the power cycle ,it needs to be suspended furthur in time and hence cannot be sheduled along with other drivers.Hence,moving to Syscore suspend allows the GPIO module to be suspend later and resume futher ahead of the devices. Bug 1323103 Change-Id: Id3a092a1e492f2830c485b330ccc6fb26746ff6d Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com> Reviewed-on: http://git-master/r/213997 (cherry picked from commit bc25f5333f90baf716b313060d56dd78fe7fe7e9) Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com> Reviewed-on: http://git-master/r/246721 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com> Tested-by: Dan Willemsen <dwillemsen@nvidia.com>
2013-09-14HACK: gpio: tegra: Don't require pinctrlDan Willemsen
We're not using pinctrl yet, so don't make gpio-tegra require it. Without this change, gpio_request will always return -EPROBE_DEFER. Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>
2013-09-14__dev*Dan Willemsen
Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>