Re: [PATCH v3 4/6] pinctrl: Add pinctrl binding for Broadcom Capri SoCs

2013-12-17 Thread Sherman Yin

On 13-12-16 05:17 AM, Linus Walleij wrote:

On Sat, Dec 14, 2013 at 2:16 AM, Sherman Yin  wrote:


+- bias-pull-up:Integer. Pull up strength in Ohm:
+   1: 1.2 kOhm
+   2: 1.8 kOhm
+   3: 720 Ohm
+   4: 2.7 kOhm
+   5: 831 Ohm
+   6: 1.08 kOhm
+   7: 568 Ohm



Please do not use these custom enumerators 1 thru 7.
Instead say that the argument is given in ohms, so for
example:

bias-pull-up = <12000>;

Then translate this into the proper enumerator in your
driver instead.


Ok.  The 3 bits in this enumeration correspond to enabling the 3 pull up Rs
(1.2k, 1.8k, 2.7k) in parallel, so the enum kind of make sense. But sure I
can change it to actual ohms and will error out in the driver if specified
value is not one of the 7.


Aha, that's how they do it :-)

Please write this in a comment in the driver because it makes
it a lot easier to understand what is going on, and e.g. how to
fuzz an apropriate resistance.


Yes, I plan to explain where those odd numbers come from in this file.


Can you tell me something about how such resistors are produced
in silicon?


Sorry I'm not quite sure.  I only know a little bit of the circuitry 
down to the schematic level...


Regards,
Sherman
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 4/6] pinctrl: Add pinctrl binding for Broadcom Capri SoCs

2013-12-17 Thread Sherman Yin

On 13-12-16 05:17 AM, Linus Walleij wrote:

On Sat, Dec 14, 2013 at 2:16 AM, Sherman Yin s...@broadcom.com wrote:


+- bias-pull-up:Integer. Pull up strength in Ohm:
+   1: 1.2 kOhm
+   2: 1.8 kOhm
+   3: 720 Ohm
+   4: 2.7 kOhm
+   5: 831 Ohm
+   6: 1.08 kOhm
+   7: 568 Ohm



Please do not use these custom enumerators 1 thru 7.
Instead say that the argument is given in ohms, so for
example:

bias-pull-up = 12000;

Then translate this into the proper enumerator in your
driver instead.


Ok.  The 3 bits in this enumeration correspond to enabling the 3 pull up Rs
(1.2k, 1.8k, 2.7k) in parallel, so the enum kind of make sense. But sure I
can change it to actual ohms and will error out in the driver if specified
value is not one of the 7.


Aha, that's how they do it :-)

Please write this in a comment in the driver because it makes
it a lot easier to understand what is going on, and e.g. how to
fuzz an apropriate resistance.


Yes, I plan to explain where those odd numbers come from in this file.


Can you tell me something about how such resistors are produced
in silicon?


Sorry I'm not quite sure.  I only know a little bit of the circuitry 
down to the schematic level...


Regards,
Sherman
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 4/6] pinctrl: Add pinctrl binding for Broadcom Capri SoCs

2013-12-16 Thread Linus Walleij
On Sat, Dec 14, 2013 at 2:16 AM, Sherman Yin  wrote:

>>> +- bias-pull-up:Integer. Pull up strength in Ohm:
>>> +   1: 1.2 kOhm
>>> +   2: 1.8 kOhm
>>> +   3: 720 Ohm
>>> +   4: 2.7 kOhm
>>> +   5: 831 Ohm
>>> +   6: 1.08 kOhm
>>> +   7: 568 Ohm
>>
>>
>> Please do not use these custom enumerators 1 thru 7.
>> Instead say that the argument is given in ohms, so for
>> example:
>>
>> bias-pull-up = <12000>;
>>
>> Then translate this into the proper enumerator in your
>> driver instead.
>
> Ok.  The 3 bits in this enumeration correspond to enabling the 3 pull up Rs
> (1.2k, 1.8k, 2.7k) in parallel, so the enum kind of make sense. But sure I
> can change it to actual ohms and will error out in the driver if specified
> value is not one of the 7.

