<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/gpio/gpio-omap.c, branch v3.4.4</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>gpio/omap: fix incorrect initialization of omap_gpio_mod_init</title>
<updated>2012-05-10T14:16:15+00:00</updated>
<author>
<name>Tarun Kanti DebBarma</name>
<email>tarun.kanti@ti.com</email>
</author>
<published>2012-04-30T07:20:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6edd94db250038c8fdf176f23ca4017d2f312509'/>
<id>6edd94db250038c8fdf176f23ca4017d2f312509</id>
<content type='text'>
Initialization of irqenable, irqstatus registers is the common
operation done in this function for all OMAP platforms, viz. OMAP1,
OMAP2+. The latter _gpio_rmw()'s which supposedly got introduced
wrongly to take care of OMAP2+ platforms were overwriting initially
programmed OMAP1 value breaking functionality on OMAP1.
Somehow incorrect assumption was made that each _gpio_rmw()'s were
mutually exclusive. On close observation it is found that the first
_gpio_rmw() which is supposedly done to take care of OMAP1 platform
is generic enough and takes care of OMAP2+ platform as well.
Therefore remove the latter _gpio_rmw() to irqenable as they are
redundant now.

Writing to ctrl and debounce_en registers for OMAP2+ platforms are
modified to match the original(pre-cleanup) code where the registers
are initialized with 0. In the cleanup series since we are using
_gpio_rmw(reg, 0, 1), instead of __raw_writel(), we are just reading
and writing the same values to ctrl and debounce_en. This is not an
issue for debounce_en register because it has 0x0 as the default value.
But in the case of ctrl register the default value is 0x2 (GATINGRATIO
 = 0x1) so that we end up writing 0x2 instead of intended 0 value.
Therefore changing back to __raw_writel() as this is sufficient for
this case besides simpler to understand.

Also, change irqstatus initalization logic that avoids comparison
with bool, besides making it fit in a single line.

Cc: stable@vger.kernel.org
Cc: Tony Lindgren &lt;tony@atomide.com&gt;
Cc: Kevin Hilman &lt;khilman@ti.com&gt;
Cc: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Cc: Grant Likely &lt;grant.likely@secretlab.ca&gt;
Reported-by: Janusz Krzysztofik &lt;jkrzyszt@tis.icnet.pl&gt;
Tested-by: Janusz Krzysztofik &lt;jkrzyszt@tis.icnet.pl&gt;
Signed-off-by: Tarun Kanti DebBarma &lt;tarun.kanti@ti.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Initialization of irqenable, irqstatus registers is the common
operation done in this function for all OMAP platforms, viz. OMAP1,
OMAP2+. The latter _gpio_rmw()'s which supposedly got introduced
wrongly to take care of OMAP2+ platforms were overwriting initially
programmed OMAP1 value breaking functionality on OMAP1.
Somehow incorrect assumption was made that each _gpio_rmw()'s were
mutually exclusive. On close observation it is found that the first
_gpio_rmw() which is supposedly done to take care of OMAP1 platform
is generic enough and takes care of OMAP2+ platform as well.
Therefore remove the latter _gpio_rmw() to irqenable as they are
redundant now.

Writing to ctrl and debounce_en registers for OMAP2+ platforms are
modified to match the original(pre-cleanup) code where the registers
are initialized with 0. In the cleanup series since we are using
_gpio_rmw(reg, 0, 1), instead of __raw_writel(), we are just reading
and writing the same values to ctrl and debounce_en. This is not an
issue for debounce_en register because it has 0x0 as the default value.
But in the case of ctrl register the default value is 0x2 (GATINGRATIO
 = 0x1) so that we end up writing 0x2 instead of intended 0 value.
Therefore changing back to __raw_writel() as this is sufficient for
this case besides simpler to understand.

Also, change irqstatus initalization logic that avoids comparison
with bool, besides making it fit in a single line.

