linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] mfd: da9063: Register device with proper irq_base
@ 2014-11-21 15:29 Dmitry Lavnikevich
  2014-11-21 15:29 ` [PATCH v2 1/2] mfd: da9063: Get irq base dynamically before registering device Dmitry Lavnikevich
  2014-11-21 15:29 ` [PATCH v2 2/2] regulator: da9063: Do not transform local IRQ to virtual Dmitry Lavnikevich
  0 siblings, 2 replies; 6+ messages in thread
From: Dmitry Lavnikevich @ 2014-11-21 15:29 UTC (permalink / raw)
  To: support.opensource, sameo, lee.jones, lgirdwood, broonie, linux-kernel

This patchset fixes rtc-da9063 registration failure caused by
platform_get_irq_byname() returning local irq instead of virtual one.

In first patch version it was supposed to just transform local IRQ to
VIRQ in rtc-da9063 driver but after discussion in [1] it was decided
to register mfd device with proper irq_base instead of performing IRQ
transform. This is done with patch 1.

This way getting VIRQ in da9063-regulator driver become unnecessary
and so it is removed with patch 2.

[1] https://lkml.org/lkml/2014/11/20/242


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

* [PATCH v2 1/2] mfd: da9063: Get irq base dynamically before registering device
  2014-11-21 15:29 [PATCH v2 0/2] mfd: da9063: Register device with proper irq_base Dmitry Lavnikevich
@ 2014-11-21 15:29 ` Dmitry Lavnikevich
  2014-11-24 10:07   ` Lee Jones
  2014-11-21 15:29 ` [PATCH v2 2/2] regulator: da9063: Do not transform local IRQ to virtual Dmitry Lavnikevich
  1 sibling, 1 reply; 6+ messages in thread
From: Dmitry Lavnikevich @ 2014-11-21 15:29 UTC (permalink / raw)
  To: support.opensource, sameo, lee.jones, lgirdwood, broonie, linux-kernel
  Cc: Dmitry Lavnikevich

After registering mfd device with proper irq_base
platform_get_irq_byname() calls will return VIRQ instead of local IRQ.
This fixes da9063 rtc registration issue:
da9063-rtc da9063-rtc: Failed to request ALARM IRQ 1: -22

Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
---
 drivers/mfd/da9063-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/da9063-core.c b/drivers/mfd/da9063-core.c
index 93db8bb..f38bc98 100644
--- a/drivers/mfd/da9063-core.c
+++ b/drivers/mfd/da9063-core.c
@@ -118,7 +118,7 @@ int da9063_device_init(struct da9063 *da9063, unsigned int irq)
 		da9063->irq_base = pdata->irq_base;
 	} else {
 		da9063->flags = 0;
-		da9063->irq_base = 0;
+		da9063->irq_base = -1;
 	}
 	da9063->chip_irq = irq;
 
@@ -168,6 +168,8 @@ int da9063_device_init(struct da9063 *da9063, unsigned int irq)
 		return ret;
 	}
 
+	da9063->irq_base = regmap_irq_chip_get_base(da9063->regmap_irq);
+
 	ret = mfd_add_devices(da9063->dev, -1, da9063_devs,
 			      ARRAY_SIZE(da9063_devs), NULL, da9063->irq_base,
 			      NULL);
-- 
2.1.3


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

* [PATCH v2 2/2] regulator: da9063: Do not transform local IRQ to virtual
  2014-11-21 15:29 [PATCH v2 0/2] mfd: da9063: Register device with proper irq_base Dmitry Lavnikevich
  2014-11-21 15:29 ` [PATCH v2 1/2] mfd: da9063: Get irq base dynamically before registering device Dmitry Lavnikevich
@ 2014-11-21 15:29 ` Dmitry Lavnikevich
  2014-11-21 18:14   ` Mark Brown
  1 sibling, 1 reply; 6+ messages in thread
From: Dmitry Lavnikevich @ 2014-11-21 15:29 UTC (permalink / raw)
  To: support.opensource, sameo, lee.jones, lgirdwood, broonie, linux-kernel
  Cc: Dmitry Lavnikevich

Call platform_get_irq_byname() already returns VIRQ instead of local
IRQ. Passing this value to regmap_irq_get_virq() causes error which
results in IRQ registration failure. This patch fixes such behaviour.

Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
---
 drivers/regulator/da9063-regulator.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c
index 7c9461d..37dd427 100644
--- a/drivers/regulator/da9063-regulator.c
+++ b/drivers/regulator/da9063-regulator.c
@@ -867,17 +867,14 @@ static int da9063_regulator_probe(struct platform_device *pdev)
 		return irq;
 	}
 
