diff mbox

[1/2] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers

Message ID 1386717544-478-1-git-send-email-sboyd@codeaurora.org (mailing list archive)
State New, archived
Headers show

Commit Message

Stephen Boyd Dec. 10, 2013, 11:19 p.m. UTC
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>
---
 drivers/gpio/gpio-msm-v2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Linus Walleij Dec. 12, 2013, 7:02 p.m. UTC | #1
On Wed, Dec 11, 2013 at 12:19 AM, Stephen Boyd <sboyd@codeaurora.org> wrote:

> 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>

I've applied this for fixes and tagged for stable.
Björn, Rohit: OK?

Yours,
Linus Walleij
Bjorn Andersson Dec. 13, 2013, 3:58 a.m. UTC | #2
On Thu 12 Dec 11:02 PST 2013, Linus Walleij wrote:

> On Wed, Dec 11, 2013 at 12:19 AM, Stephen Boyd <sboyd@codeaurora.org> wrote:
> 
> > 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>
> 
> I've applied this for fixes and tagged for stable.
> Björn, Rohit: OK?

This looks good.

JFYI; the pinctrl-msm is written with gpio-msm-v2 in mind as well, so replacing
it with pinctrl is on my todo list...

Regards,
Bjorn
Rohit Vaswani Dec. 19, 2013, 1:27 a.m. UTC | #3
On 12/12/2013 11:02 AM, Linus Walleij wrote:
> On Wed, Dec 11, 2013 at 12:19 AM, Stephen Boyd <sboyd@codeaurora.org> wrote:
>
>> 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>
> I've applied this for fixes and tagged for stable.
> Björn, Rohit: OK?
>
> Yours,
> Linus Walleij
Acked-by: Rohit Vaswani <rvaswani@codeaurora.org>

Thanks,
Rohit Vaswani
diff mbox

Patch

diff --git a/drivers/gpio/gpio-msm-v2.c b/drivers/gpio/gpio-msm-v2.c
index f7a0cc4..00a0978 100644
--- a/drivers/gpio/gpio-msm-v2.c
+++ b/drivers/gpio/gpio-msm-v2.c
@@ -252,7 +252,7 @@  static void msm_gpio_irq_mask(struct irq_data *d)
 
 	spin_lock_irqsave(&tlmm_lock, irq_flags);
 	writel(TARGET_PROC_NONE, GPIO_INTR_CFG_SU(gpio));
-	clear_gpio_bits(INTR_RAW_STATUS_EN | INTR_ENABLE, GPIO_INTR_CFG(gpio));
+	clear_gpio_bits(BIT(INTR_RAW_STATUS_EN) | BIT(INTR_ENABLE), GPIO_INTR_CFG(gpio));
 	__clear_bit(gpio, msm_gpio.enabled_irqs);
 	spin_unlock_irqrestore(&tlmm_lock, irq_flags);
 }
@@ -264,7 +264,7 @@  static void msm_gpio_irq_unmask(struct irq_data *d)
 
 	spin_lock_irqsave(&tlmm_lock, irq_flags);
 	__set_bit(gpio, msm_gpio.enabled_irqs);
-	set_gpio_bits(INTR_RAW_STATUS_EN | INTR_ENABLE, GPIO_INTR_CFG(gpio));
+	set_gpio_bits(BIT(INTR_RAW_STATUS_EN) | BIT(INTR_ENABLE), GPIO_INTR_CFG(gpio));
 	writel(TARGET_PROC_SCORPION, GPIO_INTR_CFG_SU(gpio));
 	spin_unlock_irqrestore(&tlmm_lock, irq_flags);
 }