Cc: stable@vger.kernel.org
Cc: Tony Lindgren &lt;tony@atomide.com&gt;
Cc: Kevin Hilman &lt;khilman@ti.com&gt;
Cc: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Cc: Grant Likely &lt;grant.likely@secretlab.ca&gt;
Reported-by: Janusz Krzysztofik &lt;jkrzyszt@tis.icnet.pl&gt;
Tested-by: Janusz Krzysztofik &lt;jkrzyszt@tis.icnet.pl&gt;
Signed-off-by: Tarun Kanti DebBarma &lt;tarun.kanti@ti.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio/omap: fix redundant decoding of gpio offset</title>
<updated>2012-03-21T04:51:24+00:00</updated>
<author>
<name>Tarun Kanti DebBarma</name>
<email>tarun.kanti@ti.com</email>
</author>
<published>2012-02-27T06:16:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7fcca715de3438b8fc3c8a144702f3a95c8ff63c'/>
<id>7fcca715de3438b8fc3c8a144702f3a95c8ff63c</id>
<content type='text'>
In gpio_get(), _get_gpio_datain() and _get_gpio_dataout() get rid of
un-necessary operation to compute gpio mask. The gpio offset passed
to gpio_get() is sufficient to do that.

Here is Russell's original comment:
Can someone explain to me this:

static int _get_gpio_datain(struct gpio_bank *bank, int gpio)
{
       void __iomem *reg = bank-&gt;base + bank-&gt;regs-&gt;datain;

       return (__raw_readl(reg) &amp; GPIO_BIT(bank, gpio)) != 0;
}

static int gpio_get(struct gpio_chip *chip, unsigned offset)
{
       struct gpio_bank *bank = container_of(chip, struct gpio_bank, chip);
       void __iomem *reg = bank-&gt;base;
       int gpio = chip-&gt;base + offset;
       u32 mask = GPIO_BIT(bank, gpio);

       if (gpio_is_input(bank, mask))
               return _get_gpio_datain(bank, gpio);
       else
               return _get_gpio_dataout(bank, gpio);
}

Given that bank-&gt;width on OMAP is either 32 or 16, and GPIO numbers for
any GPIO chip are always aligned to 32 or 16, why does this code bother
adding the chips base gpio number and then modulo the width?

Surely this means if - for argument sake - you registered a GPIO chip
with 8 lines followed by one with 16 lines, GPIO0..7 would be chip 0
bit 0..7, GPIO8..15 would be chip 1 bit 8..15, GPIO16..23 would be
chip 1 bit 0..7.

However, if you registered a GPIO chip with 16 lines first, it would
mean GPIO0..15 would be chip 0 bit 0..15, and GPIO16..31 would be
chip 1 bit 0..15.

Surely this kind of behaviour is not intended?

Is there a reason why the bitmask can't just be (1 &lt;&lt; offset) where
offset is passed into these functions as GPIO number - chip-&gt;base ?

Reported-by: Russell King - ARM Linux &lt;linux@arm.linux.org.uk&gt;
Signed-off-by: Tarun Kanti DebBarma &lt;tarun.kanti@ti.com&gt;
Reviewed-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Reviewed-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In gpio_get(), _get_gpio_datain() and _get_gpio_dataout() get rid of
un-necessary operation to compute gpio mask. The gpio offset passed
to gpio_get() is sufficient to do that.

Here is Russell's original comment:
Can someone explain to me this:

static int _get_gpio_datain(struct gpio_bank *bank, int gpio)
{
       void __iomem *reg = bank-&gt;base + bank-&gt;regs-&gt;datain;

       return (__raw_readl(reg) &amp; GPIO_BIT(bank, gpio)) != 0;
}

static int gpio_get(struct gpio_chip *chip, unsigned offset)
{
       struct gpio_bank *bank = container_of(chip, struct gpio_bank, chip);
       void __iomem *reg = bank-&gt;base;
       int gpio = chip-&gt;base + offset;
       u32 mask = GPIO_BIT(bank, gpio);

       if (gpio_is_input(bank, mask))
               return _get_gpio_datain(bank, gpio);
       else
               return _get_gpio_dataout(bank, gpio);
}

Given that bank-&gt;width on OMAP is either 32 or 16, and GPIO numbers for
any GPIO chip are always aligned to 32 or 16, why does this code bother
adding the chips base gpio number and then modulo the width?

Surely this means if - for argument sake - you registered a GPIO chip
with 8 lines followed by one with 16 lines, GPIO0..7 would be chip 0
bit 0..7, GPIO8..15 would be chip 1 bit 8..15, GPIO16..23 would be
chip 1 bit 0..7.

