<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/gpio, branch v3.10.16</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>gpio/omap: auto-setup a GPIO when used as an IRQ</title>
<updated>2013-10-13T23:08:31+00:00</updated>
<author>
<name>Javier Martinez Canillas</name>
<email>javier.martinez@collabora.co.uk</email>
</author>
<published>2013-09-25T00:36:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=517ff99417cf9a27a6c4f34f99977505d9928785'/>
<id>517ff99417cf9a27a6c4f34f99977505d9928785</id>
<content type='text'>
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 &lt;swarren@nvidia.com&gt;
Tested-by: George Cherian &lt;george.cherian@ti.com&gt;
Tested-by: Aaro Koskinen &lt;aaro.koskinen@iki.fi&gt;
Tested-by: Lars Poeschel &lt;poeschel@lemonage.de&gt;
Reviewed-by: Kevin Hilman &lt;khilman@linaro.org&gt;
Tested-by: Kevin Hilman &lt;khilman@linaro.org&gt;
Acked-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Javier Martinez Canillas &lt;javier.martinez@collabora.co.uk&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;swarren@nvidia.com&gt;
Tested-by: George Cherian &lt;george.cherian@ti.com&gt;
Tested-by: Aaro Koskinen &lt;aaro.koskinen@iki.fi&gt;
Tested-by: Lars Poeschel &lt;poeschel@lemonage.de&gt;
Reviewed-by: Kevin Hilman &lt;khilman@linaro.org&gt;
Tested-by: Kevin Hilman &lt;khilman@linaro.org&gt;
Acked-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Javier Martinez Canillas &lt;javier.martinez@collabora.co.uk&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>gpio/omap: maintain GPIO and IRQ usage separately</title>
<updated>2013-10-13T23:08:31+00:00</updated>
<author>
<name>Javier Martinez Canillas</name>
<email>javier.martinez@collabora.co.uk</email>
</author>
<published>2013-09-25T00:36:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9dbd65f3bc7a1d75d474528360cfcb2f8816f5b7'/>
<id>9dbd65f3bc7a1d75d474528360cfcb2f8816f5b7</id>
<content type='text'>
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 &lt;swarren@nvidia.com&gt;
Tested-by: George Cherian &lt;george.cherian@ti.com&gt;
Tested-by: Aaro Koskinen &lt;aaro.koskinen@iki.fi&gt;
Tested-by: Lars Poeschel &lt;poeschel@lemonage.de&gt;
Reviewed-by: Kevin Hilman &lt;khilman@linaro.org&gt;
Tested-by: Kevin Hilman &lt;khilman@linaro.org&gt;
Acked-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Javier Martinez Canillas &lt;javier.martinez@collabora.co.uk&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;swarren@nvidia.com&gt;
Tested-by: George Cherian &lt;george.cherian@ti.com&gt;
Tested-by: Aaro Koskinen &lt;aaro.koskinen@iki.fi&gt;
Tested-by: Lars Poeschel &lt;poeschel@lemonage.de&gt;
Reviewed-by: Kevin Hilman &lt;khilman@linaro.org&gt;
Tested-by: Kevin Hilman &lt;khilman@linaro.org&gt;
Acked-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Javier Martinez Canillas &lt;javier.martinez@collabora.co.uk&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>gpio/omap: don't use linear domain mapping for OMAP1</title>
<updated>2013-06-26T06:13:40+00:00</updated>
<author>
<name>Javier Martinez Canillas</name>
<email>javier.martinez@collabora.co.uk</email>
</author>
<published>2013-06-24T15:13:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=397eada946712b90e0620c378b366bcc6c98c9f6'/>
<id>397eada946712b90e0620c378b366bcc6c98c9f6</id>
<content type='text'>
Commit ede4d7a5 ("gpio/omap: convert gpio irq domain to linear mapping")
converted the OMAP GPIO driver to use a linear mapping for the GPIO IRQ
domain instead of using a legacy mapping. Not using a legacy mapping has
a number of benefits but it requires the platform to support SPARSE_IRQ
which currently is not supported on OMAP1.

So this change caused a regression on OMAP1 platforms [1].

Since this issue is not present on all OMAP2+ platforms, there is no need to
revert the driver to use legacy domain mapping for all the platforms.

[1]: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg89005.html