Aha, that's how they do it :-)

Please write this in a comment in the driver because it makes
it a lot easier to understand what is going on, and e.g. how to
fuzz an apropriate resistance.

Can you tell me something about how such resistors are produced
in silicon?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 4/6] pinctrl: Add pinctrl binding for Broadcom Capri SoCs

2013-12-16 Thread Linus Walleij
On Sat, Dec 14, 2013 at 2:16 AM, Sherman Yin s...@broadcom.com wrote:

 +- bias-pull-up:Integer. Pull up strength in Ohm:
 +   1: 1.2 kOhm
 +   2: 1.8 kOhm
 +   3: 720 Ohm
 +   4: 2.7 kOhm
 +   5: 831 Ohm
 +   6: 1.08 kOhm
 +   7: 568 Ohm


 Please do not use these custom enumerators 1 thru 7.
 Instead say that the argument is given in ohms, so for
 example:

 bias-pull-up = 12000;

 Then translate this into the proper enumerator in your
 driver instead.

 Ok.  The 3 bits in this enumeration correspond to enabling the 3 pull up Rs
 (1.2k, 1.8k, 2.7k) in parallel, so the enum kind of make sense. But sure I
 can change it to actual ohms and will error out in the driver if specified
 value is not one of the 7.

Aha, that's how they do it :-)

Please write this in a comment in the driver because it makes
it a lot easier to understand what is going on, and e.g. how to
fuzz an apropriate resistance.

Can you tell me something about how such resistors are produced
in silicon?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 4/6] pinctrl: Add pinctrl binding for Broadcom Capri SoCs

2013-12-13 Thread Sherman Yin

On 13-12-12 12:37 PM, Linus Walleij wrote:

On Wed, Dec 11, 2013 at 7:37 PM, Sherman Yin  wrote:


Adds pinctrl driver devicetree binding for Broadcom Capri (BCM281xx) SoCs.

Signed-off-by: Sherman Yin 
Reviewed-by: Christian Daudt 
Reviewed-by: Matt Porter 
---
v3: Use generic pin config properties instead of brcm-specific ones.  Clarified
 pin types (standard, i2c, hdmi).
v2: Use hyphens instead of underscore in DT property names.


Overall this is very nice!


Thanks!


+- bias-pull-up:Integer. Pull up strength in Ohm:
+   1: 1.2 kOhm
+   2: 1.8 kOhm
+   3: 720 Ohm
+   4: 2.7 kOhm
+   5: 831 Ohm
+   6: 1.08 kOhm
+   7: 568 Ohm


Please do not use these custom enumerators 1 thru 7.
Instead say that the argument is given in ohms, so for
example:

bias-pull-up = <12000>;

Then translate this into the proper enumerator in your
driver instead.


Ok.  The 3 bits in this enumeration correspond to enabling the 3 pull up 
Rs (1.2k, 1.8k, 2.7k) in parallel, so the enum kind of make sense. But 
sure I can change it to actual ohms and will error out in the driver if 
specified value is not one of the 7.



No full example provided in the binding! This needs to
be there for understanding.


Ok Will add some examples.

Thanks,
Sherman

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 4/6] pinctrl: Add pinctrl binding for Broadcom Capri SoCs

2013-12-13 Thread Sherman Yin

On 13-12-12 12:37 PM, Linus Walleij wrote:

On Wed, Dec 11, 2013 at 7:37 PM, Sherman Yin s...@broadcom.com wrote:


Adds pinctrl driver devicetree binding for Broadcom Capri (BCM281xx) SoCs.

Signed-off-by: Sherman Yin s...@broadcom.com
Reviewed-by: Christian Daudt b...@fixthebug.org
Reviewed-by: Matt Porter matt.por...@linaro.org
---
v3: Use generic pin config properties instead of brcm-specific ones.  Clarified
 pin types (standard, i2c, hdmi).
v2: Use hyphens instead of underscore in DT property names.


Overall this is very nice!


Thanks!