However, if you registered a GPIO chip with 16 lines first, it would
mean GPIO0..15 would be chip 0 bit 0..15, and GPIO16..31 would be
chip 1 bit 0..15.

Surely this kind of behaviour is not intended?

Is there a reason why the bitmask can't just be (1 &lt;&lt; offset) where
offset is passed into these functions as GPIO number - chip-&gt;base ?

Reported-by: Russell King - ARM Linux &lt;linux@arm.linux.org.uk&gt;
Signed-off-by: Tarun Kanti DebBarma &lt;tarun.kanti@ti.com&gt;
Reviewed-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Reviewed-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio/omap: fix incorrect update to context.irqenable1</title>
<updated>2012-03-21T04:48:54+00:00</updated>
<author>
<name>Tarun Kanti DebBarma</name>
<email>tarun.kanti@ti.com</email>
</author>
<published>2012-03-06T06:38:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2a900eb74c123a21054836ab2c63d6ff46f854c6'/>
<id>2a900eb74c123a21054836ab2c63d6ff46f854c6</id>
<content type='text'>
In _enable_gpio_irqbank() when bank-&gt;regs-&gt;set_irqenable is TRUE,
gpio_mask can be directly set by writing to set_irqenable register
without overwriting current value. In order to ensure the same is
stored in context.irqenable1, we must avoid overwriting it with
gpio_mask at the end of the function. Instead, update irqenable1
appropriately by OR'ing with gpio_mask.
For the case where bank-&gt;regs-&gt;set_irqenable is FALSE, irqenable1
can be directly overwritten with 'l' which holds correct computed
value.
        if (bank-&gt;regs-&gt;set_irqenable) {
                reg += bank-&gt;regs-&gt;set_irqenable;
                l = gpio_mask;
        } else {
                reg += bank-&gt;regs-&gt;irqenable;
                l = __raw_readl(reg);
                if (bank-&gt;regs-&gt;irqenable_inv)
                        l &amp;= ~gpio_mask;
                else
                        l |= gpio_mask;
        }

Make similar change for _disable_gpio_irqbank().

Signed-off-by: Tarun Kanti DebBarma &lt;tarun.kanti@ti.com&gt;
Reviewed-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Reviewed-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In _enable_gpio_irqbank() when bank-&gt;regs-&gt;set_irqenable is TRUE,
gpio_mask can be directly set by writing to set_irqenable register
without overwriting current value. In order to ensure the same is
stored in context.irqenable1, we must avoid overwriting it with
gpio_mask at the end of the function. Instead, update irqenable1
appropriately by OR'ing with gpio_mask.
For the case where bank-&gt;regs-&gt;set_irqenable is FALSE, irqenable1
can be directly overwritten with 'l' which holds correct computed
value.
        if (bank-&gt;regs-&gt;set_irqenable) {
                reg += bank-&gt;regs-&gt;set_irqenable;
                l = gpio_mask;
        } else {
                reg += bank-&gt;regs-&gt;irqenable;
                l = __raw_readl(reg);
                if (bank-&gt;regs-&gt;irqenable_inv)
                        l &amp;= ~gpio_mask;
                else
                        l |= gpio_mask;
        }

Make similar change for _disable_gpio_irqbank().

Signed-off-by: Tarun Kanti DebBarma &lt;tarun.kanti@ti.com&gt;
Reviewed-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Reviewed-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio/omap: fix incorrect context restore logic in omap_gpio_runtime_*</title>
<updated>2012-03-20T10:02:46+00:00</updated>
<author>
<name>Tarun Kanti DebBarma</name>
<email>tarun.kanti@ti.com</email>
</author>
<published>2012-03-05T10:30:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=960edffe29dfd845ee532ee51398592cba96d701'/>
<id>960edffe29dfd845ee532ee51398592cba96d701</id>
<content type='text'>
In omap_gpio_runtime_suspend/resume() the context save/restore should
be independent of bank-&gt;enabled_non_wakeup_gpios. This was preventing
context restore of GPIO lines which are not wakeup enabled.