Signed-off-by: Javier Martinez Canillas &lt;javier.martinez@collabora.co.uk&gt;
Tested-by: Aaro Koskinen &lt;aaro.koskinen@iki.fi&gt;
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit ede4d7a5 ("gpio/omap: convert gpio irq domain to linear mapping")
converted the OMAP GPIO driver to use a linear mapping for the GPIO IRQ
domain instead of using a legacy mapping. Not using a legacy mapping has
a number of benefits but it requires the platform to support SPARSE_IRQ
which currently is not supported on OMAP1.

So this change caused a regression on OMAP1 platforms [1].

Since this issue is not present on all OMAP2+ platforms, there is no need to
revert the driver to use legacy domain mapping for all the platforms.

[1]: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg89005.html

Signed-off-by: Javier Martinez Canillas &lt;javier.martinez@collabora.co.uk&gt;
Tested-by: Aaro Koskinen &lt;aaro.koskinen@iki.fi&gt;
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'gpio-fixes-v3.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio</title>
<updated>2013-05-24T01:24:10+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-05-24T01:24:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=514e250f67d2b2a8ab08dc9c3650af19a411c926'/>
<id>514e250f67d2b2a8ab08dc9c3650af19a411c926</id>
<content type='text'>
Pull GPIO fixes from Linus Walleij:
 - An OMAP fix that makes ethernet work again.
 - Fix for build problem when building the MCP23S08 driver as module.
 - IRQ conflicts in the Langwell driver.
 - Fix IRQ coherency issues in the MXS driver.
 - Return correct errorcode on errorpath when removing GPIO chips.

* tag 'gpio-fixes-v3.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio: Don't override the error code in probe error handling
  gpio: mxs: Use set and clear capabilities of the gpio controller
  gpio-langwell: fix irq conflicts when DT is not used
  gpio: mcp23s08: Fix build error when CONFIG_SPI_MASTER=y &amp;&amp; CONFIG_I2C=m
  gpio/omap: ensure gpio context is initialised
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull GPIO fixes from Linus Walleij:
 - An OMAP fix that makes ethernet work again.
 - Fix for build problem when building the MCP23S08 driver as module.
 - IRQ conflicts in the Langwell driver.
 - Fix IRQ coherency issues in the MXS driver.
 - Return correct errorcode on errorpath when removing GPIO chips.

* tag 'gpio-fixes-v3.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio: Don't override the error code in probe error handling
  gpio: mxs: Use set and clear capabilities of the gpio controller
  gpio-langwell: fix irq conflicts when DT is not used
  gpio: mcp23s08: Fix build error when CONFIG_SPI_MASTER=y &amp;&amp; CONFIG_I2C=m
  gpio/omap: ensure gpio context is initialised
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio: Don't override the error code in probe error handling</title>
<updated>2013-05-20T18:27:30+00:00</updated>
<author>
<name>Axel Lin</name>
<email>axel.lin@ingics.com</email>
</author>
<published>2013-05-19T06:00:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=cfb10898efe1bc1f3eb8d8f37f164d9e2ac8b43a'/>
<id>cfb10898efe1bc1f3eb8d8f37f164d9e2ac8b43a</id>
<content type='text'>
Otherwise, we return 0 in probe error paths when gpiochip_remove() returns 0.
Also show error message if gpiochip_remove() fails.

Signed-off-by: Axel Lin &lt;axel.lin@ingics.com&gt;
Cc: Tomoya MORINAGA &lt;tomoya.rohm@gmail.com&gt;
Cc: Denis Turischev &lt;denis@compulab.co.il&gt;
Cc: Lars Poeschel &lt;poeschel@lemonage.de&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Otherwise, we return 0 in probe error paths when gpiochip_remove() returns 0.
Also show error message if gpiochip_remove() fails.

Signed-off-by: Axel Lin &lt;axel.lin@ingics.com&gt;
Cc: Tomoya MORINAGA &lt;tomoya.rohm@gmail.com&gt;
Cc: Denis Turischev &lt;denis@compulab.co.il&gt;
Cc: Lars Poeschel &lt;poeschel@lemonage.de&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio: mxs: Use set and clear capabilities of the gpio controller</title>
<updated>2013-05-20T18:14:43+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime.ripard@free-electrons.com</email>
</author>
<published>2013-04-29T14:07:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=90dae4ebf03063a70d992aad00d5f5a607c31db8'/>
<id>90dae4ebf03063a70d992aad00d5f5a607c31db8</id>
<content type='text'>
The current driver doesn't use the set and clear registers found on the
mxs gpio controller.

This leads the generic gpio controller to be using some internal value
to avoid looking up the value stored in the registers, making it behave
pretty much like a cache.

