* [PATCH v1 1/8] usb: otg: palmas-usb: make palmas-usb as a comparator driver
[not found] ` <1359083551-8524-1-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
@ 2013-01-25 3:12 ` Kishon Vijay Abraham I
2013-01-25 7:43 ` 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
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Kishon Vijay Abraham I @ 2013-01-25 3:12 UTC (permalink / raw)
To: rob.herring-bsGFqQB8/DxBDgjK7y7TUQ, rob-VoJi6FS/r0vR7s880joybQ,
balbi-l0cyMroinI0, sameo-VuQAYsv1563Yd54FQh9/CA,
gg-kDsPt+C1G03kYMGBc/C6ZA, s-guiriec-l0cyMroinI0,
broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-doc-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
Cc: grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, kishon-l0cyMroinI0
palmas-usb is made as a comparator driver to omap usb2 phy, so that
omap usb can make use of palmas for srp and also to set vbus.
Signed-off-by: Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>
---
drivers/usb/otg/palmas-usb.c | 20 ++++++++++++++++++--
include/linux/mfd/palmas.h | 3 +++
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/otg/palmas-usb.c b/drivers/usb/otg/palmas-usb.c
index 8389ad6..76240ef 100644
--- a/drivers/usb/otg/palmas-usb.c
+++ b/drivers/usb/otg/palmas-usb.c
@@ -31,6 +31,8 @@
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/usb/otg.h>
+#include <linux/usb/phy_companion.h>
+#include <linux/usb/omap_usb.h>
#include <linux/regulator/consumer.h>
#include <linux/err.h>
#include <linux/notifier.h>
@@ -208,16 +210,20 @@ static void palmas_set_vbus_work(struct work_struct *data)
regulator_disable(palmas_usb->vbus_reg);
}
-static int palmas_set_vbus(struct palmas_usb *palmas_usb, bool enabled)
+static int palmas_set_vbus(struct phy_companion *comparator, bool enabled)
{
+ struct palmas_usb *palmas_usb = comparator_to_palmas(comparator);
+
palmas_usb->vbus_enable = enabled;
schedule_work(&palmas_usb->set_vbus_work);
return 0;
}
-static int palmas_start_srp(struct palmas_usb *palmas_usb)
+static int palmas_start_srp(struct phy_companion *comparator)
{
+ struct palmas_usb *palmas_usb = comparator_to_palmas(comparator);
+
palmas_usb_write(palmas_usb->palmas, PALMAS_USB_VBUS_CTRL_SET,
PALMAS_USB_VBUS_CTRL_SET_VBUS_DISCHRG |
PALMAS_USB_VBUS_CTRL_SET_VBUS_IADP_SINK);
@@ -253,6 +259,7 @@ static void palmas_dt_to_pdata(struct device_node *node,
static int palmas_usb_probe(struct platform_device *pdev)
{
+ u32 ret;
struct palmas *palmas = dev_get_drvdata(pdev->dev.parent);
struct palmas_usb_platform_data *pdata = pdev->dev.platform_data;
struct device_node *node = pdev->dev.of_node;
@@ -289,6 +296,15 @@ static int palmas_usb_probe(struct platform_device *pdev)
palmas_usb->irq4 = regmap_irq_get_virq(palmas->irq_data,
PALMAS_VBUS_IRQ);
+ palmas_usb->comparator.set_vbus = palmas_set_vbus;
+ palmas_usb->comparator.start_srp = palmas_start_srp;
+
+ ret = omap_usb2_set_comparator(&palmas_usb->comparator);
+ if (ret == -ENODEV) {
+ dev_info(&pdev->dev, "phy not ready, deferring probe");
+ return -EPROBE_DEFER;
+ }
+
palmas_usb_wakeup(palmas, pdata->wakeup);
/* init spinlock for workqueue */
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index 82932db..a557db6 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -19,6 +19,7 @@
#include <linux/leds.h>
#include <linux/regmap.h>
#include <linux/regulator/driver.h>
+#include <linux/usb/phy_companion.h>
#define PALMAS_NUM_CLIENTS 3
@@ -343,6 +344,8 @@ struct palmas_usb {
struct palmas *palmas;
struct device *dev;
+ struct phy_companion comparator;
+
/* for vbus reporting with irqs disabled */
spinlock_t lock;
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v1 1/8] usb: otg: palmas-usb: make palmas-usb as a comparator driver
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
[not found] ` <20130125074339.GD15886-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Felipe Balbi @ 2013-01-25 7:43 UTC (permalink / raw)
To: Kishon Vijay Abraham I
Cc: rob.herring, rob, balbi, sameo, gg, s-guiriec, broonie, linux-usb,
linux-omap, linux-kernel, linux-doc, devicetree-discuss,
grant.likely, gregkh
[-- Attachment #1: Type: text/plain, Size: 338 bytes --]
Hi,
On Fri, Jan 25, 2013 at 08:42:24AM +0530, Kishon Vijay Abraham I wrote:
> palmas-usb is made as a comparator driver to omap usb2 phy, so that
> omap usb can make use of palmas for srp and also to set vbus.
>
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
doesn't apply. palmas-usb isn't in mainline
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v1 2/8] usb: otg: palmas-usb: use devres API to allocate resources
[not found] ` <1359083551-8524-1-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
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 3:12 ` 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 ` [PATCH v1 5/8] usb: otg: palmas-usb: use bool to read property instead of u32 Kishon Vijay Abraham I
3 siblings, 0 replies; 12+ messages in thread
From: Kishon Vijay Abraham I @ 2013-01-25 3:12 UTC (permalink / raw)
To: rob.herring-bsGFqQB8/DxBDgjK7y7TUQ, rob-VoJi6FS/r0vR7s880joybQ,
balbi-l0cyMroinI0, sameo-VuQAYsv1563Yd54FQh9/CA,
gg-kDsPt+C1G03kYMGBc/C6ZA, s-guiriec-l0cyMroinI0,
broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-doc-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, kishon-l0cyMroinI0
used devres API while allocating resources so that these resources are
released automatically on driver detach.
Signed-off-by: Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>
---
drivers/usb/otg/palmas-usb.c | 47 ++++++++++++++----------------------------
1 file changed, 15 insertions(+), 32 deletions(-)
diff --git a/drivers/usb/otg/palmas-usb.c b/drivers/usb/otg/palmas-usb.c
index 76240ef..f063350 100644
--- a/drivers/usb/otg/palmas-usb.c
+++ b/drivers/usb/otg/palmas-usb.c
@@ -278,7 +278,7 @@ static int palmas_usb_probe(struct platform_device *pdev)
if (!pdata)
return -EINVAL;
- palmas_usb = kzalloc(sizeof(*palmas_usb), GFP_KERNEL);
+ palmas_usb = devm_kzalloc(&pdev->dev, sizeof(*palmas_usb), GFP_KERNEL);
if (!palmas_usb)
return -ENOMEM;
@@ -311,11 +311,10 @@ static int palmas_usb_probe(struct platform_device *pdev)
spin_lock_init(&palmas_usb->lock);
if (!pdata->no_control_vbus) {
- palmas_usb->vbus_reg = regulator_get(palmas->dev,
+ palmas_usb->vbus_reg = devm_regulator_get(palmas->dev,
"vbus");
if (IS_ERR(palmas_usb->vbus_reg)) {
dev_err(&pdev->dev, "vbus init failed\n");
- kfree(palmas_usb);
return PTR_ERR(palmas_usb->vbus_reg);
}
}
@@ -330,44 +329,44 @@ static int palmas_usb_probe(struct platform_device *pdev)
INIT_WORK(&palmas_usb->set_vbus_work, palmas_set_vbus_work);
- status = request_threaded_irq(palmas_usb->irq1, NULL,
- palmas_id_irq,
+ status = devm_request_threaded_irq(palmas_usb->dev, palmas_usb->irq1,
+ NULL, palmas_id_irq,
IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
"palmas_usb", palmas_usb);
if (status < 0) {
dev_err(&pdev->dev, "can't get IRQ %d, err %d\n",
palmas_usb->irq1, status);
- goto fail_irq1;
+ goto fail_irq;
}
- status = request_threaded_irq(palmas_usb->irq2, NULL,
- palmas_id_wakeup_irq,
+ status = devm_request_threaded_irq(palmas_usb->dev, palmas_usb->irq2,
+ NULL, palmas_id_wakeup_irq,
IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
"palmas_usb", palmas_usb);
if (status < 0) {
dev_err(&pdev->dev, "can't get IRQ %d, err %d\n",
palmas_usb->irq2, status);
- goto fail_irq2;
+ goto fail_irq;
}
- status = request_threaded_irq(palmas_usb->irq3, NULL,
- palmas_vbus_irq,
+ status = devm_request_threaded_irq(palmas_usb->dev, palmas_usb->irq3,
+ NULL, palmas_vbus_irq,
IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
"palmas_usb", palmas_usb);
if (status < 0) {
dev_err(&pdev->dev, "can't get IRQ %d, err %d\n",
palmas_usb->irq3, status);
- goto fail_irq3;
+ goto fail_irq;
}
- status = request_threaded_irq(palmas_usb->irq4, NULL,
- palmas_vbus_wakeup_irq,
+ status = devm_request_threaded_irq(palmas_usb->dev, palmas_usb->irq4,
+ NULL, palmas_vbus_wakeup_irq,
IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
"palmas_usb", palmas_usb);
if (status < 0) {
dev_err(&pdev->dev, "can't get IRQ %d, err %d\n",
palmas_usb->irq4, status);
- goto fail_irq4;
+ goto fail_irq;
}
dev_info(&pdev->dev, "Initialized Palmas USB module\n");
@@ -376,19 +375,9 @@ static int palmas_usb_probe(struct platform_device *pdev)
return 0;
-fail_irq4:
- free_irq(palmas_usb->irq3, palmas_usb);
-
-fail_irq3:
- free_irq(palmas_usb->irq2, palmas_usb);
-
-fail_irq2:
- free_irq(palmas_usb->irq1, palmas_usb);
-
-fail_irq1:
+fail_irq:
cancel_work_sync(&palmas_usb->set_vbus_work);
device_remove_file(palmas_usb->dev, &dev_attr_vbus);
- kfree(palmas_usb);
return status;
}
@@ -397,14 +386,8 @@ static int palmas_usb_remove(struct platform_device *pdev)
{
struct palmas_usb *palmas_usb = platform_get_drvdata(pdev);
- free_irq(palmas_usb->irq1, palmas_usb);
- free_irq(palmas_usb->irq2, palmas_usb);
- free_irq(palmas_usb->irq3, palmas_usb);
- free_irq(palmas_usb->irq4, palmas_usb);
- regulator_put(palmas_usb->vbus_reg);
device_remove_file(palmas_usb->dev, &dev_attr_vbus);
cancel_work_sync(&palmas_usb->set_vbus_work);
- kfree(palmas_usb);
return 0;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v1 4/8] usb: otg: palmas-usb: use mailbox API to send VBUS or ID events
[not found] ` <1359083551-8524-1-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
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 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 ` Kishon Vijay Abraham I
2013-01-25 3:12 ` [PATCH v1 5/8] usb: otg: palmas-usb: use bool to read property instead of u32 Kishon Vijay Abraham I
3 siblings, 0 replies; 12+ messages in thread
From: Kishon Vijay Abraham I @ 2013-01-25 3:12 UTC (permalink / raw)
To: rob.herring-bsGFqQB8/DxBDgjK7y7TUQ, rob-VoJi6FS/r0vR7s880joybQ,
balbi-l0cyMroinI0, sameo-VuQAYsv1563Yd54FQh9/CA,
gg-kDsPt+C1G03kYMGBc/C6ZA, s-guiriec-l0cyMroinI0,
broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-doc-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, kishon-l0cyMroinI0
Whenever palmas detects a VBUS or ID event, the mailbox API in dwc3 glue
is called. The mailbox API takes care of notifying it to the core.
Signed-off-by: Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>
Signed-off-by: Moiz Sonasath <m-sonasath-l0cyMroinI0@public.gmane.org>
---
drivers/usb/otg/palmas-usb.c | 32 +++++++++++++++++++++-----------
include/linux/mfd/palmas.h | 4 +++-
2 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/drivers/usb/otg/palmas-usb.c b/drivers/usb/otg/palmas-usb.c
index be9d81c..1bd8b15 100644
--- a/drivers/usb/otg/palmas-usb.c
+++ b/drivers/usb/otg/palmas-usb.c
@@ -33,6 +33,7 @@
#include <linux/usb/otg.h>
#include <linux/usb/phy_companion.h>
#include <linux/usb/omap_usb.h>
+#include <linux/usb/dwc3-omap.h>
#include <linux/regulator/consumer.h>
#include <linux/err.h>
#include <linux/notifier.h>
@@ -85,13 +86,14 @@ static ssize_t palmas_usb_vbus_show(struct device *dev,
spin_lock_irqsave(&palmas_usb->lock, flags);
switch (palmas_usb->linkstat) {
- case USB_EVENT_VBUS:
+ case OMAP_DWC3_VBUS_VALID:
ret = snprintf(buf, PAGE_SIZE, "vbus\n");
break;
- case USB_EVENT_ID:
+ case OMAP_DWC3_ID_GROUND:
ret = snprintf(buf, PAGE_SIZE, "id\n");
break;
- case USB_EVENT_NONE:
+ case OMAP_DWC3_ID_FLOAT:
+ case OMAP_DWC3_VBUS_OFF:
ret = snprintf(buf, PAGE_SIZE, "none\n");
break;
default:
@@ -106,7 +108,7 @@ static DEVICE_ATTR(vbus, 0444, palmas_usb_vbus_show, NULL);
static irqreturn_t palmas_vbus_wakeup_irq(int irq, void *_palmas_usb)
{
struct palmas_usb *palmas_usb = _palmas_usb;
- int status = 0;
+ enum omap_dwc3_vbus_id_status status = OMAP_DWC3_UNKNOWN;
int slave;
unsigned int vbus_line_state, addr;
@@ -118,20 +120,24 @@ static irqreturn_t palmas_vbus_wakeup_irq(int irq, void *_palmas_usb)
if (vbus_line_state & PALMAS_INT3_LINE_STATE_VBUS) {
regulator_enable(palmas_usb->vbus_reg);
- status = USB_EVENT_VBUS;
+ status = OMAP_DWC3_VBUS_VALID;
} else {
- status = USB_EVENT_NONE;
+ status = OMAP_DWC3_VBUS_OFF;
regulator_disable(palmas_usb->vbus_reg);
}
palmas_usb->linkstat = status;
+ if (status != OMAP_DWC3_UNKNOWN) {
+ dwc3_omap_mailbox(status);
+ return IRQ_HANDLED;
+ }
- return IRQ_HANDLED;
+ return IRQ_NONE;
}
static irqreturn_t palmas_id_wakeup_irq(int irq, void *_palmas_usb)
{
- int status = 0;
+ enum omap_dwc3_vbus_id_status status = OMAP_DWC3_UNKNOWN;
unsigned int set;
struct palmas_usb *palmas_usb = _palmas_usb;
@@ -145,7 +151,7 @@ static irqreturn_t palmas_id_wakeup_irq(int irq, void *_palmas_usb)
palmas_usb_write(palmas_usb->palmas,
PALMAS_USB_ID_INT_EN_HI_CLR,
PALMAS_USB_ID_INT_EN_HI_CLR_ID_GND);
- status = USB_EVENT_ID;
+ status = OMAP_DWC3_ID_GROUND;
} else if (set & PALMAS_USB_ID_INT_SRC_ID_FLOAT) {
palmas_usb_write(palmas_usb->palmas,
PALMAS_USB_ID_INT_EN_HI_SET,
@@ -154,12 +160,16 @@ static irqreturn_t palmas_id_wakeup_irq(int irq, void *_palmas_usb)
PALMAS_USB_ID_INT_EN_HI_CLR,
PALMAS_USB_ID_INT_EN_HI_CLR_ID_FLOAT);
regulator_disable(palmas_usb->vbus_reg);
- status = USB_EVENT_NONE;
+ status = OMAP_DWC3_ID_FLOAT;
}
palmas_usb->linkstat = status;
+ if (status != OMAP_DWC3_UNKNOWN) {
+ dwc3_omap_mailbox(status);
+ return IRQ_HANDLED;
+ }
- return IRQ_HANDLED;
+ return IRQ_NONE;
}
static int palmas_enable_irq(struct palmas_usb *palmas_usb)
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index a557db6..d6c3bec 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -20,6 +20,8 @@
#include <linux/regmap.h>
#include <linux/regulator/driver.h>
#include <linux/usb/phy_companion.h>
+#include <linux/usb/dwc3-omap.h>
+#include <linux/platform_data/dwc3-omap.h>
#define PALMAS_NUM_CLIENTS 3
@@ -361,7 +363,7 @@ struct palmas_usb {
int vbus_enable;
- u8 linkstat;
+ enum omap_dwc3_vbus_id_status linkstat;
};
#define comparator_to_palmas(x) container_of((x), struct palmas_usb, comparator)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v1 5/8] usb: otg: palmas-usb: use bool to read property instead of u32
[not found] ` <1359083551-8524-1-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
` (2 preceding siblings ...)
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
3 siblings, 0 replies; 12+ messages in thread
From: Kishon Vijay Abraham I @ 2013-01-25 3:12 UTC (permalink / raw)
To: rob.herring-bsGFqQB8/DxBDgjK7y7TUQ, rob-VoJi6FS/r0vR7s880joybQ,
balbi-l0cyMroinI0, sameo-VuQAYsv1563Yd54FQh9/CA,
gg-kDsPt+C1G03kYMGBc/C6ZA, s-guiriec-l0cyMroinI0,
broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-doc-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, kishon-l0cyMroinI0
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-l0cyMroinI0@public.gmane.org>
---
.../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
^ permalink raw reply related [flat|nested] 12+ messages in thread