Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1705049 > unrolled thread

[PATCH v2 1/5] mfd: mt6397: create irq mappings in mfd core driver

Started byChen Zhong <chen.zhong@mediatek.com>
First post2017-08-07 04:00 +0200
Last post2017-08-08 13:20 +0200
Articles 5 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 1/5] mfd: mt6397: create irq mappings in mfd core driver Chen Zhong <chen.zhong@mediatek.com> - 2017-08-07 04:00 +0200
    Re: [PATCH v2 1/5] mfd: mt6397: create irq mappings in mfd core  driver Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-08-07 23:40 +0200
      Re: [PATCH v2 1/5] mfd: mt6397: create irq mappings in mfd core  driver Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-08-08 05:00 +0200
        Re: [PATCH v2 1/5] mfd: mt6397: create irq mappings in mfd core  driver Chen Zhong <chen.zhong@mediatek.com> - 2017-08-08 11:20 +0200
    Re: [PATCH v2 1/5] mfd: mt6397: create irq mappings in mfd core  driver Lee Jones <lee.jones@linaro.org> - 2017-08-08 13:20 +0200

#1705049 — [PATCH v2 1/5] mfd: mt6397: create irq mappings in mfd core driver

FromChen Zhong <chen.zhong@mediatek.com>
Date2017-08-07 04:00 +0200
Subject[PATCH v2 1/5] mfd: mt6397: create irq mappings in mfd core driver
Message-ID<ubFuO-1I9-19@gated-at.bofh.it>
The core driver should create and manage irq mappings instead of
leaf drivers. This patch change to pass irq domain to
devm_mfd_add_devices() and it will create mapping for irq resources
automatically. And remove irq mapping in rtc driver since this has
been done in core driver.

Signed-off-by: Chen Zhong <chen.zhong@mediatek.com>
---
 drivers/mfd/mt6397-core.c |    4 ++--
 drivers/rtc/rtc-mt6397.c  |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
index 04a601f..6546d7f 100644
--- a/drivers/mfd/mt6397-core.c
+++ b/drivers/mfd/mt6397-core.c
@@ -289,7 +289,7 @@ static int mt6397_probe(struct platform_device *pdev)
 
 		ret = devm_mfd_add_devices(&pdev->dev, -1, mt6323_devs,
 					   ARRAY_SIZE(mt6323_devs), NULL,
-					   0, NULL);
+					   0, pmic->irq_domain);
 		break;
 
 	case MT6397_CID_CODE:
@@ -304,7 +304,7 @@ static int mt6397_probe(struct platform_device *pdev)
 
 		ret = devm_mfd_add_devices(&pdev->dev, -1, mt6397_devs,
 					   ARRAY_SIZE(mt6397_devs), NULL,
-					   0, NULL);
+					   0, pmic->irq_domain);
 		break;
 
 	default:
diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
index 1a61fa5..22c52f7 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -323,7 +323,7 @@ static int mtk_rtc_probe(struct platform_device *pdev)
 	rtc->addr_base = res->start;
 
 	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	rtc->irq = irq_create_mapping(mt6397_chip->irq_domain, res->start);
+	rtc->irq = res->start;
 	if (rtc->irq <= 0)
 		return -EINVAL;
 
-- 
1.7.9.5

[toc] | [next] | [standalone]


#1705879 — Re: [PATCH v2 1/5] mfd: mt6397: create irq mappings in mfd core driver

FromAlexandre Belloni <alexandre.belloni@free-electrons.com>
Date2017-08-07 23:40 +0200
SubjectRe: [PATCH v2 1/5] mfd: mt6397: create irq mappings in mfd core driver
Message-ID<ubXUJ-6aH-11@gated-at.bofh.it>
In reply to#1705049
On 07/08/2017 at 09:57:41 +0800, Chen Zhong wrote:
> The core driver should create and manage irq mappings instead of
> leaf drivers. This patch change to pass irq domain to
> devm_mfd_add_devices() and it will create mapping for irq resources
> automatically. And remove irq mapping in rtc driver since this has
> been done in core driver.
> 
> Signed-off-by: Chen Zhong <chen.zhong@mediatek.com>

For the RTC part:
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

