linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Enric Balletbo i Serra <enric.balletbo@collabora.com>
To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Sebastian Reichel <sre@kernel.org>
Cc: Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Sjoerd Simons <sjoerd.simons@collabora.co.uk>,
	Martyn Welch <martyn.welch@collabora.com>
Subject: [RESEND PATCH v4 1/2] devicetree: Add UCS1002 USB Port Power Controller binding
Date: Fri, 15 Apr 2016 09:26:20 +0200	[thread overview]
Message-ID: <1460705181-10493-2-git-send-email-enric.balletbo@collabora.com> (raw)
In-Reply-To: <1460705181-10493-1-git-send-email-enric.balletbo@collabora.com>

The UCS1002-2 provides a USB port power switch for precise control of up
to 2.5 amperes continuous current.

You can add support to your board with current binding.

Example:

    ucs1002: ucs1002@57 {
             compatible = "microchip,ucs1002";
             reg = <0x57>;
    };

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Acked-by: Rob Herring <robh@kernel.org>
---
Changes since v3:
- Added Acked-by: Rob Herring <robh@kernel.org>
Changes since v2:
 - Rename microchip,current-limit to microchip,limit-microamps (Rob Herring)
Changes since v1:
 - Fix units, are microamps (Rob Herring)
 - Remove microchip,pin-ignore as is implied by absence of gpio properties (Rob
   Herring)
 - Group control gpios instead of use separate gpios. All control gpios must be
   set together (Enric Balletbo)

 .../devicetree/bindings/power/ucs1002.txt          | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/ucs1002.txt

diff --git a/Documentation/devicetree/bindings/power/ucs1002.txt b/Documentation/devicetree/bindings/power/ucs1002.txt
new file mode 100644
index 0000000..31f6e49
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/ucs1002.txt
@@ -0,0 +1,41 @@
+UCS1002-2 Programmable USB Port Power Controller with Charger Emulation bindings
+
+Required properties:
+- compatible: "microchip,ucs1002"
+- reg: integer, the I2C address of the device.
+
+Optional properties:
+- interrupt-parent: the phandle of the interrupt controller that services
+    interrupts for this device.
+- interrupts: interrupt specifiers for two interrupt sources.
+    - First interrupt specifier is for A_DET interrupt.
+    - Second interrupt specifier is for ALERT interrupt.
+- microchip,limit-microamps: integer, maximum current in microamps. Note that the
+    default value is based on the resistor on the COMM_SEL/ILIM pin and this
+    value cannot be changed to be higher than hardware set value. Accepted
+    values are: 500000, 900000, 1000000, 1200000, 1500000, 1800000, 2000000 and
+    2500000 (microamps).
+- control-gpios = list of gpios used as pin states when determining the active mode
+    selection and power state. Must provide EM_EN, M1, M2 and PWR_EN gpio mapping.
+    If this property is not set it uses I2C for configuration.
+
+Example (polling):
+
+	ucs1002: ucs1002@57 {
+		compatible = "microchip,ucs1002";
+		reg = <0x57>;
+		microchip,limit-microamps = <2000000>;
+	};
+
+Example (interrupts + control gpios):
+
+	ucs1002: ucs1002@57 {
+		compatible = "microchip,ucs1002";
+		reg = <0x57>;
+		interrupt-parent = <&gpio0>;
+		interrupts = <30 0>, <31 0>;
+		control-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>,	/* EM_EN */
+				<&gpio0 3 GPIO_ACTIVE_HIGH>,	/* M1 */
+				<&gpio1 17 GPIO_ACTIVE_HIGH>,	/* M2 */
+				<&gpio1 19 0>;			/* PWR_EN */
+	};
-- 
2.1.0

  reply	other threads:[~2016-04-15  7:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15  7:26 [RESEND PATCH v4 0/2] Add UCS1002 USB Port Power Controller Enric Balletbo i Serra
2016-04-15  7:26 ` Enric Balletbo i Serra [this message]
2016-04-15  7:26 ` [RESEND PATCH v4 2/2] power: ucs1002: Add support for Programmable " Enric Balletbo i Serra
2016-04-15 19:25   ` Sebastian Reichel
2016-04-19  9:09     ` Enric Balletbo i Serra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460705181-10493-2-git-send-email-enric.balletbo@collabora.com \
    --to=enric.balletbo@collabora.com \
    --cc=dbaryshkov@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=martyn.welch@collabora.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sjoerd.simons@collabora.co.uk \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).