RE: [EXT] Re: [PATCH 1/3] dt-bindings: i2c: add optional mul-value property to binding

2019-05-08 Thread Leo Li


> -Original Message-
> From: Chuanhua Han
> Sent: Wednesday, May 8, 2019 6:45 AM
> To: Rob Herring 
> Cc: mark.rutl...@arm.com; shawn...@kernel.org;
> s.ha...@pengutronix.de; Leo Li ; linux-
> ker...@vger.kernel.org; devicet...@vger.kernel.org; linux-arm-
> ker...@lists.infradead.org; linux-...@vger.kernel.org;
> ker...@pengutronix.de; dl-linux-imx ;
> feste...@gmail.com; wsa+rene...@sang-engineering.com; u.kleine-
> koe...@pengutronix.de; e...@deif.com; li...@rempel-privat.de; Sumit
> Batra ; l.st...@pengutronix.de; p...@axentia.se
> Subject: RE: [EXT] Re: [PATCH 1/3] dt-bindings: i2c: add optional mul-value
> property to binding
> 
> 
> 
> > -Original Message-
> > From: Rob Herring 
> > Sent: 2019年5月3日 4:59
> > To: Chuanhua Han 
> > Cc: mark.rutl...@arm.com; shawn...@kernel.org;
> s.ha...@pengutronix.de;
> > Leo Li ; linux-kernel@vger.kernel.org;
> > devicet...@vger.kernel.org; linux-arm-ker...@lists.infradead.org;
> > linux-...@vger.kernel.org; ker...@pengutronix.de; dl-linux-imx
> > ; feste...@gmail.com;
> > wsa+rene...@sang-engineering.com; u.kleine-koe...@pengutronix.de;
> > e...@deif.com; li...@rempel-privat.de; Sumit Batra
> > ; l.st...@pengutronix.de; p...@axentia.se
> > Subject: [EXT] Re: [PATCH 1/3] dt-bindings: i2c: add optional
> > mul-value property to binding
> >
> > Caution: EXT Email
> >
> > On Tue, Apr 30, 2019 at 12:32:40PM +0800, Chuanhua Han wrote:
> > > NXP Layerscape SoC have up to three MUL options available for all
> > > divider values, we choice of MUL determines the internal monitor
> > > rate of the I2C bus (SCL and SDA signals):
> > > A lower MUL value results in a higher sampling rate of the I2C signals.
> > > A higher MUL value results in a lower sampling rate of the I2C signals.
> > >
> > > So in Optional properties we added our custom mul-value property in
> > > the binding to select which mul option for the device tree i2c
> > > controller node.
> > >
> > > Signed-off-by: Chuanhua Han 
> > > ---
> > >  Documentation/devicetree/bindings/i2c/i2c-imx.txt | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> > > b/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> > > index b967544590e8..ba8e7b7b3fa8 100644
> > > --- a/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> > > +++ b/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> > > @@ -18,6 +18,9 @@ Optional properties:
> > >  - sda-gpios: specify the gpio related to SDA pin
> > >  - pinctrl: add extra pinctrl to configure i2c pins to gpio function for 
> > > i2c
> > >bus recovery, call it "gpio" state
> > > +- mul-value: NXP Layerscape SoC have up to three MUL options
> > > +available for all I2C divider values, it describes which MUL we
> > > +choose to use for the driver, the values should be 1,2,4.
> >
> > Needs a vendor prefix. I don't find 'value' to add anything nor do I
> > understand what MUL is.
> Yes,you are right!
> >
> > If it is determined by SoC rather than board, then it should perhaps
> > be implied by compatible.
> This is determined by the SOC, but it has three options to choose from, so I
> think it's better to use the optional option instead of compatible

If there is only one best choice for each SoC letting the SoC compatible 
determine it will be the best.  Unless different board designs(use cases) of 
the same SoC requires different MUL settings, I also don't see much value of 
making it defined in device tree.

Regards,
Leo


RE: [EXT] Re: [PATCH 1/3] dt-bindings: i2c: add optional mul-value property to binding

2019-05-08 Thread Chuanhua Han


