Re: [PATCH v2 1/5] dt-bindings: add bindings for i2c-pca-platform

2017-06-23 Thread Rob Herring
On Thu, Jun 22, 2017 at 09:20:59PM +, Chris Packham wrote:
> On 22/06/17 20:23, Wolfram Sang wrote:
> > 
> >> + - reset-gpios : gpio specifier for gpio connected to RESET_N pin.
> > 
> > What about the 'active' state that Rob mentioned in his last review?
> > 
> 
> My intention was that by saying it is connected to the RESET_N bin the 
> active state is covered.

I would say okay, but based on below it's not.

> I personally always get a little confused when talking about reset 
> lines. The _N denotes that the line is active low but because it is a 
> reset line writing 1 releases the reset so from a what-the-user-wants 
> perspective it's active high.
> 
> dt-binding-wise what we want here is GPIO_ACTIVE_HIGH, as in the driver 
> writes 1 to release reset so don't do any polarity inversion. I'd be 
> happy do add something to that effect in a v3 but I actually felt saying 
> the gpio is connected to RESET_N was less ambiguous.

No, the driver is wrong. The binding should say GPIO_ACTIVE_LOW because 
that is how the pin is defined. The driver needs to set it to inactive.

Rob


Re: [PATCH v2 1/5] dt-bindings: add bindings for i2c-pca-platform

2017-06-23 Thread Rob Herring
On Thu, Jun 22, 2017 at 09:20:59PM +, Chris Packham wrote:
> On 22/06/17 20:23, Wolfram Sang wrote:
> > 
> >> + - reset-gpios : gpio specifier for gpio connected to RESET_N pin.
> > 
> > What about the 'active' state that Rob mentioned in his last review?
> > 
> 
> My intention was that by saying it is connected to the RESET_N bin the 
> active state is covered.

I would say okay, but based on below it's not.

> I personally always get a little confused when talking about reset 
> lines. The _N denotes that the line is active low but because it is a 
> reset line writing 1 releases the reset so from a what-the-user-wants 
> perspective it's active high.
> 
> dt-binding-wise what we want here is GPIO_ACTIVE_HIGH, as in the driver 
> writes 1 to release reset so don't do any polarity inversion. I'd be 
> happy do add something to that effect in a v3 but I actually felt saying 
> the gpio is connected to RESET_N was less ambiguous.

No, the driver is wrong. The binding should say GPIO_ACTIVE_LOW because 
that is how the pin is defined. The driver needs to set it to inactive.

Rob


Re: [PATCH v2 1/5] dt-bindings: add bindings for i2c-pca-platform

2017-06-23 Thread Wolfram Sang
On Thu, Jun 22, 2017 at 09:20:59PM +, Chris Packham wrote:
> On 22/06/17 20:23, Wolfram Sang wrote:
> > 
> >> + - reset-gpios : gpio specifier for gpio connected to RESET_N pin.
> > 
> > What about the 'active' state that Rob mentioned in his last review?
> > 
> 
> My intention was that by saying it is connected to the RESET_N bin the 
> active state is covered.
> 
> I personally always get a little confused when talking about reset 
> lines. The _N denotes that the line is active low but because it is a 
> reset line writing 1 releases the reset so from a what-the-user-wants 
> perspective it's active high.
> 
> dt-binding-wise what we want here is GPIO_ACTIVE_HIGH, as in the driver 
> writes 1 to release reset so don't do any polarity inversion. I'd be 
> happy do add something to that effect in a v3 but I actually felt saying 
> the gpio is connected to RESET_N was less ambiguous.

Okay. Thanks for the explanation. I am fine with it but I'll leave the
final decision to Rob.



signature.asc
Description: PGP signature


Re: [PATCH v2 1/5] dt-bindings: add bindings for i2c-pca-platform

2017-06-23 Thread Wolfram Sang
On Thu, Jun 22, 2017 at 09:20:59PM +, Chris Packham wrote:
> On 22/06/17 20:23, Wolfram Sang wrote:
> > 
> >> + - reset-gpios : gpio specifier for gpio connected to RESET_N pin.
> > 
> > What about the 'active' state that Rob mentioned in his last review?
> > 
> 
> My intention was that by saying it is connected to the RESET_N bin the 
> active state is covered.
> 
> I personally always get a little confused when talking about reset 
> lines. The _N denotes that the line is active low but because it is a 
> reset line writing 1 releases the reset so from a what-the-user-wants 
> perspective it's active high.
> 
> dt-binding-wise what we want here is GPIO_ACTIVE_HIGH, as in the driver 
> writes 1 to release reset so don't do any polarity inversion. I'd be 
> happy do add something to that effect in a v3 but I actually felt saying 
> the gpio is connected to RESET_N was less ambiguous.

Okay. Thanks for the explanation. I am fine with it but I'll leave the
final decision to Rob.



signature.asc
Description: PGP signature


Re: [PATCH v2 1/5] dt-bindings: add bindings for i2c-pca-platform

2017-06-22 Thread Chris Packham
On 22/06/17 20:23, Wolfram Sang wrote:
> 
>> + - reset-gpios : gpio specifier for gpio connected to RESET_N pin.
> 
> What about the 'active' state that Rob mentioned in his last review?
> 

