<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/gpio/driver.h, branch v4.4.194</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.194</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.194'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2015-10-16T20:11:16Z</updated>
<entry>
<title>gpiolib: provide generic request/free implementations</title>
<updated>2015-10-16T20:11:16Z</updated>
<author>
<name>Jonas Gorski</name>
<email>jogo@openwrt.org</email>
</author>
<published>2015-10-11T15:34:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c771c2f484857f3b1fc81d180485e96b7cb67c17'/>
<id>urn:sha1:c771c2f484857f3b1fc81d180485e96b7cb67c17</id>
<content type='text'>
Provide generic request/free implementations that pinctrl aware gpio
drivers can use instead of open coding if they use a 1:1 pin to gpio
signal mapping.

Signed-off-by: Jonas Gorski &lt;jogo@openwrt.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpiolib: add description for gpio irqchip fields in struct gpio_chip</title>
<updated>2015-08-26T07:29:50Z</updated>
<author>
<name>Grygorii Strashko</name>
<email>grygorii.strashko@ti.com</email>
</author>
<published>2015-08-17T12:35:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=41d6bb4c890c8db01248b1bdd512a18e7bd29ca3'/>
<id>urn:sha1:41d6bb4c890c8db01248b1bdd512a18e7bd29ca3</id>
<content type='text'>
Add missed description for GPIO irqchip fields in struct gpio_chip.

Signed-off-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpiolib: irqchip: use different lockdep class for each gpio irqchip</title>
<updated>2015-08-17T13:32:03Z</updated>
<author>
<name>Grygorii Strashko</name>
<email>grygorii.strashko@ti.com</email>
</author>
<published>2015-08-17T12:35:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a0a8bcf4670c2c696e6e83742539a5e0dd7a62d6'/>
<id>urn:sha1:a0a8bcf4670c2c696e6e83742539a5e0dd7a62d6</id>
<content type='text'>
Since IRQ chip helpers were introduced drivers lose ability to
register separate lockdep classes for each registered GPIO IRQ
chip and the gpiolib now is using shared lockdep class for
all GPIO IRQ chips (gpiochip_irq_lock_class).
As result, lockdep will produce warning when there are min two
stacked GPIO chips and all of them are interrupt controllers.

HW configuration which generates lockdep warning (TI dra7-evm):

[SOC GPIO bankA.gpioX]
  &lt;- irq - [pcf875x.gpioY]
            &lt;- irq - DevZ.enable_irq_wake(pcf_gpioY_irq);
The issue was reported in [1] and discussed [2].

=============================================
[ INFO: possible recursive locking detected ]
4.2.0-rc6-00013-g5d050ed-dirty #55 Not tainted
---------------------------------------------
sh/63 is trying to acquire lock:
 (class){......}, at: [&lt;c009b91c&gt;] __irq_get_desc_lock+0x50/0x94

but task is already holding lock:
 (class){......}, at: [&lt;c009b91c&gt;] __irq_get_desc_lock+0x50/0x94

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(class);
  lock(class);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

7 locks held by sh/63:
 #0:  (sb_writers#4){.+.+.+}, at: [&lt;c016bbb8&gt;] vfs_write+0x13c/0x164
 #1:  (&amp;of-&gt;mutex){+.+.+.}, at: [&lt;c01debf4&gt;] kernfs_fop_write+0x4c/0x1a0
 #2:  (s_active#36){.+.+.+}, at: [&lt;c01debfc&gt;] kernfs_fop_write+0x54/0x1a0
 #3:  (pm_mutex){+.+.+.}, at: [&lt;c009758c&gt;] pm_suspend+0xec/0x4c4
 #4:  (&amp;dev-&gt;mutex){......}, at: [&lt;c03f77f8&gt;] __device_suspend+0xd4/0x398
 #5:  (&amp;gpio-&gt;lock){+.+.+.}, at: [&lt;c009b940&gt;] __irq_get_desc_lock+0x74/0x94
 #6:  (class){......}, at: [&lt;c009b91c&gt;] __irq_get_desc_lock+0x50/0x94