> -Original Message-
> From: Rob Herring 
> Sent: 2019年5月3日 4:59
> To: Chuanhua Han 
> Cc: mark.rutl...@arm.com; shawn...@kernel.org; s.ha...@pengutronix.de;
> Leo Li ; linux-kernel@vger.kernel.org;
> devicet...@vger.kernel.org; linux-arm-ker...@lists.infradead.org;
> linux-...@vger.kernel.org; ker...@pengutronix.de; dl-linux-imx
> ; feste...@gmail.com;
> wsa+rene...@sang-engineering.com; u.kleine-koe...@pengutronix.de;
> e...@deif.com; li...@rempel-privat.de; Sumit Batra ;
> l.st...@pengutronix.de; p...@axentia.se
> Subject: [EXT] Re: [PATCH 1/3] dt-bindings: i2c: add optional mul-value
> property to binding
> 
> Caution: EXT Email
> 
> On Tue, Apr 30, 2019 at 12:32:40PM +0800, Chuanhua Han wrote:
> > NXP Layerscape SoC have up to three MUL options available for all
> > divider values, we choice of MUL determines the internal monitor rate
> > of the I2C bus (SCL and SDA signals):
> > A lower MUL value results in a higher sampling rate of the I2C signals.
> > A higher MUL value results in a lower sampling rate of the I2C signals.
> >
> > So in Optional properties we added our custom mul-value property in
> > the binding to select which mul option for the device tree i2c
> > controller node.
> >
> > Signed-off-by: Chuanhua Han 
> > ---
> >  Documentation/devicetree/bindings/i2c/i2c-imx.txt | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> > b/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> > index b967544590e8..ba8e7b7b3fa8 100644
> > --- a/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> > @@ -18,6 +18,9 @@ Optional properties:
> >  - sda-gpios: specify the gpio related to SDA pin
> >  - pinctrl: add extra pinctrl to configure i2c pins to gpio function for i2c
> >bus recovery, call it "gpio" state
> > +- mul-value: NXP Layerscape SoC have up to three MUL options
> > +available for all I2C divider values, it describes which MUL we
> > +choose to use for the driver, the values should be 1,2,4.
> 
> Needs a vendor prefix. I don't find 'value' to add anything nor do I 
> understand
> what MUL is.
Yes,you are right!
> 
> If it is determined by SoC rather than board, then it should perhaps be 
> implied
> by compatible.
This is determined by the SOC, but it has three options to choose from, 
so I think it's better to use the optional option instead of compatible

> 
> Rob


Re: [PATCH 1/3] dt-bindings: i2c: add optional mul-value property to binding

2019-05-07 Thread Wolfram Sang
On Thu, May 02, 2019 at 03:59:01PM -0500, Rob Herring wrote:
> On Tue, Apr 30, 2019 at 12:32:40PM +0800, Chuanhua Han wrote:
> > NXP Layerscape SoC have up to three MUL options available for all
> > divider values, we choice of MUL determines the internal monitor rate
> > of the I2C bus (SCL and SDA signals):
> > A lower MUL value results in a higher sampling rate of the I2C signals.
> > A higher MUL value results in a lower sampling rate of the I2C signals.
> > 
> > So in Optional properties we added our custom mul-value property in the
> > binding to select which mul option for the device tree i2c controller
> > node.
> > 
> > Signed-off-by: Chuanhua Han 
> > ---
> >  Documentation/devicetree/bindings/i2c/i2c-imx.txt | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-imx.txt 
> > b/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> > index b967544590e8..ba8e7b7b3fa8 100644
> > --- a/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> > @@ -18,6 +18,9 @@ Optional properties:
> >  - sda-gpios: specify the gpio related to SDA pin
> >  - pinctrl: add extra pinctrl to configure i2c pins to gpio function for i2c
> >bus recovery, call it "gpio" state
> > +- mul-value: NXP Layerscape SoC have up to three MUL options available for
> > +all I2C divider values, it describes which MUL we choose to use for the 
> > driver,
> > +the values should be 1,2,4.
> 
> Needs a vendor prefix. I don't find 'value' to add anything nor do I 
> understand what MUL is.
> 
> If it is determined by SoC rather than board, then it should perhaps be 
> implied by compatible.

