linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers
@ 2013-12-10 23:19 Stephen Boyd
  2013-12-10 23:19 ` [PATCH 2/2] gpio: msm: Add module device table and mark table const Stephen Boyd
  2013-12-12 19:02 ` [PATCH 1/2] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers Linus Walleij
  0 siblings, 2 replies; 6+ messages in thread
From: Stephen Boyd @ 2013-12-10 23:19 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, linux-gpio

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

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);
 }
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] gpio: msm: Add module device table and mark table const
  2013-12-10 23:19 [PATCH 1/2] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers Stephen Boyd
@ 2013-12-10 23:19 ` Stephen Boyd
  2013-12-12 19:04   ` Linus Walleij
  2013-12-12 19:02 ` [PATCH 1/2] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers Linus Walleij
  1 sibling, 1 reply; 6+ messages in thread
From: Stephen Boyd @ 2013-12-10 23:19 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, linux-gpio

This allows the module to be loaded automatically.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
 drivers/gpio/gpio-msm-v2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-msm-v2.c b/drivers/gpio/gpio-msm-v2.c
index 00a0978..a4dcbe4 100644
--- a/drivers/gpio/gpio-msm-v2.c
+++ b/drivers/gpio/gpio-msm-v2.c
@@ -430,10 +430,11 @@ static int msm_gpio_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static struct of_device_id msm_gpio_of_match[] = {
+static const struct of_device_id msm_gpio_of_match[] = {
 	{ .compatible = "qcom,msm-gpio", },
 	{ },
 };
+MODULE_DEVICE_TABLE(of, msm_gpio_of_match);
 
 static int msm_gpio_remove(struct platform_device *dev)
 {
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers
  2013-12-10 23:19 [PATCH 1/2] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers Stephen Boyd
  2013-12-10 23:19 ` [PATCH 2/2] gpio: msm: Add module device table and mark table const Stephen Boyd
@ 2013-12-12 19:02 ` Linus Walleij
  2013-12-13  3:58   ` Bjorn Andersson
  2013-12-19  1:27   ` Rohit Vaswani
  1 sibling, 2 replies; 6+ messages in thread
From: Linus Walleij @ 2013-12-12 19:02 UTC (permalink / raw)
  To: Stephen Boyd, Bjorn Andersson, Rohit Vaswani
  Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, linux-gpio

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] gpio: msm: Add module device table and mark table const
  2013-12-10 23:19 ` [PATCH 2/2] gpio: msm: Add module device table and mark table const Stephen Boyd
@ 2013-12-12 19:04   ` Linus Walleij
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2013-12-12 19:04 UTC (permalink / raw)
  To: Stephen Boyd, Rohit Vaswani, Bjorn Andersson
  Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, linux-gpio

On Wed, Dec 11, 2013 at 12:19 AM, Stephen Boyd <sboyd@codeaurora.org> wrote:

> This allows the module to be loaded automatically.
>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers
  2013-12-12 19:02 ` [PATCH 1/2] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers Linus Walleij
@ 2013-12-13  3:58   ` Bjorn Andersson
  2013-12-19  1:27   ` Rohit Vaswani
  1 sibling, 0 replies; 6+ messages in thread
From: Bjorn Andersson @ 2013-12-13  3:58 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Stephen Boyd, Rohit Vaswani, linux-kernel, linux-arm-msm,
	linux-arm-kernel, linux-gpio

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers
  2013-12-12 19:02 ` [PATCH 1/2] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers Linus Walleij
  2013-12-13  3:58   ` Bjorn Andersson
@ 2013-12-19  1:27   ` Rohit Vaswani
  1 sibling, 0 replies; 6+ messages in thread
From: Rohit Vaswani @ 2013-12-19  1:27 UTC (permalink / raw)
  To: Linus Walleij, Stephen Boyd, Bjorn Andersson
  Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, linux-gpio

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

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-12-19  1:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-10 23:19 [PATCH 1/2] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers Stephen Boyd
2013-12-10 23:19 ` [PATCH 2/2] gpio: msm: Add module device table and mark table const Stephen Boyd
2013-12-12 19:04   ` Linus Walleij
2013-12-12 19:02 ` [PATCH 1/2] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers Linus Walleij
2013-12-13  3:58   ` Bjorn Andersson
2013-12-19  1:27   ` Rohit Vaswani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).