linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mfd: Support active high IRQs on WM835x
@ 2009-01-26 19:23 Mark Brown
  2009-01-26 19:23 ` [PATCH 2/2] mfd: Ensure all WM8350 IRQs are masked at startup Mark Brown
  2009-02-02 21:56 ` [PATCH 1/2] mfd: Support active high IRQs on WM835x Andrew Morton
  0 siblings, 2 replies; 6+ messages in thread
From: Mark Brown @ 2009-01-26 19:23 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-kernel, Mark Brown

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/mfd/wm8350-core.c       |   16 +++++++++++++++-
 include/linux/mfd/wm8350/core.h |    2 ++
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c
index e5e82c7..908284c 100644
--- a/drivers/mfd/wm8350-core.c
+++ b/drivers/mfd/wm8350-core.c
@@ -1423,7 +1423,21 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq,
 	mutex_init(&wm8350->irq_mutex);
 	INIT_WORK(&wm8350->irq_work, wm8350_irq_worker);
 	if (irq) {
-		ret = request_irq(irq, wm8350_irq, 0,
+		int flags = 0;
+
+		if (pdata && pdata->irq_high) {
+			flags |= IRQF_TRIGGER_HIGH;
+
+			wm8350_set_bits(wm8350, WM8350_SYSTEM_CONTROL_1,
+					WM8350_IRQ_POL);
+		} else {
+			flags |= IRQF_TRIGGER_LOW;
+
+			wm8350_clear_bits(wm8350, WM8350_SYSTEM_CONTROL_1,
+					  WM8350_IRQ_POL);
+		}
+
+		ret = request_irq(irq, wm8350_irq, flags,
 				  "wm8350", wm8350);
 		if (ret != 0) {
 			dev_err(wm8350->dev, "Failed to request IRQ: %d\n",
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h
index 980669d..42cca67 100644
--- a/include/linux/mfd/wm8350/core.h
+++ b/include/linux/mfd/wm8350/core.h
@@ -640,9 +640,11 @@ struct wm8350 {
  *
  * @init: Function called during driver initialisation.  Should be
  *        used by the platform to configure GPIO functions and similar.
+ * @irq_high: Set if WM8350 IRQ is active high.
  */
 struct wm8350_platform_data {
 	int (*init)(struct wm8350 *wm8350);
+	int irq_high;
 };
 
 
-- 
1.5.6.5


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

* [PATCH 2/2] mfd: Ensure all WM8350 IRQs are masked at startup
  2009-01-26 19:23 [PATCH 1/2] mfd: Support active high IRQs on WM835x Mark Brown
@ 2009-01-26 19:23 ` Mark Brown
  2009-02-02 21:56 ` [PATCH 1/2] mfd: Support active high IRQs on WM835x Andrew Morton
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Brown @ 2009-01-26 19:23 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-kernel, Mark Brown

The IRQs might have been left enabled in hardware, generating spurious
IRQs before the drivers have registered.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/mfd/wm8350-core.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c
index 908284c..3024aa2 100644
--- a/drivers/mfd/wm8350-core.c
+++ b/drivers/mfd/wm8350-core.c
@@ -1419,6 +1419,13 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq,
 		return ret;
 	}
 
+	wm8350_reg_write(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK, 0xFFFF);
+	wm8350_reg_write(wm8350, WM8350_INT_STATUS_1_MASK, 0xFFFF);
+	wm8350_reg_write(wm8350, WM8350_INT_STATUS_2_MASK, 0xFFFF);
+	wm8350_reg_write(wm8350, WM8350_UNDER_VOLTAGE_INT_STATUS_MASK, 0xFFFF);
+	wm8350_reg_write(wm8350, WM8350_GPIO_INT_STATUS_MASK, 0xFFFF);
+	wm8350_reg_write(wm8350, WM8350_COMPARATOR_INT_STATUS_MASK, 0xFFFF);
+
 	mutex_init(&wm8350->auxadc_mutex);
 	mutex_init(&wm8350->irq_mutex);
 	INIT_WORK(&wm8350->irq_work, wm8350_irq_worker);
-- 
1.5.6.5


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

* Re: [PATCH 1/2] mfd: Support active high IRQs on WM835x
  2009-01-26 19:23 [PATCH 1/2] mfd: Support active high IRQs on WM835x Mark Brown
  2009-01-26 19:23 ` [PATCH 2/2] mfd: Ensure all WM8350 IRQs are masked at startup Mark Brown
@ 2009-02-02 21:56 ` Andrew Morton
  2009-02-06 13:54   ` Samuel Ortiz
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2009-02-02 21:56 UTC (permalink / raw)
  To: Mark Brown; +Cc: sameo, linux-kernel, broonie

On Mon, 26 Jan 2009 19:23:18 +0000
Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:

> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>  drivers/mfd/wm8350-core.c       |   16 +++++++++++++++-
>  include/linux/mfd/wm8350/core.h |    2 ++
>  2 files changed, 17 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c
> index e5e82c7..908284c 100644
> --- a/drivers/mfd/wm8350-core.c
> +++ b/drivers/mfd/wm8350-core.c
> @@ -1423,7 +1423,21 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq,
>  	mutex_init(&wm8350->irq_mutex);
>  	INIT_WORK(&wm8350->irq_work, wm8350_irq_worker);
>  	if (irq) {
> -		ret = request_irq(irq, wm8350_irq, 0,
> +		int flags = 0;
> +
> +		if (pdata && pdata->irq_high) {
> +			flags |= IRQF_TRIGGER_HIGH;
> +
> +			wm8350_set_bits(wm8350, WM8350_SYSTEM_CONTROL_1,
> +					WM8350_IRQ_POL);
> +		} else {
> +			flags |= IRQF_TRIGGER_LOW;
> +
> +			wm8350_clear_bits(wm8350, WM8350_SYSTEM_CONTROL_1,
> +					  WM8350_IRQ_POL);
> +		}
> +
> +		ret = request_irq(irq, wm8350_irq, flags,
>  				  "wm8350", wm8350);
>  		if (ret != 0) {
>  			dev_err(wm8350->dev, "Failed to request IRQ: %d\n",

This conflicts a bit with your earlier
mfd-initialise-wm8350-interrupts-earlier.patch.

I had marked mfd-initialise-wm8350-interrupts-earlier.patch as
needed-in-2.6.29 so I reworked this patch to fit.

afacit we haven't heard from Sam in a couple of weeks.  If he's having
a bit of downtime I guess I'll merge

mfd-initialise-wm8350-interrupts-earlier.patch
mfd-mark-wm835x-usb_slv_500ma-bit-as-accessible.patch
mfd-pcf50633-terminate-i2c_device_id-list.patch

myself.  But I'll leave that a week or two yet.

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

* Re: [PATCH 1/2] mfd: Support active high IRQs on WM835x
  2009-02-02 21:56 ` [PATCH 1/2] mfd: Support active high IRQs on WM835x Andrew Morton
@ 2009-02-06 13:54   ` Samuel Ortiz
  2009-02-06 14:27     ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Samuel Ortiz @ 2009-02-06 13:54 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Mark Brown, linux-kernel

Hi Andrew,

On Mon, Feb 02, 2009 at 01:56:50PM -0800, Andrew Morton wrote:
> On Mon, 26 Jan 2009 19:23:18 +0000
> Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
> 
> > Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> > ---
> >  drivers/mfd/wm8350-core.c       |   16 +++++++++++++++-
> >  include/linux/mfd/wm8350/core.h |    2 ++
> >  2 files changed, 17 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c
> > index e5e82c7..908284c 100644
> > --- a/drivers/mfd/wm8350-core.c
> > +++ b/drivers/mfd/wm8350-core.c
> > @@ -1423,7 +1423,21 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq,
> >  	mutex_init(&wm8350->irq_mutex);
> >  	INIT_WORK(&wm8350->irq_work, wm8350_irq_worker);
> >  	if (irq) {
> > -		ret = request_irq(irq, wm8350_irq, 0,
> > +		int flags = 0;
> > +
> > +		if (pdata && pdata->irq_high) {
> > +			flags |= IRQF_TRIGGER_HIGH;
> > +
> > +			wm8350_set_bits(wm8350, WM8350_SYSTEM_CONTROL_1,
> > +					WM8350_IRQ_POL);
> > +		} else {
> > +			flags |= IRQF_TRIGGER_LOW;
> > +
> > +			wm8350_clear_bits(wm8350, WM8350_SYSTEM_CONTROL_1,
> > +					  WM8350_IRQ_POL);
> > +		}
> > +
> > +		ret = request_irq(irq, wm8350_irq, flags,
> >  				  "wm8350", wm8350);
> >  		if (ret != 0) {
> >  			dev_err(wm8350->dev, "Failed to request IRQ: %d\n",
> 
> This conflicts a bit with your earlier
> mfd-initialise-wm8350-interrupts-earlier.patch.
> 
> I had marked mfd-initialise-wm8350-interrupts-earlier.patch as
> needed-in-2.6.29 so I reworked this patch to fit.
> 
> afacit we haven't heard from Sam in a couple of weeks.  If he's having
> a bit of downtime I guess I'll merge
Sorry for the latency. Our mailserver had some issues, and I was quite busy
fixing wireless drivers myself :/
I'm back on track now. Mark, I havent got those 2 mfd patches. Did you send
them to me for merging ? If that's so, could you please resend them ?

Cheers,
Samuel.


> mfd-initialise-wm8350-interrupts-earlier.patch
> mfd-mark-wm835x-usb_slv_500ma-bit-as-accessible.patch
> mfd-pcf50633-terminate-i2c_device_id-list.patch
> 
> myself.  But I'll leave that a week or two yet.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* Re: [PATCH 1/2] mfd: Support active high IRQs on WM835x
  2009-02-06 13:54   ` Samuel Ortiz
@ 2009-02-06 14:27     ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2009-02-06 14:27 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: Andrew Morton, linux-kernel

On Fri, Feb 06, 2009 at 02:54:32PM +0100, Samuel Ortiz wrote:

> Sorry for the latency. Our mailserver had some issues, and I was quite busy
> fixing wireless drivers myself :/

No problem.

> I'm back on track now. Mark, I havent got those 2 mfd patches. Did you send
> them to me for merging ? If that's so, could you please resend them ?

I resent the patches that you hadn't merged yesterday when the commits
showed up in -next - I figured they must've slipped through the cracks
when you were catching up.  It was just those two.

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

* [PATCH 2/2] mfd: Ensure all WM8350 IRQs are masked at startup
  2009-02-05 18:13 ` [PATCH 1/2] mfd: Support active high IRQs on WM835x Mark Brown
@ 2009-02-05 18:13   ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2009-02-05 18:13 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-kernel, Mark Brown

The IRQs might have been left enabled in hardware, generating spurious
IRQs before the drivers have registered.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/mfd/wm8350-core.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c
index d784b3e..c384cd2 100644
--- a/drivers/mfd/wm8350-core.c
+++ b/drivers/mfd/wm8350-core.c
@@ -1422,6 +1422,13 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq,
 		return ret;
 	}
 
+	wm8350_reg_write(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK, 0xFFFF);
+	wm8350_reg_write(wm8350, WM8350_INT_STATUS_1_MASK, 0xFFFF);
+	wm8350_reg_write(wm8350, WM8350_INT_STATUS_2_MASK, 0xFFFF);
+	wm8350_reg_write(wm8350, WM8350_UNDER_VOLTAGE_INT_STATUS_MASK, 0xFFFF);
+	wm8350_reg_write(wm8350, WM8350_GPIO_INT_STATUS_MASK, 0xFFFF);
+	wm8350_reg_write(wm8350, WM8350_COMPARATOR_INT_STATUS_MASK, 0xFFFF);
+
 	mutex_init(&wm8350->auxadc_mutex);
 	mutex_init(&wm8350->irq_mutex);
 	INIT_WORK(&wm8350->irq_work, wm8350_irq_worker);
-- 
1.5.6.5


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

end of thread, other threads:[~2009-02-06 14:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-26 19:23 [PATCH 1/2] mfd: Support active high IRQs on WM835x Mark Brown
2009-01-26 19:23 ` [PATCH 2/2] mfd: Ensure all WM8350 IRQs are masked at startup Mark Brown
2009-02-02 21:56 ` [PATCH 1/2] mfd: Support active high IRQs on WM835x Andrew Morton
2009-02-06 13:54   ` Samuel Ortiz
2009-02-06 14:27     ` Mark Brown
2009-02-05 18:12 [PATCH 0/2] WM8350 updates Mark Brown
2009-02-05 18:13 ` [PATCH 1/2] mfd: Support active high IRQs on WM835x Mark Brown
2009-02-05 18:13   ` [PATCH 2/2] mfd: Ensure all WM8350 IRQs are masked at startup Mark Brown

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