This raises some coherency problem when a gpio is not modified by the
gpio controller, while it can easily be fixed by using the set and clear
registers.

Signed-off-by: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Acked-by: Shawn Guo &lt;shawn.guo@linaro.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current driver doesn't use the set and clear registers found on the
mxs gpio controller.

This leads the generic gpio controller to be using some internal value
to avoid looking up the value stored in the registers, making it behave
pretty much like a cache.

This raises some coherency problem when a gpio is not modified by the
gpio controller, while it can easily be fixed by using the set and clear
registers.

Signed-off-by: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Acked-by: Shawn Guo &lt;shawn.guo@linaro.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio-langwell: fix irq conflicts when DT is not used</title>
<updated>2013-05-20T18:10:22+00:00</updated>
<author>
<name>David Cohen</name>
<email>david.a.cohen@intel.com</email>
</author>
<published>2013-05-06T23:11:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2519f9abced15b4327f03d7b8666827517582c29'/>
<id>2519f9abced15b4327f03d7b8666827517582c29</id>
<content type='text'>
When DT is not used IOAPIC does not register irq domain. As result
IOAPIC won't care about gpio-langwell's virq and may cause conflict if
an irq number is equal to gpio-langwell's virq mapped beforehand.

This patch tells gpio_langwell to not ignore irq_base if != 0 and
preferably use it to avoid the conflict.

If DT is used, irq_base can safely be 0.

Signed-off-by: David Cohen &lt;david.a.cohen@intel.com&gt;
Acked-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When DT is not used IOAPIC does not register irq domain. As result
IOAPIC won't care about gpio-langwell's virq and may cause conflict if
an irq number is equal to gpio-langwell's virq mapped beforehand.

This patch tells gpio_langwell to not ignore irq_base if != 0 and
preferably use it to avoid the conflict.

If DT is used, irq_base can safely be 0.

Signed-off-by: David Cohen &lt;david.a.cohen@intel.com&gt;
Acked-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio: mcp23s08: Fix build error when CONFIG_SPI_MASTER=y &amp;&amp; CONFIG_I2C=m</title>
<updated>2013-05-20T17:16:16+00:00</updated>
<author>
<name>Axel Lin</name>
<email>axel.lin@ingics.com</email>
</author>
<published>2013-05-19T11:11:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0f119a840b128f18b20608f0d33895e85f381105'/>
<id>0f119a840b128f18b20608f0d33895e85f381105</id>
<content type='text'>
This patch fixes below build error when CONFIG_SPI_MASTER=y &amp;&amp; CONFIG_I2C=m &amp;&amp;
CONFIG_GPIO_MCP23S08=y.

  LD      init/built-in.o
drivers/built-in.o: In function `mcp23017_write':
clkdev.c:(.text+0x1e14): undefined reference to `i2c_smbus_write_word_data'
drivers/built-in.o: In function `mcp23017_read':
clkdev.c:(.text+0x1e24): undefined reference to `i2c_smbus_read_word_data'
drivers/built-in.o: In function `mcp23008_write':
clkdev.c:(.text+0x1e8c): undefined reference to `i2c_smbus_write_byte_data'
drivers/built-in.o: In function `mcp23008_read':
clkdev.c:(.text+0x1e98): undefined reference to `i2c_smbus_read_byte_data'
drivers/built-in.o: In function `mcp23008_read_regs':
clkdev.c:(.text+0x1ed0): undefined reference to `i2c_smbus_read_byte_data'
drivers/built-in.o: In function `mcp23s08_init':
clkdev.c:(.init.text+0x30): undefined reference to `i2c_register_driver'
drivers/built-in.o: In function `mcp23s08_exit':
clkdev.c:(.exit.text+0x30): undefined reference to `i2c_del_driver'
make: *** [vmlinux] Error 1

When CONFIG_I2C=m, meaning we can't build the drivers in with I2C support.
Thus don't allow the drivers to be compiled as built-in when CONFIG_I2C=m.

The real fix though is to break the driver apart into a SPI part, an I2C part
and a common part. But that's something for 3.11 while this is something for
3.10/stable.

Signed-off-by: Axel Lin &lt;axel.lin@ingics.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes below build error when CONFIG_SPI_MASTER=y &amp;&amp; CONFIG_I2C=m &amp;&amp;
CONFIG_GPIO_MCP23S08=y.

  LD      init/built-in.o
