RE: [PATCH 2/3] rtc: imx-sc: Make compatible string more generic

2019-06-11 Thread Anson Huang
Hi, Fabio/Trent

> -Original Message-
> From: Trent Piepho 
> Sent: Wednesday, June 12, 2019 4:46 AM
> To: feste...@gmail.com; Anson Huang 
> Cc: Aisheng Dong ; alexandre.bell...@bootlin.com;
> robh...@kernel.org; dl-linux-imx ; linux-
> ker...@vger.kernel.org; devicet...@vger.kernel.org;
> a.zu...@towertech.it; mark.rutl...@arm.com; Peng Fan
> ; shawn...@kernel.org; linux-arm-
> ker...@lists.infradead.org; Daniel Baluta ;
> ulf.hans...@linaro.org; ker...@pengutronix.de; linux-...@vger.kernel.org;
> s.ha...@pengutronix.de
> Subject: Re: [PATCH 2/3] rtc: imx-sc: Make compatible string more generic
> 
> On Tue, 2019-06-11 at 17:32 -0300, Fabio Estevam wrote:
> > Hi Anson,
> >
> > On Tue, Jun 11, 2019 at 3:31 AM  wrote:
> > >
> > > From: Anson Huang 
> > >
> > > i.MX system controller RTC driver can support all i.MX SoCs with
> > > system controller inside, this patch makes the compatible string
> > > more generic to support other i.MX SoCs with system controller
> > > inside, such as i.MX8QM etc..
> > >
> > > Signed-off-by: Anson Huang 
> > > ---
> > >  drivers/rtc/rtc-imx-sc.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/rtc/rtc-imx-sc.c b/drivers/rtc/rtc-imx-sc.c
> > > index c933045..38ef3ca 100644
> > > --- a/drivers/rtc/rtc-imx-sc.c
> > > +++ b/drivers/rtc/rtc-imx-sc.c
> > > @@ -178,7 +178,7 @@ static int imx_sc_rtc_probe(struct
> > > platform_device *pdev)  }
> > >
> > >  static const struct of_device_id imx_sc_dt_ids[] = {
> > > -   { .compatible = "fsl,imx8qxp-sc-rtc", },
> > > +   { .compatible = "fsl,imx-sc-rtc", },
> >
> > What is wrong with the current compatible string?

Nothing wrong, just want to make it aligned with other SCU drivers, like
SCU watchdog, SCU thermal etc., the driver ONLY contains "fsl,imx-sc-xxx"
compatible string, then for new SoC, we can just add it as compatible or
fallback compatible string, no need to do any change for driver.  

> >
> > If you want to support i.MX8QM just add in its dtsi:
> >
> > compatible = "fsl,imx8qm-sc-rtc", "fsl,imx8qxp-sc-rtc"
> >
> > and add a dt-bindings entry for "fsl,imx8qm-sc-rtc"

I am OK if we can just use " fsl,imx8qxp-sc-rtc" as fallback compatible string
for later SoCs.

> 
> Yes, I thought this is (was?) the recommended practice for IP blocks in SoCs
> that don't have their own version (vs something like a Synopsis block used
> many places):
> 
> * Use the first SoC to have the block as the base compatible for the block.
> * Always add the current SoC, in additional to the base, in the SoC's dts's 
> list
> of compatibles.  Even if unneeded at the present.
> * The driver will list the base compatible in the match table, and will add 
> new
> ones for specific socs if/when there is a need for it.

Make sense, I was recommended to make the fallback compatible string aligned
for all SCU drivers, for me, I am OK with either way, so if you think it is NOT 
necessary
to do it, we can drop this series.

Thanks,
Anson



Re: [PATCH 2/3] rtc: imx-sc: Make compatible string more generic

2019-06-11 Thread Trent Piepho
On Tue, 2019-06-11 at 17:32 -0300, Fabio Estevam wrote:
> Hi Anson,
> 
> On Tue, Jun 11, 2019 at 3:31 AM  wrote:
> > 
> > From: Anson Huang 
> > 
> > i.MX system controller RTC driver can support all i.MX SoCs
> > with system controller inside, this patch makes the compatible
> > string more generic to support other i.MX SoCs with system
> > controller inside, such as i.MX8QM etc..
> > 
> > Signed-off-by: Anson Huang 
> > ---
> >  drivers/rtc/rtc-imx-sc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/rtc/rtc-imx-sc.c b/drivers/rtc/rtc-imx-sc.c
> > index c933045..38ef3ca 100644
> > --- a/drivers/rtc/rtc-imx-sc.c
> > +++ b/drivers/rtc/rtc-imx-sc.c
> > @@ -178,7 +178,7 @@ static int imx_sc_rtc_probe(struct
> > platform_device *pdev)
> >  }
> > 
> >  static const struct of_device_id imx_sc_dt_ids[] = {
> > -   { .compatible = "fsl,imx8qxp-sc-rtc", },
> > +   { .compatible = "fsl,imx-sc-rtc", },
> 
> What is wrong with the current compatible string?
> 
> If you want to support i.MX8QM just add in its dtsi:
> 
> compatible = "fsl,imx8qm-sc-rtc", "fsl,imx8qxp-sc-rtc"
> 
> and add a dt-bindings entry for "fsl,imx8qm-sc-rtc"

Yes, I thought this is (was?) the recommended practice for IP blocks in
SoCs that don't have their own version (vs something like a Synopsis
block used many places):