stack backtrace:
CPU: 0 PID: 63 Comm: sh Not tainted 4.2.0-rc6-00013-g5d050ed-dirty #55
Hardware name: Generic DRA74X (Flattened Device Tree)
[&lt;c0016e24&gt;] (unwind_backtrace) from [&lt;c0013338&gt;] (show_stack+0x10/0x14)
[&lt;c0013338&gt;] (show_stack) from [&lt;c05f6b24&gt;] (dump_stack+0x84/0x9c)
[&lt;c05f6b24&gt;] (dump_stack) from [&lt;c00903f4&gt;] (__lock_acquire+0x19c0/0x1e20)
[&lt;c00903f4&gt;] (__lock_acquire) from [&lt;c0091098&gt;] (lock_acquire+0xa8/0x128)
[&lt;c0091098&gt;] (lock_acquire) from [&lt;c05fd61c&gt;] (_raw_spin_lock_irqsave+0x38/0x4c)
[&lt;c05fd61c&gt;] (_raw_spin_lock_irqsave) from [&lt;c009b91c&gt;] (__irq_get_desc_lock+0x50/0x94)
[&lt;c009b91c&gt;] (__irq_get_desc_lock) from [&lt;c009c4f4&gt;] (irq_set_irq_wake+0x20/0xfc)
[&lt;c009c4f4&gt;] (irq_set_irq_wake) from [&lt;c0393ac4&gt;] (pcf857x_irq_set_wake+0x24/0x54)
[&lt;c0393ac4&gt;] (pcf857x_irq_set_wake) from [&lt;c009c560&gt;] (irq_set_irq_wake+0x8c/0xfc)
[&lt;c009c560&gt;] (irq_set_irq_wake) from [&lt;c04a02ac&gt;] (gpio_keys_suspend+0x70/0xd4)
[&lt;c04a02ac&gt;] (gpio_keys_suspend) from [&lt;c03f6a00&gt;] (dpm_run_callback+0x50/0x124)
[&lt;c03f6a00&gt;] (dpm_run_callback) from [&lt;c03f7830&gt;] (__device_suspend+0x10c/0x398)
[&lt;c03f7830&gt;] (__device_suspend) from [&lt;c03f90f0&gt;] (dpm_suspend+0x134/0x2f4)
[&lt;c03f90f0&gt;] (dpm_suspend) from [&lt;c0096e20&gt;] (suspend_devices_and_enter+0xa8/0x728)
[&lt;c0096e20&gt;] (suspend_devices_and_enter) from [&lt;c00977cc&gt;] (pm_suspend+0x32c/0x4c4)
[&lt;c00977cc&gt;] (pm_suspend) from [&lt;c0096060&gt;] (state_store+0x64/0xb8)
[&lt;c0096060&gt;] (state_store) from [&lt;c01dec64&gt;] (kernfs_fop_write+0xbc/0x1a0)
[&lt;c01dec64&gt;] (kernfs_fop_write) from [&lt;c016b280&gt;] (__vfs_write+0x20/0xd8)
[&lt;c016b280&gt;] (__vfs_write) from [&lt;c016bb0c&gt;] (vfs_write+0x90/0x164)
[&lt;c016bb0c&gt;] (vfs_write) from [&lt;c016c330&gt;] (SyS_write+0x44/0x9c)
[&lt;c016c330&gt;] (SyS_write) from [&lt;c000f500&gt;] (ret_fast_syscall+0x0/0x54)

Lets fix it by using separate lockdep class for each registered GPIO
IRQ Chip. This is done by wrapping gpiochip_irqchip_add call into macros.

The implementation of this patch inspired by solution done by Nicolas
Boichat for regmap [3]

[1] http://www.spinics.net/lists/linux-gpio/msg05844.html
[2] http://www.spinics.net/lists/linux-gpio/msg06021.html
[3] http://www.spinics.net/lists/arm-kernel/msg429834.html

Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Cc: Roger Quadros &lt;rogerq@ti.com&gt;
Reported-by: Roger Quadros &lt;rogerq@ti.com&gt;
Tested-by: Roger Quadros &lt;rogerq@ti.com&gt;
Signed-off-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpio: Remove double "base" in comment</title>
<updated>2015-07-15T22:12:24Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2015-06-15T11:31:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=30bb6fb39e5c08b9db5bc592d6cbc9a5fc5e67a4'/>
<id>urn:sha1:30bb6fb39e5c08b9db5bc592d6cbc9a5fc5e67a4</id>
<content type='text'>
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpio: discourage passing base to gpio_chip</title>
<updated>2015-05-14T10:19:48Z</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2015-05-13T11:03:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=af6c235d1a5c112964c3029eb0ed4b52c7aa33bf'/>
<id>urn:sha1:af6c235d1a5c112964c3029eb0ed4b52c7aa33bf</id>
<content type='text'>
Passing a fixed base in struct gpio_chip is done for legacy
systems that cannot handle dynamic allocation. Discourage this
behaviour in the kerneldoc.

Acked-by: Alexandre Courbot &lt;acourbot@nvidia.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpiolib: cleanup chained handler and data</title>
<updated>2015-05-13T11:02:36Z</updated>
<author>
<name>Dmitry Eremin-Solenikov</name>
<email>dbaryshkov@gmail.com</email>
</author>
<published>2015-05-12T17:12:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=25e4fe92a20bbffde87500615250f1d54bfb832f'/>
<id>urn:sha1:25e4fe92a20bbffde87500615250f1d54bfb832f</id>
<content type='text'>
Clean up chained handler and handler data if they were set by
gpiochip_set_chained_irqchip().