I was wondering the same.



signature.asc
Description: PGP signature


Re: [PATCH 1/3] dt-bindings: i2c: add optional mul-value property to binding

2019-05-02 Thread Rob Herring
On Tue, Apr 30, 2019 at 12:32:40PM +0800, Chuanhua Han wrote:
> NXP Layerscape SoC have up to three MUL options available for all
> divider values, we choice of MUL determines the internal monitor rate
> of the I2C bus (SCL and SDA signals):
> A lower MUL value results in a higher sampling rate of the I2C signals.
> A higher MUL value results in a lower sampling rate of the I2C signals.
> 
> So in Optional properties we added our custom mul-value property in the
> binding to select which mul option for the device tree i2c controller
> node.
> 
> Signed-off-by: Chuanhua Han 
> ---
>  Documentation/devicetree/bindings/i2c/i2c-imx.txt | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-imx.txt 
> b/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> index b967544590e8..ba8e7b7b3fa8 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> +++ b/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> @@ -18,6 +18,9 @@ Optional properties:
>  - sda-gpios: specify the gpio related to SDA pin
>  - pinctrl: add extra pinctrl to configure i2c pins to gpio function for i2c
>bus recovery, call it "gpio" state
> +- mul-value: NXP Layerscape SoC have up to three MUL options available for
> +all I2C divider values, it describes which MUL we choose to use for the 
> driver,
> +the values should be 1,2,4.

Needs a vendor prefix. I don't find 'value' to add anything nor do I 
understand what MUL is.

If it is determined by SoC rather than board, then it should perhaps be 
implied by compatible.

Rob


RE: [EXT] Re: [PATCH 1/3] dt-bindings: i2c: add optional mul-value property to binding

2019-04-30 Thread Chuanhua Han


> -Original Message-
> From: Uwe Kleine-König 
> Sent: 2019年4月30日 14:38
> To: Chuanhua Han 
> Cc: robh...@kernel.org; mark.rutl...@arm.com; shawn...@kernel.org;
> s.ha...@pengutronix.de; Leo Li ;
> linux-kernel@vger.kernel.org; devicet...@vger.kernel.org;
> linux-arm-ker...@lists.infradead.org; linux-...@vger.kernel.org;
> ker...@pengutronix.de; dl-linux-imx ;
> feste...@gmail.com; wsa+rene...@sang-engineering.com; e...@deif.com;
> li...@rempel-privat.de; Sumit Batra ;
> l.st...@pengutronix.de; p...@axentia.se
> Subject: [EXT] Re: [PATCH 1/3] dt-bindings: i2c: add optional mul-value
> property to binding
> 
> Caution: EXT Email
> 
> On Tue, Apr 30, 2019 at 12:32:40PM +0800, Chuanhua Han wrote:
> > NXP Layerscape SoC have up to three MUL options available for all
> > divider values, we choice of MUL determines the internal monitor rate
> > of the I2C bus (SCL and SDA signals):
> > A lower MUL value results in a higher sampling rate of the I2C signals.
> > A higher MUL value results in a lower sampling rate of the I2C signals.
> >
> > So in Optional properties we added our custom mul-value property in
> > the binding to select which mul option for the device tree i2c
> > controller node.
> >
> > Signed-off-by: Chuanhua Han 
> > ---
> >  Documentation/devicetree/bindings/i2c/i2c-imx.txt | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> > b/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> > index b967544590e8..ba8e7b7b3fa8 100644
> > --- a/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> > @@ -18,6 +18,9 @@ Optional properties:
> >  - sda-gpios: specify the gpio related to SDA pin
> >  - pinctrl: add extra pinctrl to configure i2c pins to gpio function for i2c
> >bus recovery, call it "gpio" state
> > +- mul-value: NXP Layerscape SoC have up to three MUL options
> > +available for all I2C divider values, it describes which MUL we
> > +choose to use for the driver, the values should be 1,2,4.
> 
> Indention is broken.
Yes, I also found this problem, next version I will fix the indent problem
> 
> I wonder why this needs to be configurable on a per-machine/device level.
> What is the trade-off?
According to NXP Layerscape SoC Reference Manual, there are three MUL 
options for i2c controller to configure i2c Bus Frequency Divider Register 
(IBFD)
to determine the clock Frequency of i2c. 
Some socs (such as ls1046a) have the best performance when MUL=4, 
and the default is MUL=1. 
This option is optional and can be configured by device tree
> 
> Best regards
> Uwe
> 
> --
> Pengutronix e.K.   | Uwe Kleine-König
> |
> Industrial Linux Solutions |
> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.pe
> ngutronix.de%2Fdata=02%7C01%7Cchuanhua.han%40nxp.com%7C158
> 21c9cf4c449f2d5ea08d6cd367aaa%7C686ea1d3bc2b4c6fa92cd99c5c301635
> %7C0%7C0%7C636922031201957736sdata=8jKPN%2FSJghgOF890NTr
> %2FC%2B9PsFpEr64%2B%2FXHLSX5Cipo%3Dreserved=0  |