> ---
>  drivers/mfd/mt6397-core.c |    4 ++--
>  drivers/rtc/rtc-mt6397.c  |    2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
> index 04a601f..6546d7f 100644
> --- a/drivers/mfd/mt6397-core.c
> +++ b/drivers/mfd/mt6397-core.c
> @@ -289,7 +289,7 @@ static int mt6397_probe(struct platform_device *pdev)
>  
>  		ret = devm_mfd_add_devices(&pdev->dev, -1, mt6323_devs,
>  					   ARRAY_SIZE(mt6323_devs), NULL,
> -					   0, NULL);
> +					   0, pmic->irq_domain);
>  		break;
>  
>  	case MT6397_CID_CODE:
> @@ -304,7 +304,7 @@ static int mt6397_probe(struct platform_device *pdev)
>  
>  		ret = devm_mfd_add_devices(&pdev->dev, -1, mt6397_devs,
>  					   ARRAY_SIZE(mt6397_devs), NULL,
> -					   0, NULL);
> +					   0, pmic->irq_domain);
>  		break;
>  
>  	default:
> diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
> index 1a61fa5..22c52f7 100644
> --- a/drivers/rtc/rtc-mt6397.c
> +++ b/drivers/rtc/rtc-mt6397.c
> @@ -323,7 +323,7 @@ static int mtk_rtc_probe(struct platform_device *pdev)
>  	rtc->addr_base = res->start;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> -	rtc->irq = irq_create_mapping(mt6397_chip->irq_domain, res->start);
> +	rtc->irq = res->start;
>  	if (rtc->irq <= 0)
>  		return -EINVAL;
>  
> -- 
> 1.7.9.5
> 

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[toc] | [prev] | [next] | [standalone]


#1705975 — Re: [PATCH v2 1/5] mfd: mt6397: create irq mappings in mfd core driver

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-08-08 05:00 +0200
SubjectRe: [PATCH v2 1/5] mfd: mt6397: create irq mappings in mfd core driver
Message-ID<uc2Up-1xb-5@gated-at.bofh.it>
In reply to#1705879
On Mon, Aug 07, 2017 at 11:32:44PM +0200, Alexandre Belloni wrote:
> On 07/08/2017 at 09:57:41 +0800, Chen Zhong wrote:
> > The core driver should create and manage irq mappings instead of
> > leaf drivers. This patch change to pass irq domain to
> > devm_mfd_add_devices() and it will create mapping for irq resources
> > automatically. And remove irq mapping in rtc driver since this has
> > been done in core driver.
> > 
> > Signed-off-by: Chen Zhong <chen.zhong@mediatek.com>
> 
> For the RTC part:
> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> 
> > ---
> >  drivers/mfd/mt6397-core.c |    4 ++--
> >  drivers/rtc/rtc-mt6397.c  |    2 +-
> >  2 files changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
> > index 04a601f..6546d7f 100644
> > --- a/drivers/mfd/mt6397-core.c
> > +++ b/drivers/mfd/mt6397-core.c
> > @@ -289,7 +289,7 @@ static int mt6397_probe(struct platform_device *pdev)
> >  
> >  		ret = devm_mfd_add_devices(&pdev->dev, -1, mt6323_devs,
> >  					   ARRAY_SIZE(mt6323_devs), NULL,
> > -					   0, NULL);
> > +					   0, pmic->irq_domain);
> >  		break;
> >  
> >  	case MT6397_CID_CODE:
> > @@ -304,7 +304,7 @@ static int mt6397_probe(struct platform_device *pdev)
> >  
> >  		ret = devm_mfd_add_devices(&pdev->dev, -1, mt6397_devs,
> >  					   ARRAY_SIZE(mt6397_devs), NULL,
> > -					   0, NULL);
> > +					   0, pmic->irq_domain);
> >  		break;
> >  
> >  	default:
> > diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
> > index 1a61fa5..22c52f7 100644
> > --- a/drivers/rtc/rtc-mt6397.c
> > +++ b/drivers/rtc/rtc-mt6397.c
> > @@ -323,7 +323,7 @@ static int mtk_rtc_probe(struct platform_device *pdev)
> >  	rtc->addr_base = res->start;
> >  
> >  	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> > -	rtc->irq = irq_create_mapping(mt6397_chip->irq_domain, res->start);
> > +	rtc->irq = res->start;

Why not

	rtc->irq = platform_get_irq(pdev, 0);
	if (rtc->irq < 0)
		return rtc->irq;
?

This way you propagate error properly.

Thanks.

-- 
Dmitry