Signed-off-by: Dmitry Eremin-Solenikov &lt;dbaryshkov@gmail.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpio: sysfs: clean up chip class-device handling</title>
<updated>2015-05-12T08:46:44Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2015-05-04T15:10:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6a4b6b0a3b55f23f4cc9ad85a1539c581bcb0874'/>
<id>urn:sha1:6a4b6b0a3b55f23f4cc9ad85a1539c581bcb0874</id>
<content type='text'>
Clean gpio-chip class device registration and deregistration.

The class device is registered when a gpio-chip is added (or from
gpiolib_sysfs_init post-core init call), and deregistered when the chip
is removed.

Store the class device in struct gpio_chip directly rather than do a
class-device lookup on deregistration. This also removes the need for
the exported flag.

Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Reviewed-by: Alexandre Courbot &lt;acourbot@nvidia.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpio: move pincontrol calls to &lt;linux/gpio/driver.h&gt;</title>
<updated>2015-03-19T08:45:54Z</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2015-03-18T00:56:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=964cb341882f920a1a1043864178f22def3193e4'/>
<id>urn:sha1:964cb341882f920a1a1043864178f22def3193e4</id>
<content type='text'>
These functions do not belong in &lt;asm-generic/gpio.h&gt; since the
split into separate GPIO headers under &lt;linux/gpio/*&gt;. Move them
to &lt;linux/gpio/driver.h&gt; as is apropriate.

Acked-by: Alexandre Courbot &lt;acourbot@nvidia.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpiolib: allow simultaneous setting of multiple GPIO outputs</title>
<updated>2014-11-27T14:01:18Z</updated>
<author>
<name>Rojhalat Ibrahim</name>
<email>imr@rtschenk.de</email>
</author>
<published>2014-11-04T16:12:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5f42424354f5b0ca5413b4fb8528d150692c85b7'/>
<id>urn:sha1:5f42424354f5b0ca5413b4fb8528d150692c85b7</id>
<content type='text'>
Introduce new functions gpiod_set_array &amp; gpiod_set_raw_array to the consumer
interface which allow setting multiple outputs with just one function call.
Also add an optional set_multiple function to the driver interface. Without an
implementation of that function in the chip driver outputs are set
sequentially.

Implementing the set_multiple function in a chip driver allows for:
- Improved performance for certain use cases. The original motivation for this
  was the task of configuring an FPGA. In that specific case, where 9 GPIO
  lines have to be set many times, configuration time goes down from 48 s to
  20 s when using the new function.
- Simultaneous glitch-free setting of multiple pins on any kind of parallel
  bus attached to GPIOs provided they all reside on the same chip and bank.

Limitations:
  Performance is only improved for normal high-low outputs. Open drain and
  open source outputs are always set separately from each other. Those kinds
  of outputs could probably be accelerated in a similar way if we could
  forgo the error checking when setting GPIO directions.

Change log:
  v6: - rebase on current linux-gpio devel branch
  v5: - check can_sleep property per chip
      - remove superfluous checks
      - supplement documentation
  v4: - add gpiod_set_array function for setting logical values
      - change interface of the set_multiple driver function to use
        unsigned long as type for the bit fields
      - use generic bitops (which also use unsigned long for bit fields)
      - do not use ARCH_NR_GPIOS any more
  v3: - add documentation
      - change commit message
  v2: - use descriptor interface
      - allow arbitrary groups of GPIOs spanning multiple chips

Signed-off-by: Rojhalat Ibrahim &lt;imr@rtschenk.de&gt;
Reviewed-by: Alexandre Courbot &lt;acourbot@nvidia.com&gt;
Reviewed-by: Mark Brown &lt;broonie@linaro.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpio: rename gpio_lock_as_irq to gpiochip_lock_as_irq</title>
<updated>2014-10-28T16:30:59Z</updated>
<author>
<name>Alexandre Courbot</name>
<email>acourbot@nvidia.com</email>
</author>
<published>2014-10-23T08:27:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e3a2e87893125bcd99bd7e1ddf9bfc421e492572'/>
<id>urn:sha1:e3a2e87893125bcd99bd7e1ddf9bfc421e492572</id>
<content type='text'>
This function actually operates on a gpio_chip, so its prefix should
reflect that fact for consistency with other functions defined in
gpio/driver.h.

Signed-off-by: Alexandre Courbot &lt;acourbot@nvidia.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
</feed>