* Use the first SoC to have the block as the base compatible for the
block.
* Always add the current SoC, in additional to the base, in the SoC's
dts's list of compatibles.  Even if unneeded at the present.
* The driver will list the base compatible in the match table, and will
add new ones for specific socs if/when there is a need for it.


Re: [PATCH 2/3] rtc: imx-sc: Make compatible string more generic

2019-06-11 Thread Fabio Estevam
Hi Anson,

On Tue, Jun 11, 2019 at 3:31 AM  wrote:
>
> From: Anson Huang 
>
> i.MX system controller RTC driver can support all i.MX SoCs
> with system controller inside, this patch makes the compatible
> string more generic to support other i.MX SoCs with system
> controller inside, such as i.MX8QM etc..
>
> Signed-off-by: Anson Huang 
> ---
>  drivers/rtc/rtc-imx-sc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/rtc/rtc-imx-sc.c b/drivers/rtc/rtc-imx-sc.c
> index c933045..38ef3ca 100644
> --- a/drivers/rtc/rtc-imx-sc.c
> +++ b/drivers/rtc/rtc-imx-sc.c
> @@ -178,7 +178,7 @@ static int imx_sc_rtc_probe(struct platform_device *pdev)
>  }
>
>  static const struct of_device_id imx_sc_dt_ids[] = {
> -   { .compatible = "fsl,imx8qxp-sc-rtc", },
> +   { .compatible = "fsl,imx-sc-rtc", },

What is wrong with the current compatible string?

If you want to support i.MX8QM just add in its dtsi:

compatible = "fsl,imx8qm-sc-rtc", "fsl,imx8qxp-sc-rtc"

and add a dt-bindings entry for "fsl,imx8qm-sc-rtc"


Re: [PATCH 2/3] rtc: imx-sc: Make compatible string more generic

2019-06-11 Thread Alexandre Belloni
On 11/06/2019 10:57:17+, Aisheng Dong wrote:
> > From: anson.hu...@nxp.com [mailto:anson.hu...@nxp.com]
> > Sent: Tuesday, June 11, 2019 2:34 PM
> > 
> > i.MX system controller RTC driver can support all i.MX SoCs with system
> > controller inside, this patch makes the compatible string more generic to
> > support other i.MX SoCs with system controller inside, such as i.MX8QM etc..
> > 
> > Signed-off-by: Anson Huang 
> 
> Reviewed-by: Dong Aisheng 
> 
> Regards
> Dong Aisheng
> 
> > ---
> >  drivers/rtc/rtc-imx-sc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/rtc/rtc-imx-sc.c b/drivers/rtc/rtc-imx-sc.c index
> > c933045..38ef3ca 100644
> > --- a/drivers/rtc/rtc-imx-sc.c
> > +++ b/drivers/rtc/rtc-imx-sc.c
> > @@ -178,7 +178,7 @@ static int imx_sc_rtc_probe(struct platform_device
> > *pdev)  }
> > 
> >  static const struct of_device_id imx_sc_dt_ids[] = {
> > -   { .compatible = "fsl,imx8qxp-sc-rtc", },

Don't you want to keep that compatible for backward compatibility?

> > +   { .compatible = "fsl,imx-sc-rtc", },
> > {}
> >  };
> >  MODULE_DEVICE_TABLE(of, imx_sc_dt_ids);
> > --
> > 2.7.4
> 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


RE: [PATCH 2/3] rtc: imx-sc: Make compatible string more generic

2019-06-11 Thread Aisheng Dong
> From: anson.hu...@nxp.com [mailto:anson.hu...@nxp.com]
> Sent: Tuesday, June 11, 2019 2:34 PM
> 
> i.MX system controller RTC driver can support all i.MX SoCs with system
> controller inside, this patch makes the compatible string more generic to
> support other i.MX SoCs with system controller inside, such as i.MX8QM etc..
> 
> Signed-off-by: Anson Huang 

Reviewed-by: Dong Aisheng 

Regards
Dong Aisheng

> ---
>  drivers/rtc/rtc-imx-sc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/rtc/rtc-imx-sc.c b/drivers/rtc/rtc-imx-sc.c index
> c933045..38ef3ca 100644
> --- a/drivers/rtc/rtc-imx-sc.c
> +++ b/drivers/rtc/rtc-imx-sc.c
> @@ -178,7 +178,7 @@ static int imx_sc_rtc_probe(struct platform_device
> *pdev)  }
> 
>  static const struct of_device_id imx_sc_dt_ids[] = {
> - { .compatible = "fsl,imx8qxp-sc-rtc", },
> + { .compatible = "fsl,imx-sc-rtc", },
>   {}
>  };
>  MODULE_DEVICE_TABLE(of, imx_sc_dt_ids);
> --
> 2.7.4