Reported-by: Govindraj Raja &lt;govindraj.raja@ti.com&gt;
Signed-off-by: Tarun Kanti DebBarma &lt;tarun.kanti@ti.com&gt;
Reviewed-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Reviewed-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In omap_gpio_runtime_suspend/resume() the context save/restore should
be independent of bank-&gt;enabled_non_wakeup_gpios. This was preventing
context restore of GPIO lines which are not wakeup enabled.

Reported-by: Govindraj Raja &lt;govindraj.raja@ti.com&gt;
Signed-off-by: Tarun Kanti DebBarma &lt;tarun.kanti@ti.com&gt;
Reviewed-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Reviewed-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio/omap: fix missing dataout context save in _set_gpio_dataout_reg</title>
<updated>2012-03-20T09:59:52+00:00</updated>
<author>
<name>Tarun Kanti DebBarma</name>
<email>tarun.kanti@ti.com</email>
</author>
<published>2012-03-02T07:22:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2c836f7ea5e7b5eec2a798e02b1d76ea791fa094'/>
<id>2c836f7ea5e7b5eec2a798e02b1d76ea791fa094</id>
<content type='text'>
There are two functions, _set_gpio_dataout_reg() and _set_gpio_dataout_mask()
which writes to dataout register and the dataout context must be saved.
It is missing in the first function, _set_gpio_dataout_reg(). Fix this.

Signed-off-by: Tarun Kanti DebBarma &lt;tarun.kanti@ti.com&gt;
Reviewed-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Reviewed-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are two functions, _set_gpio_dataout_reg() and _set_gpio_dataout_mask()
which writes to dataout register and the dataout context must be saved.
It is missing in the first function, _set_gpio_dataout_reg(). Fix this.

Signed-off-by: Tarun Kanti DebBarma &lt;tarun.kanti@ti.com&gt;
Reviewed-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Reviewed-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio/omap: fix _set_gpio_irqenable implementation</title>
<updated>2012-03-20T09:59:09+00:00</updated>
<author>
<name>Tarun Kanti DebBarma</name>
<email>tarun.kanti@ti.com</email>
</author>
<published>2011-11-25T09:57:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8276536cec38bc6bde30d0aa67716f22b9b9705a'/>
<id>8276536cec38bc6bde30d0aa67716f22b9b9705a</id>
<content type='text'>
This function should be capable of both enabling and disabling interrupts
based upon the *enable* parameter. Right now the function only enables
the interrupt and *enable* is not used at all. So add the interrupt
disable capability also using the parameter.

Signed-off-by: Tarun Kanti DebBarma &lt;tarun.kanti@ti.com&gt;
Reviewed-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Acked-by: Felipe Balbi &lt;balbi@ti.com&gt;
Reviewed-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This function should be capable of both enabling and disabling interrupts
based upon the *enable* parameter. Right now the function only enables
the interrupt and *enable* is not used at all. So add the interrupt
disable capability also using the parameter.

Signed-off-by: Tarun Kanti DebBarma &lt;tarun.kanti@ti.com&gt;
Reviewed-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Acked-by: Felipe Balbi &lt;balbi@ti.com&gt;
Reviewed-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio/omap: fix trigger type to unsigned</title>
<updated>2012-03-20T09:59:04+00:00</updated>
<author>
<name>Tarun Kanti DebBarma</name>
<email>tarun.kanti@ti.com</email>
</author>
<published>2011-11-25T10:11:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=00ece7e4826e631565eae089d3c813120c6535ef'/>
<id>00ece7e4826e631565eae089d3c813120c6535ef</id>
<content type='text'>
The GPIO trigger parameter is of type unsigned.
enum {
        IRQ_TYPE_NONE           = 0x00000000,
        IRQ_TYPE_EDGE_RISING    = 0x00000001,
        IRQ_TYPE_EDGE_FALLING   = 0x00000002,
        IRQ_TYPE_EDGE_BOTH      = (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING),
        IRQ_TYPE_LEVEL_HIGH     = 0x00000004,
        IRQ_TYPE_LEVEL_LOW      = 0x00000008,
        IRQ_TYPE_LEVEL_MASK     = (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH),
        IRQ_TYPE_SENSE_MASK     = 0x0000000f,

        IRQ_TYPE_PROBE          = 0x00000010,
...
};
Even though gpio_irq_type(struct irq_data *d, unsigned type) has the right type
of parameter, the subsequent called functions set_gpio_triggering() and
set_gpio_trigger() wrongly makes it signed integer. Fix this.