[toc] | [prev] | [next] | [standalone]


#1706247 — Re: [PATCH v2 1/5] mfd: mt6397: create irq mappings in mfd core driver

FromChen Zhong <chen.zhong@mediatek.com>
Date2017-08-08 11:20 +0200
SubjectRe: [PATCH v2 1/5] mfd: mt6397: create irq mappings in mfd core driver
Message-ID<uc8Qa-5YJ-9@gated-at.bofh.it>
In reply to#1705975
On Mon, 2017-08-07 at 19:53 -0700, Dmitry Torokhov wrote:
> On Mon, Aug 07, 2017 at 11:32:44PM +0200, Alexandre Belloni wrote:
> > On 07/08/2017 at 09:57:41 +0800, Chen Zhong wrote:
> > > The core driver should create and manage irq mappings instead of
> > > leaf drivers. This patch change to pass irq domain to
> > > devm_mfd_add_devices() and it will create mapping for irq resources
> > > automatically. And remove irq mapping in rtc driver since this has
> > > been done in core driver.
> > > 
> > > Signed-off-by: Chen Zhong <chen.zhong@mediatek.com>
> > 
> > For the RTC part:
> > Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> > 
> > > ---
> > >  drivers/mfd/mt6397-core.c |    4 ++--
> > >  drivers/rtc/rtc-mt6397.c  |    2 +-
> > >  2 files changed, 3 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
> > > index 04a601f..6546d7f 100644
> > > --- a/drivers/mfd/mt6397-core.c
> > > +++ b/drivers/mfd/mt6397-core.c
> > > @@ -289,7 +289,7 @@ static int mt6397_probe(struct platform_device *pdev)
> > >  
> > >  		ret = devm_mfd_add_devices(&pdev->dev, -1, mt6323_devs,
> > >  					   ARRAY_SIZE(mt6323_devs), NULL,
> > > -					   0, NULL);
> > > +					   0, pmic->irq_domain);
> > >  		break;
> > >  
> > >  	case MT6397_CID_CODE:
> > > @@ -304,7 +304,7 @@ static int mt6397_probe(struct platform_device *pdev)
> > >  
> > >  		ret = devm_mfd_add_devices(&pdev->dev, -1, mt6397_devs,
> > >  					   ARRAY_SIZE(mt6397_devs), NULL,
> > > -					   0, NULL);
> > > +					   0, pmic->irq_domain);
> > >  		break;
> > >  
> > >  	default:
> > > diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
> > > index 1a61fa5..22c52f7 100644
> > > --- a/drivers/rtc/rtc-mt6397.c
> > > +++ b/drivers/rtc/rtc-mt6397.c
> > > @@ -323,7 +323,7 @@ static int mtk_rtc_probe(struct platform_device *pdev)
> > >  	rtc->addr_base = res->start;
> > >  
> > >  	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> > > -	rtc->irq = irq_create_mapping(mt6397_chip->irq_domain, res->start);
> > > +	rtc->irq = res->start;
> 
> Why not
> 
> 	rtc->irq = platform_get_irq(pdev, 0);
> 	if (rtc->irq < 0)
> 		return rtc->irq;
> ?
> 
> This way you propagate error properly.
> 
> Thanks.
> 

Hi Dmitry,

	I'll modify it to get irq number via this way.

Thank you.

[toc] | [prev] | [next] | [standalone]


#1706355 — Re: [PATCH v2 1/5] mfd: mt6397: create irq mappings in mfd core driver

FromLee Jones <lee.jones@linaro.org>
Date2017-08-08 13:20 +0200
SubjectRe: [PATCH v2 1/5] mfd: mt6397: create irq mappings in mfd core driver
Message-ID<ucaIi-7zl-11@gated-at.bofh.it>
In reply to#1705049
On Mon, 07 Aug 2017, Chen Zhong wrote:

> The core driver should create and manage irq mappings instead of
> leaf drivers. This patch change to pass irq domain to
> devm_mfd_add_devices() and it will create mapping for irq resources
> automatically. And remove irq mapping in rtc driver since this has
> been done in core driver.
> 
> Signed-off-by: Chen Zhong <chen.zhong@mediatek.com>
> ---
>  drivers/mfd/mt6397-core.c |    4 ++--
>  drivers/rtc/rtc-mt6397.c  |    2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)

Once you've fixed Dmitry's comment:

For my own reference:
  Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>

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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web