drivers/built-in.o: In function `mcp23017_write':
clkdev.c:(.text+0x1e14): undefined reference to `i2c_smbus_write_word_data'
drivers/built-in.o: In function `mcp23017_read':
clkdev.c:(.text+0x1e24): undefined reference to `i2c_smbus_read_word_data'
drivers/built-in.o: In function `mcp23008_write':
clkdev.c:(.text+0x1e8c): undefined reference to `i2c_smbus_write_byte_data'
drivers/built-in.o: In function `mcp23008_read':
clkdev.c:(.text+0x1e98): undefined reference to `i2c_smbus_read_byte_data'
drivers/built-in.o: In function `mcp23008_read_regs':
clkdev.c:(.text+0x1ed0): undefined reference to `i2c_smbus_read_byte_data'
drivers/built-in.o: In function `mcp23s08_init':
clkdev.c:(.init.text+0x30): undefined reference to `i2c_register_driver'
drivers/built-in.o: In function `mcp23s08_exit':
clkdev.c:(.exit.text+0x30): undefined reference to `i2c_del_driver'
make: *** [vmlinux] Error 1

When CONFIG_I2C=m, meaning we can't build the drivers in with I2C support.
Thus don't allow the drivers to be compiled as built-in when CONFIG_I2C=m.

The real fix though is to break the driver apart into a SPI part, an I2C part
and a common part. But that's something for 3.11 while this is something for
3.10/stable.

Signed-off-by: Axel Lin &lt;axel.lin@ingics.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drivers/gpio: don't check resource with devm_ioremap_resource</title>
<updated>2013-05-18T09:55:19+00:00</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@the-dreams.de</email>
</author>
<published>2013-05-12T13:19:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8cfc2a1fce75d763bf59dd2d9d40add758fe7b46'/>
<id>8cfc2a1fce75d763bf59dd2d9d40add758fe7b46</id>
<content type='text'>
devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Acked-by: Stephen Warren &lt;swarren@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Acked-by: Stephen Warren &lt;swarren@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio/omap: ensure gpio context is initialised</title>
<updated>2013-05-13T19:20:44+00:00</updated>
<author>
<name>Jon Hunter</name>
<email>jon-hunter@ti.com</email>
</author>
<published>2013-04-15T18:06:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=352a2d5bfc336d980af69cb0ed24f86d9026f377'/>
<id>352a2d5bfc336d980af69cb0ed24f86d9026f377</id>
<content type='text'>
Commit a2797be (gpio/omap: force restore if context loss is not
detectable) broke gpio support for OMAP when booting with device-tree
because a restore of the gpio context being performed without ever
initialising the gpio context. In other words, the context restored was
bad.

This problem could also occur in the non device-tree case, however, it
is much less likely because when booting without device-tree we can
detect context loss via a platform specific API and so context restore
is performed less often.

Nevertheless we should ensure that the gpio context is initialised
on the first pm-runtime resume for gpio banks that could lose their
state regardless of whether we are booting with device-tree or not.

The context loss count was being initialised on the first pm-runtime
suspend following a resume, by populating the get_count_loss_count()
function pointer after the first pm-runtime resume. To make the code
more readable and logical, initialise the context loss count on the
first pm-runtime resume if the context is not yet valid.

Reported-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Jon Hunter &lt;jon-hunter@ti.com&gt;
Acked-by: Santosh Shilimkar&lt;santosh.shilimkar@ti.com&gt;
Reviewed-by: Kevin Hilman &lt;khilman@linaro.org&gt;
Tested-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit a2797be (gpio/omap: force restore if context loss is not
detectable) broke gpio support for OMAP when booting with device-tree
because a restore of the gpio context being performed without ever
initialising the gpio context. In other words, the context restored was
bad.

This problem could also occur in the non device-tree case, however, it
is much less likely because when booting without device-tree we can
detect context loss via a platform specific API and so context restore
is performed less often.

Nevertheless we should ensure that the gpio context is initialised
on the first pm-runtime resume for gpio banks that could lose their
state regardless of whether we are booting with device-tree or not.

The context loss count was being initialised on the first pm-runtime
suspend following a resume, by populating the get_count_loss_count()
function pointer after the first pm-runtime resume. To make the code
more readable and logical, initialise the context loss count on the
first pm-runtime resume if the context is not yet valid.

Reported-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Jon Hunter &lt;jon-hunter@ti.com&gt;
Acked-by: Santosh Shilimkar&lt;santosh.shilimkar@ti.com&gt;
Reviewed-by: Kevin Hilman &lt;khilman@linaro.org&gt;
Tested-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