Re: [PATCH 1/3] dt-bindings: i2c: add optional mul-value property to binding

2019-04-30 Thread Uwe Kleine-König
On Tue, Apr 30, 2019 at 12:32:40PM +0800, Chuanhua Han wrote:
> NXP Layerscape SoC have up to three MUL options available for all
> divider values, we choice of MUL determines the internal monitor rate
> of the I2C bus (SCL and SDA signals):
> A lower MUL value results in a higher sampling rate of the I2C signals.
> A higher MUL value results in a lower sampling rate of the I2C signals.
> 
> So in Optional properties we added our custom mul-value property in the
> binding to select which mul option for the device tree i2c controller
> node.
> 
> Signed-off-by: Chuanhua Han 
> ---
>  Documentation/devicetree/bindings/i2c/i2c-imx.txt | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-imx.txt 
> b/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> index b967544590e8..ba8e7b7b3fa8 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> +++ b/Documentation/devicetree/bindings/i2c/i2c-imx.txt
> @@ -18,6 +18,9 @@ Optional properties:
>  - sda-gpios: specify the gpio related to SDA pin
>  - pinctrl: add extra pinctrl to configure i2c pins to gpio function for i2c
>bus recovery, call it "gpio" state
> +- mul-value: NXP Layerscape SoC have up to three MUL options available for
> +all I2C divider values, it describes which MUL we choose to use for the 
> driver,
> +the values should be 1,2,4.

Indention is broken.

I wonder why this needs to be configurable on a per-machine/device
level. What is the trade-off?

Best regards
Uwe

-- 
Pengutronix e.K.   | Uwe Kleine-König|
Industrial Linux Solutions | http://www.pengutronix.de/  |


[PATCH 1/3] dt-bindings: i2c: add optional mul-value property to binding

2019-04-29 Thread Chuanhua Han
NXP Layerscape SoC have up to three MUL options available for all
divider values, we choice of MUL determines the internal monitor rate
of the I2C bus (SCL and SDA signals):
A lower MUL value results in a higher sampling rate of the I2C signals.
A higher MUL value results in a lower sampling rate of the I2C signals.

So in Optional properties we added our custom mul-value property in the
binding to select which mul option for the device tree i2c controller
node.

Signed-off-by: Chuanhua Han 
---
 Documentation/devicetree/bindings/i2c/i2c-imx.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/i2c/i2c-imx.txt 
b/Documentation/devicetree/bindings/i2c/i2c-imx.txt
index b967544590e8..ba8e7b7b3fa8 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-imx.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-imx.txt
@@ -18,6 +18,9 @@ Optional properties:
 - sda-gpios: specify the gpio related to SDA pin
 - pinctrl: add extra pinctrl to configure i2c pins to gpio function for i2c
   bus recovery, call it "gpio" state
+- mul-value: NXP Layerscape SoC have up to three MUL options available for
+all I2C divider values, it describes which MUL we choose to use for the driver,
+the values should be 1,2,4.
 
 Examples:
 
-- 
2.17.1