-	regulators->irq_ldo_lim = regmap_irq_get_virq(da9063->regmap_irq, irq);
-	if (regulators->irq_ldo_lim >= 0) {
-		ret = request_threaded_irq(regulators->irq_ldo_lim,
-					   NULL, da9063_ldo_lim_event,
-					   IRQF_TRIGGER_LOW | IRQF_ONESHOT,
-					   "LDO_LIM", regulators);
-		if (ret) {
-			dev_err(&pdev->dev,
-					"Failed to request LDO_LIM IRQ.\n");
-			regulators->irq_ldo_lim = -ENXIO;
-		}
+	ret = request_threaded_irq(irq,
+				NULL, da9063_ldo_lim_event,
+				IRQF_TRIGGER_LOW | IRQF_ONESHOT,
+				"LDO_LIM", regulators);
+	if (ret) {
+		dev_err(&pdev->dev,
+				"Failed to request LDO_LIM IRQ.\n");
+		regulators->irq_ldo_lim = -ENXIO;
 	}
 
 	return 0;
-- 
2.1.3


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

* Re: [PATCH v2 2/2] regulator: da9063: Do not transform local IRQ to virtual
  2014-11-21 15:29 ` [PATCH v2 2/2] regulator: da9063: Do not transform local IRQ to virtual Dmitry Lavnikevich
@ 2014-11-21 18:14   ` Mark Brown
  2014-11-24  8:45     ` Opensource [Steve Twiss]
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2014-11-21 18:14 UTC (permalink / raw)
  To: Dmitry Lavnikevich
  Cc: support.opensource, sameo, lee.jones, lgirdwood, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 299 bytes --]

On Fri, Nov 21, 2014 at 06:29:08PM +0300, Dmitry Lavnikevich wrote:
> Call platform_get_irq_byname() already returns VIRQ instead of local
> IRQ. Passing this value to regmap_irq_get_virq() causes error which
> results in IRQ registration failure. This patch fixes such behaviour.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* RE: [PATCH v2 2/2] regulator: da9063: Do not transform local IRQ to virtual
  2014-11-21 18:14   ` Mark Brown
@ 2014-11-24  8:45     ` Opensource [Steve Twiss]
  0 siblings, 0 replies; 6+ messages in thread
From: Opensource [Steve Twiss] @ 2014-11-24  8:45 UTC (permalink / raw)
  To: Dmitry Lavnikevich
  Cc: Support Opensource, sameo, lee.jones, lgirdwood, linux-kernel,
	Mark Brown


On 21 November 2014 18:14 Mark Brown wrote

> To: Dmitry Lavnikevich
> Subject: Re: [PATCH v2 2/2] regulator: da9063: Do not transform local IRQ to virtual
> 
> On Fri, Nov 21, 2014 at 06:29:08PM +0300, Dmitry Lavnikevich wrote:
> > Call platform_get_irq_byname() already returns VIRQ instead of local
> > IRQ. Passing this value to regmap_irq_get_virq() causes error which
> > results in IRQ registration failure. This patch fixes such behaviour.
> 
> Applied, thanks.

Tested-by: Steve Twiss <stwiss.opensource@diasemi.com>

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

* Re: [PATCH v2 1/2] mfd: da9063: Get irq base dynamically before registering device
  2014-11-21 15:29 ` [PATCH v2 1/2] mfd: da9063: Get irq base dynamically before registering device Dmitry Lavnikevich
@ 2014-11-24 10:07   ` Lee Jones
  0 siblings, 0 replies; 6+ messages in thread
From: Lee Jones @ 2014-11-24 10:07 UTC (permalink / raw)
  To: Dmitry Lavnikevich
  Cc: support.opensource, sameo, lgirdwood, broonie, linux-kernel

On Fri, 21 Nov 2014, Dmitry Lavnikevich wrote:

> After registering mfd device with proper irq_base
> platform_get_irq_byname() calls will return VIRQ instead of local IRQ.
> This fixes da9063 rtc registration issue:
> da9063-rtc da9063-rtc: Failed to request ALARM IRQ 1: -22
> 
> Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
> ---
>  drivers/mfd/da9063-core.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Applied, thanks.

> diff --git a/drivers/mfd/da9063-core.c b/drivers/mfd/da9063-core.c
> index 93db8bb..f38bc98 100644
> --- a/drivers/mfd/da9063-core.c
> +++ b/drivers/mfd/da9063-core.c
> @@ -118,7 +118,7 @@ int da9063_device_init(struct da9063 *da9063, unsigned int irq)
>  		da9063->irq_base = pdata->irq_base;
>  	} else {
>  		da9063->flags = 0;
> -		da9063->irq_base = 0;
> +		da9063->irq_base = -1;
>  	}
>  	da9063->chip_irq = irq;
>  
> @@ -168,6 +168,8 @@ int da9063_device_init(struct da9063 *da9063, unsigned int irq)
>  		return ret;
>  	}
>  
> +	da9063->irq_base = regmap_irq_chip_get_base(da9063->regmap_irq);
> +
>  	ret = mfd_add_devices(da9063->dev, -1, da9063_devs,
>  			      ARRAY_SIZE(da9063_devs), NULL, da9063->irq_base,
>  			      NULL);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2014-11-24 10:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-21 15:29 [PATCH v2 0/2] mfd: da9063: Register device with proper irq_base Dmitry Lavnikevich
2014-11-21 15:29 ` [PATCH v2 1/2] mfd: da9063: Get irq base dynamically before registering device Dmitry Lavnikevich
2014-11-24 10:07   ` Lee Jones
2014-11-21 15:29 ` [PATCH v2 2/2] regulator: da9063: Do not transform local IRQ to virtual Dmitry Lavnikevich
2014-11-21 18:14   ` Mark Brown
2014-11-24  8:45     ` Opensource [Steve Twiss]

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