From: Kishon Vijay Abraham I <kishon@ti.com>
To: <rob.herring@calxeda.com>, <rob@landley.net>, <balbi@ti.com>,
<sameo@linux.intel.com>, <gg@slimlogic.co.uk>, <s-guiriec@ti.com>,
<broonie@opensource.wolfsonmicro.com>,
<linux-usb@vger.kernel.org>, <linux-omap@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-doc@vger.kernel.org>,
<devicetree-discuss@lists.ozlabs.org>
Cc: <grant.likely@secretlab.ca>, <gregkh@linuxfoundation.org>,
<kishon@ti.com>
Subject: [PATCH v1 5/8] usb: otg: palmas-usb: use bool to read property instead of u32
Date: Fri, 25 Jan 2013 08:42:28 +0530 [thread overview]
Message-ID: <1359083551-8524-6-git-send-email-kishon@ti.com> (raw)
In-Reply-To: <1359083551-8524-1-git-send-email-kishon@ti.com>
properies like wakeup and no_control_vbus can be represented in boolean,
so read those properties using of_property_read_bool.
Also updated the documentation with device tree binding information for
palmas-usb.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
.../devicetree/bindings/usb/twlxxxx-usb.txt | 24 ++++++++++++++++++++
drivers/usb/otg/palmas-usb.c | 15 +++---------
2 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/Documentation/devicetree/bindings/usb/twlxxxx-usb.txt b/Documentation/devicetree/bindings/usb/twlxxxx-usb.txt
index 36b9aed..fa037ad 100644
--- a/Documentation/devicetree/bindings/usb/twlxxxx-usb.txt
+++ b/Documentation/devicetree/bindings/usb/twlxxxx-usb.txt
@@ -38,3 +38,27 @@ twl4030-usb {
usb3v1-supply = <&vusb3v1>;
usb_mode = <1>;
};
+
+PALMAS USB COMPARATOR
+Required Properties:
+ - compatible : Should be "ti,palmas-usb"
+ - interrupts : Four interrupt numbers to the cpu should be specified. First
+ interrupt number is the otg interrupt number that raises ID interrupts when
+ the controller has to act as host and the second interrupt number is the
+ ID wakeup interrupt number, third interrupt is VBUS interrupt and fourth
+ interrupt is VBUS wakeup interrupt.
+- interrupt-name : the name corresponding to each interrupt populated in
+ interrupts property.
+ - vbus-supply : phandle to the regulator device tree node.
+
+Optional Properties:
+ - ti,wakeup : To enable the wakeup comparator in probe
+ - ti,no_control_vbus: if the platform wishes its own vbus control
+
+palmas-usb {
+ compatible = "ti,palmas-usb";
+ interrupts = <20 0>, <21 0>, <22 0>, <23 0>;
+ interrupt-names = "ID", "ID_WAKEUP", "VBUS", "VBUS_WAKEUP";
+ vbus-supply = <&smps10_reg>;
+ ti,wakeup;
+};
diff --git a/drivers/usb/otg/palmas-usb.c b/drivers/usb/otg/palmas-usb.c
index 1bd8b15..2377836 100644
--- a/drivers/usb/otg/palmas-usb.c
+++ b/drivers/usb/otg/palmas-usb.c
@@ -235,18 +235,9 @@ static int palmas_start_srp(struct phy_companion *comparator)
static void palmas_dt_to_pdata(struct device_node *node,
struct palmas_usb_platform_data *pdata)
{
- int ret;
- u32 prop;
-
- ret = of_property_read_u32(node, "ti,no_control_vbus", &prop);
- if (!ret) {
- pdata->no_control_vbus = prop;
- }
-
- ret = of_property_read_u32(node, "ti,wakeup", &prop);
- if (!ret) {
- pdata->wakeup = prop;
- }
+ pdata->no_control_vbus = of_property_read_bool(node,
+ "ti,no_control_vbus");
+ pdata->wakeup = of_property_read_bool(node, "ti,wakeup");
}
static int palmas_usb_probe(struct platform_device *pdev)
--
1.7.9.5
next prev parent reply other threads:[~2013-01-25 3:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-25 3:12 [PATCH v1 0/8] usb: otg: palmas-usb: fixes/cleanups to get dwc3 working Kishon Vijay Abraham I
2013-01-25 3:12 ` [PATCH v1 1/8] usb: otg: palmas-usb: make palmas-usb as a comparator driver Kishon Vijay Abraham I
2013-01-25 7:43 ` Felipe Balbi
2013-01-25 8:44 ` kishon
2013-01-25 8:59 ` Felipe Balbi
2013-01-25 3:12 ` [PATCH v1 2/8] usb: otg: palmas-usb: use devres API to allocate resources Kishon Vijay Abraham I
2013-01-25 3:12 ` [PATCH v1 3/8] usb: otg: palmas-usb: remove compiler warning Kishon Vijay Abraham I
2013-01-25 3:12 ` [PATCH v1 4/8] usb: otg: palmas-usb: use mailbox API to send VBUS or ID events Kishon Vijay Abraham I
2013-01-25 3:12 ` Kishon Vijay Abraham I [this message]
2013-01-25 3:12 ` [PATCH v1 6/8] usb: otg: palmas-usb: call regulator enable/disable only on valid regulator Kishon Vijay Abraham I
2013-01-25 3:12 ` [PATCH v1 7/8] usb: otg: palmas-usb: pass the correct dev ptr in regulator get Kishon Vijay Abraham I
2013-01-25 3:12 ` [PATCH v1 8/8] usb: otg: palmas-usb: fix cold plug issue Kishon Vijay Abraham I
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=1359083551-8524-6-git-send-email-kishon@ti.com \
--to=kishon@ti.com \
--cc=balbi@ti.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=gg@slimlogic.co.uk \
--cc=grant.likely@secretlab.ca \
--cc=gregkh@linuxfoundation.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=s-guiriec@ti.com \
--cc=sameo@linux.intel.com \
/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
all inboxes | Powered by JetHome®