My intention was that by saying it is connected to the RESET_N bin the 
active state is covered.

I personally always get a little confused when talking about reset 
lines. The _N denotes that the line is active low but because it is a 
reset line writing 1 releases the reset so from a what-the-user-wants 
perspective it's active high.

dt-binding-wise what we want here is GPIO_ACTIVE_HIGH, as in the driver 
writes 1 to release reset so don't do any polarity inversion. I'd be 
happy do add something to that effect in a v3 but I actually felt saying 
the gpio is connected to RESET_N was less ambiguous.


Re: [PATCH v2 1/5] dt-bindings: add bindings for i2c-pca-platform

2017-06-22 Thread Chris Packham
On 22/06/17 20:23, Wolfram Sang wrote:
> 
>> + - reset-gpios : gpio specifier for gpio connected to RESET_N pin.
> 
> What about the 'active' state that Rob mentioned in his last review?
> 

My intention was that by saying it is connected to the RESET_N bin the 
active state is covered.

I personally always get a little confused when talking about reset 
lines. The _N denotes that the line is active low but because it is a 
reset line writing 1 releases the reset so from a what-the-user-wants 
perspective it's active high.

dt-binding-wise what we want here is GPIO_ACTIVE_HIGH, as in the driver 
writes 1 to release reset so don't do any polarity inversion. I'd be 
happy do add something to that effect in a v3 but I actually felt saying 
the gpio is connected to RESET_N was less ambiguous.


Re: [PATCH v2 1/5] dt-bindings: add bindings for i2c-pca-platform

2017-06-22 Thread Wolfram Sang

> + - reset-gpios : gpio specifier for gpio connected to RESET_N pin.

What about the 'active' state that Rob mentioned in his last review?



signature.asc
Description: PGP signature


Re: [PATCH v2 1/5] dt-bindings: add bindings for i2c-pca-platform

2017-06-22 Thread Wolfram Sang

> + - reset-gpios : gpio specifier for gpio connected to RESET_N pin.

What about the 'active' state that Rob mentioned in his last review?



signature.asc
Description: PGP signature


[PATCH v2 1/5] dt-bindings: add bindings for i2c-pca-platform

2017-06-19 Thread Chris Packham
Signed-off-by: Chris Packham 
---
Changes in v2:
- Split dt-binding to separate patch, use "reset-gpios" instead of "gpios".

 .../devicetree/bindings/i2c/i2c-pca-platform.txt   | 18 ++
 1 file changed, 18 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-pca-platform.txt

diff --git a/Documentation/devicetree/bindings/i2c/i2c-pca-platform.txt 
b/Documentation/devicetree/bindings/i2c/i2c-pca-platform.txt
new file mode 100644
index ..86abf249b194
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-pca-platform.txt
@@ -0,0 +1,18 @@
+* NXP PCA PCA9564/PCA9665 I2C controller
+
+The PCA9564/PCA9665 serves as an interface between most standard
+parallel-bus microcontrollers/microprocessors and the serial I2C-bus
+and allows the parallel bus system to communicate bi-directionally
+with the I2C-bus.
+
+Required properties :
+
+ - reg : Offset and length of the register set for the device
+ - compatible : one of "nxp,pca9564" or "nxp,pca9665"
+
+Optional properties
+ - interrupts : the interrupt number
+ - interrupt-parent : the phandle for the interrupt controller.
+   If an interrupt is not specified polling will be used.
+ - reset-gpios : gpio specifier for gpio connected to RESET_N pin.
+ - clock-frequency : I2C bus frequency.
-- 
2.13.0



[PATCH v2 1/5] dt-bindings: add bindings for i2c-pca-platform

2017-06-19 Thread Chris Packham
Signed-off-by: Chris Packham 
---
Changes in v2:
- Split dt-binding to separate patch, use "reset-gpios" instead of "gpios".

 .../devicetree/bindings/i2c/i2c-pca-platform.txt   | 18 ++
 1 file changed, 18 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-pca-platform.txt

diff --git a/Documentation/devicetree/bindings/i2c/i2c-pca-platform.txt 
b/Documentation/devicetree/bindings/i2c/i2c-pca-platform.txt
new file mode 100644
index ..86abf249b194
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-pca-platform.txt
@@ -0,0 +1,18 @@
+* NXP PCA PCA9564/PCA9665 I2C controller
+
+The PCA9564/PCA9665 serves as an interface between most standard
+parallel-bus microcontrollers/microprocessors and the serial I2C-bus
+and allows the parallel bus system to communicate bi-directionally
+with the I2C-bus.
+
+Required properties :
+
+ - reg : Offset and length of the register set for the device
+ - compatible : one of "nxp,pca9564" or "nxp,pca9665"
+
+Optional properties
+ - interrupts : the interrupt number
+ - interrupt-parent : the phandle for the interrupt controller.
+   If an interrupt is not specified polling will be used.
+ - reset-gpios : gpio specifier for gpio connected to RESET_N pin.
+ - clock-frequency : I2C bus frequency.
-- 
2.13.0