Signed-off-by: Tarun Kanti DebBarma &lt;tarun.kanti@ti.com&gt;
Reviewed-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Acked-by: Felipe Balbi &lt;balbi@ti.com&gt;
Reviewed-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The GPIO trigger parameter is of type unsigned.
enum {
        IRQ_TYPE_NONE           = 0x00000000,
        IRQ_TYPE_EDGE_RISING    = 0x00000001,
        IRQ_TYPE_EDGE_FALLING   = 0x00000002,
        IRQ_TYPE_EDGE_BOTH      = (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING),
        IRQ_TYPE_LEVEL_HIGH     = 0x00000004,
        IRQ_TYPE_LEVEL_LOW      = 0x00000008,
        IRQ_TYPE_LEVEL_MASK     = (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH),
        IRQ_TYPE_SENSE_MASK     = 0x0000000f,

        IRQ_TYPE_PROBE          = 0x00000010,
...
};
Even though gpio_irq_type(struct irq_data *d, unsigned type) has the right type
of parameter, the subsequent called functions set_gpio_triggering() and
set_gpio_trigger() wrongly makes it signed integer. Fix this.

Signed-off-by: Tarun Kanti DebBarma &lt;tarun.kanti@ti.com&gt;
Reviewed-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Acked-by: Felipe Balbi &lt;balbi@ti.com&gt;
Reviewed-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio/omap: fix wakeup_en register update in _set_gpio_wakeup()</title>
<updated>2012-03-20T09:58:58+00:00</updated>
<author>
<name>Tarun Kanti DebBarma</name>
<email>tarun.kanti@ti.com</email>
</author>
<published>2012-02-29T16:19:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=381a752f291763bd6971521fa44c76ad9e937f7b'/>
<id>381a752f291763bd6971521fa44c76ad9e937f7b</id>
<content type='text'>
There are two ways through which wakeup_en register can be programmed
using gpiolib APIs as shown below. It is seen that in the second case
in _set_gpio_wakeup(), even though bank-&gt;suspend_wakeup is updated
correctly, its value is not programmed in wakeup_en register. Fix this.

irq_set_type()-&gt;gpio_irq_type()-&gt;_set_gpio_triggering()-&gt;set_gpio_trigger()
irq_set_wake()-&gt;gpio_wake_enable()-&gt;_set_gpio_wakeup()

Signed-off-by: Tarun Kanti DebBarma &lt;tarun.kanti@ti.com&gt;
Reviewed-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are two ways through which wakeup_en register can be programmed
using gpiolib APIs as shown below. It is seen that in the second case
in _set_gpio_wakeup(), even though bank-&gt;suspend_wakeup is updated
correctly, its value is not programmed in wakeup_en register. Fix this.

irq_set_type()-&gt;gpio_irq_type()-&gt;_set_gpio_triggering()-&gt;set_gpio_trigger()
irq_set_wake()-&gt;gpio_wake_enable()-&gt;_set_gpio_wakeup()

Signed-off-by: Tarun Kanti DebBarma &lt;tarun.kanti@ti.com&gt;
Reviewed-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio/omap: Fix section warning for omap_mpuio_alloc_gc()</title>
<updated>2012-03-12T17:44:46+00:00</updated>
<author>
<name>Tony Lindgren</name>
<email>tony@atomide.com</email>
</author>
<published>2012-03-05T23:32:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8805f410e4fb88a56552c1af42d61b38837a38fd'/>
<id>8805f410e4fb88a56552c1af42d61b38837a38fd</id>
<content type='text'>
Make omap_mpuio_alloc_gc() __devinit as omap_gpio_chip_init()
is __devinit. Otherwise we get:

WARNING: vmlinux.o(.devinit.text+0xa10): Section mismatch in reference
from the function omap_gpio_chip_init() to the function .init.text:omap_mpuio_alloc_gc()
The function __devinit omap_gpio_chip_init() references
a function __init omap_mpuio_alloc_gc().
If omap_mpuio_alloc_gc is only used by omap_gpio_chip_init then
annotate omap_mpuio_alloc_gc with a matching annotation.

Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Acked-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Grant Likely &lt;grant.likely@secretlab.ca&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make omap_mpuio_alloc_gc() __devinit as omap_gpio_chip_init()
is __devinit. Otherwise we get:

WARNING: vmlinux.o(.devinit.text+0xa10): Section mismatch in reference
from the function omap_gpio_chip_init() to the function .init.text:omap_mpuio_alloc_gc()
The function __devinit omap_gpio_chip_init() references
a function __init omap_mpuio_alloc_gc().
If omap_mpuio_alloc_gc is only used by omap_gpio_chip_init then
annotate omap_mpuio_alloc_gc with a matching annotation.

Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Acked-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Grant Likely &lt;grant.likely@secretlab.ca&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio/omap: fix wakeups on level-triggered GPIOs</title>
<updated>2012-03-12T16:16:11+00:00</updated>
<author>
<name>Kevin Hilman</name>
<email>khilman@ti.com</email>
</author>
<published>2012-03-05T23:10:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=68942edb09f69b6e09522d1d346665eb3aadde49'/>
<id>68942edb09f69b6e09522d1d346665eb3aadde49</id>
<content type='text'>
While both level- and edge-triggered GPIOs are capable of generating
interrupts, only edge-triggered GPIOs are capable of generating a
module-level wakeup to the PRCM (c.f. 34xx NDA TRM section 25.5.3.2.)

In order to ensure that devices using level-triggered GPIOs as
interrupts can also cause wakeups (e.g. from idle), this patch enables
edge-triggering for wakeup-enabled, level-triggered GPIOs when a GPIO
bank is runtime-suspended (which also happens during idle.)

This fixes a problem found in GPMC-connected network cards with GPIO
interrupts (e.g. smsc911x on Zoom3, Overo, ...) where network booting
with NFSroot was very slow since the GPIO IRQs used by the NIC were
not generating PRCM wakeups, and thus not waking the system from idle.
NOTE: until v3.3, this boot-time problem was somewhat masked because
the UART init prevented WFI during boot until the full serial driver
was available.  Preventing WFI allowed regular GPIO interrupts to fire
and this problem was not seen.  After the UART runtime PM cleanups, we
no longer avoid WFI during boot, so GPIO IRQs that were not causing
wakeups resulted in very slow IRQ response times.

Tested on platforms using level-triggered GPIOs for network IRQs using
the SMSC911x NIC: 3530/Overo and 3630/Zoom3.

Reported-by: Tony Lindgren &lt;tony@atomide.com&gt;
Tested-by: Tarun Kanti DebBarma &lt;tarun.kanti@ti.com&gt;
Tested-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Grant Likely &lt;grant.likely@secretlab.ca&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While both level- and edge-triggered GPIOs are capable of generating
interrupts, only edge-triggered GPIOs are capable of generating a
module-level wakeup to the PRCM (c.f. 34xx NDA TRM section 25.5.3.2.)

In order to ensure that devices using level-triggered GPIOs as
interrupts can also cause wakeups (e.g. from idle), this patch enables
edge-triggering for wakeup-enabled, level-triggered GPIOs when a GPIO
bank is runtime-suspended (which also happens during idle.)

This fixes a problem found in GPMC-connected network cards with GPIO
interrupts (e.g. smsc911x on Zoom3, Overo, ...) where network booting
with NFSroot was very slow since the GPIO IRQs used by the NIC were
not generating PRCM wakeups, and thus not waking the system from idle.
NOTE: until v3.3, this boot-time problem was somewhat masked because
the UART init prevented WFI during boot until the full serial driver
was available.  Preventing WFI allowed regular GPIO interrupts to fire
and this problem was not seen.  After the UART runtime PM cleanups, we
no longer avoid WFI during boot, so GPIO IRQs that were not causing
wakeups resulted in very slow IRQ response times.

Tested on platforms using level-triggered GPIOs for network IRQs using
the SMSC911x NIC: 3530/Overo and 3630/Zoom3.

Reported-by: Tony Lindgren &lt;tony@atomide.com&gt;
Tested-by: Tarun Kanti DebBarma &lt;tarun.kanti@ti.com&gt;
Tested-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Grant Likely &lt;grant.likely@secretlab.ca&gt;
</pre>
</div>
</content>
</entry>
</feed>