+- bias-pull-up:Integer. Pull up strength in Ohm:
+   1: 1.2 kOhm
+   2: 1.8 kOhm
+   3: 720 Ohm
+   4: 2.7 kOhm
+   5: 831 Ohm
+   6: 1.08 kOhm
+   7: 568 Ohm


Please do not use these custom enumerators 1 thru 7.
Instead say that the argument is given in ohms, so for
example:

bias-pull-up = 12000;

Then translate this into the proper enumerator in your
driver instead.


Ok.  The 3 bits in this enumeration correspond to enabling the 3 pull up 
Rs (1.2k, 1.8k, 2.7k) in parallel, so the enum kind of make sense. But 
sure I can change it to actual ohms and will error out in the driver if 
specified value is not one of the 7.



No full example provided in the binding! This needs to
be there for understanding.


Ok Will add some examples.

Thanks,
Sherman

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 4/6] pinctrl: Add pinctrl binding for Broadcom Capri SoCs

2013-12-12 Thread Linus Walleij
On Wed, Dec 11, 2013 at 7:37 PM, Sherman Yin  wrote:

> Adds pinctrl driver devicetree binding for Broadcom Capri (BCM281xx) SoCs.
>
> Signed-off-by: Sherman Yin 
> Reviewed-by: Christian Daudt 
> Reviewed-by: Matt Porter 
> ---
> v3: Use generic pin config properties instead of brcm-specific ones.  
> Clarified
> pin types (standard, i2c, hdmi).
> v2: Use hyphens instead of underscore in DT property names.

Overall this is very nice!

> +- bias-pull-up:Integer. Pull up strength in Ohm:
> +   1: 1.2 kOhm
> +   2: 1.8 kOhm
> +   3: 720 Ohm
> +   4: 2.7 kOhm
> +   5: 831 Ohm
> +   6: 1.08 kOhm
> +   7: 568 Ohm

Please do not use these custom enumerators 1 thru 7.
Instead say that the argument is given in ohms, so for
example:

bias-pull-up = <12000>;

Then translate this into the proper enumerator in your
driver instead.

No full example provided in the binding! This needs to
be there for understanding.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 4/6] pinctrl: Add pinctrl binding for Broadcom Capri SoCs

2013-12-12 Thread Linus Walleij
On Wed, Dec 11, 2013 at 7:37 PM, Sherman Yin s...@broadcom.com wrote:

 Adds pinctrl driver devicetree binding for Broadcom Capri (BCM281xx) SoCs.

 Signed-off-by: Sherman Yin s...@broadcom.com
 Reviewed-by: Christian Daudt b...@fixthebug.org
 Reviewed-by: Matt Porter matt.por...@linaro.org
 ---
 v3: Use generic pin config properties instead of brcm-specific ones.  
 Clarified
 pin types (standard, i2c, hdmi).
 v2: Use hyphens instead of underscore in DT property names.

Overall this is very nice!

 +- bias-pull-up:Integer. Pull up strength in Ohm:
 +   1: 1.2 kOhm
 +   2: 1.8 kOhm
 +   3: 720 Ohm
 +   4: 2.7 kOhm
 +   5: 831 Ohm
 +   6: 1.08 kOhm
 +   7: 568 Ohm

Please do not use these custom enumerators 1 thru 7.
Instead say that the argument is given in ohms, so for
example:

bias-pull-up = 12000;

Then translate this into the proper enumerator in your
driver instead.

No full example provided in the binding! This needs to
be there for understanding.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3 4/6] pinctrl: Add pinctrl binding for Broadcom Capri SoCs

2013-12-11 Thread Sherman Yin
Adds pinctrl driver devicetree binding for Broadcom Capri (BCM281xx) SoCs.

Signed-off-by: Sherman Yin 
Reviewed-by: Christian Daudt 
Reviewed-by: Matt Porter 
---
v3: Use generic pin config properties instead of brcm-specific ones.  Clarified
pin types (standard, i2c, hdmi).
v2: Use hyphens instead of underscore in DT property names.
---
 .../bindings/pinctrl/brcm,capri-pinctrl.txt|  429 
 1 file changed, 429 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt

diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt 
b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt
new file mode 100644
index 000..7973cbd
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt
@@ -0,0 +1,429 @@
+Broadcom Capri Pin Controller
+
+This is a pin controller for the Broadcom BCM281xx SoC family, which includes
+BCM11130, BCM11140, BCM11351, BCM28145, and BCM28155 SoCs.
+
+=== Pin Controller Node ===
+
+Required Properties:
+
+- compatible:  Must be "brcm,capri-pinctrl".
+- reg: Base address of the PAD Controller register block and the size
+   of the block.
+
+For example, the following is the bare minimum node:
+
+   pinctrl@35004800 {
+   compatible = "brcm,capri-pinctrl";
+   reg = <0x35004800 0x430>;
+   };
+
+As a pin controller device, in addition to the required properties, this node
+should also contain the pin configuration nodes that client devices reference,
+if any.
+
+=== Pin Configuration Node ===
+
+Each pin configuration node is a sub-node of the pin controller node and is a
+container of an arbitrary number of subnodes, called pin group nodes in this
+document.
+
+Please refer to the pinctrl-bindings.txt in this directory for details of the
+common pinctrl bindings used by client devices, including the definition of a
+"pin configuration node".
+
+=== Pin Group Node ===
+
+A pin group node specifies the desired pin mux and/or pin configuration for an
+arbitrary number of pins.  The name of the pin group node is optional and not
+used.
+
+A pin group node only affects the properties specified in the node, and has no
+effect on any properties that are omitted.
+
+The pin group node accepts a subset of the generic pin config properties. For
+details generic pin config properties, please refer to pinctrl-bindings.txt
+and .
+
+Each pin controlled by this pin controller belong to one of three types:
+Standard, I2C, and HDMI.  Each type accepts a different set of pin config
+properties.  A list of pins and their types is provided below.
+
+Required Properties (applicable to all pins):
+
+- pins:Multiple strings.  Specifies the name(s) of one or more 
pins to
+   be configured by this node.
+
+Optional Properties (for standard pins):
+
+- function:String. Specifies the pin mux selection. Values
+   must be one of: "alt1", "alt2", "alt3", "alt4"
+- input-schmitt-enable:No arguments. Enable schmitt-trigger 
mode.
+- input-schmitt-disable:   No arguments. Disable schmitt-trigger mode.
+- bias-pull-up:No arguments. Pull up on pin.
+- bias-pull-down:  No arguments. Pull down on pin.
+- bias-disable:No arguments. Disable pin bias.
+- slew-rate:   Integer. Meaning depends on configured pin mux:
+   *_SCL or *_SDA:
+   0: Standard(100kbps)& Fast(400kbps) mode
+   1: Highspeed (3.4Mbps) mode
+   IC_DM or IC_DP:
+   0: normal slew rate
+   1: fast slew rate
+   Otherwise:
+   0: fast slew rate
+   1: normal slew rate
+- input-enable:No arguements. Enable input (does not 
affect
+   output.)
+- input-disable:   No arguements. Disable input (does not affect
+   output.)
+- drive-strength:  Integer. Drive strength in mA.  Valid values are
+   2, 4, 6, 8, 10, 12, 14, 16 mA.
+
+Optional Properties (for I2C pins):
+
+- function:String. Specifies the pin mux selection. Values
+   must be one of: "alt1", "alt2", "alt3", "alt4"
+- bias-pull-up:Integer. Pull up strength in Ohm:
+   1: 1.2 kOhm
+   2: 1.8 kOhm
+   3: 720 Ohm
+   4: 2.7 kOhm
+   5: 831 Ohm
+   6: 

[PATCH v3 4/6] pinctrl: Add pinctrl binding for Broadcom Capri SoCs

2013-12-11 Thread Sherman Yin
Adds pinctrl driver devicetree binding for Broadcom Capri (BCM281xx) SoCs.

Signed-off-by: Sherman Yin s...@broadcom.com
Reviewed-by: Christian Daudt b...@fixthebug.org
Reviewed-by: Matt Porter matt.por...@linaro.org
---
v3: Use generic pin config properties instead of brcm-specific ones.  Clarified
pin types (standard, i2c, hdmi).
v2: Use hyphens instead of underscore in DT property names.
---
 .../bindings/pinctrl/brcm,capri-pinctrl.txt|  429 
 1 file changed, 429 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt

diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt 
b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt
new file mode 100644
index 000..7973cbd
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt
@@ -0,0 +1,429 @@
+Broadcom Capri Pin Controller
+
+This is a pin controller for the Broadcom BCM281xx SoC family, which includes
+BCM11130, BCM11140, BCM11351, BCM28145, and BCM28155 SoCs.
+
+=== Pin Controller Node ===
+
+Required Properties:
+
+- compatible:  Must be brcm,capri-pinctrl.
+- reg: Base address of the PAD Controller register block and the size
+   of the block.
+
+For example, the following is the bare minimum node:
+
+   pinctrl@35004800 {
+   compatible = brcm,capri-pinctrl;
+   reg = 0x35004800 0x430;
+   };
+
+As a pin controller device, in addition to the required properties, this node
+should also contain the pin configuration nodes that client devices reference,
+if any.
+
+=== Pin Configuration Node ===
+
+Each pin configuration node is a sub-node of the pin controller node and is a
+container of an arbitrary number of subnodes, called pin group nodes in this
+document.
+
+Please refer to the pinctrl-bindings.txt in this directory for details of the
+common pinctrl bindings used by client devices, including the definition of a
+pin configuration node.
+
+=== Pin Group Node ===
+
+A pin group node specifies the desired pin mux and/or pin configuration for an
+arbitrary number of pins.  The name of the pin group node is optional and not
+used.
+
+A pin group node only affects the properties specified in the node, and has no
+effect on any properties that are omitted.
+
+The pin group node accepts a subset of the generic pin config properties. For
+details generic pin config properties, please refer to pinctrl-bindings.txt
+and include/linux/pinctrl/pinconfig-generic.h.
+
+Each pin controlled by this pin controller belong to one of three types:
+Standard, I2C, and HDMI.  Each type accepts a different set of pin config
+properties.  A list of pins and their types is provided below.
+
+Required Properties (applicable to all pins):
+
+- pins:Multiple strings.  Specifies the name(s) of one or more 
pins to
+   be configured by this node.
+
+Optional Properties (for standard pins):
+
+- function:String. Specifies the pin mux selection. Values
+   must be one of: alt1, alt2, alt3, alt4
+- input-schmitt-enable:No arguments. Enable schmitt-trigger 
mode.
+- input-schmitt-disable:   No arguments. Disable schmitt-trigger mode.
+- bias-pull-up:No arguments. Pull up on pin.
+- bias-pull-down:  No arguments. Pull down on pin.
+- bias-disable:No arguments. Disable pin bias.
+- slew-rate:   Integer. Meaning depends on configured pin mux:
+   *_SCL or *_SDA:
+   0: Standard(100kbps) Fast(400kbps) mode
+   1: Highspeed (3.4Mbps) mode
+   IC_DM or IC_DP:
+   0: normal slew rate
+   1: fast slew rate
+   Otherwise:
+   0: fast slew rate
+   1: normal slew rate
+- input-enable:No arguements. Enable input (does not 
affect
+   output.)
+- input-disable:   No arguements. Disable input (does not affect
+   output.)
+- drive-strength:  Integer. Drive strength in mA.  Valid values are
+   2, 4, 6, 8, 10, 12, 14, 16 mA.
+
+Optional Properties (for I2C pins):
+
+- function:String. Specifies the pin mux selection. Values
+   must be one of: alt1, alt2, alt3, alt4
+- bias-pull-up:Integer. Pull up strength in Ohm:
+   1: 1.2 kOhm
+   2: 1.8 kOhm
+   3: 720 Ohm
+   4: 2.7 kOhm
+