[V6 PATCH 16/16] arm: mmp: add extern chip support for ttc_dkb

2013-02-05 Thread Chao Xie
Change the board support for usb as extern chip is supported
in marvell usb PHY driver.

Signed-off-by: Chao Xie 
---
 arch/arm/mach-mmp/ttc_dkb.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c
index 0962791..eb34608 100644
--- a/arch/arm/mach-mmp/ttc_dkb.c
+++ b/arch/arm/mach-mmp/ttc_dkb.c
@@ -172,10 +172,8 @@ static struct mv_usb_phy_platform_data ttc_usb_phy_pdata = 
{
 static struct mv_usb_platform_data ttc_usb_pdata = {
.clknum = 1,
.clkname= pxa910_usb_clock_name,
-   .vbus   = NULL,
.mode   = MV_USB_MODE_OTG,
.otg_force_a_bus_req = 1,
-   .set_vbus   = NULL,
 };
 #endif
 #endif
-- 
1.7.4.1

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


[V6 PATCH 13/16] usb: ehci: ehci-mv: add extern chip support

2013-02-05 Thread Chao Xie
It does the similar things as what we do for udc driver.

Signed-off-by: Chao Xie 
Acked-by: Alan Stern 
---
 drivers/usb/host/ehci-mv.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index be504fd..171e145 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -256,8 +256,8 @@ static int mv_ehci_probe(struct platform_device *pdev)
goto err_disable_clk;
 #endif
} else {
-   if (pdata->set_vbus)
-   pdata->set_vbus(1);
+   if (mv_usb2_has_extern_call(ehci_mv->mvphy, vbus, set_vbus))
+   mv_usb2_extern_call(ehci_mv->mvphy, vbus, set_vbus, 1);
 
retval = usb_add_hcd(hcd, hcd->irq, IRQF_SHARED);
if (retval) {
@@ -275,8 +275,8 @@ static int mv_ehci_probe(struct platform_device *pdev)
return 0;
 
 err_set_vbus:
-   if (pdata->set_vbus)
-   pdata->set_vbus(0);
+   if (mv_usb2_has_extern_call(ehci_mv->mvphy, vbus, set_vbus))
+   mv_usb2_extern_call(ehci_mv->mvphy, vbus, set_vbus, 0);
 err_disable_clk:
mv_ehci_disable(ehci_mv);
 err_clear_drvdata:
@@ -299,8 +299,8 @@ static int mv_ehci_remove(struct platform_device *pdev)
otg_set_host(ehci_mv->otg->otg, NULL);
 
if (ehci_mv->mode == MV_USB_MODE_HOST) {
-   if (ehci_mv->pdata->set_vbus)
-   ehci_mv->pdata->set_vbus(0);
+   if (mv_usb2_has_extern_call(ehci_mv->mvphy, vbus, set_vbus))
+   mv_usb2_extern_call(ehci_mv->mvphy, vbus, set_vbus, 1);
 
mv_ehci_disable(ehci_mv);
}
-- 
1.7.4.1

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


[V6 PATCH 15/16] arm: mmp: add extern chip support for brownstone

2013-02-05 Thread Chao Xie
Change the board support for usb as extern chip is supported
in marvell usb PHY driver

Signed-off-by: Chao Xie 
---
 arch/arm/mach-mmp/brownstone.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-mmp/brownstone.c b/arch/arm/mach-mmp/brownstone.c
index 90c0340..3dcf38f 100644
--- a/arch/arm/mach-mmp/brownstone.c
+++ b/arch/arm/mach-mmp/brownstone.c
@@ -212,10 +212,8 @@ static struct mv_usb_phy_platform_data 
brownstone_usb_phy_pdata = {
 static struct mv_usb_platform_data brownstone_usb_pdata = {
.clknum = 1,
.clkname= mmp2_usb_clock_name,
-   .vbus   = NULL,
.mode   = MV_USB_MODE_OTG,
.otg_force_a_bus_req = 1,
-   .set_vbus   = NULL,
 };
 #endif
 #endif
-- 
1.7.4.1

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


[V6 PATCH 14/16] usb: otg: mv_otg: add extern chip support

2013-02-05 Thread Chao Xie
It does the similar things as what we do for udc driver.

Signed-off-by: Chao Xie 
---
 drivers/usb/otg/mv_otg.c |   63 -
 drivers/usb/otg/mv_otg.h |3 ++
 2 files changed, 31 insertions(+), 35 deletions(-)

diff --git a/drivers/usb/otg/mv_otg.c b/drivers/usb/otg/mv_otg.c
index 44ddf25..d2e38a6 100644
--- a/drivers/usb/otg/mv_otg.c
+++ b/drivers/usb/otg/mv_otg.c
@@ -59,10 +59,10 @@ static char *state_string[] = {
 static int mv_otg_set_vbus(struct usb_otg *otg, bool on)
 {
struct mv_otg *mvotg = container_of(otg->phy, struct mv_otg, phy);
-   if (mvotg->pdata->set_vbus == NULL)
+   if (!mv_usb2_has_extern_call(mvotg->mvphy, vbus, set_vbus))
return -ENODEV;
 
-   return mvotg->pdata->set_vbus(on);
+   return mv_usb2_extern_call(mvotg->mvphy, vbus, set_vbus, on);
 }
 
 static int mv_otg_set_host(struct usb_otg *otg,
@@ -184,14 +184,14 @@ static void mv_otg_init_irq(struct mv_otg *mvotg)
mvotg->irq_status = OTGSC_INTSTS_A_SESSION_VALID
| OTGSC_INTSTS_A_VBUS_VALID;
 
-   if (mvotg->pdata->vbus == NULL) {
+   if (!(mvotg->extern_attr & MV_USB_HAS_VBUS_DETECTION)) {
mvotg->irq_en |= OTGSC_INTR_B_SESSION_VALID
| OTGSC_INTR_B_SESSION_END;
mvotg->irq_status |= OTGSC_INTSTS_B_SESSION_VALID
| OTGSC_INTSTS_B_SESSION_END;
}
 
-   if (mvotg->pdata->id == NULL) {
+   if (!(mvotg->extern_attr & MV_USB_HAS_IDPIN_DETECTION)) {
mvotg->irq_en |= OTGSC_INTR_USB_ID;
mvotg->irq_status |= OTGSC_INTSTS_USB_ID;
}
@@ -306,11 +306,14 @@ static void mv_otg_update_inputs(struct mv_otg *mvotg)
 {
struct mv_otg_ctrl *otg_ctrl = &mvotg->otg_ctrl;
u32 otgsc;
+   unsigned int vbus, idpin;
 
otgsc = readl(&mvotg->op_regs->otgsc);
 
-   if (mvotg->pdata->vbus) {
-   if (mvotg->pdata->vbus->poll() == VBUS_HIGH) {
+   if (mvotg->extern_attr & MV_USB_HAS_VBUS_DETECTION) {
+   if (mv_usb2_extern_call(mvotg->mvphy, vbus, get_vbus, &vbus))
+   return;
+   if (vbus == VBUS_HIGH) {
otg_ctrl->b_sess_vld = 1;
otg_ctrl->b_sess_end = 0;
} else {
@@ -322,8 +325,11 @@ static void mv_otg_update_inputs(struct mv_otg *mvotg)
otg_ctrl->b_sess_end = !!(otgsc & OTGSC_STS_B_SESSION_END);
}
 
-   if (mvotg->pdata->id)
-   otg_ctrl->id = !!mvotg->pdata->id->poll();
+   if (mvotg->extern_attr & MV_USB_HAS_IDPIN_DETECTION) {
+   if (mv_usb2_extern_call(mvotg->mvphy, idpin, get_idpin, &idpin))
+   return;
+   otg_ctrl->id = !!idpin;
+   }
else
otg_ctrl->id = !!(otgsc & OTGSC_STS_USB_ID);
 
@@ -505,7 +511,7 @@ static irqreturn_t mv_otg_irq(int irq, void *dev)
 * if we have vbus, then the vbus detection for B-device
 * will be done by mv_otg_inputs_irq().
 */
-   if (mvotg->pdata->vbus)
+   if (mvotg->extern_attr & MV_USB_HAS_VBUS_DETECTION)
if ((otgsc & OTGSC_STS_USB_ID) &&
!(otgsc & OTGSC_INTSTS_USB_ID))
return IRQ_NONE;
@@ -518,9 +524,10 @@ static irqreturn_t mv_otg_irq(int irq, void *dev)
return IRQ_HANDLED;
 }
 
-static irqreturn_t mv_otg_inputs_irq(int irq, void *dev)
+static int mv_otg_notifier_call(struct notifier_block *nb,
+   unsigned long val, void *v)
 {
-   struct mv_otg *mvotg = dev;
+   struct mv_otg *mvotg = container_of(nb, struct mv_otg, notifier);
 
/* The clock may disabled at this time */
if (!mvotg->active) {
@@ -530,7 +537,7 @@ static irqreturn_t mv_otg_inputs_irq(int irq, void *dev)
 
mv_otg_run_state_machine(mvotg, 0);
 
-   return IRQ_HANDLED;
+   return 0;
 }
 
 static ssize_t
@@ -666,6 +673,10 @@ int mv_otg_remove(struct platform_device *pdev)
 
sysfs_remove_group(&mvotg->pdev->dev.kobj, &inputs_attr_group);
 
+   if ((mvotg->extern_attr & MV_USB_HAS_VBUS_DETECTION) ||
+   (mvotg->extern_attr & MV_USB_HAS_IDPIN_DETECTION))
+   mv_usb2_unregister_notifier(mvotg->mvphy, &mvotg->notifier);
+
if (mvotg->qwork) {
flush_workqueue(mvotg->qwork);
destroy_workqueue(mvotg->qwork);
@@ -707,6 +718,7 @@ static int mv_otg_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, mvotg);
 
mvotg->pdev = pdev;
+   mvotg->extern_attr = pdata->extern_attr;
mvotg->pdata = pdata;
 
mvotg->clknum = pdata->clknum;
@@ -773,29 +785,10 @@ static int mv_otg_probe(struct platform_device *pdev)
(struct mv_otg_regs __iomem *) ((unsigned long) mvotg->cap_regs
+ (readl(mvotg->cap_regs) & CAPLENGTH_MASK));
 
-   if (pdata->id) {
-   

[V6 PATCH 11/16] usb: phy: mv_usb2_phy: add externel chip support

2013-02-05 Thread Chao Xie
For the vbus and idpin detection. It may be completed by some
external chip, for example the pmic chip 88pm860x in driver/mfd
can do it.
Although the usb controller can detect the vbus and id pin, but
it need clock on and PHY enabled to detect the
vbus/idpin. It will increase the power.
Using the external chip to detect vbus/idpin can save the power.

Signed-off-by: Chao Xie 
---
 drivers/usb/phy/mv_usb2_phy.c|   49 +++
 include/linux/platform_data/mv_usb.h |   15 ++
 include/linux/usb/mv_usb2.h  |   85 ++
 3 files changed, 139 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/phy/mv_usb2_phy.c b/drivers/usb/phy/mv_usb2_phy.c
index c2bccae..78ddeff 100644
--- a/drivers/usb/phy/mv_usb2_phy.c
+++ b/drivers/usb/phy/mv_usb2_phy.c
@@ -136,6 +136,53 @@ struct mv_usb2_phy *mv_usb2_get_phy(void)
 }
 EXPORT_SYMBOL(mv_usb2_get_phy);
 
+int mv_usb2_register_notifier(struct mv_usb2_phy *phy,
+   struct notifier_block *nb)
+{
+   int ret;
+
+   if (!phy)
+   return -ENODEV;
+
+   ret = atomic_notifier_chain_register(&phy->extern_chip.head, nb);
+   if (ret)
+   return ret;
+
+   return 0;
+}
+EXPORT_SYMBOL(mv_usb2_register_notifier);
+
+int mv_usb2_unregister_notifier(struct mv_usb2_phy *phy,
+   struct notifier_block *nb)
+{
+   int ret;
+
+   if (!phy)
+   return -ENODEV;
+
+   ret = atomic_notifier_chain_unregister(&phy->extern_chip.head, nb);
+   if (ret)
+   return ret;
+
+   return 0;
+}
+EXPORT_SYMBOL(mv_usb2_unregister_notifier);
+
+int mv_usb2_notify(struct mv_usb2_phy *phy, unsigned long val, void *v)
+{
+   int ret;
+
+   if (!phy)
+   return -ENODEV;
+
+   ret = atomic_notifier_call_chain(&phy->extern_chip.head, val, v);
+   if (ret)
+   return ret;
+
+   return 0;
+}
+EXPORT_SYMBOL(mv_usb2_notify);
+
 static unsigned int u2o_get(void __iomem *base, unsigned int offset)
 {
return readl(base + offset);
@@ -414,6 +461,8 @@ static int usb_phy_probe(struct platform_device *pdev)
mv_phy->init = usb_phy_init;
mv_phy->shutdown = usb_phy_shutdown;
 
+   ATOMIC_INIT_NOTIFIER_HEAD(&mv_phy->extern_chip.head);
+
platform_set_drvdata(pdev, mv_phy);
 
the_phy = mv_phy;
diff --git a/include/linux/platform_data/mv_usb.h 
b/include/linux/platform_data/mv_usb.h
index fd3d1b4..dc25d60 100644
--- a/include/linux/platform_data/mv_usb.h
+++ b/include/linux/platform_data/mv_usb.h
@@ -28,16 +28,13 @@ enum {
VBUS_HIGH   = 1 << 0,
 };
 
-struct mv_usb_addon_irq {
-   unsigned intirq;
-   int (*poll)(void);
-};
-
+#define MV_USB_HAS_VBUS_DETECTION  (1 << 0)
+#define MV_USB_HAS_IDPIN_DETECTION (1 << 1)
 struct mv_usb_platform_data {
unsigned intclknum;
char**clkname;
-   struct mv_usb_addon_irq *id;/* Only valid for OTG. ID pin change*/
-   struct mv_usb_addon_irq *vbus;  /* valid for OTG/UDC. VBUS change*/
+
+   unsigned intextern_attr;
 
/* only valid for HCD. OTG or Host only*/
unsigned intmode;
@@ -45,9 +42,7 @@ struct mv_usb_platform_data {
/* This flag is used for that needs id pin checked by otg */
unsigned intdisable_otg_clock_gating:1;
/* Force a_bus_req to be asserted */
-unsigned intotg_force_a_bus_req:1;
-
-   int (*set_vbus)(unsigned int vbus);
+   unsigned intotg_force_a_bus_req:1;
 };
 
 struct mv_usb_phy_platform_data {
diff --git a/include/linux/usb/mv_usb2.h b/include/linux/usb/mv_usb2.h
index 9744a97..f76fa06 100644
--- a/include/linux/usb/mv_usb2.h
+++ b/include/linux/usb/mv_usb2.h
@@ -17,6 +17,33 @@
 
 #include 
 
+enum {
+   EVENT_VBUS,
+   EVENT_ID,
+};
+
+struct pxa_usb_vbus_ops {
+   int (*get_vbus)(unsigned int *level);
+   int (*set_vbus)(unsigned int level);
+   int (*init)(void);
+};
+
+struct pxa_usb_idpin_ops {
+   int (*get_idpin)(unsigned int *level);
+   int (*init)(void);
+};
+
+struct pxa_usb_extern_ops {
+   struct pxa_usb_vbus_ops vbus;
+   struct pxa_usb_idpin_opsidpin;
+};
+
+struct mv_usb2_extern_chip {
+   unsigned int id;
+   struct pxa_usb_extern_ops ops;
+   struct atomic_notifier_head head;
+};
+
 struct mv_usb2_phy {
struct platform_device  *pdev;
struct mutexphy_lock;
@@ -26,6 +53,8 @@ struct mv_usb2_phy {
struct clk  **clks;
unsigned intclks_num;
 
+   struct mv_usb2_extern_chip extern_chip;
+
int (*init)(struct mv_usb2_phy *mv_phy);
void(*shutdown)(struct mv_usb2_phy *mv_phy);
 };
@@ -34,10 +63,66 @@ struct mv_usb2_phy {
 
 extern struct mv_usb2_phy *mv_usb2_get_phy(void);
 
+#define mv_usb2_has_extern_call(phy, o, f, arg...)( \
+{ \
+   int ret; 

[V6 PATCH 12/16] usb: gadget: mv_udc: add extern chip support

2013-02-05 Thread Chao Xie
Because arch-mmp will make use of irq domain for irq
allocation, the irqs allocated for PMIC is dynamical.
The vbus/idpin irqs from PMIC can not be passed by platform data.
Using the extern chip APIs provides by PHY driver can solve this
problem.
Marvell usb PHY driver provides a middle layer.
The PMIC usb drivers will help to register the callbacks in the
marvell usb PHY driver.
udc/otg/ehci driver will call the callbacks.
Then we do not need pass the information in platform data. It will
remove another block in the way of enabling device tree for usb.

Signed-off-by: Chao Xie 
---
 drivers/usb/gadget/mv_udc.h  |3 ++
 drivers/usb/gadget/mv_udc_core.c |   47 ++---
 2 files changed, 31 insertions(+), 19 deletions(-)

diff --git a/drivers/usb/gadget/mv_udc.h b/drivers/usb/gadget/mv_udc.h
index 4851b2b..50ae7c7 100644
--- a/drivers/usb/gadget/mv_udc.h
+++ b/drivers/usb/gadget/mv_udc.h
@@ -178,6 +178,9 @@ struct mv_udc {
struct platform_device  *dev;
int irq;
 
+   unsigned intextern_attr;
+   struct notifier_block   notifier;
+
struct mv_cap_regs __iomem  *cap_regs;
struct mv_op_regs __iomem   *op_regs;
unsigned intmax_eps;
diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c
index 76fcfc7..2e5907f 100644
--- a/drivers/usb/gadget/mv_udc_core.c
+++ b/drivers/usb/gadget/mv_udc_core.c
@@ -2077,27 +2077,30 @@ static irqreturn_t mv_udc_irq(int irq, void *dev)
return IRQ_HANDLED;
 }
 
-static irqreturn_t mv_udc_vbus_irq(int irq, void *dev)
+static int mv_udc_vbus_notifier_call(struct notifier_block *nb,
+   unsigned long val, void *v)
 {
-   struct mv_udc *udc = (struct mv_udc *)dev;
+   struct mv_udc *udc = container_of(nb, struct mv_udc, notifier);
 
/* polling VBUS and init phy may cause too much time*/
-   if (udc->qwork)
+   if (udc->qwork && val == EVENT_VBUS)
queue_work(udc->qwork, &udc->vbus_work);
 
-   return IRQ_HANDLED;
+   return 0;
 }
 
 static void mv_udc_vbus_work(struct work_struct *work)
 {
struct mv_udc *udc;
-   unsigned int vbus;
+   unsigned int vbus = VBUS_LOW;
 
udc = container_of(work, struct mv_udc, vbus_work);
-   if (!udc->pdata->vbus)
+   if (!(udc->extern_attr & MV_USB_HAS_VBUS_DETECTION))
+   return;
+
+   if (mv_usb2_extern_call(udc->phy, vbus, get_vbus, &vbus))
return;
 
-   vbus = udc->pdata->vbus->poll();
dev_info(&udc->dev->dev, "vbus is %d\n", vbus);
 
if (vbus == VBUS_HIGH)
@@ -2124,6 +2127,9 @@ static int mv_udc_remove(struct platform_device *pdev)
 
usb_del_gadget_udc(&udc->gadget);
 
+   if (udc->extern_attr & MV_USB_HAS_VBUS_DETECTION)
+   mv_usb2_unregister_notifier(udc->phy, &udc->notifier);
+
if (udc->qwork) {
flush_workqueue(udc->qwork);
destroy_workqueue(udc->qwork);
@@ -2169,6 +2175,7 @@ static int mv_udc_probe(struct platform_device *pdev)
}
 
udc->done = &release_done;
+   udc->extern_attr = pdata->extern_attr;
udc->pdata = pdev->dev.platform_data;
spin_lock_init(&udc->lock);
 
@@ -2319,17 +2326,8 @@ static int mv_udc_probe(struct platform_device *pdev)
/* VBUS detect: we can disable/enable clock on demand.*/
if (udc->transceiver)
udc->clock_gating = 1;
-   else if (pdata->vbus) {
+   else if (udc->extern_attr & MV_USB_HAS_VBUS_DETECTION) {
udc->clock_gating = 1;
-   retval = devm_request_threaded_irq(&pdev->dev,
-   pdata->vbus->irq, NULL,
-   mv_udc_vbus_irq, IRQF_ONESHOT, "vbus", udc);
-   if (retval) {
-   dev_info(&pdev->dev,
-   "Can not request irq for VBUS, "
-   "disable clock gating\n");
-   udc->clock_gating = 0;
-   }
 
udc->qwork = create_singlethread_workqueue("mv_udc_queue");
if (!udc->qwork) {
@@ -2339,6 +2337,8 @@ static int mv_udc_probe(struct platform_device *pdev)
}
 
INIT_WORK(&udc->vbus_work, mv_udc_vbus_work);
+   udc->notifier.notifier_call = mv_udc_vbus_notifier_call;
+   mv_usb2_register_notifier(udc->phy, &udc->notifier);
}
 
/*
@@ -2362,6 +2362,9 @@ static int mv_udc_probe(struct platform_device *pdev)
return 0;
 
 err_create_workqueue:
+   if (!udc->transceiver
+   && (udc->extern_attr & MV_USB_HAS_VBUS_DETECTION))
+   mv_usb2_unregister_notifier(udc->phy, &udc->notifier);
destroy_workqueue(udc->qwork);
 err_unregister:
device_unregister(&udc->gadget.dev);
@@ -2380,6 +2383,7 @@ 

[V6 PATCH 09/16] arm: mmp: remove the usb phy setting

2013-02-05 Thread Chao Xie
phy setting are formatted into a phy driver at drivers/usb/phy,
we do not need do the setting in SOC files.

Signed-off-by: Chao Xie 
---
 arch/arm/mach-mmp/devices.c   |  278 -
 arch/arm/mach-mmp/include/mach/regs-usb.h |  253 --
 2 files changed, 0 insertions(+), 531 deletions(-)
 delete mode 100644 arch/arm/mach-mmp/include/mach/regs-usb.h

diff --git a/arch/arm/mach-mmp/devices.c b/arch/arm/mach-mmp/devices.c
index dd2d8b1..af341e5 100644
--- a/arch/arm/mach-mmp/devices.c
+++ b/arch/arm/mach-mmp/devices.c
@@ -15,7 +15,6 @@
 #include 
 #include 
 #include 
-#include 
 
 int __init pxa_register_device(struct pxa_device_desc *desc,
void *data, size_t size)
@@ -72,280 +71,3 @@ int __init pxa_register_device(struct pxa_device_desc *desc,
return platform_device_add(pdev);
 }
 
-#if defined(CONFIG_USB) || defined(CONFIG_USB_GADGET)
-
-/*
- * The registers read/write routines
- */
-
-static unsigned int u2o_get(void __iomem *base, unsigned int offset)
-{
-   return readl_relaxed(base + offset);
-}
-
-static void u2o_set(void __iomem *base, unsigned int offset,
-   unsigned int value)
-{
-   u32 reg;
-
-   reg = readl_relaxed(base + offset);
-   reg |= value;
-   writel_relaxed(reg, base + offset);
-   readl_relaxed(base + offset);
-}
-
-static void u2o_clear(void __iomem *base, unsigned int offset,
-   unsigned int value)
-{
-   u32 reg;
-
-   reg = readl_relaxed(base + offset);
-   reg &= ~value;
-   writel_relaxed(reg, base + offset);
-   readl_relaxed(base + offset);
-}
-
-static void u2o_write(void __iomem *base, unsigned int offset,
-   unsigned int value)
-{
-   writel_relaxed(value, base + offset);
-   readl_relaxed(base + offset);
-}
-
-#if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV)
-
-#if defined(CONFIG_CPU_PXA910) || defined(CONFIG_CPU_PXA168)
-
-static DEFINE_MUTEX(phy_lock);
-static int phy_init_cnt;
-
-static int usb_phy_init_internal(void __iomem *base)
-{
-   int loops;
-
-   pr_info("Init usb phy!!!\n");
-
-   /* Initialize the USB PHY power */
-   if (cpu_is_pxa910()) {
-   u2o_set(base, UTMI_CTRL, (1< 100) {
-   printk(KERN_WARNING "calibrate timeout, UTMI_PLL %x\n",
-   u2o_get(base, UTMI_PLL));
-   break;
-   }
-   }
-
-   if (cpu_is_pxa168()) {
-   u2o_set(base, UTMI_RESERVE, 1 << 5);
-   /* Turn on UTMI PHY OTG extension */
-   u2o_write(base, UTMI_OTG_ADDON, 1);
-   }
-
-   return 0;
-}
-
-static int usb_phy_deinit_internal(void __iomem *base)
-{
-   pr_info("Deinit usb phy!!!\n");
-
-   if (cpu_is_pxa168())
-   u2o_clear(base, UTMI_OTG_ADDON, UTMI_OTG_ADDON_OTG_ON);
-
-   u2o_clear(base, UTMI_CTRL, UTMI_CTRL_RXBUF_PDWN);
-   u2o_clear(base, UTMI_CTRL, UTMI_CTRL_TXBUF_PDWN);
-   u2o_clear(base, UTMI_CTRL, UTMI_CTRL_USB_CLK_EN);
-   u2o_clear(base, UTMI_CTRL, 1

[V6 PATCH 08/16] arm: ttc_dkb: add usb support

2013-02-05 Thread Chao Xie
for ttc_dkb board, add udc/otg/ehci support

Signed-off-by: Chao Xie 
---
 arch/arm/mach-mmp/ttc_dkb.c |   30 +++---
 1 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c
index ce55fd8..0962791 100644
--- a/arch/arm/mach-mmp/ttc_dkb.c
+++ b/arch/arm/mach-mmp/ttc_dkb.c
@@ -27,7 +27,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include "common.h"
 
@@ -158,20 +157,24 @@ static struct i2c_board_info ttc_dkb_i2c_info[] = {
 };
 
 #ifdef CONFIG_USB_SUPPORT
-#if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV_U2O)
 
 static char *pxa910_usb_clock_name[] = {
-   [0] = "U2OCLK",
+   [0] = "usb_clk",
+};
+
+static struct mv_usb_phy_platform_data ttc_usb_phy_pdata = {
+   .clknum = 1,
+   .clkname= pxa910_usb_clock_name,
 };
 
+#if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV_U2O)
+
 static struct mv_usb_platform_data ttc_usb_pdata = {
.clknum = 1,
.clkname= pxa910_usb_clock_name,
.vbus   = NULL,
.mode   = MV_USB_MODE_OTG,
.otg_force_a_bus_req = 1,
-   .phy_init   = pxa_usb_phy_init,
-   .phy_deinit = pxa_usb_phy_deinit,
.set_vbus   = NULL,
 };
 #endif
@@ -198,19 +201,24 @@ static void __init ttc_dkb_init(void)
pxa910_add_twsi(0, NULL, ARRAY_AND_SIZE(ttc_dkb_i2c_info));
platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices));
 
+#ifdef CONFIG_USB_SUPPORT
+   pxa_register_device(&pxa910_device_u2ophy, &ttc_usb_phy_pdata,
+   sizeof(ttc_usb_phy_pdata));
+#endif
+
 #ifdef CONFIG_USB_MV_UDC
-   pxa168_device_u2o.dev.platform_data = &ttc_usb_pdata;
-   platform_device_register(&pxa168_device_u2o);
+   pxa_register_device(&pxa910_device_u2o, &ttc_usb_pdata,
+   sizeof(ttc_usb_pdata));
 #endif
 
 #ifdef CONFIG_USB_EHCI_MV_U2O
-   pxa168_device_u2oehci.dev.platform_data = &ttc_usb_pdata;
-   platform_device_register(&pxa168_device_u2oehci);
+   pxa_register_device(&pxa910_device_u2oehci, &ttc_usb_pdata,
+   sizeof(ttc_usb_pdata));
 #endif
 
 #ifdef CONFIG_USB_MV_OTG
-   pxa168_device_u2ootg.dev.platform_data = &ttc_usb_pdata;
-   platform_device_register(&pxa168_device_u2ootg);
+   pxa_register_device(&pxa910_device_u2ootg, &ttc_usb_pdata,
+   sizeof(ttc_usb_pdata));
 #endif
 }
 
-- 
1.7.4.1

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


[V6 PATCH 10/16] arm: mmp: remove usb devices from pxa168

2013-02-05 Thread Chao Xie
Signed-off-by: Chao Xie 
---
 arch/arm/mach-mmp/pxa168.c |   42 --
 1 files changed, 0 insertions(+), 42 deletions(-)

diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c
index b7f074f..dd3a68b 100644
--- a/arch/arm/mach-mmp/pxa168.c
+++ b/arch/arm/mach-mmp/pxa168.c
@@ -28,7 +28,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include "common.h"
 #include "clock.h"
@@ -135,47 +134,6 @@ struct platform_device pxa168_device_gpio = {
.resource   = pxa168_resource_gpio,
 };
 
-struct resource pxa168_usb_host_resources[] = {
-   /* USB Host conroller register base */
-   [0] = {
-   .start  = PXA168_U2H_REGBASE + U2x_CAPREGS_OFFSET,
-   .end= PXA168_U2H_REGBASE + USB_REG_RANGE,
-   .flags  = IORESOURCE_MEM,
-   .name   = "capregs",
-   },
-   /* USB PHY register base */
-   [1] = {
-   .start  = PXA168_U2H_PHYBASE,
-   .end= PXA168_U2H_PHYBASE + USB_PHY_RANGE,
-   .flags  = IORESOURCE_MEM,
-   .name   = "phyregs",
-   },
-   [2] = {
-   .start  = IRQ_PXA168_USB2,
-   .end= IRQ_PXA168_USB2,
-   .flags  = IORESOURCE_IRQ,
-   },
-};
-
-static u64 pxa168_usb_host_dmamask = DMA_BIT_MASK(32);
-struct platform_device pxa168_device_usb_host = {
-   .name = "pxa-sph",
-   .id   = -1,
-   .dev  = {
-   .dma_mask = &pxa168_usb_host_dmamask,
-   .coherent_dma_mask = DMA_BIT_MASK(32),
-   },
-
-   .num_resources = ARRAY_SIZE(pxa168_usb_host_resources),
-   .resource  = pxa168_usb_host_resources,
-};
-
-int __init pxa168_add_usb_host(struct mv_usb_platform_data *pdata)
-{
-   pxa168_device_usb_host.dev.platform_data = pdata;
-   return platform_device_register(&pxa168_device_usb_host);
-}
-
 void pxa168_restart(char mode, const char *cmd)
 {
soft_restart(0x);
-- 
1.7.4.1

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


[V6 PATCH 06/16] arm: pxa910: change the defintion of usb devices

2013-02-05 Thread Chao Xie
because phy is seperated from the usb controller driver,
we can use the common pxa_device_desc for device register.

Signed-off-by: Chao Xie 
---
 arch/arm/mach-mmp/include/mach/pxa910.h |7 ---
 arch/arm/mach-mmp/pxa910.c  |4 
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-mmp/include/mach/pxa910.h 
b/arch/arm/mach-mmp/include/mach/pxa910.h
index 3b58a3b..26ea4fe 100644
--- a/arch/arm/mach-mmp/include/mach/pxa910.h
+++ b/arch/arm/mach-mmp/include/mach/pxa910.h
@@ -20,9 +20,10 @@ extern struct pxa_device_desc pxa910_device_pwm2;
 extern struct pxa_device_desc pxa910_device_pwm3;
 extern struct pxa_device_desc pxa910_device_pwm4;
 extern struct pxa_device_desc pxa910_device_nand;
-extern struct platform_device pxa168_device_u2o;
-extern struct platform_device pxa168_device_u2ootg;
-extern struct platform_device pxa168_device_u2oehci;
+extern struct pxa_device_desc pxa910_device_u2o;
+extern struct pxa_device_desc pxa910_device_u2ootg;
+extern struct pxa_device_desc pxa910_device_u2oehci;
+extern struct pxa_device_desc pxa910_device_u2ophy;
 
 extern struct platform_device pxa910_device_gpio;
 extern struct platform_device pxa910_device_rtc;
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c
index 8b1e16f..65174f7 100644
--- a/arch/arm/mach-mmp/pxa910.c
+++ b/arch/arm/mach-mmp/pxa910.c
@@ -138,6 +138,10 @@ PXA910_DEVICE(pwm2, "pxa910-pwm", 1, NONE, 0xd401a400, 
0x10);
 PXA910_DEVICE(pwm3, "pxa910-pwm", 2, NONE, 0xd401a800, 0x10);
 PXA910_DEVICE(pwm4, "pxa910-pwm", 3, NONE, 0xd401ac00, 0x10);
 PXA910_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x80, 97, 99);
+PXA910_DEVICE(u2ophy, "pxa910-usb-phy", -1, NONE, 0xd4207000, 0x1ff);
+PXA910_DEVICE(u2o, "mv-udc", -1, USB1, 0xd4208100, 0x1ff);
+PXA910_DEVICE(u2ootg, "mv-otg", -1, USB1, 0xd4208100, 0x1ff);
+PXA910_DEVICE(u2oehci, "mv-ehci", -1, USB1, 0xd4208100, 0x1ff);
 
 struct resource pxa910_resource_gpio[] = {
{
-- 
1.7.4.1

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


[V6 PATCH 07/16] arm: brownstone: add usb support for the board

2013-02-05 Thread Chao Xie
for brownstone board, add the udc/otg/ehci support

Signed-off-by: Chao Xie 
---
 arch/arm/mach-mmp/brownstone.c |   47 
 1 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-mmp/brownstone.c b/arch/arm/mach-mmp/brownstone.c
index 5cb769c..90c0340 100644
--- a/arch/arm/mach-mmp/brownstone.c
+++ b/arch/arm/mach-mmp/brownstone.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -195,6 +196,31 @@ static struct sram_platdata mmp2_isram_platdata = {
.granularity= SRAM_GRANULARITY,
 };
 
+#ifdef CONFIG_USB_SUPPORT
+
+static char *mmp2_usb_clock_name[] = {
+   [0] = "usb_clk",
+};
+
+static struct mv_usb_phy_platform_data brownstone_usb_phy_pdata = {
+   .clknum = 1,
+   .clkname= mmp2_usb_clock_name,
+};
+
+#if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV_U2O)
+
+static struct mv_usb_platform_data brownstone_usb_pdata = {
+   .clknum = 1,
+   .clkname= mmp2_usb_clock_name,
+   .vbus   = NULL,
+   .mode   = MV_USB_MODE_OTG,
+   .otg_force_a_bus_req = 1,
+   .set_vbus   = NULL,
+};
+#endif
+#endif
+
+
 static void __init brownstone_init(void)
 {
mfp_config(ARRAY_AND_SIZE(brownstone_pin_config));
@@ -211,6 +237,27 @@ static void __init brownstone_init(void)
 
/* enable 5v regulator */
platform_device_register(&brownstone_v_5vp_device);
+
+#ifdef CONFIG_USB_SUPPORT
+   pxa_register_device(&mmp2_device_u2ophy, &brownstone_usb_phy_pdata,
+   sizeof(brownstone_usb_phy_pdata));
+#endif
+
+#ifdef CONFIG_USB_MV_UDC
+   pxa_register_device(&mmp2_device_u2o, &brownstone_usb_pdata,
+   sizeof(brownstone_usb_pdata));
+#endif
+
+#ifdef CONFIG_USB_EHCI_MV_U2O
+   pxa_register_device(&mmp2_device_u2oehci, &brownstone_usb_pdata,
+   sizeof(brownstone_usb_pdata));
+#endif
+
+#ifdef CONFIG_USB_MV_OTG
+   pxa_register_device(&mmp2_device_u2ootg, &brownstone_usb_pdata,
+   sizeof(brownstone_usb_pdata));
+#endif
+
 }
 
 MACHINE_START(BROWNSTONE, "Brownstone Development Platform")
-- 
1.7.4.1

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


[V6 PATCH 05/16] arm: mmp2: change the defintion of usb devices

2013-02-05 Thread Chao Xie
add the udc/otg/ehci devices for mmp2

Signed-off-by: Chao Xie 
---
 arch/arm/mach-mmp/include/mach/mmp2.h |4 
 arch/arm/mach-mmp/mmp2.c  |4 
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-mmp/include/mach/mmp2.h 
b/arch/arm/mach-mmp/include/mach/mmp2.h
index c4ca4d1..58e96b0 100644
--- a/arch/arm/mach-mmp/include/mach/mmp2.h
+++ b/arch/arm/mach-mmp/include/mach/mmp2.h
@@ -31,6 +31,10 @@ extern struct pxa_device_desc mmp2_device_sdh2;
 extern struct pxa_device_desc mmp2_device_sdh3;
 extern struct pxa_device_desc mmp2_device_asram;
 extern struct pxa_device_desc mmp2_device_isram;
+extern struct pxa_device_desc mmp2_device_u2o;
+extern struct pxa_device_desc mmp2_device_u2ootg;
+extern struct pxa_device_desc mmp2_device_u2oehci;
+extern struct pxa_device_desc mmp2_device_u2ophy;
 
 extern struct platform_device mmp2_device_gpio;
 
diff --git a/arch/arm/mach-mmp/mmp2.c b/arch/arm/mach-mmp/mmp2.c
index 3a3768c..73edbfc 100644
--- a/arch/arm/mach-mmp/mmp2.c
+++ b/arch/arm/mach-mmp/mmp2.c
@@ -153,6 +153,10 @@ MMP2_DEVICE(sdh3, "sdhci-pxav3", 3, MMC4, 0xd4281800, 
0x120);
 MMP2_DEVICE(asram, "asram", -1, NONE, 0xe000, 0x4000);
 /* 0xd100 ~ 0xd101 is reserved for secure processor */
 MMP2_DEVICE(isram, "isram", -1, NONE, 0xd102, 0x18000);
+MMP2_DEVICE(u2ophy, "mmp2-usb-phy", -1, NONE, 0xd4207000, 0x1ff);
+MMP2_DEVICE(u2o, "mv-udc", -1, USB_OTG, 0xd4208100, 0x1ff);
+MMP2_DEVICE(u2ootg, "mv-otg", -1, USB_OTG, 0xd4208100, 0x1ff);
+MMP2_DEVICE(u2oehci, "mv-ehci", -1, USB_OTG, 0xd4208100, 0x1ff);
 
 struct resource mmp2_resource_gpio[] = {
{
-- 
1.7.4.1

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


[V6 PATCH 04/16] usb: otg: mv_otg: use PHY driver for otg

2013-02-05 Thread Chao Xie
Originaly, otg driver will call the callbacks in platform data
for PHY initialization and shut down.
With PHY driver, it will call the APIs provided by PHY driver
for PHY initialization and shut down. It removes the callbacks
in platform data, and at same time it removes one block in the
way of enabling device tree for otg driver.

Signed-off-by: Chao Xie 
---
 drivers/usb/otg/mv_otg.c |   33 -
 drivers/usb/otg/mv_otg.h |2 +-
 2 files changed, 13 insertions(+), 22 deletions(-)

diff --git a/drivers/usb/otg/mv_otg.c b/drivers/usb/otg/mv_otg.c
index b6a9be3..44ddf25 100644
--- a/drivers/usb/otg/mv_otg.c
+++ b/drivers/usb/otg/mv_otg.c
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "mv_otg.h"
@@ -261,8 +262,8 @@ static int mv_otg_enable_internal(struct mv_otg *mvotg)
dev_dbg(&mvotg->pdev->dev, "otg enabled\n");
 
otg_clock_enable(mvotg);
-   if (mvotg->pdata->phy_init) {
-   retval = mvotg->pdata->phy_init(mvotg->phy_regs);
+   if (mvotg->mvphy->init) {
+   retval = mvotg->mvphy->init(mvotg->mvphy);
if (retval) {
dev_err(&mvotg->pdev->dev,
"init phy error %d\n", retval);
@@ -288,8 +289,8 @@ static void mv_otg_disable_internal(struct mv_otg *mvotg)
 {
if (mvotg->active) {
dev_dbg(&mvotg->pdev->dev, "otg disabled\n");
-   if (mvotg->pdata->phy_deinit)
-   mvotg->pdata->phy_deinit(mvotg->phy_regs);
+   if (mvotg->mvphy->shutdown)
+   mvotg->mvphy->shutdown(mvotg->mvphy);
otg_clock_disable(mvotg);
mvotg->active = 0;
}
@@ -741,23 +742,8 @@ static int mv_otg_probe(struct platform_device *pdev)
for (i = 0; i < OTG_TIMER_NUM; i++)
init_timer(&mvotg->otg_ctrl.timer[i]);
 
-   r = platform_get_resource_byname(mvotg->pdev,
-IORESOURCE_MEM, "phyregs");
-   if (r == NULL) {
-   dev_err(&pdev->dev, "no phy I/O memory resource defined\n");
-   retval = -ENODEV;
-   goto err_destroy_workqueue;
-   }
-
-   mvotg->phy_regs = devm_ioremap(&pdev->dev, r->start, resource_size(r));
-   if (mvotg->phy_regs == NULL) {
-   dev_err(&pdev->dev, "failed to map phy I/O memory\n");
-   retval = -EFAULT;
-   goto err_destroy_workqueue;
-   }
-
-   r = platform_get_resource_byname(mvotg->pdev,
-IORESOURCE_MEM, "capregs");
+   r = platform_get_resource(mvotg->pdev,
+IORESOURCE_MEM, 0);
if (r == NULL) {
dev_err(&pdev->dev, "no I/O memory resource defined\n");
retval = -ENODEV;
@@ -770,6 +756,11 @@ static int mv_otg_probe(struct platform_device *pdev)
retval = -EFAULT;
goto err_destroy_workqueue;
}
+   mvotg->mvphy = mv_usb2_get_phy();
+   if (mvotg->mvphy == NULL) {
+   retval = -ENODEV;
+   goto err_destroy_workqueue;
+   }
 
/* we will acces controller register, so enable the udc controller */
retval = mv_otg_enable_internal(mvotg);
diff --git a/drivers/usb/otg/mv_otg.h b/drivers/usb/otg/mv_otg.h
index 8a9e351..7b9629a 100644
--- a/drivers/usb/otg/mv_otg.h
+++ b/drivers/usb/otg/mv_otg.h
@@ -137,10 +137,10 @@ struct mv_otg_regs {
 
 struct mv_otg {
struct usb_phy phy;
+   struct mv_usb2_phy *mvphy;
struct mv_otg_ctrl otg_ctrl;
 
/* base address */
-   void __iomem *phy_regs;
void __iomem *cap_regs;
struct mv_otg_regs __iomem *op_regs;
 
-- 
1.7.4.1

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


[V6 PATCH 03/16] usb: ehci: ehci-mv: use PHY driver for ehci

2013-02-05 Thread Chao Xie
Originaly, ehci driver will call the callbacks in platform data
for PHY initialization and shut down.
With PHY driver, it will call the APIs provided by PHY driver
for PHY initialization and shut down. It removes the callbacks
in platform data, and at same time it removes one block in the
way of enabling device tree for ehci driver.

Signed-off-by: Chao Xie 
Acked-by: Alan Stern 
---
 drivers/usb/host/ehci-mv.c |   37 +
 1 files changed, 13 insertions(+), 24 deletions(-)

diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index 3065809..be504fd 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -15,17 +15,18 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #define CAPLENGTH_MASK (0xff)
 
 struct ehci_hcd_mv {
struct usb_hcd *hcd;
+   struct mv_usb2_phy *mvphy;
 
/* Which mode does this ehci running OTG/Host ? */
int mode;
 
-   void __iomem *phy_regs;
void __iomem *cap_regs;
void __iomem *op_regs;
 
@@ -59,8 +60,8 @@ static int mv_ehci_enable(struct ehci_hcd_mv *ehci_mv)
int retval;
 
ehci_clock_enable(ehci_mv);
-   if (ehci_mv->pdata->phy_init) {
-   retval = ehci_mv->pdata->phy_init(ehci_mv->phy_regs);
+   if (ehci_mv->mvphy->init) {
+   retval = ehci_mv->mvphy->init(ehci_mv->mvphy);
if (retval)
return retval;
}
@@ -70,8 +71,8 @@ static int mv_ehci_enable(struct ehci_hcd_mv *ehci_mv)
 
 static void mv_ehci_disable(struct ehci_hcd_mv *ehci_mv)
 {
-   if (ehci_mv->pdata->phy_deinit)
-   ehci_mv->pdata->phy_deinit(ehci_mv->phy_regs);
+   if (ehci_mv->mvphy->shutdown)
+   ehci_mv->mvphy->shutdown(ehci_mv->mvphy);
ehci_clock_disable(ehci_mv);
 }
 
@@ -184,22 +185,7 @@ static int mv_ehci_probe(struct platform_device *pdev)
}
}
 
-   r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phyregs");
-   if (r == NULL) {
-   dev_err(&pdev->dev, "no phy I/O memory resource defined\n");
-   retval = -ENODEV;
-   goto err_clear_drvdata;
-   }
-
-   ehci_mv->phy_regs = devm_ioremap(&pdev->dev, r->start,
-resource_size(r));
-   if (ehci_mv->phy_regs == 0) {
-   dev_err(&pdev->dev, "failed to map phy I/O memory\n");
-   retval = -EFAULT;
-   goto err_clear_drvdata;
-   }
-
-   r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "capregs");
+   r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r) {
dev_err(&pdev->dev, "no I/O memory resource defined\n");
retval = -ENODEV;
@@ -214,6 +200,12 @@ static int mv_ehci_probe(struct platform_device *pdev)
goto err_clear_drvdata;
}
 
+   ehci_mv->mvphy = mv_usb2_get_phy();
+   if (ehci_mv->mvphy == NULL) {
+   retval = -ENODEV;
+   goto err_clear_drvdata;
+   }
+
retval = mv_ehci_enable(ehci_mv);
if (retval) {
dev_err(&pdev->dev, "init phy error %d\n", retval);
@@ -275,9 +267,6 @@ static int mv_ehci_probe(struct platform_device *pdev)
}
}
 
-   if (pdata->private_init)
-   pdata->private_init(ehci_mv->op_regs, ehci_mv->phy_regs);
-
dev_info(&pdev->dev,
 "successful find EHCI device with regs 0x%p irq %d"
 " working in %s mode\n", hcd->regs, hcd->irq,
-- 
1.7.4.1

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


[V6 PATCH 02/16] usb: gadget: mv_udc: use PHY driver for udc

2013-02-05 Thread Chao Xie
Originaly, udc driver will call the callbacks in platform data
for PHY initialization and shut down.
With PHY driver, it will call the APIs provided by PHY driver
for PHY initialization and shut down. It removes the callbacks
in platform data, and at same time it removes one block in the
way of enabling device tree for udc driver.

Signed-off-by: Chao Xie 
---
 drivers/usb/gadget/mv_udc.h  |2 +-
 drivers/usb/gadget/mv_udc_core.c |   23 ---
 2 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/gadget/mv_udc.h b/drivers/usb/gadget/mv_udc.h
index 9073436..4851b2b 100644
--- a/drivers/usb/gadget/mv_udc.h
+++ b/drivers/usb/gadget/mv_udc.h
@@ -180,7 +180,6 @@ struct mv_udc {
 
struct mv_cap_regs __iomem  *cap_regs;
struct mv_op_regs __iomem   *op_regs;
-   void __iomem*phy_regs;
unsigned intmax_eps;
struct mv_dqh   *ep_dqh;
size_t  ep_dqh_size;
@@ -217,6 +216,7 @@ struct mv_udc {
struct work_struct  vbus_work;
struct workqueue_struct *qwork;
 
+   struct mv_usb2_phy  *phy;
struct usb_phy  *transceiver;
 
struct mv_usb_platform_data *pdata;
diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c
index c8cf959..76fcfc7 100644
--- a/drivers/usb/gadget/mv_udc_core.c
+++ b/drivers/usb/gadget/mv_udc_core.c
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "mv_udc.h"
@@ -1121,8 +1122,8 @@ static int mv_udc_enable_internal(struct mv_udc *udc)
 
dev_dbg(&udc->dev->dev, "enable udc\n");
udc_clock_enable(udc);
-   if (udc->pdata->phy_init) {
-   retval = udc->pdata->phy_init(udc->phy_regs);
+   if (udc->phy->init) {
+   retval = udc->phy->init(udc->phy);
if (retval) {
dev_err(&udc->dev->dev,
"init phy error %d\n", retval);
@@ -1147,8 +1148,8 @@ static void mv_udc_disable_internal(struct mv_udc *udc)
 {
if (udc->active) {
dev_dbg(&udc->dev->dev, "disable udc\n");
-   if (udc->pdata->phy_deinit)
-   udc->pdata->phy_deinit(udc->phy_regs);
+   if (udc->phy->shutdown)
+   udc->phy->shutdown(udc->phy);
udc_clock_disable(udc);
udc->active = 0;
}
@@ -2194,7 +2195,7 @@ static int mv_udc_probe(struct platform_device *pdev)
}
}
 
-   r = platform_get_resource_byname(udc->dev, IORESOURCE_MEM, "capregs");
+   r = platform_get_resource(udc->dev, IORESOURCE_MEM, 0);
if (r == NULL) {
dev_err(&pdev->dev, "no I/O memory resource defined\n");
return -ENODEV;
@@ -2207,17 +2208,9 @@ static int mv_udc_probe(struct platform_device *pdev)
return -EBUSY;
}
 
-   r = platform_get_resource_byname(udc->dev, IORESOURCE_MEM, "phyregs");
-   if (r == NULL) {
-   dev_err(&pdev->dev, "no phy I/O memory resource defined\n");
+   udc->phy = mv_usb2_get_phy();
+   if (udc->phy == NULL)
return -ENODEV;
-   }
-
-   udc->phy_regs = ioremap(r->start, resource_size(r));
-   if (udc->phy_regs == NULL) {
-   dev_err(&pdev->dev, "failed to map phy I/O memory\n");
-   return -EBUSY;
-   }
 
/* we will acces controller register, so enable the clk */
retval = mv_udc_enable_internal(udc);
-- 
1.7.4.1

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


[V6 PATCH 01/16] usb: phy: mv_usb2: add PHY driver for marvell usb2 controller

2013-02-05 Thread Chao Xie
The PHY is seperated from usb controller.
The usb controller used in marvell pxa168/pxa910/mmp2 are same,
but PHY initialization may be different.
the usb controller can support udc/otg/ehci, and for each of
the mode, it need PHY to initialized before use the controller.
Direclty writing the phy driver will make the usb controller
driver to be simple and portable.
The PHY driver will be used by marvell udc/otg/ehci.

Signed-off-by: Chao Xie 
---
 drivers/usb/phy/Kconfig  |7 +
 drivers/usb/phy/Makefile |1 +
 drivers/usb/phy/mv_usb2_phy.c|  454 ++
 include/linux/platform_data/mv_usb.h |9 +-
 include/linux/usb/mv_usb2.h  |   43 
 5 files changed, 511 insertions(+), 3 deletions(-)
 create mode 100644 drivers/usb/phy/mv_usb2_phy.c
 create mode 100644 include/linux/usb/mv_usb2.h

diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index 65217a5..5479760 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -73,3 +73,10 @@ config SAMSUNG_USBPHY
help
  Enable this to support Samsung USB phy controller for samsung
  SoCs.
+
+config MV_USB2_PHY
+   tristate "Marvell USB 2.0 PHY Driver"
+   depends on USB || USB_GADGET
+   help
+ Enable this to support Marvell USB 2.0 phy driver for Marvell
+ SoC.
diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile
index b13faa1..3835316 100644
--- a/drivers/usb/phy/Makefile
+++ b/drivers/usb/phy/Makefile
@@ -12,3 +12,4 @@ obj-$(CONFIG_MV_U3D_PHY)  += mv_u3d_phy.o
 obj-$(CONFIG_USB_EHCI_TEGRA)   += tegra_usb_phy.o
 obj-$(CONFIG_USB_RCAR_PHY) += rcar-phy.o
 obj-$(CONFIG_SAMSUNG_USBPHY)   += samsung-usbphy.o
+obj-$(CONFIG_MV_USB2_PHY)  += mv_usb2_phy.o
diff --git a/drivers/usb/phy/mv_usb2_phy.c b/drivers/usb/phy/mv_usb2_phy.c
new file mode 100644
index 000..c2bccae
--- /dev/null
+++ b/drivers/usb/phy/mv_usb2_phy.c
@@ -0,0 +1,454 @@
+/*
+ * Copyright (C) 2010 Google, Inc.
+ *
+ * Author:
+ * Chao Xie 
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* phy regs */
+#define UTMI_REVISION  0x0
+#define UTMI_CTRL  0x4
+#define UTMI_PLL   0x8
+#define UTMI_TX0xc
+#define UTMI_RX0x10
+#define UTMI_IVREF 0x14
+#define UTMI_T00x18
+#define UTMI_T10x1c
+#define UTMI_T20x20
+#define UTMI_T30x24
+#define UTMI_T40x28
+#define UTMI_T50x2c
+#define UTMI_RESERVE   0x30
+#define UTMI_USB_INT   0x34
+#define UTMI_DBG_CTL   0x38
+#define UTMI_OTG_ADDON 0x3c
+
+/* For UTMICTRL Register */
+#define UTMI_CTRL_USB_CLK_EN(1 << 31)
+/* pxa168 */
+#define UTMI_CTRL_SUSPEND_SET1  (1 << 30)
+#define UTMI_CTRL_SUSPEND_SET2  (1 << 29)
+#define UTMI_CTRL_RXBUF_PDWN(1 << 24)
+#define UTMI_CTRL_TXBUF_PDWN(1 << 11)
+
+#define UTMI_CTRL_INPKT_DELAY_SHIFT 30
+#define UTMI_CTRL_INPKT_DELAY_SOF_SHIFT28
+#define UTMI_CTRL_PU_REF_SHIFT 20
+#define UTMI_CTRL_ARC_PULLDN_SHIFT  12
+#define UTMI_CTRL_PLL_PWR_UP_SHIFT  1
+#define UTMI_CTRL_PWR_UP_SHIFT  0
+
+/* For UTMI_PLL Register */
+#define UTMI_PLL_PLLCALI12_SHIFT   29
+#define UTMI_PLL_PLLCALI12_MASK(0x3 << 29)
+
+#define UTMI_PLL_PLLVDD18_SHIFT27
+#define UTMI_PLL_PLLVDD18_MASK (0x3 << 27)
+
+#define UTMI_PLL_PLLVDD12_SHIFT25
+#define UTMI_PLL_PLLVDD12_MASK (0x3 << 25)
+
+#define UTMI_PLL_CLK_BLK_EN_SHIFT   24
+#define CLK_BLK_EN  (0x1 << 24)
+#define PLL_READY   (0x1 << 23)
+#define KVCO_EXT(0x1 << 22)
+#define VCOCAL_START(0x1 << 21)
+
+#define UTMI_PLL_KVCO_SHIFT15
+#define UTMI_PLL_KVCO_MASK  (0x7 << 15)
+
+#define UTMI_PLL_ICP_SHIFT 12
+#define UTMI_PLL_ICP_MASK   (0x7 << 12)
+
+#define UTMI_PLL_FBDIV_SHIFT

[V6 PATCH 00/16] mv-usb phy enhancement patches

2013-02-05 Thread Chao Xie
The patches are divied into 2 parts

1. PHY driver
To remove the callbacks in the platform data, a usb PHY driver
for marvell udc/otg/ehci is written.
For device tree support, it is not good to pass the callback
pointers by platform data. The PHY driver also removes the
block.

  usb: phy: mv_usb2: add PHY driver for marvell usb2 controller
  usb: gadget: mv_udc: use PHY driver for udc
  usb: ehci: ehci-mv: use PHY driver for ehci
  usb: otg: mv_otg: use PHY driver for otg
Above patches are marvell usb PHY driver support.

  arm: mmp2: change the defintion of usb devices
  arm: pxa910: change the defintion of usb devices
  arm: brownstone: add usb support for the board
  arm: ttc_dkb: add usb support
  arm: mmp: remove the usb phy setting
  arm: mmp: remove usb devices from pxa168
Above patches are for SOC/board support for marvell usb PHY
driver.

2. external chip support
The marvell usb controller can detect the vbus/idpin, but it
need PHY and usb clocks to be enabled.
Based on measurement it will import 15mA current, and increase
the power when the usb is not used.
Using a external chip to detect vbus/idpin changes will save
the power.
In fact the marvell PMIC 88pm860x and 88pm80x can do it. The
drivers are located at drivers/mfd.
So add a middle layer in the marvell usb PHY driver.
PMIC call the APIs in middle driver to registers the callback
for vbus/idpin detection/query
udc/otg/ehci driver will call the APIs to get vbus/idpin changes
and query the states of the vbus/idpin.
  usb: phy: mv_usb2_phy: add externel chip support
  usb: gadget: mv_udc: add extern chip support
  usb: ehci: ehci-mv: add extern chip support
  usb: otg: mv_otg: add extern chip support
Above patches are the middle layer suppor for udc/otg/ehci

  arm: mmp: add extern chip support for brownstone
  arm: mmp: add extern chip support for ttc_dkb
Above patches are corresponding board file changes

V2->V1:
  Change the Signed-off-by to be right email address

v3->v2
  re-format the patches to new code base

v4->v3
  1. make mv udc gadget driver depend on ARCH_PXA and ARCH_MMP
  2. remove __devinit and __devexit
  3. make the driver compiled successful if CONFIG_MV_USB2_PHY is not defined.
  The modified patches are
  usb: gadget: mv_udc: make mv_udc depends on ARCH_MMP or ARCH_PXA
  usb: phy: mv_usb2: add PHY driver for marvell usb2 controller

v5->v4
  make the struct mv_usb2_extern_chip member ->head to be
  struct atomic_notifier_head instead of struct atomic_notifier_head *.

v6->v5
  the bug fix patches are merged.
  Removed the dependcy of ARCH_MMP and ARCH_PXA, and make the driver can be
  compiled for x86.
  The device tree support patches need modification, remove them from this
  patch series, and they will be submitted in another series.


Chao Xie (16):
  usb: phy: mv_usb2: add PHY driver for marvell usb2 controller
  usb: gadget: mv_udc: use PHY driver for udc
  usb: ehci: ehci-mv: use PHY driver for ehci
  usb: otg: mv_otg: use PHY driver for otg
  arm: mmp2: change the defintion of usb devices
  arm: pxa910: change the defintion of usb devices
  arm: brownstone: add usb support for the board
  arm: ttc_dkb: add usb support
  arm: mmp: remove the usb phy setting
  arm: mmp: remove usb devices from pxa168
  usb: phy: mv_usb2_phy: add externel chip support
  usb: gadget: mv_udc: add extern chip support
  usb: ehci: ehci-mv: add extern chip support
  usb: otg: mv_otg: add extern chip support
  arm: mmp: add extern chip support for brownstone
  arm: mmp: add extern chip support for ttc_dkb

 arch/arm/mach-mmp/brownstone.c|   45 +++
 arch/arm/mach-mmp/devices.c   |  278 
 arch/arm/mach-mmp/include/mach/mmp2.h |4 +
 arch/arm/mach-mmp/include/mach/pxa910.h   |7 +-
 arch/arm/mach-mmp/include/mach/regs-usb.h |  253 ---
 arch/arm/mach-mmp/mmp2.c  |4 +
 arch/arm/mach-mmp/pxa168.c|   42 ---
 arch/arm/mach-mmp/pxa910.c|4 +
 arch/arm/mach-mmp/ttc_dkb.c   |   32 ++-
 drivers/usb/gadget/mv_udc.h   |5 +-
 drivers/usb/gadget/mv_udc_core.c  |   70 ++--
 drivers/usb/host/ehci-mv.c|   49 ++--
 drivers/usb/otg/mv_otg.c  |   96 +++
 drivers/usb/otg/mv_otg.h  |5 +-
 drivers/usb/phy/Kconfig   |7 +
 drivers/usb/phy/Makefile  |1 +
 drivers/usb/phy/mv_usb2_phy.c |  503 +
 include/linux/platform_data/mv_usb.h  |   22 +-
 include/linux/usb/mv_usb2.h   |  128 
 19 files changed, 832 insertions(+), 723 deletions(-)
 delete mode 100644 arch/arm/mach-mmp/include/mach/regs-usb.h
 create mode 100644 drivers/usb/phy/mv_usb2_phy.c
 create mode 100644 include/linux/usb/mv_usb2.h

-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://v

[PATCH] usb: gadget: imx_udc: make it depend on BROKEN

2013-02-05 Thread Felipe Balbi
that driver hasn't been maintained for quite
some time, at least since e08300043e (ARM:
imx: dynamically allocate imx_udc device).

Because of that, and because driver doesn't
even compile with allyesconfig and allmodconfig,
we're making it depend on BROKEN.

Reported-by: Arnd Bergmann 
Signed-off-by: Felipe Balbi 
---
 drivers/usb/gadget/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 14625fd..e2b6e83 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -281,6 +281,7 @@ config USB_S3C_HSOTG
 config USB_IMX
tristate "Freescale i.MX1 USB Peripheral Controller"
depends on ARCH_MXC
+   depends on BROKEN
help
   Freescale's i.MX1 includes an integrated full speed
   USB 1.1 device controller.
-- 
1.8.1.rc1.5.g7e0651a

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


Re: [PATCH 12/15] USB: gadget/freescale: disable non-multiplatform drivers

2013-02-05 Thread Felipe Balbi
On Tue, Feb 05, 2013 at 05:55:11PM -0800, Greg Kroah-Hartman wrote:
> On Tue, Feb 05, 2013 at 10:54:00PM +, Arnd Bergmann wrote:
> > On Tuesday 05 February 2013, Felipe Balbi wrote:
> > > [linus/master] Merge branch 'fix-max-write' of 
> > > git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm
> > > 
> > > It's building find for me:
> > > 
> > > $ crossmake drivers/usb/gadget/fsl_udc_core.o \
> > > drivers/usb/gadget/fsl_mxc_udc.o > /dev/null
> > > 
> > > (crossmake is an alias to make ARCH=arm)
> > > 
> > > Arnd, are you maybe missing a merge of v3.8-rc6 ?
> > >
> > > I can see that imx_udc.c is broken still, but there are no maintainers
> > > for that driver. I'm adding Sascha to Cc list, maybe he knows someone
> > > who can help, but if this driver isn't fixed in 2 merge windows, I will
> > > schedule for removal from tree and someone else will have to
> > > re-introduce it later without all the bogus includes.
> > 
> > Ah, I see what happened now: I submitted a patch that lumped together
> > two patches, disabling both fsl_mxc_udc and imx_udc. You already had
> > a fix for the first one, so I dropped my patch, but now I see the
> > build error for the second one that my patch was avoiding.
> > 
> > The last patch to imx_udc that seems to have seen more than just
> > build testing was probably "USB: gadget: imx_udc: don't queue more
> > data when zlp is to be sent", while fsl_mxc_udc looks actively
> > maintained. It's not completely clear to me whether these
> > are actually two drivers for the same hardware, of whether
> > imx_udc is the i.mx1 variant and fsl_mxc_udc is the i.mx2 variant.
> > 
> > What I can say is that no platform in the kernel currently defines
> > an "imx_udc" platform_device, so it is certainly unused, and has
> > been since at least e08300043e in 2010.
> > 
> > I would suggest that we mark the imx_udc driver as 'depends on
> > BROKEN' right away, since no in-tree user needs it, and any
> > out of tree user is already broken in 3.8. I also wouldn't
> > mind removing the driver unless the imx maintainers have
> > a plan for it.
> 
> Sure, someone just send me a patch for that and I'll be glad to mark it
> BROKEN.

coming in a minute

-- 
balbi


signature.asc
Description: Digital signature


[PATCH 3/5] ARM: OMAP2: MUSB: Specify omap4 has mailbox

2013-02-05 Thread Kishon Vijay Abraham I
Added has_mailbox to the musb platform data to specify that omap uses
an external mailbox (in control module) to communicate with the musb
core during device connect and disconnect.

Signed-off-by: Kishon Vijay Abraham I 
Acked-by: Tony Lindgren 
---
 arch/arm/mach-omap2/usb-musb.c |3 +++
 include/linux/usb/musb.h   |2 ++
 2 files changed, 5 insertions(+)

diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 7b33b37..9d27e3f 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -85,6 +85,9 @@ void __init usb_musb_init(struct omap_musb_board_data 
*musb_board_data)
musb_plat.mode = board_data->mode;
musb_plat.extvbus = board_data->extvbus;
 
+   if (cpu_is_omap44xx())
+   musb_plat.has_mailbox = true;
+
if (soc_is_am35xx()) {
oh_name = "am35x_otg_hs";
name = "musb-am35x";
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h
index eb50525..053c268 100644
--- a/include/linux/usb/musb.h
+++ b/include/linux/usb/musb.h
@@ -99,6 +99,8 @@ struct musb_hdrc_platform_data {
/* MUSB_HOST, MUSB_PERIPHERAL, or MUSB_OTG */
u8  mode;
 
+   u8  has_mailbox:1;
+
/* for clk_get() */
const char  *clock;
 
-- 
1.7.10.4

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


[PATCH 1/5] ARM: OMAP4: remove control module address space from PHY and OTG

2013-02-05 Thread Kishon Vijay Abraham I
Now that we have a separate driver for the control module,
stop populating the control module device data in other modules
(PHY and OTG) device info.

Signed-off-by: Kishon Vijay Abraham I 
Acked-by: Tony Lindgren 
---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   13 -
 1 file changed, 13 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 793f54a..624a7e8 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -2702,13 +2702,6 @@ static struct resource omap44xx_usb_phy_and_pll_addrs[] 
= {
.end= 0x4a0ae000,
.flags  = IORESOURCE_MEM,
},
-   {
-   /* XXX: Remove this once control module driver is in place */
-   .name   = "ctrl_dev",
-   .start  = 0x4a002300,
-   .end= 0x4a002303,
-   .flags  = IORESOURCE_MEM,
-   },
{ }
 };
 
@@ -6156,12 +6149,6 @@ static struct omap_hwmod_addr_space 
omap44xx_usb_otg_hs_addrs[] = {
.pa_end = 0x4a0ab7ff,
.flags  = ADDR_TYPE_RT
},
-   {
-   /* XXX: Remove this once control module driver is in place */
-   .pa_start   = 0x4a00233c,
-   .pa_end = 0x4a00233f,
-   .flags  = ADDR_TYPE_RT
-   },
{ }
 };
 
-- 
1.7.10.4

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


[PATCH 2/5] ARM: OMAP: devices: create device for usb part of control module

2013-02-05 Thread Kishon Vijay Abraham I
A seperate driver has been added to handle the usb part of control
module. A device for the above driver is created here, using the register
address information to be used by the driver for powering on the PHY and
for writing to the mailbox.

Signed-off-by: Kishon Vijay Abraham I 
Acked-by: Tony Lindgren 
---
 arch/arm/mach-omap2/devices.c |   45 +
 1 file changed, 45 insertions(+)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 626f3ea..6cda103 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -254,6 +255,49 @@ static inline void omap_init_camera(void)
 #endif
 }
 
+#if IS_ENABLED(CONFIG_OMAP_CONTROL_USB)
+static struct omap_control_usb_platform_data omap4_control_usb_pdata = {
+   .type = 1,
+};
+
+struct resource omap4_control_usb_res[] = {
+   {
+   .name   = "control_dev_conf",
+   .start  = 0x4a002300,
+   .end= 0x4a002303,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .name   = "otghs_control",
+   .start  = 0x4a00233c,
+   .end= 0x4a00233f,
+   .flags  = IORESOURCE_MEM,
+   },
+};
+
+static struct platform_device omap4_control_usb = {
+   .name   = "omap-control-usb",
+   .id = -1,
+   .dev = {
+   .platform_data = &omap4_control_usb_pdata,
+   },
+   .num_resources = 2,
+   .resource = omap4_control_usb_res,
+};
+
+static inline void __init omap_init_control_usb(void)
+{
+   if (!cpu_is_omap44xx())
+   return;
+
+   if (platform_device_register(&omap4_control_usb))
+   pr_err("Error registering omap_control_usb device\n");
+}
+
+#else
+static inline void omap_init_control_usb(void) { }
+#endif /* CONFIG_OMAP_CONTROL_USB */
+
 int __init omap4_keyboard_init(struct omap4_keypad_platform_data
*sdp4430_keypad_data, struct omap_board_data *bdata)
 {
@@ -721,6 +765,7 @@ static int __init omap2_init_devices(void)
omap_init_mbox();
/* If dtb is there, the devices will be created dynamically */
if (!of_have_populated_dt()) {
+   omap_init_control_usb();
omap_init_dmic();
omap_init_mcpdm();
omap_init_mcspi();
-- 
1.7.10.4

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


[PATCH 0/5] ARM: OMAP: arm part of usb patches

2013-02-05 Thread Kishon Vijay Abraham I
Hi Greg,

Here is the patch series that includes the arch/arm part to get MUSB
working in OMAP platforms. As discussed in the other mail thread with
Tony, this patch series should go into usb-next.

This patch series also contains a patch by Felipe to fix compilation
warning in usb-next when CONFIG_OMAP_CONTROL_USB is not set.

Boot tested panda board.

Felipe Balbi (1):
  usb: omap_control_usb: fix compile warning

Kishon Vijay Abraham I (4):
  ARM: OMAP4: remove control module address space from PHY and OTG
  ARM: OMAP: devices: create device for usb part of control module
  ARM: OMAP2: MUSB: Specify omap4 has mailbox
  ARM: OMAP: USB: Add phy binding information

 arch/arm/mach-omap2/board-2430sdp.c  |2 ++
 arch/arm/mach-omap2/board-3430sdp.c  |2 ++
 arch/arm/mach-omap2/board-4430sdp.c  |2 ++
 arch/arm/mach-omap2/board-cm-t35.c   |2 ++
 arch/arm/mach-omap2/board-devkit8000.c   |2 ++
 arch/arm/mach-omap2/board-igep0020.c |2 ++
 arch/arm/mach-omap2/board-ldp.c  |2 ++
 arch/arm/mach-omap2/board-omap3beagle.c  |2 ++
 arch/arm/mach-omap2/board-omap3evm.c |2 ++
 arch/arm/mach-omap2/board-omap3logic.c   |2 ++
 arch/arm/mach-omap2/board-omap3pandora.c |2 ++
 arch/arm/mach-omap2/board-omap3stalker.c |2 ++
 arch/arm/mach-omap2/board-omap3touchbook.c   |2 ++
 arch/arm/mach-omap2/board-omap4panda.c   |2 ++
 arch/arm/mach-omap2/board-overo.c|2 ++
 arch/arm/mach-omap2/board-rm680.c|2 ++
 arch/arm/mach-omap2/board-zoom-peripherals.c |2 ++
 arch/arm/mach-omap2/devices.c|   45 ++
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c   |   13 
 arch/arm/mach-omap2/usb-musb.c   |3 ++
 include/linux/usb/musb.h |2 ++
 include/linux/usb/omap_control_usb.h |2 +-
 22 files changed, 85 insertions(+), 14 deletions(-)

-- 
1.7.10.4

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


[PATCH 5/5] usb: omap_control_usb: fix compile warning

2013-02-05 Thread Kishon Vijay Abraham I
From: Felipe Balbi 

When CONFIG_OMAP_CONTROL_USB isn't enabled,
there's a compile warning stating that a
particular function isn't a prototype.

Fix it.

Signed-off-by: Felipe Balbi 
Signed-off-by: Kishon Vijay Abraham I 
---
 include/linux/usb/omap_control_usb.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/usb/omap_control_usb.h 
b/include/linux/usb/omap_control_usb.h
index f306db7..27b5b8c 100644
--- a/include/linux/usb/omap_control_usb.h
+++ b/include/linux/usb/omap_control_usb.h
@@ -70,7 +70,7 @@ extern void omap_control_usb3_phy_power(struct device *dev, 
bool on);
 extern void omap_control_usb_set_mode(struct device *dev,
enum omap_control_usb_mode mode);
 #else
-static inline struct device *omap_get_control_dev()
+static inline struct device *omap_get_control_dev(void)
 {
return ERR_PTR(-ENODEV);
 }
-- 
1.7.10.4

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


[PATCH 4/5] ARM: OMAP: USB: Add phy binding information

2013-02-05 Thread Kishon Vijay Abraham I
This is w.r.t the changes in PHY library to support adding and getting
multiple PHYs of the same type. In the new design, the
binding information between the PHY and the USB controller should be
specified in the platform specific initialization code. So it's been
done here for OMAP platforms.

Signed-off-by: Kishon Vijay Abraham I 
Acked-by: Tony Lindgren 
---
 arch/arm/mach-omap2/board-2430sdp.c  |2 ++
 arch/arm/mach-omap2/board-3430sdp.c  |2 ++
 arch/arm/mach-omap2/board-4430sdp.c  |2 ++
 arch/arm/mach-omap2/board-cm-t35.c   |2 ++
 arch/arm/mach-omap2/board-devkit8000.c   |2 ++
 arch/arm/mach-omap2/board-igep0020.c |2 ++
 arch/arm/mach-omap2/board-ldp.c  |2 ++
 arch/arm/mach-omap2/board-omap3beagle.c  |2 ++
 arch/arm/mach-omap2/board-omap3evm.c |2 ++
 arch/arm/mach-omap2/board-omap3logic.c   |2 ++
 arch/arm/mach-omap2/board-omap3pandora.c |2 ++
 arch/arm/mach-omap2/board-omap3stalker.c |2 ++
 arch/arm/mach-omap2/board-omap3touchbook.c   |2 ++
 arch/arm/mach-omap2/board-omap4panda.c   |2 ++
 arch/arm/mach-omap2/board-overo.c|2 ++
 arch/arm/mach-omap2/board-rm680.c|2 ++
 arch/arm/mach-omap2/board-zoom-peripherals.c |2 ++
 17 files changed, 34 insertions(+)

diff --git a/arch/arm/mach-omap2/board-2430sdp.c 
b/arch/arm/mach-omap2/board-2430sdp.c
index 4815ea6..1337f2c 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -263,6 +264,7 @@ static void __init omap_2430sdp_init(void)
omap_hsmmc_init(mmc);
 
omap_mux_init_signal("usb0hs_stp", OMAP_PULL_ENA | OMAP_PULL_UP);
+   usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
usb_musb_init(NULL);
 
board_smc91x_init();
diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index bb73afc..8a2e242 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -579,6 +580,7 @@ static void __init omap_3430sdp_init(void)
omap_ads7846_init(1, gpio_pendown, 310, NULL);
omap_serial_init();
omap_sdrc_init(hyb18m512160af6_sdrc_params, NULL);
+   usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
usb_musb_init(NULL);
board_smc91x_init();
board_flash_init(sdp_flash_partitions, chip_sel_3430, 0);
diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index 1cc6696..8e8efcc 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -696,6 +697,7 @@ static void __init omap_4430sdp_init(void)
omap4_sdp4430_wifi_init();
omap4_twl6030_hsmmc_init(mmc);
 
+   usb_bind_phy("musb-hdrc.0.auto", 0, "omap-usb2.1.auto");
usb_musb_init(&musb_board_data);
 
status = omap_ethernet_init();
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index b3102c2..f1172f2 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -724,6 +725,7 @@ static void __init cm_t3x_common_init(void)
cm_t35_init_display();
omap_twl4030_audio_init("cm-t3x");
 
+   usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
usb_musb_init(NULL);
cm_t35_init_usbh();
cm_t35_init_camera();
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index 12865af..77cade52 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -622,6 +623,7 @@ static void __init devkit8000_init(void)
 
omap_ads7846_init(2, OMAP3_DEVKIT_TS_GPIO, 0, NULL);
 
+   usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
usb_musb_init(NULL);
usbhs_init(&usbhs_bdata);
board_nand_init(devkit8000_nand_partitions,
diff --git a/arch/arm/mach-omap2/board-igep0020.c 
b/arch/arm/mach-omap2/board-igep0020.c
index 0f24cb8..15e5881 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -625,6 +626,7 @@ static void __init igep_init(void)
omap_serial_init();
omap_sdrc_init(m65kam_sdrc_params,
  m65kam_sdrc_params);
+   usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
usb_musb_init(NULL);
 
igep_flash_init();
diff --git a/arch/arm/mach-omap2/board-ldp.c b/

RE: [GIT PULL] ARM part of USB patches

2013-02-05 Thread Hiremath, Vaibhav
On Tue, Feb 05, 2013 at 23:49:47, Tony Lindgren wrote:
> * gre...@linuxfoundation.org  [130205 09:28]:
> > On Tue, Feb 05, 2013 at 08:56:13PM +0530, kishon wrote:
> > > Hi Tony, Greg,
> > > 
> > > On Tuesday 05 February 2013 08:54 PM, kishon wrote:
> > > >Hi Tony,
> > > >
> > > >As discussed, I'm sending a pull request for the arch/arm part of my USB
> > > >patches. These patches are necessary to get MUSB functional in both dt
> > > >and non-dt boot. Also added dt data for dwc3 present in OMAP. This patch
> > > >series *depends* on some of the patches which are merged in usb-next.
> > > 
> > > This patch series should go in only after USB. Or else it will break
> > > compilation.
> > 
> > Then it probably should go through the USB tree, right?  We don't want
> > to break bisectability.
> 
> Looks like this branch needs to be based on at least 01658f0f (usb: phy:
> add a new driver for usb part of control module) to compile. Probably
> needs other USB patches too to make sense.
> 
> This branch has a high likelihood of conflicting with .dts files, so
> Kishon, I suggest you do two branches:
> 
> 1. A branch for Greg based on top of the USB changes
> 
>This branch should contain:
> 
>ARM: OMAP4: remove control module address space from PHY and OTG
>ARM: OMAP: devices: create device for usb part of control module
>ARM: OMAP2: MUSB: Specify omap4 has mailbox
>ARM: OMAP: USB: Add phy binding information
> 
>Naturally please make sure they compile and boot on their own.
>Looks like this will only cause few trivial include merge conflicts
>with what I have queued up.
> 
>You can add my Acked-by: Tony Lindgren  for those.
> 
> 2. A branch for Benoit based on v3.8-rc6
> 
>That branch should contain all the .dts changes as those will
>most likely cause nasty merge conflicts otherwise with what
>Benoit has queued up.
> 

Tony/Benoit,

There are few AM33xx DTS patches pending from long time, how do you want to 
take it forward? You want me to put it into one branch and share? OR just 
provide the list of all patches to you?

Thanks,
Vaibhav
> Regards,
> 
> Tony
> ___
> devicetree-discuss mailing list
> devicetree-disc...@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
> 

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


Re: Linux USB file storage gadget with new UDC

2013-02-05 Thread victor yeo
Hi,

>> Thanks, i added in UDC driver to call bulk_in_complete for every
>> request over a bulk in ep, now the gadget driver is able to process
>> the SCSI Inquiry command. When it comes to SCSI Read Format Capacities
>> command, the gadget driver gives attention condition error in
>> check_command() in the code snippet below, and the command is not
>> processed by do_read_format_capacities().
>>
>> if (curlun && curlun->unit_attention_data != SS_NO_SENSE &&
>> fsg->cmnd[0] != INQUIRY &&
>> fsg->cmnd[0] != REQUEST_SENSE) {
>> curlun->sense_data = curlun->unit_attention_data;
>> curlun->unit_attention_data = SS_NO_SENSE;
>> return -EINVAL;
>> }
>>
>> Besides the code snippet, the only place that sets unit_attention data
>> to SS_NO_SENSE is in handle_exception(). How is UDC driver able to
>> overcome this problem?
>
> What problem?  This all sounds perfectly normal.
>
> Maybe you should post the kernel debugging log.
>

The problem is READ FORMAT CAPACITIES command is not processed, and no
reply is sent back in response to the command.

the kernel log does not show any error that is related to SCSI commands.

thanks,
victor
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 12/15] USB: gadget/freescale: disable non-multiplatform drivers

2013-02-05 Thread Greg Kroah-Hartman
On Tue, Feb 05, 2013 at 10:54:00PM +, Arnd Bergmann wrote:
> On Tuesday 05 February 2013, Felipe Balbi wrote:
> > [linus/master] Merge branch 'fix-max-write' of 
> > git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm
> > 
> > It's building find for me:
> > 
> > $ crossmake drivers/usb/gadget/fsl_udc_core.o \
> > drivers/usb/gadget/fsl_mxc_udc.o > /dev/null
> > 
> > (crossmake is an alias to make ARCH=arm)
> > 
> > Arnd, are you maybe missing a merge of v3.8-rc6 ?
> >
> > I can see that imx_udc.c is broken still, but there are no maintainers
> > for that driver. I'm adding Sascha to Cc list, maybe he knows someone
> > who can help, but if this driver isn't fixed in 2 merge windows, I will
> > schedule for removal from tree and someone else will have to
> > re-introduce it later without all the bogus includes.
> 
> Ah, I see what happened now: I submitted a patch that lumped together
> two patches, disabling both fsl_mxc_udc and imx_udc. You already had
> a fix for the first one, so I dropped my patch, but now I see the
> build error for the second one that my patch was avoiding.
> 
> The last patch to imx_udc that seems to have seen more than just
> build testing was probably "USB: gadget: imx_udc: don't queue more
> data when zlp is to be sent", while fsl_mxc_udc looks actively
> maintained. It's not completely clear to me whether these
> are actually two drivers for the same hardware, of whether
> imx_udc is the i.mx1 variant and fsl_mxc_udc is the i.mx2 variant.
> 
> What I can say is that no platform in the kernel currently defines
> an "imx_udc" platform_device, so it is certainly unused, and has
> been since at least e08300043e in 2010.
> 
> I would suggest that we mark the imx_udc driver as 'depends on
> BROKEN' right away, since no in-tree user needs it, and any
> out of tree user is already broken in 3.8. I also wouldn't
> mind removing the driver unless the imx maintainers have
> a plan for it.

Sure, someone just send me a patch for that and I'll be glad to mark it
BROKEN.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 12/15] USB: gadget/freescale: disable non-multiplatform drivers

2013-02-05 Thread Arnd Bergmann
On Tuesday 05 February 2013, Felipe Balbi wrote:
> [linus/master] Merge branch 'fix-max-write' of 
> git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm
> 
> It's building find for me:
> 
> $ crossmake drivers/usb/gadget/fsl_udc_core.o \
> drivers/usb/gadget/fsl_mxc_udc.o > /dev/null
> 
> (crossmake is an alias to make ARCH=arm)
> 
> Arnd, are you maybe missing a merge of v3.8-rc6 ?
>
> I can see that imx_udc.c is broken still, but there are no maintainers
> for that driver. I'm adding Sascha to Cc list, maybe he knows someone
> who can help, but if this driver isn't fixed in 2 merge windows, I will
> schedule for removal from tree and someone else will have to
> re-introduce it later without all the bogus includes.

Ah, I see what happened now: I submitted a patch that lumped together
two patches, disabling both fsl_mxc_udc and imx_udc. You already had
a fix for the first one, so I dropped my patch, but now I see the
build error for the second one that my patch was avoiding.

The last patch to imx_udc that seems to have seen more than just
build testing was probably "USB: gadget: imx_udc: don't queue more
data when zlp is to be sent", while fsl_mxc_udc looks actively
maintained. It's not completely clear to me whether these
are actually two drivers for the same hardware, of whether
imx_udc is the i.mx1 variant and fsl_mxc_udc is the i.mx2 variant.

What I can say is that no platform in the kernel currently defines
an "imx_udc" platform_device, so it is certainly unused, and has
been since at least e08300043e in 2010.

I would suggest that we mark the imx_udc driver as 'depends on
BROKEN' right away, since no in-tree user needs it, and any
out of tree user is already broken in 3.8. I also wouldn't
mind removing the driver unless the imx maintainers have
a plan for it.

>  build breaks ---
> 
> sound/soc/fsl/imx-pcm.c: In function 'snd_imx_pcm_mmap':
> sound/soc/fsl/imx-pcm.c:28:2: error: 'KBUILD_MODNAME' undeclared (first use 
> in this function)
> sound/soc/fsl/imx-pcm.c:28:2: note: each undeclared identifier is
> reported only once for each function it appears in
> make[3]: *** [sound/soc/fsl/imx-pcm.o] Error 1
> 
> drivers/video/omap2/dss/dss.c: In function 'dss_calc_clock_div':
> drivers/video/omap2/dss/dss.c:572:20: error:
> 'CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK' undeclared (first use in this function)
> drivers/video/omap2/dss/dss.c:572:20: note: each undeclared identifier
> is reported only once for each function it appears in
> make[4]: *** [drivers/video/omap2/dss/dss.o] Error 1

Yes, I submitted patches for these, too, and like this case, we decided
to drop my patch in favor of a better fix, which has not yet gone
in. Today I sent emails about these as well, in the hope that we
can find a solution.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 12/15] USB: gadget/freescale: disable non-multiplatform drivers

2013-02-05 Thread Felipe Balbi
Hi,

On Tue, Feb 05, 2013 at 09:00:27AM -0800, Greg Kroah-Hartman wrote:
> On Tue, Feb 05, 2013 at 04:27:18PM +, Arnd Bergmann wrote:
> > On Monday 21 January 2013, Greg Kroah-Hartman wrote:
> > > On Mon, Jan 21, 2013 at 08:41:38PM +0200, Felipe Balbi wrote:
> > > > Hi,
> > > > 
> > > > On Mon, Jan 21, 2013 at 05:16:05PM +, Arnd Bergmann wrote:
> > > > > Both the fsl_mxc gadget and the imx_udc gadget drivers fail to build
> > > > > without the mach/hardware.h file that is not available when building
> > > > > for multiplatform. Let's disable these drivers for v3.8 in combination
> > > > > with CONFIG_ARCH_MULTIPLATFORM, and fix them properly in v3.9 unless
> > > > > someone has an better solution.
> > > > > 
> > > > > Without this patch, building allyesconfig results in:
> > > > > 
> > > > > drivers/usb/gadget/fsl_mxc_udc.c:21:27: fatal error: mach/hardware.h: 
> > > > > No such file or directory
> > > > > 
> > > > > Signed-off-by: Arnd Bergmann 
> > > > > Cc: Felipe Balbi 
> > > > > Cc: Shawn Guo 
> > > > > Cc: Greg Kroah-Hartman 
> > > > > Cc: linux-usb@vger.kernel.org
> > > > 
> > > > NAK, I prefer to see a real fix for the problem (which in fact is
> > > > already in my fixes branch).
> > > 
> > > I'll pull that branch now, sorry for the delay.
> > 
> > Apparently it hasn't made it into the upstream kernel yet, and it also 
> > doesn't
> > seem to be in linux-next. Maybe this got lost while you were travelling?
> 
> Hm, no, I thought I got Felipe's fixes branch up into Linus's tree
> already.  Felipe, did I miss something from you?  If so, please resend
> or let me know, as I don't have anything pending on my side.

I don't have anything pending in my fixes branch:

$ git log fixes ^linus/master

$ git show-branch linus/master
[linus/master] Merge branch 'fix-max-write' of 
git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm

It's building find for me:

$ crossmake drivers/usb/gadget/fsl_udc_core.o \
drivers/usb/gadget/fsl_mxc_udc.o > /dev/null

(crossmake is an alias to make ARCH=arm)

Arnd, are you maybe missing a merge of v3.8-rc6 ?

I can see that imx_udc.c is broken still, but there are no maintainers
for that driver. I'm adding Sascha to Cc list, maybe he knows someone
who can help, but if this driver isn't fixed in 2 merge windows, I will
schedule for removal from tree and someone else will have to
re-introduce it later without all the bogus includes.

 build breaks ---

sound/soc/fsl/imx-pcm.c: In function 'snd_imx_pcm_mmap':
sound/soc/fsl/imx-pcm.c:28:2: error: 'KBUILD_MODNAME' undeclared (first use in 
this function)
sound/soc/fsl/imx-pcm.c:28:2: note: each undeclared identifier is
reported only once for each function it appears in
make[3]: *** [sound/soc/fsl/imx-pcm.o] Error 1

drivers/video/omap2/dss/dss.c: In function 'dss_calc_clock_div':
drivers/video/omap2/dss/dss.c:572:20: error:
'CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK' undeclared (first use in this function)
drivers/video/omap2/dss/dss.c:572:20: note: each undeclared identifier
is reported only once for each function it appears in
make[4]: *** [drivers/video/omap2/dss/dss.o] Error 1

-- 
balbi


signature.asc
Description: Digital signature


Re: [-next-20130204] usb/hcd: irq 18: nobody cared

2013-02-05 Thread Alan Stern
On Tue, 5 Feb 2013, Peter Hurley wrote:

> With -next-20130204:
> 
> [   33.855570] irq 18: nobody cared (try booting with the "irqpoll" option)
> [   33.855580] Pid: 0, comm: swapper/4 Not tainted 3.8.0-next-20130204-xeon 
> #20130204
> [   33.855582] Call Trace:
> [   33.855585][] __report_bad_irq+0x36/0xe0
> [   33.855600]  [] note_interrupt+0x1aa/0x200
> [   33.855606]  [] ? mwait_idle+0x82/0x1b0
> [   33.855610]  [] handle_irq_event_percpu+0xc9/0x260
> [   33.855614]  [] handle_irq_event+0x48/0x70
> [   33.855618]  [] handle_fasteoi_irq+0x5a/0x100
> [   33.855624]  [] handle_irq+0x22/0x40
> [   33.855630]  [] do_IRQ+0x5a/0xd0
> [   33.855636]  [] common_interrupt+0x6d/0x6d
> [   33.855638][] ? rcu_eqs_enter_common+0x4a/0x320
> [   33.855646]  [] ? mwait_idle+0x82/0x1b0
> [   33.855649]  [] ? mwait_idle+0x29/0x1b0
> [   33.855653]  [] cpu_idle+0x116/0x130
> [   33.855658]  [] start_secondary+0x251/0x258
> [   33.855660] handlers:
> [   33.855664] [] usb_hcd_irq
> [   33.855667] Disabling IRQ #18
> 
> From earlier in the boot log:
> [1.297020] uhci_hcd :00:1d.2: setting latency timer to 64
> [1.297032] uhci_hcd :00:1d.2: UHCI Host Controller
> [1.297040] uhci_hcd :00:1d.2: new USB bus registered, assigned bus 
> number 4
> [1.297076] uhci_hcd :00:1d.2: irq 18, io base 0xff40
> [1.297213] hub 4-0:1.0: USB hub found
> [1.297221] hub 4-0:1.0: 2 ports detected
> 
> lsusb:
> ...
> Bus 004 Device 002: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
> Bus 004 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
> ...
> 
> Didn't have this problem with -next-20120125. One of these commits, maybe?
> next/drivers/usb/core$ git log --oneline next-20130125..next-20130204 -- *
> 2c2e865 usb: forbid memory allocation with I/O during bus reset
> e9121a8 Merge remote-tracking branch 'usb/usb-next'
> 3b2ab2b Revert "usb: Register usb port's acpi power resources"
> da0aa71 USB: add usb_hcd_{start,end}_port_resume
> 192fef1 usb: enable usb port device's async suspend.
> f6cced1 usb: expose usb port's pm qos flags to user space
> ad493e5 usb: add usb port auto power off mechanism
> 971fcd4 usb: add runtime pm support for usb port device
> 88bb965 usb: Register usb port's acpi power resources
> 54a3ac0 usb: Using correct way to clear usb3.0 device's remote wakeup feature.

None of those commits seems likely to have caused the problem.  The 
most likely is da0aa71, combined with one you didn't mention:

840008bb USB: UHCI: notify usbcore about port resumes

If you revert these two commits, does that make any difference?  What
if you revert all of these commits?

> I didn't see any changes in the drivers/hid/hid-logitech-dj.c or usbhid
> but maybe it's doing something wrong anyway?
> 
> I'll open a bugzilla if a bunch more info is necessary.

If the suggestion above doesn't work out, bisection may be the best way
to find the answer.

Alan Stern

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


[-next-20130204] usb/hcd: irq 18: nobody cared

2013-02-05 Thread Peter Hurley
With -next-20130204:

[   33.855570] irq 18: nobody cared (try booting with the "irqpoll" option)
[   33.855580] Pid: 0, comm: swapper/4 Not tainted 3.8.0-next-20130204-xeon 
#20130204
[   33.855582] Call Trace:
[   33.855585][] __report_bad_irq+0x36/0xe0
[   33.855600]  [] note_interrupt+0x1aa/0x200
[   33.855606]  [] ? mwait_idle+0x82/0x1b0
[   33.855610]  [] handle_irq_event_percpu+0xc9/0x260
[   33.855614]  [] handle_irq_event+0x48/0x70
[   33.855618]  [] handle_fasteoi_irq+0x5a/0x100
[   33.855624]  [] handle_irq+0x22/0x40
[   33.855630]  [] do_IRQ+0x5a/0xd0
[   33.855636]  [] common_interrupt+0x6d/0x6d
[   33.855638][] ? rcu_eqs_enter_common+0x4a/0x320
[   33.855646]  [] ? mwait_idle+0x82/0x1b0
[   33.855649]  [] ? mwait_idle+0x29/0x1b0
[   33.855653]  [] cpu_idle+0x116/0x130
[   33.855658]  [] start_secondary+0x251/0x258
[   33.855660] handlers:
[   33.855664] [] usb_hcd_irq
[   33.855667] Disabling IRQ #18

>From earlier in the boot log:
[1.297020] uhci_hcd :00:1d.2: setting latency timer to 64
[1.297032] uhci_hcd :00:1d.2: UHCI Host Controller
[1.297040] uhci_hcd :00:1d.2: new USB bus registered, assigned bus 
number 4
[1.297076] uhci_hcd :00:1d.2: irq 18, io base 0xff40
[1.297213] hub 4-0:1.0: USB hub found
[1.297221] hub 4-0:1.0: 2 ports detected

lsusb:
...
Bus 004 Device 002: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
Bus 004 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
...

Didn't have this problem with -next-20120125. One of these commits, maybe?
next/drivers/usb/core$ git log --oneline next-20130125..next-20130204 -- *
2c2e865 usb: forbid memory allocation with I/O during bus reset
e9121a8 Merge remote-tracking branch 'usb/usb-next'
3b2ab2b Revert "usb: Register usb port's acpi power resources"
da0aa71 USB: add usb_hcd_{start,end}_port_resume
192fef1 usb: enable usb port device's async suspend.
f6cced1 usb: expose usb port's pm qos flags to user space
ad493e5 usb: add usb port auto power off mechanism
971fcd4 usb: add runtime pm support for usb port device
88bb965 usb: Register usb port's acpi power resources
54a3ac0 usb: Using correct way to clear usb3.0 device's remote wakeup feature.

I didn't see any changes in the drivers/hid/hid-logitech-dj.c or usbhid
but maybe it's doing something wrong anyway?

I'll open a bugzilla if a bunch more info is necessary.

Regards,
Peter Hurley



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


Re: [GIT PULL] ARM part of USB patches

2013-02-05 Thread gre...@linuxfoundation.org
On Tue, Feb 05, 2013 at 10:19:47AM -0800, Tony Lindgren wrote:
> * gre...@linuxfoundation.org  [130205 09:28]:
> > On Tue, Feb 05, 2013 at 08:56:13PM +0530, kishon wrote:
> > > Hi Tony, Greg,
> > > 
> > > On Tuesday 05 February 2013 08:54 PM, kishon wrote:
> > > >Hi Tony,
> > > >
> > > >As discussed, I'm sending a pull request for the arch/arm part of my USB
> > > >patches. These patches are necessary to get MUSB functional in both dt
> > > >and non-dt boot. Also added dt data for dwc3 present in OMAP. This patch
> > > >series *depends* on some of the patches which are merged in usb-next.
> > > 
> > > This patch series should go in only after USB. Or else it will break
> > > compilation.
> > 
> > Then it probably should go through the USB tree, right?  We don't want
> > to break bisectability.
> 
> Looks like this branch needs to be based on at least 01658f0f (usb: phy:
> add a new driver for usb part of control module) to compile. Probably
> needs other USB patches too to make sense.
> 
> This branch has a high likelihood of conflicting with .dts files, so
> Kishon, I suggest you do two branches:
> 
> 1. A branch for Greg based on top of the USB changes
> 
>This branch should contain:
> 
>ARM: OMAP4: remove control module address space from PHY and OTG
>ARM: OMAP: devices: create device for usb part of control module
>ARM: OMAP2: MUSB: Specify omap4 has mailbox
>ARM: OMAP: USB: Add phy binding information
> 
>Naturally please make sure they compile and boot on their own.
>Looks like this will only cause few trivial include merge conflicts
>with what I have queued up.
> 
>You can add my Acked-by: Tony Lindgren  for those.

If that happens, please send me patches in email, I don't take git
pull requests, especially for something as small as 4 patches.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] usb: phy: Add USB host phy support on Exyno4412

2013-02-05 Thread Dongjin Kim
Hello Praveen,

Thank you for reviewing.
I was also considered to use TYPE_4X12, but in some other thread some
people prefer to use 4412 instead of 4X12 because no 4212 based
hardware yet. :)
Anyway, TYPE_4X12 is also fine to me.

And as you pointed out about PHY0, while testing my patch with my
hardware I also wondered why PHY0 has to be enabled. Unless USBPHY its
status was monitored as "halted" it didn't work at all. Now I find the
reason that the first is power for USB block is wrong (not stable) and
the second is when the hardware is initialized at first, like power
up, URSTCON's initial value is 0x79, which means HSIC0, HSIC1, PHY1
and OTG is in reset state. So it has to be released before USB starts.
So I am finding the good place to initiate URSTCON properly, u-boot or
kernel itself.

Do you have any advice on this?

Thank you again.
Dongjin.

On Tue, Feb 5, 2013 at 11:38 PM, Praveen Paneri  wrote:
>
> Hi,
>
> On Tue, Feb 5, 2013 at 6:55 AM, Dongjin Kim  wrote:
> > This patch adds host phy support for Samsung's Exynos4412 SoC to
> > samsung-usbphy driver. This patch is created upon
> > "http://git.kernel.org/?p=linux/kernel/git/balbi/usb.git;a=commit;h=2564b526b8cf01e6c36285edfd40a438e683c2b8";
> >
> > Cc: Praveen Paneri 
> > Signed-off-by: Dongjin Kim 
> > ---
> >  drivers/usb/phy/samsung-usbphy.c |  156
> > +-
> >  1 file changed, 154 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/usb/phy/samsung-usbphy.c
> > b/drivers/usb/phy/samsung-usbphy.c
> > index 6ea5537..c800fa4 100644
> > --- a/drivers/usb/phy/samsung-usbphy.c
> > +++ b/drivers/usb/phy/samsung-usbphy.c
> > @@ -47,7 +47,7 @@
> >
> >  #define PHYCLK_MODE_USB11  (0x1 << 6)
> >  #define PHYCLK_EXT_OSC (0x1 << 5)
> > -#define PHYCLK_COMMON_ON_N (0x1 << 4)
> > +#define PHYCLK_COMMON_ON_N_PHY0(0x1 << 4)
> >  #define PHYCLK_ID_PULL (0x1 << 2)
> >  #define PHYCLK_CLKSEL_MASK (0x3 << 0)
> >  #define PHYCLK_CLKSEL_48M  (0x0 << 0)
> > @@ -60,6 +60,22 @@
> >  #define RSTCON_HLINK_SWRST (0x1 << 1)
> >  #define RSTCON_SWRST   (0x1 << 0)
> >
> > +/* For Exynos4412 */
> > +#define PHYCLK_COMMON_ON_N_PHY1(0x1 << 7)
> > +
> > +#define PHYPWR_NORMAL_MASK_HSIC1   (0x7 << 12)
> > +#define PHYPWR_NORMAL_MASK_HSIC0   (0x7 << 9)
> > +#define PHYPWR_NORMAL_MASK_PHY1(0x7 << 6)
> > +
> > +#define PHYPWR_ANALOG_POWERDOWN_PHY1   (0x1 << 7)
> > +
> > +#define RSTCON_HLINK_SWRST_MASK(0xf << 7)
> > +#define RSTCON_PHY1_SWRST_MASK (0xf << 3)
> > +#define RSTCON_PHY0_SWRST_MASK (0x7 << 0)
> > +
> > +#define EXYNOS4_PHY_HSIC_CTRL0 (0x04)
> > +#define EXYNOS4_PHY_HSIC_CTRL1 (0x08)
> > +
> >  /* EXYNOS5 */
> >  #define EXYNOS5_PHY_HOST_CTRL0 (0x00)
> >
> > @@ -174,6 +190,7 @@
> >  enum samsung_cpu_type {
> > TYPE_S3C64XX,
> > TYPE_EXYNOS4210,
> > +   TYPE_EXYNOS4412,
> Shouldn't you add it under the TYPE_EXYNOS4X12. We will have to add a
> separate support for 4212 then.
> > TYPE_EXYNOS5250,
> >  };
> >
> > @@ -322,6 +339,17 @@ static void samsung_usbphy_set_isolation(struct
> > samsung_usbphy *sphy, bool on)
> > en_mask = sphy->drv_data->hostphy_en_mask;
> > }
> > break;
> > +   case TYPE_EXYNOS4412:
> > +   if (sphy->phy_type == USB_PHY_TYPE_DEVICE) {
> > +   reg = sphy->pmuregs +
> > +   sphy->drv_data->devphy_reg_offset;
> > +   en_mask = sphy->drv_data->devphy_en_mask;
> > +   } else if (sphy->phy_type == USB_PHY_TYPE_HOST) {
> > +   reg = sphy->pmuregs +
> > +   sphy->drv_data->hostphy_reg_offset;
> > +   en_mask = sphy->drv_data->hostphy_en_mask;
> > +   }
> > +   break;
> > default:
> > dev_err(sphy->dev, "Invalid SoC type\n");
> > return;
> > @@ -422,6 +450,29 @@ static int samsung_usbphy_get_refclk_freq(struct
> > samsung_usbphy *sphy)
> > refclk_freq = FSEL_CLKSEL_24M;
> > break;
> > }
> > +   } else if (sphy->drv_data->cpu_type == TYPE_EXYNOS4412) {
> > +   switch (clk_get_rate(ref_clk)) {
> > +   case 9600 * KHZ:
> > +   refclk_freq = FSEL_CLKSEL_9600K;
> > +   break;
> > +   case 10 * MHZ:
> > +   refclk_freq = FSEL_CLKSEL_10M;
> > +   break;
> > +   case 12 * MHZ:
> > +   refclk_freq = FSEL_CLKSEL_12M;
> > +   

Re: [GIT PULL] ARM part of USB patches

2013-02-05 Thread Tony Lindgren
* gre...@linuxfoundation.org  [130205 09:28]:
> On Tue, Feb 05, 2013 at 08:56:13PM +0530, kishon wrote:
> > Hi Tony, Greg,
> > 
> > On Tuesday 05 February 2013 08:54 PM, kishon wrote:
> > >Hi Tony,
> > >
> > >As discussed, I'm sending a pull request for the arch/arm part of my USB
> > >patches. These patches are necessary to get MUSB functional in both dt
> > >and non-dt boot. Also added dt data for dwc3 present in OMAP. This patch
> > >series *depends* on some of the patches which are merged in usb-next.
> > 
> > This patch series should go in only after USB. Or else it will break
> > compilation.
> 
> Then it probably should go through the USB tree, right?  We don't want
> to break bisectability.

Looks like this branch needs to be based on at least 01658f0f (usb: phy:
add a new driver for usb part of control module) to compile. Probably
needs other USB patches too to make sense.

This branch has a high likelihood of conflicting with .dts files, so
Kishon, I suggest you do two branches:

1. A branch for Greg based on top of the USB changes

   This branch should contain:

   ARM: OMAP4: remove control module address space from PHY and OTG
   ARM: OMAP: devices: create device for usb part of control module
   ARM: OMAP2: MUSB: Specify omap4 has mailbox
   ARM: OMAP: USB: Add phy binding information

   Naturally please make sure they compile and boot on their own.
   Looks like this will only cause few trivial include merge conflicts
   with what I have queued up.

   You can add my Acked-by: Tony Lindgren  for those.

2. A branch for Benoit based on v3.8-rc6

   That branch should contain all the .dts changes as those will
   most likely cause nasty merge conflicts otherwise with what
   Benoit has queued up.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PATCH] USB fixes for 3.8-rc6

2013-02-05 Thread Greg KH
The following changes since commit 949db153b6466c6f7cad5a427ecea94985927311:

  Linux 3.8-rc5 (2013-01-25 11:57:28 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/ tags/usb-3.8-rc6

for you to fetch changes up to 200e0d994d9d1919b28c87f1a5fb99a8e13b8a0f:

  USB: storage: optimize to match the Huawei USB storage devices and support 
new switch command (2013-02-04 10:41:40 -0800)


USB fixes for 3.8-rc6

Here are a few tiny USB fixes for 3.8-rc6.

Nothing major here, some host controller bug fixes to resolve a number
of bugs that people have reported, and a bunch of additional device ids
are added to a number of drivers (which caused code to be deleted from
the usb-storage driver, always nice.)

Signed-off-by: Greg Kroah-Hartman 


Alan Stern (9):
  USB: XHCI: fix memory leak of URB-private data
  USB: EHCI: remove ASS/PSS polling timeout
  USB: EHCI: unlink one async QH at a time
  USB: add usb_hcd_{start,end}_port_resume
  USB: EHCI: notify usbcore about port resumes
  USB: UHCI: notify usbcore about port resumes
  USB: EHCI: fix timer bug affecting port resume
  USB: EHCI: fix for leaking isochronous data
  USB: EHCI: fix bug in scheduling periodic split transfers

Bjørn Mork (1):
  USB: option: add Changhong CH690

Daniele Palmas (2):
  USB: qcserial: add Telit Gobi QDL device
  USB: option: add support for Telit LE920

David Moore (1):
  usb: Prevent dead ports when xhci is not enabled

Greg Kroah-Hartman (1):
  Merge tag 'for-usb-linus-2012-01-24' of 
git://git.kernel.org/.../sarah/xhci into usb-linus

Lan Tianyu (1):
  usb: Using correct way to clear usb3.0 device's remote wakeup feature.

Luis Llorente Campo (1):
  USB: add OWL CM-160 support to cp210x driver

Nickolai Zeldovich (1):
  drivers: xhci: fix incorrect bit test

Petr Kubánek (1):
  USB: ftdi_sio: add Zolix FTDI PID

Sarah Sharp (2):
  xhci: Fix isoc TD encoding.
  xhci: Fix TD size for isochronous URBs.

Sven Killig (1):
  USB: ftdi_sio: add PID/VID entries for ELV WS 300 PC II

fangxiaozhi (2):
  USB: storage: Define a new macro for USB storage match rules
  USB: storage: optimize to match the Huawei USB storage devices and 
support new switch command

 drivers/usb/core/hcd.c |  44 +
 drivers/usb/core/hub.c |  70 ++--
 drivers/usb/host/ehci-hcd.c|   1 +
 drivers/usb/host/ehci-hub.c|   9 +-
 drivers/usb/host/ehci-q.c  |  50 +++---
 drivers/usb/host/ehci-sched.c  |   9 +-
 drivers/usb/host/ehci-timer.c  |  29 ++--
 drivers/usb/host/pci-quirks.c  |   1 +
 drivers/usb/host/uhci-hub.c|   3 +
 drivers/usb/host/xhci-ring.c   |  13 +-
 drivers/usb/serial/cp210x.c|   1 +
 drivers/usb/serial/ftdi_sio.c  |   2 +
 drivers/usb/serial/ftdi_sio_ids.h  |   9 +-
 drivers/usb/serial/option.c|  13 ++
 drivers/usb/serial/qcserial.c  |   1 +
 drivers/usb/storage/initializers.c |  76 -
 drivers/usb/storage/initializers.h |   4 +-
 drivers/usb/storage/unusual_devs.h | 329 +
 drivers/usb/storage/usb.c  |  12 ++
 drivers/usb/storage/usual-tables.c |  15 ++
 include/linux/usb.h|   2 +
 include/linux/usb/hcd.h|   3 +
 include/uapi/linux/usb/ch9.h   |   6 +
 23 files changed, 310 insertions(+), 392 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] ARM part of USB patches

2013-02-05 Thread gre...@linuxfoundation.org
On Tue, Feb 05, 2013 at 08:56:13PM +0530, kishon wrote:
> Hi Tony, Greg,
> 
> On Tuesday 05 February 2013 08:54 PM, kishon wrote:
> >Hi Tony,
> >
> >As discussed, I'm sending a pull request for the arch/arm part of my USB
> >patches. These patches are necessary to get MUSB functional in both dt
> >and non-dt boot. Also added dt data for dwc3 present in OMAP. This patch
> >series *depends* on some of the patches which are merged in usb-next.
> 
> This patch series should go in only after USB. Or else it will break
> compilation.

Then it probably should go through the USB tree, right?  We don't want
to break bisectability.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver

2013-02-05 Thread Tony Lindgren
* Greg KH  [130205 09:00]:
> On Tue, Feb 05, 2013 at 01:28:51PM +0200, Roger Quadros wrote:
> > Hi Tony & Greg,
> > 
> > What's the best way to get these patches in?
> > 
> > All patches have been acked by respective maintainers.
> > 
> > If Tony can Ack the arch/arm/mach-omap2 stuff then should I send a
> > pull request directly to Greg? or the other way round?
> > 
> > Tony, 
> > fyi, these patches should not interfere with the dw3c/musb stuff
> > sent by Felipe & Kishon.
> 
> I'm fine with Tony just taking them all if he wants to.

OK. Roger, can you please do me a pull request with these
against v3.8-rc6?

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 12/15] USB: gadget/freescale: disable non-multiplatform drivers

2013-02-05 Thread Greg Kroah-Hartman
On Tue, Feb 05, 2013 at 04:27:18PM +, Arnd Bergmann wrote:
> On Monday 21 January 2013, Greg Kroah-Hartman wrote:
> > On Mon, Jan 21, 2013 at 08:41:38PM +0200, Felipe Balbi wrote:
> > > Hi,
> > > 
> > > On Mon, Jan 21, 2013 at 05:16:05PM +, Arnd Bergmann wrote:
> > > > Both the fsl_mxc gadget and the imx_udc gadget drivers fail to build
> > > > without the mach/hardware.h file that is not available when building
> > > > for multiplatform. Let's disable these drivers for v3.8 in combination
> > > > with CONFIG_ARCH_MULTIPLATFORM, and fix them properly in v3.9 unless
> > > > someone has an better solution.
> > > > 
> > > > Without this patch, building allyesconfig results in:
> > > > 
> > > > drivers/usb/gadget/fsl_mxc_udc.c:21:27: fatal error: mach/hardware.h: 
> > > > No such file or directory
> > > > 
> > > > Signed-off-by: Arnd Bergmann 
> > > > Cc: Felipe Balbi 
> > > > Cc: Shawn Guo 
> > > > Cc: Greg Kroah-Hartman 
> > > > Cc: linux-usb@vger.kernel.org
> > > 
> > > NAK, I prefer to see a real fix for the problem (which in fact is
> > > already in my fixes branch).
> > 
> > I'll pull that branch now, sorry for the delay.
> 
> Apparently it hasn't made it into the upstream kernel yet, and it also doesn't
> seem to be in linux-next. Maybe this got lost while you were travelling?

Hm, no, I thought I got Felipe's fixes branch up into Linus's tree
already.  Felipe, did I miss something from you?  If so, please resend
or let me know, as I don't have anything pending on my side.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver

2013-02-05 Thread Greg KH
On Tue, Feb 05, 2013 at 01:28:51PM +0200, Roger Quadros wrote:
> Hi Tony & Greg,
> 
> What's the best way to get these patches in?
> 
> All patches have been acked by respective maintainers.
> 
> If Tony can Ack the arch/arm/mach-omap2 stuff then should I send a
> pull request directly to Greg? or the other way round?
> 
> Tony, 
> fyi, these patches should not interfere with the dw3c/musb stuff
> sent by Felipe & Kishon.

I'm fine with Tony just taking them all if he wants to.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [REVERT][v3.x.y] EHCI: Update qTD next pointer in QH overlay region during unlink

2013-02-05 Thread Alan Stern
On Tue, 5 Feb 2013, Joseph Salisbury wrote:

> > I have replied to the original report at bugs.launchpad.net with a
> > diagnostic patch.  Maybe it will help indicate what's going wrong.
> >
> > Alan Stern
> >
> Thanks so much for the assistance, Alan.  I'll work with the bug 
> reporter to build a kernel with the patch and test.

The bug reporter may not need any help, considering that he was already 
able to carry out a git bisection search.

Alan Stern

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


Re: Linux USB file storage gadget with new UDC

2013-02-05 Thread Alan Stern
On Tue, 5 Feb 2013, victor yeo wrote:

> Thanks, i added in UDC driver to call bulk_in_complete for every
> request over a bulk in ep, now the gadget driver is able to process
> the SCSI Inquiry command. When it comes to SCSI Read Format Capacities
> command, the gadget driver gives attention condition error in
> check_command() in the code snippet below, and the command is not
> processed by do_read_format_capacities().
> 
> if (curlun && curlun->unit_attention_data != SS_NO_SENSE &&
> fsg->cmnd[0] != INQUIRY &&
> fsg->cmnd[0] != REQUEST_SENSE) {
> curlun->sense_data = curlun->unit_attention_data;
> curlun->unit_attention_data = SS_NO_SENSE;
> return -EINVAL;
> }
> 
> Besides the code snippet, the only place that sets unit_attention data
> to SS_NO_SENSE is in handle_exception(). How is UDC driver able to
> overcome this problem?

What problem?  This all sounds perfectly normal.

Maybe you should post the kernel debugging log.

Alan Stern

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


Re: [PATCH 12/15] USB: gadget/freescale: disable non-multiplatform drivers

2013-02-05 Thread Arnd Bergmann
On Monday 21 January 2013, Greg Kroah-Hartman wrote:
> On Mon, Jan 21, 2013 at 08:41:38PM +0200, Felipe Balbi wrote:
> > Hi,
> > 
> > On Mon, Jan 21, 2013 at 05:16:05PM +, Arnd Bergmann wrote:
> > > Both the fsl_mxc gadget and the imx_udc gadget drivers fail to build
> > > without the mach/hardware.h file that is not available when building
> > > for multiplatform. Let's disable these drivers for v3.8 in combination
> > > with CONFIG_ARCH_MULTIPLATFORM, and fix them properly in v3.9 unless
> > > someone has an better solution.
> > > 
> > > Without this patch, building allyesconfig results in:
> > > 
> > > drivers/usb/gadget/fsl_mxc_udc.c:21:27: fatal error: mach/hardware.h: No 
> > > such file or directory
> > > 
> > > Signed-off-by: Arnd Bergmann 
> > > Cc: Felipe Balbi 
> > > Cc: Shawn Guo 
> > > Cc: Greg Kroah-Hartman 
> > > Cc: linux-usb@vger.kernel.org
> > 
> > NAK, I prefer to see a real fix for the problem (which in fact is
> > already in my fixes branch).
> 
> I'll pull that branch now, sorry for the delay.

Apparently it hasn't made it into the upstream kernel yet, and it also doesn't
seem to be in linux-next. Maybe this got lost while you were travelling?

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 09/13] mfd: omap-usb-host: Add device tree support and binding information

2013-02-05 Thread Mark Rutland
[...]

> >> +
> >> +- single_ulpi_bypass: Must be present if the controller contains a single
> >> +  ULPI bypass control bit. e.g. OMAP3 silicon <= ES2.1
> > 
> > Again it would be nicer to have '-' rather than '_' here. It might be worth
> > prefixing this "ti,".
> 
> Is prefixing with "ti" really required? how does it better?

I thought single-ulpi-bypass sounded rather generic, but it probably is
specific enough as-is. I don't know enough about USB hardware to have strong
feelings either way.

[...]

> Thanks for the in-depth review :).

You're welcome.

Thanks,
Mark.

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


Re: [REVERT][v3.x.y] EHCI: Update qTD next pointer in QH overlay region during unlink

2013-02-05 Thread Joseph Salisbury

On 02/04/2013 05:04 PM, Alan Stern wrote:

On Fri, 1 Feb 2013, Joseph Salisbury wrote:


Hi Alan,

There is a tar file[0] attached to the bug report[1].  The tar file
contains a few examples of failed and successful recording attempts
while collecting usbmon traces.  There is a readme.txt file available
after extracting the files.

The bug reporter states that only the first recording after boot fails.
Subsequent recordings succeed will succeed.

Thanks again for reviewing this, Alan.  Just let me know if you would
like any additional data or testing.

Thanks,

Joe

[0]
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1088733/+attachment/3510887/+files/usbmon-1088733.tar.gz
[1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1088733

I have replied to the original report at bugs.launchpad.net with a
diagnostic patch.  Maybe it will help indicate what's going wrong.

Alan Stern

Thanks so much for the assistance, Alan.  I'll work with the bug 
reporter to build a kernel with the patch and test.


Joe
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] ARM part of USB patches

2013-02-05 Thread kishon

Hi Tony, Greg,

On Tuesday 05 February 2013 08:54 PM, kishon wrote:

Hi Tony,

As discussed, I'm sending a pull request for the arch/arm part of my USB
patches. These patches are necessary to get MUSB functional in both dt
and non-dt boot. Also added dt data for dwc3 present in OMAP. This patch
series *depends* on some of the patches which are merged in usb-next.


This patch series should go in only after USB. Or else it will break 
compilation.


Thanks
Kishon



Thanks
Kishon

The following changes since commit
88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7:

   Linux 3.8-rc6 (2013-02-01 12:08:14 +1100)

are available in the git repository at:

   git://gitorious.org/linux-usb/linux-usb.git arm-usb-dt

for you to fetch changes up to 09084a48903c6056e20e27ae5054902958a10275:

   ARM: dts: omap5: add dwc3 core dt data (2013-02-05 20:11:46 +0530)


Kishon Vijay Abraham I (12):
   ARM: OMAP4: remove control module address space from PHY and OTG
   ARM: OMAP: devices: create device for usb part of control module
   ARM: OMAP2: MUSB: Specify omap4 has mailbox
   ARM: dts: omap: Add omap control usb data
   ARM: dts: omap: Add omap-usb2 dt data
   ARM: dts: omap: Add usb_otg and glue data
   ARM: OMAP: USB: Add phy binding information
   ARM: dts: omap5: Add omap control usb data
   ARM: dts: omap5: Add ocp2scp data
   ARM: dts: omap5: Add omap-usb3 and omap-usb2 dt data
   ARM: dts: omap5: add dwc3 omap dt data
   ARM: dts: omap5: add dwc3 core dt data

  Documentation/devicetree/bindings/usb/omap-usb.txt |1 +
  arch/arm/boot/dts/omap3-beagle-xm.dts  |6 ++
  arch/arm/boot/dts/omap3-evm.dts|6 ++
  arch/arm/boot/dts/omap3-overo.dtsi |6 ++
  arch/arm/boot/dts/omap3.dtsi   |   12 
  arch/arm/boot/dts/omap4-panda.dts  |6 ++
  arch/arm/boot/dts/omap4-sdp.dts|6 ++
  arch/arm/boot/dts/omap4.dtsi   |   26
++
  arch/arm/boot/dts/omap5.dtsi   |   48

  arch/arm/boot/dts/twl4030.dtsi |2 +-
  arch/arm/mach-omap2/board-2430sdp.c|2 ++
  arch/arm/mach-omap2/board-3430sdp.c|2 ++
  arch/arm/mach-omap2/board-4430sdp.c|2 ++
  arch/arm/mach-omap2/board-cm-t35.c |2 ++
  arch/arm/mach-omap2/board-devkit8000.c |2 ++
  arch/arm/mach-omap2/board-igep0020.c   |2 ++
  arch/arm/mach-omap2/board-ldp.c|2 ++
  arch/arm/mach-omap2/board-omap3beagle.c|2 ++
  arch/arm/mach-omap2/board-omap3evm.c   |2 ++
  arch/arm/mach-omap2/board-omap3logic.c |2 ++
  arch/arm/mach-omap2/board-omap3pandora.c   |2 ++
  arch/arm/mach-omap2/board-omap3stalker.c   |2 ++
  arch/arm/mach-omap2/board-omap3touchbook.c |2 ++
  arch/arm/mach-omap2/board-omap4panda.c |2 ++
  arch/arm/mach-omap2/board-overo.c  |2 ++
  arch/arm/mach-omap2/board-rm680.c  |2 ++
  arch/arm/mach-omap2/board-zoom-peripherals.c   |2 ++
  arch/arm/mach-omap2/devices.c  |   45
+
  arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   13 -
  arch/arm/mach-omap2/usb-musb.c |3 +++
  include/linux/usb/musb.h   |2 ++
  31 files changed, 202 insertions(+), 14 deletions(-)


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


[GIT PULL] ARM part of USB patches

2013-02-05 Thread kishon

Hi Tony,

As discussed, I'm sending a pull request for the arch/arm part of my USB 
patches. These patches are necessary to get MUSB functional in both dt 
and non-dt boot. Also added dt data for dwc3 present in OMAP. This patch 
series *depends* on some of the patches which are merged in usb-next.


Thanks
Kishon

The following changes since commit 88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7:

  Linux 3.8-rc6 (2013-02-01 12:08:14 +1100)

are available in the git repository at:

  git://gitorious.org/linux-usb/linux-usb.git arm-usb-dt

for you to fetch changes up to 09084a48903c6056e20e27ae5054902958a10275:

  ARM: dts: omap5: add dwc3 core dt data (2013-02-05 20:11:46 +0530)


Kishon Vijay Abraham I (12):
  ARM: OMAP4: remove control module address space from PHY and OTG
  ARM: OMAP: devices: create device for usb part of control module
  ARM: OMAP2: MUSB: Specify omap4 has mailbox
  ARM: dts: omap: Add omap control usb data
  ARM: dts: omap: Add omap-usb2 dt data
  ARM: dts: omap: Add usb_otg and glue data
  ARM: OMAP: USB: Add phy binding information
  ARM: dts: omap5: Add omap control usb data
  ARM: dts: omap5: Add ocp2scp data
  ARM: dts: omap5: Add omap-usb3 and omap-usb2 dt data
  ARM: dts: omap5: add dwc3 omap dt data
  ARM: dts: omap5: add dwc3 core dt data

 Documentation/devicetree/bindings/usb/omap-usb.txt |1 +
 arch/arm/boot/dts/omap3-beagle-xm.dts  |6 ++
 arch/arm/boot/dts/omap3-evm.dts|6 ++
 arch/arm/boot/dts/omap3-overo.dtsi |6 ++
 arch/arm/boot/dts/omap3.dtsi   |   12 
 arch/arm/boot/dts/omap4-panda.dts  |6 ++
 arch/arm/boot/dts/omap4-sdp.dts|6 ++
 arch/arm/boot/dts/omap4.dtsi   |   26 
++
 arch/arm/boot/dts/omap5.dtsi   |   48 


 arch/arm/boot/dts/twl4030.dtsi |2 +-
 arch/arm/mach-omap2/board-2430sdp.c|2 ++
 arch/arm/mach-omap2/board-3430sdp.c|2 ++
 arch/arm/mach-omap2/board-4430sdp.c|2 ++
 arch/arm/mach-omap2/board-cm-t35.c |2 ++
 arch/arm/mach-omap2/board-devkit8000.c |2 ++
 arch/arm/mach-omap2/board-igep0020.c   |2 ++
 arch/arm/mach-omap2/board-ldp.c|2 ++
 arch/arm/mach-omap2/board-omap3beagle.c|2 ++
 arch/arm/mach-omap2/board-omap3evm.c   |2 ++
 arch/arm/mach-omap2/board-omap3logic.c |2 ++
 arch/arm/mach-omap2/board-omap3pandora.c   |2 ++
 arch/arm/mach-omap2/board-omap3stalker.c   |2 ++
 arch/arm/mach-omap2/board-omap3touchbook.c |2 ++
 arch/arm/mach-omap2/board-omap4panda.c |2 ++
 arch/arm/mach-omap2/board-overo.c  |2 ++
 arch/arm/mach-omap2/board-rm680.c  |2 ++
 arch/arm/mach-omap2/board-zoom-peripherals.c   |2 ++
 arch/arm/mach-omap2/devices.c  |   45 
+

 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   13 -
 arch/arm/mach-omap2/usb-musb.c |3 +++
 include/linux/usb/musb.h   |2 ++
 31 files changed, 202 insertions(+), 14 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: how to specify an OMAP clock in device tree?

2013-02-05 Thread Roger Quadros
On 02/05/2013 04:36 PM, Rajendra Nayak wrote:
> On Tuesday 05 February 2013 07:59 PM, Roger Quadros wrote:
>> On 02/05/2013 04:21 PM, Rajendra Nayak wrote:
>>> On Tuesday 05 February 2013 07:48 PM, Roger Quadros wrote:
 On 02/05/2013 04:13 PM, Rajendra Nayak wrote:
> On Tuesday 05 February 2013 07:16 PM, Roger Quadros wrote:
>> Fixing the device name doesn't really solve the problem.
>> Not all OMAP boards will use the same clock for the external device.
>
> Are you saying different OMAP boards will use different Internal clocks?
> Or different OMAP boards will use a single Internal clock or an
> external one.
>
 All I was saying is that one board can use for example auxclk1 whereas 
 another
 one can use auxclk3, both generated by OMAP for the same PHY configuration.
>>>
>>> Ok, so lets keep DT aside for a while. How would something like this
>>> work in a non-DT world? Would the driver then be able to do a
>>> clk_get(dev, "main_clk"); and get say auxclk1 on one board and
>>> auxclk3 on another?
>>>
>>
>> Yes, all you need to do is specify an alias to the clock in the board file.
> 
> Can we then create a special board specific node for panda and do
> similar things from DT?
> See a similar discussion below on how to handle the gpio_request()
> we had as part of board files
> http://www.spinics.net/lists/linux-omap/msg85248.html

Doesn't look very elegant to me, but I wouldn't mind if there is no better 
option.
Even then, we can't rely on the device name as its index can change based on 
where it is
located in the dts file. e.g. in the beginning it may be named phy.8, and if a 
device
node is added before it, it will get changed to phy.9

> 
>>
>> e.g. in board 1 file
>> clk_add_alias("main_clk", "phy.1", "auxclk1_ck", NULL);
>>
>> in board 2 file
>> clk_add_alias("main_clk", "phy.1", "auxclk3_ck", NULL);
>>

cheers,
-roger

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


Re: [PATCH 1/2] usb: phy: Add USB host phy support on Exyno4412

2013-02-05 Thread Praveen Paneri
Hi,

On Tue, Feb 5, 2013 at 6:55 AM, Dongjin Kim  wrote:
> This patch adds host phy support for Samsung's Exynos4412 SoC to
> samsung-usbphy driver. This patch is created upon 
> "http://git.kernel.org/?p=linux/kernel/git/balbi/usb.git;a=commit;h=2564b526b8cf01e6c36285edfd40a438e683c2b8";
>
> Cc: Praveen Paneri 
> Signed-off-by: Dongjin Kim 
> ---
>  drivers/usb/phy/samsung-usbphy.c |  156 
> +-
>  1 file changed, 154 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/phy/samsung-usbphy.c 
> b/drivers/usb/phy/samsung-usbphy.c
> index 6ea5537..c800fa4 100644
> --- a/drivers/usb/phy/samsung-usbphy.c
> +++ b/drivers/usb/phy/samsung-usbphy.c
> @@ -47,7 +47,7 @@
>
>  #define PHYCLK_MODE_USB11  (0x1 << 6)
>  #define PHYCLK_EXT_OSC (0x1 << 5)
> -#define PHYCLK_COMMON_ON_N (0x1 << 4)
> +#define PHYCLK_COMMON_ON_N_PHY0(0x1 << 4)
>  #define PHYCLK_ID_PULL (0x1 << 2)
>  #define PHYCLK_CLKSEL_MASK (0x3 << 0)
>  #define PHYCLK_CLKSEL_48M  (0x0 << 0)
> @@ -60,6 +60,22 @@
>  #define RSTCON_HLINK_SWRST (0x1 << 1)
>  #define RSTCON_SWRST   (0x1 << 0)
>
> +/* For Exynos4412 */
> +#define PHYCLK_COMMON_ON_N_PHY1(0x1 << 7)
> +
> +#define PHYPWR_NORMAL_MASK_HSIC1   (0x7 << 12)
> +#define PHYPWR_NORMAL_MASK_HSIC0   (0x7 << 9)
> +#define PHYPWR_NORMAL_MASK_PHY1(0x7 << 6)
> +
> +#define PHYPWR_ANALOG_POWERDOWN_PHY1   (0x1 << 7)
> +
> +#define RSTCON_HLINK_SWRST_MASK(0xf << 7)
> +#define RSTCON_PHY1_SWRST_MASK (0xf << 3)
> +#define RSTCON_PHY0_SWRST_MASK (0x7 << 0)
> +
> +#define EXYNOS4_PHY_HSIC_CTRL0 (0x04)
> +#define EXYNOS4_PHY_HSIC_CTRL1 (0x08)
> +
>  /* EXYNOS5 */
>  #define EXYNOS5_PHY_HOST_CTRL0 (0x00)
>
> @@ -174,6 +190,7 @@
>  enum samsung_cpu_type {
> TYPE_S3C64XX,
> TYPE_EXYNOS4210,
> +   TYPE_EXYNOS4412,
Shouldn't you add it under the TYPE_EXYNOS4X12. We will have to add a
separate support for 4212 then.
> TYPE_EXYNOS5250,
>  };
>
> @@ -322,6 +339,17 @@ static void samsung_usbphy_set_isolation(struct 
> samsung_usbphy *sphy, bool on)
> en_mask = sphy->drv_data->hostphy_en_mask;
> }
> break;
> +   case TYPE_EXYNOS4412:
> +   if (sphy->phy_type == USB_PHY_TYPE_DEVICE) {
> +   reg = sphy->pmuregs +
> +   sphy->drv_data->devphy_reg_offset;
> +   en_mask = sphy->drv_data->devphy_en_mask;
> +   } else if (sphy->phy_type == USB_PHY_TYPE_HOST) {
> +   reg = sphy->pmuregs +
> +   sphy->drv_data->hostphy_reg_offset;
> +   en_mask = sphy->drv_data->hostphy_en_mask;
> +   }
> +   break;
> default:
> dev_err(sphy->dev, "Invalid SoC type\n");
> return;
> @@ -422,6 +450,29 @@ static int samsung_usbphy_get_refclk_freq(struct 
> samsung_usbphy *sphy)
> refclk_freq = FSEL_CLKSEL_24M;
> break;
> }
> +   } else if (sphy->drv_data->cpu_type == TYPE_EXYNOS4412) {
> +   switch (clk_get_rate(ref_clk)) {
> +   case 9600 * KHZ:
> +   refclk_freq = FSEL_CLKSEL_9600K;
> +   break;
> +   case 10 * MHZ:
> +   refclk_freq = FSEL_CLKSEL_10M;
> +   break;
> +   case 12 * MHZ:
> +   refclk_freq = FSEL_CLKSEL_12M;
> +   break;
> +   case 19200 * KHZ:
> +   refclk_freq = FSEL_CLKSEL_19200K;
> +   break;
> +   case 20 * MHZ:
> +   refclk_freq = FSEL_CLKSEL_20M;
> +   break;
> +   case 24 * MHZ:
> +   default:
> +   /* default reference clock */
> +   refclk_freq = FSEL_CLKSEL_24M;
> +   break;
> +   }
> } else {
> switch (clk_get_rate(ref_clk)) {
> case 12 * MHZ:
> @@ -561,6 +612,69 @@ static void samsung_exynos5_usbphy_enable(struct 
> samsung_usbphy *sphy)
> writel(ohcictrl, regs + EXYNOS5_PHY_HOST_OHCICTRL);
>  }
>
> +static bool exynos4_phyhost_is_on(void *regs)
> +{
> +   u32 reg;
> +
> +   reg = readl(regs + SAMSUNG_PHYPWR);
> +
> +   return !(reg & PHYPWR_ANALOG_POWERDOWN_PHY1);
> +}
> +
> +static void samsung_exynos4412_usbphy_enable(struct samsung_usbphy *sphy)
> +{
> +   void __iomem *regs = sphy->regs;
> +   u32 phypwr;
> +

Re: [PATCH 09/13] mfd: omap-usb-host: Add device tree support and binding information

2013-02-05 Thread Roger Quadros
On 02/05/2013 04:20 PM, Mark Rutland wrote:
> Hi,
> 
> I have a few comments on the binding and the way it's parsed.
> 
> On Mon, Feb 04, 2013 at 03:58:56PM +, Roger Quadros wrote:
>> Allows the OMAP HS USB host controller to be specified
>> via device tree.
>>
>> CC: Samuel Ortiz 
>> Signed-off-by: Roger Quadros 
>> ---
>>  .../devicetree/bindings/mfd/omap-usb-host.txt  |   68 
>>  drivers/mfd/omap-usb-host.c|   83 
>> ++--
>>  2 files changed, 145 insertions(+), 6 deletions(-)
>>  create mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-host.txt
>>
>> diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-host.txt 
>> b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
>> new file mode 100644
>> index 000..2196893
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
>> @@ -0,0 +1,68 @@
>> +OMAP HS USB Host
>> +
>> +Required properties:
>> +
>> +- compatible: should be "ti,usbhs-host"
>> +- reg: should contain one register range i.e. start and length
>> +- ti,hwmods: must contain "usb_host_hs"
>> +
>> +Optional properties:
>> +
>> +- nports: number of USB ports. Usually this is automatically detected
>> +  from the IP's revision register but can be overridden by specifying
>> +  this property.
> 
> It would be nice if this were "num-ports", as atmel-usb is already using that,
> and it's clear that it's a number of ports rather than some other meaning of
> 'n'.
> 
> From a quick grep of binding documents, out of "nTHING(s)", "nr-THINGs", and
> num-THINGs, num-THINGs seems to be the most common. It would be nice if new
> bindings could standardise this.

Agreed.
> 
>> +
>> +- portN_mode: Integer specifying the port mode for port N, where N can be
>> +  from 1 to nports. The port mode must be as per enum usbhs_omap_port_mode
>> +  in include/linux/platform_data/usb-omap.h
>> +  If the port mode is not specified, that port is treated as unused.
> 
> I'm against devicetree bindings refering to Linux internals. It makes a poorly
> documented ABI that someone might change in future without realising the
> implications, and it makes it stupidly difficult to read a dts.
> 
> Everything required should be specified in the binding document (or another
> linked binding document). It might be better to describe this with a string
> property that gets mapped by your dt parsing code to whatever internal
> representation you need. That way it's far easier for a human to verify the 
> dts
> is correct, and you know by construction that the parsed value is something 
> you
> can handle in the driver.

As string makes it self documenting, I'll convert it to a string and update the
binding document.

> 
> It would be nicer is you used '-' rather than '_' for consistency with
> devicetree bindings in general.

OK.

> 
>> +
>> +- single_ulpi_bypass: Must be present if the controller contains a single
>> +  ULPI bypass control bit. e.g. OMAP3 silicon <= ES2.1
> 
> Again it would be nicer to have '-' rather than '_' here. It might be worth
> prefixing this "ti,".

Is prefixing with "ti" really required? how does it better?

> 
>> +
>> +Required properties if child node exists:
>> +
>> +- #address-cells: Must be 1
>> +- #size-cells: Must be 1
>> +- ranges: must be present
>> +
>> +Properties for children:
>> +
>> +The OMAP HS USB Host subsystem contains EHCI and OHCI controllers.
>> +See Documentation/devicetree/bindings/usb/omap-ehci.txt and
>> +omap3-ohci.txt
>> +
>> +Example for OMAP4:
>> +
>> +usbhshost: usbhshost@0x4a064000 {
>> +compatible = "ti,usbhs-host";
>> +reg = <0x4a064000 0x800>;
>> +ti,hwmods = "usb_host_hs";
>> +#address-cells = <1>;
>> +#size-cells = <1>;
>> +ranges;
>> +
>> +usbhsohci: ohci@0x4a064800 {
>> +compatible = "ti,omap3-ohci", "usb-ohci";
>> +reg = <0x4a064800 0x400>;
>> +interrupt-parent = <&gic>;
>> +interrupts = <0 76 0x4>;
>> +};
>> +
>> +usbhsehci: ehci@0x4a064c00 {
>> +compatible = "ti,omap-ehci", "usb-ehci";
>> +reg = <0x4a064c00 0x400>;
>> +interrupt-parent = <&gic>;
>> +interrupts = <0 77 0x4>;
>> +};
>> +};
>> +
>> +&usbhshost {
>> +port1_mode = <1>; /* OMAP_EHCI_PORT_MODE_PHY */
>> +port2_mode = <2>; /* OMAP_EHCI_PORT_MODE_TLL */
>> +port3_mode = <1>; /* OMAP_EHCI_PORT_MODE_PHY */
> 
> With a string property, these values would be self-documenting.
> 
>> +};
>> +
>> +&usbhsehci {
>> +phy = <&hsusb1_phy 0 &hsusb3_phy>;
>> +};
>> diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
>> index f8ed08e..0f67856 100644
>> --- a/drivers/mfd/omap-usb-host.c
>> +++ b/drivers/mfd/omap-usb-host.c
>> @@ -1,8 +1,9 @@
>>  /**
>>   * omap-usb-host.c - The USBHS core driver for OMAP EHCI & OHCI
>>   *
>> - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
>> + * Copyright (C) 2011-2013 Texas Instruments I

Re: how to specify an OMAP clock in device tree?

2013-02-05 Thread Rajendra Nayak

On Tuesday 05 February 2013 07:59 PM, Roger Quadros wrote:

On 02/05/2013 04:21 PM, Rajendra Nayak wrote:

On Tuesday 05 February 2013 07:48 PM, Roger Quadros wrote:

On 02/05/2013 04:13 PM, Rajendra Nayak wrote:

On Tuesday 05 February 2013 07:16 PM, Roger Quadros wrote:

Fixing the device name doesn't really solve the problem.
Not all OMAP boards will use the same clock for the external device.


Are you saying different OMAP boards will use different Internal clocks?
Or different OMAP boards will use a single Internal clock or an
external one.


All I was saying is that one board can use for example auxclk1 whereas another
one can use auxclk3, both generated by OMAP for the same PHY configuration.


Ok, so lets keep DT aside for a while. How would something like this
work in a non-DT world? Would the driver then be able to do a
clk_get(dev, "main_clk"); and get say auxclk1 on one board and
auxclk3 on another?



Yes, all you need to do is specify an alias to the clock in the board file.


Can we then create a special board specific node for panda and do
similar things from DT?
See a similar discussion below on how to handle the gpio_request()
we had as part of board files
http://www.spinics.net/lists/linux-omap/msg85248.html



e.g. in board 1 file
clk_add_alias("main_clk", "phy.1", "auxclk1_ck", NULL);

in board 2 file
clk_add_alias("main_clk", "phy.1", "auxclk3_ck", NULL);

cheers,
-roger



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


Re: how to specify an OMAP clock in device tree?

2013-02-05 Thread Roger Quadros
On 02/05/2013 04:21 PM, Rajendra Nayak wrote:
> On Tuesday 05 February 2013 07:48 PM, Roger Quadros wrote:
>> On 02/05/2013 04:13 PM, Rajendra Nayak wrote:
>>> On Tuesday 05 February 2013 07:16 PM, Roger Quadros wrote:
 Fixing the device name doesn't really solve the problem.
 Not all OMAP boards will use the same clock for the external device.
>>>
>>> Are you saying different OMAP boards will use different Internal clocks?
>>> Or different OMAP boards will use a single Internal clock or an
>>> external one.
>>>
>> All I was saying is that one board can use for example auxclk1 whereas 
>> another
>> one can use auxclk3, both generated by OMAP for the same PHY configuration.
> 
> Ok, so lets keep DT aside for a while. How would something like this
> work in a non-DT world? Would the driver then be able to do a
> clk_get(dev, "main_clk"); and get say auxclk1 on one board and
> auxclk3 on another?
> 

Yes, all you need to do is specify an alias to the clock in the board file.

e.g. in board 1 file
clk_add_alias("main_clk", "phy.1", "auxclk1_ck", NULL);

in board 2 file
clk_add_alias("main_clk", "phy.1", "auxclk3_ck", NULL);

cheers,
-roger
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: how to specify an OMAP clock in device tree?

2013-02-05 Thread Rajendra Nayak

On Tuesday 05 February 2013 07:48 PM, Roger Quadros wrote:

On 02/05/2013 04:13 PM, Rajendra Nayak wrote:

On Tuesday 05 February 2013 07:16 PM, Roger Quadros wrote:

Fixing the device name doesn't really solve the problem.
Not all OMAP boards will use the same clock for the external device.


Are you saying different OMAP boards will use different Internal clocks?
Or different OMAP boards will use a single Internal clock or an
external one.


All I was saying is that one board can use for example auxclk1 whereas another
one can use auxclk3, both generated by OMAP for the same PHY configuration.


Ok, so lets keep DT aside for a while. How would something like this
work in a non-DT world? Would the driver then be able to do a
clk_get(dev, "main_clk"); and get say auxclk1 on one board and
auxclk3 on another?



cheers,
-roger



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


Re: [PATCH 09/13] mfd: omap-usb-host: Add device tree support and binding information

2013-02-05 Thread Mark Rutland
Hi,

I have a few comments on the binding and the way it's parsed.

On Mon, Feb 04, 2013 at 03:58:56PM +, Roger Quadros wrote:
> Allows the OMAP HS USB host controller to be specified
> via device tree.
> 
> CC: Samuel Ortiz 
> Signed-off-by: Roger Quadros 
> ---
>  .../devicetree/bindings/mfd/omap-usb-host.txt  |   68 
>  drivers/mfd/omap-usb-host.c|   83 
> ++--
>  2 files changed, 145 insertions(+), 6 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-host.txt
> 
> diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-host.txt 
> b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
> new file mode 100644
> index 000..2196893
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
> @@ -0,0 +1,68 @@
> +OMAP HS USB Host
> +
> +Required properties:
> +
> +- compatible: should be "ti,usbhs-host"
> +- reg: should contain one register range i.e. start and length
> +- ti,hwmods: must contain "usb_host_hs"
> +
> +Optional properties:
> +
> +- nports: number of USB ports. Usually this is automatically detected
> +  from the IP's revision register but can be overridden by specifying
> +  this property.

It would be nice if this were "num-ports", as atmel-usb is already using that,
and it's clear that it's a number of ports rather than some other meaning of
'n'.

>From a quick grep of binding documents, out of "nTHING(s)", "nr-THINGs", and
num-THINGs, num-THINGs seems to be the most common. It would be nice if new
bindings could standardise this.

> +
> +- portN_mode: Integer specifying the port mode for port N, where N can be
> +  from 1 to nports. The port mode must be as per enum usbhs_omap_port_mode
> +  in include/linux/platform_data/usb-omap.h
> +  If the port mode is not specified, that port is treated as unused.

I'm against devicetree bindings refering to Linux internals. It makes a poorly
documented ABI that someone might change in future without realising the
implications, and it makes it stupidly difficult to read a dts.

Everything required should be specified in the binding document (or another
linked binding document). It might be better to describe this with a string
property that gets mapped by your dt parsing code to whatever internal
representation you need. That way it's far easier for a human to verify the dts
is correct, and you know by construction that the parsed value is something you
can handle in the driver.

It would be nicer is you used '-' rather than '_' for consistency with
devicetree bindings in general.

> +
> +- single_ulpi_bypass: Must be present if the controller contains a single
> +  ULPI bypass control bit. e.g. OMAP3 silicon <= ES2.1

Again it would be nicer to have '-' rather than '_' here. It might be worth
prefixing this "ti,".

> +
> +Required properties if child node exists:
> +
> +- #address-cells: Must be 1
> +- #size-cells: Must be 1
> +- ranges: must be present
> +
> +Properties for children:
> +
> +The OMAP HS USB Host subsystem contains EHCI and OHCI controllers.
> +See Documentation/devicetree/bindings/usb/omap-ehci.txt and
> +omap3-ohci.txt
> +
> +Example for OMAP4:
> +
> +usbhshost: usbhshost@0x4a064000 {
> + compatible = "ti,usbhs-host";
> + reg = <0x4a064000 0x800>;
> + ti,hwmods = "usb_host_hs";
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges;
> +
> + usbhsohci: ohci@0x4a064800 {
> + compatible = "ti,omap3-ohci", "usb-ohci";
> + reg = <0x4a064800 0x400>;
> + interrupt-parent = <&gic>;
> + interrupts = <0 76 0x4>;
> + };
> +
> + usbhsehci: ehci@0x4a064c00 {
> + compatible = "ti,omap-ehci", "usb-ehci";
> + reg = <0x4a064c00 0x400>;
> + interrupt-parent = <&gic>;
> + interrupts = <0 77 0x4>;
> + };
> +};
> +
> +&usbhshost {
> + port1_mode = <1>; /* OMAP_EHCI_PORT_MODE_PHY */
> + port2_mode = <2>; /* OMAP_EHCI_PORT_MODE_TLL */
> + port3_mode = <1>; /* OMAP_EHCI_PORT_MODE_PHY */

With a string property, these values would be self-documenting.

> +};
> +
> +&usbhsehci {
> + phy = <&hsusb1_phy 0 &hsusb3_phy>;
> +};
> diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
> index f8ed08e..0f67856 100644
> --- a/drivers/mfd/omap-usb-host.c
> +++ b/drivers/mfd/omap-usb-host.c
> @@ -1,8 +1,9 @@
>  /**
>   * omap-usb-host.c - The USBHS core driver for OMAP EHCI & OHCI
>   *
> - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
> + * Copyright (C) 2011-2013 Texas Instruments Incorporated - http://www.ti.com
>   * Author: Keshava Munegowda 
> + * Author: Roger Quadros 
>   *
>   * This program is free software: you can redistribute it and/or modify
>   * it under the terms of the GNU General Public License version 2  of
> @@ -27,6 +28,8 @@
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
>  
>  #include "omap-usb.h"
>  
> @@ 

Re: how to specify an OMAP clock in device tree?

2013-02-05 Thread Roger Quadros
On 02/05/2013 04:13 PM, Rajendra Nayak wrote:
> On Tuesday 05 February 2013 07:16 PM, Roger Quadros wrote:
>> Fixing the device name doesn't really solve the problem.
>> Not all OMAP boards will use the same clock for the external device.
> 
> Are you saying different OMAP boards will use different Internal clocks?
> Or different OMAP boards will use a single Internal clock or an
> external one.
> 
All I was saying is that one board can use for example auxclk1 whereas another
one can use auxclk3, both generated by OMAP for the same PHY configuration.

cheers,
-roger

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


Re: how to specify an OMAP clock in device tree?

2013-02-05 Thread Rajendra Nayak

On Tuesday 05 February 2013 07:16 PM, Roger Quadros wrote:

Fixing the device name doesn't really solve the problem.
Not all OMAP boards will use the same clock for the external device.


Are you saying different OMAP boards will use different Internal clocks?
Or different OMAP boards will use a single Internal clock or an
external one.

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


Re: how to specify an OMAP clock in device tree?

2013-02-05 Thread Roger Quadros
On 02/05/2013 01:15 PM, Rajendra Nayak wrote:
> On Tuesday 05 February 2013 03:04 PM, Roger Quadros wrote:
>> Hi Rajendra,
>>
>> On 02/04/2013 05:58 PM, Roger Quadros wrote:
>>> Provide the RESET and Power regulators for the USB PHY,
>>> the USB Host port mode and the PHY device.
>>>
>>> Also provide pin multiplexer information for the USB host
>>> pins.
>>>
>>> Signed-off-by: Roger Quadros 
>>> ---
>>>   arch/arm/boot/dts/omap4-panda.dts |   55 
>>> +
>>>   1 files changed, 55 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/arm/boot/dts/omap4-panda.dts 
>>> b/arch/arm/boot/dts/omap4-panda.dts
>>> index 4122efe..fe2d3d4 100644
>>> --- a/arch/arm/boot/dts/omap4-panda.dts
>>> +++ b/arch/arm/boot/dts/omap4-panda.dts
>>> @@ -57,6 +57,35 @@
>>>   "AFML", "Line In",
>>>   "AFMR", "Line In";
>>>   };
>>> +
>>> +/* HS USB Port 1 RESET */
>>> +hsusb1_reset: hsusb1_reset_reg {
>>> +compatible = "regulator-fixed";
>>> +regulator-name = "hsusb1_reset";
>>> +regulator-min-microvolt = <330>;
>>> +regulator-max-microvolt = <330>;
>>> +gpio = <&gpio2 30 0>;/* gpio_62 */
>>> +startup-delay-us = <7>;
>>> +enable-active-high;
>>> +};
>>> +
>>> +/* HS USB Port 1 Power */
>>> +hsusb1_power: hsusb1_power_reg {
>>> +compatible = "regulator-fixed";
>>> +regulator-name = "hsusb1_vbus";
>>> +regulator-min-microvolt = <330>;
>>> +regulator-max-microvolt = <330>;
>>> +gpio = <&gpio1 1 0>;/* gpio_1 */
>>> +startup-delay-us = <7>;
>>> +enable-active-high;
>>> +};
>>> +
>>> +/* HS USB Host PHY on PORT 1 */
>>> +hsusb1_phy: hsusb1_phy {
>>> +compatible = "usb-nop-xceiv";
>>> +reset-supply = <&hsusb1_reset>;
>>> +vcc-supply = <&hsusb1_power>;
>>> +};
>>
>> This is the patch I was discussing with you about before.
>>
>> Let me explain the problem again.
>>
>> The Pandaboard has a USB PHY whose reference clock is provided by
>> FREF_CLK3 pin which is a clock generated by the OMAP.
>> The PHY driver expects a reference to this clock in the PHY device node.
> 
> Well, the driver just does a clk_get(dev, "main_clk"); and clk_get() is
> then able to either pick the reference from the PHY dt node or from a
> clkdev entry.
> 
> The problem here seems to be that you are not able to add a clkdev entry
> because the device name wouldn't be fixed, since you have a node in
> the form of 'node: node {'. All other onchip OMAP devices don't have
> this issue because they have an entry in the form of 'node: node@addr'
> and hence have a fixed device name and hence can add a clkdev entry for
> the clocks they want to control.
> 
> I don't know if there is any good way to define the DT node for the
> on board PHY in such a way that the device name is always fixed, in
> which case you can then add a clkdev entry for 'dev, main_clk' mapping
> to the onchip clock that provides the clock, but if there is one, then
> that should fix your problem.

Fixing the device name doesn't really solve the problem.
Not all OMAP boards will use the same clock for the external device.
So you can't provide this information in some common clock data file.

The data has to come from a board specific location, which in the DT boot
case is the board's dts file.

I think all we need to do is register a clock provider using 
of_clk_add_provider()
and provide a clk_src_get() hook that can get the right clock.

usage e.g.

/* provider */
clks: omapclocks {
compatible = "ti,omapclocks";
#clock-cells = <1>;
};

/* consumer */
hsusb1_phy: hsusb1_phy {
compatible = "usb-nop-xceiv";
clocks = <&clks "auxclk3_ck">;  /* FREF_CLK3 */
clock-names = "main-clk";
};

The only problem I see is that the argument to the clks phandle
cannot be a string. It needs to be u32.

In that case we need to map all clocks into a u32 index.

If we can do that only for auxclks, my problem is solved for panda.

The usage e.g then changes to

/* provider */
aux_clks: omap_aux_clocks {
compatible = "ti,omap_aux_clocks";
#clock-cells = <1>;
};

/* consumer */
hsusb1_phy: hsusb1_phy {
compatible = "usb-nop-xceiv";
clocks = <&aux_clks 3>; /* FREF_CLK3 */
clock-names = "main-clk";
};

Does this idea sound reasonable?

regards,
-roger
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


usbip-utils USBIP_VERSION

2013-02-05 Thread Alexander Zubkov

Hi.
I was trying to bring together Linux & Windows usbip and faced a problem 
with currently published on SourceForge windows driver and tools. 
usbip.exe -l  is saying:

usbip err: ... (usbip_recv_op_common) recv op_common, -1
...
Debugging and tcpdumping showed that problem lies in that Windows side 
thinks it speaks 0x0106 version of the protocol and Linux side think it 
is 0x0111. Git tree of Linux shows that its define in 
drivers/staging/usbip/userspace/configure.ac USBIP_VERSION was changing 
0x0106 -> 0x0100 -> 0x0111 without obvious (to me at least) reasons.
So Linux-side rejects connections because of protocol mistmatch. 
Currently, I have recompiled usbip-utils on Linux system with fixed 
version and it became speaking to Windows now. But I have not tested 
devices yet.
I think this should be fixed somehow in usbip-utils - by downgrading 
version, or accepting other compatible versions.


--
Alexander Zubkov

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


[PATCH RFC] usb: dwc3: Set GCTL.PrtCapDir based on selected mode.

2013-02-05 Thread Vivek Gautam
Now that machines may select the mode of working of DWC3,
we can set the Port capability direction based on selected mode.

Signed-off-by: Vivek Gautam 
---
 drivers/usb/dwc3/core.c |   11 ---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 177f4c6..f4c47f7 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -479,7 +479,6 @@ static int dwc3_probe(struct platform_device *pdev)
 
switch (mode) {
case DWC3_MODE_DEVICE:
-   dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_DEVICE);
ret = dwc3_gadget_init(dwc);
if (ret) {
dev_err(dev, "failed to initialize gadget\n");
@@ -487,7 +486,6 @@ static int dwc3_probe(struct platform_device *pdev)
}
break;
case DWC3_MODE_HOST:
-   dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_HOST);
ret = dwc3_host_init(dwc);
if (ret) {
dev_err(dev, "failed to initialize host\n");
@@ -495,7 +493,6 @@ static int dwc3_probe(struct platform_device *pdev)
}
break;
case DWC3_MODE_DRD:
-   dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_OTG);
ret = dwc3_host_init(dwc);
if (ret) {
dev_err(dev, "failed to initialize host\n");
@@ -514,6 +511,14 @@ static int dwc3_probe(struct platform_device *pdev)
}
dwc->mode = mode;
 
+#if IS_ENABLED(CONFIG_USB_DWC3_HOST)
+   dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_HOST);
+#elif IS_ENABLED(CONFIG_USB_DWC3_GADGET)
+   dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_DEVICE);
+#else
+   dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_OTG);
+#endif
+
ret = dwc3_debugfs_init(dwc);
if (ret) {
dev_err(dev, "failed to initialize debugfs\n");
-- 
1.7.6.5

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


[PATCH v3 2/2] ARM: Exynos5250: Enabling samsung-usb3phy driver

2013-02-05 Thread Vivek Gautam
Adding device node for Samsung USB 3.0 PHY controller driver
on Exynos5250 along with the necessary device data to be parsed.

Signed-off-by: Vivek Gautam 
---
 arch/arm/boot/dts/exynos5250.dtsi |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5250.dtsi 
b/arch/arm/boot/dts/exynos5250.dtsi
index d1865a8..451dcdb 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -99,6 +99,18 @@
interrupts = <0 65 0>;
};
 
+   usbphy@1210 {
+   compatible = "samsung,exynos5250-usb3phy";
+   reg = <0x1210 0x100>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges;
+
+   usbphy-sys {
+   reg = <0x10040704 0x8>;
+   };
+   };
+
usbphy@1213 {
compatible = "samsung,exynos5250-usb2phy";
reg = <0x1213 0x100>;
-- 
1.7.6.5

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


[PATCH v3 1/2] ARM: Exynos5250: Enabling samsung-usb2phy driver

2013-02-05 Thread Vivek Gautam
Adding device node for Samsung USB 2.0 PHY controller driver
on Exynos5250 along with the necessary device data to be parsed.

Signed-off-by: Vivek Gautam 
---
 arch/arm/boot/dts/exynos5250.dtsi |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5250.dtsi 
b/arch/arm/boot/dts/exynos5250.dtsi
index 30485de..d1865a8 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -99,6 +99,19 @@
interrupts = <0 65 0>;
};
 
+   usbphy@1213 {
+   compatible = "samsung,exynos5250-usb2phy";
+   reg = <0x1213 0x100>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges;
+
+   usbphy-sys {
+   reg = <0x10040704 0x8>,
+ <0x10050230 0x4>;
+   };
+   };
+
serial@12C0 {
compatible = "samsung,exynos4210-uart";
reg = <0x12C0 0x100>;
-- 
1.7.6.5

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


[PATCH v3 0/2] ARM: Exynos5250: Enabling samsung usb phy

2013-02-05 Thread Vivek Gautam
Based on for-next of 'linux-samsung' tree.

Aligned with following patches for separate PHY drivers for USB 2.0 and
USB 3.0 for Samsung SoCs.
[PATCH v5 1/2] usb: phy: samsung: Common out the generic stuff
[PATCH v5 2/2] usb: phy: samsung: Add PHY support for USB 3.0 controller

Changes from v2:
 - Putting device nodes in order of device addresses.

Changes from v1:
 - Putting separate device nodes for usb 2.0 phy and usb 3.0 phy
   based on separate driver for samsung usb 3.0 phy and
   samsung usb 2.0 phy:
   [PATCH v3 0/2] Adding USB 3.0 DRD-phy support for exynos5250
   [PATCH v8 0/4] Adding usb2.0 host-phy support for exynos5250
 - Aligning as per the patch:
   usb: phy: samsung: Add support to set pmu isolation
 - Replaced phy-handle approach for PHY CONTROL registers
   to child nodes.
 - Removing AUX data entry from exynos5250 dt file.

Vivek Gautam (2):
  ARM: Exynos5250: Enabling samsung-usb2phy driver
  ARM: Exynos5250: Enabling samsung-usb3phy driver

 arch/arm/boot/dts/exynos5250.dtsi |   25 +
 1 files changed, 25 insertions(+), 0 deletions(-)

-- 
1.7.6.5

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


Re: [PATCH 08/13] USB: ehci-omap: Add device tree support and binding information

2013-02-05 Thread Roger Quadros
On 02/05/2013 02:33 PM, Mark Rutland wrote:
> On Mon, Feb 04, 2013 at 03:58:55PM +, Roger Quadros wrote:
>> Allows the OMAP EHCI controller to be specified via device tree.
>>
>> Signed-off-by: Roger Quadros 
>> ---
>>  .../devicetree/bindings/usb/omap-ehci.txt  |   34 ++
>>  drivers/usb/host/ehci-omap.c   |   36 
>> +++-
>>  2 files changed, 69 insertions(+), 1 deletions(-)
>>  create mode 100644 Documentation/devicetree/bindings/usb/omap-ehci.txt
>>
>> diff --git a/Documentation/devicetree/bindings/usb/omap-ehci.txt 
>> b/Documentation/devicetree/bindings/usb/omap-ehci.txt
>> new file mode 100644
>> index 000..90e6e3a
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/usb/omap-ehci.txt
>> @@ -0,0 +1,34 @@
>> +OMAP HS USB EHCI controller
>> +
>> +This device is usually the child of the omap-usb-host
>> +Documentation/devicetree/bindings/mfd/omap-usb-host.txt
>> +
>> +Required properties:
>> +
>> +- compatible: should be "ti,omap-ehci"
>> +- reg: should contain one register range i.e. start and length
>> +- interrupt-parent: phandle to the interrupt controller
>> +- interrupts: description of the interrupt line
>> +
>> +Optional properties:
>> +
>> +- phy: list of phandles to PHY nodes.
>> +  This property is required if at least one of the ports are in
>> +  PHY mode i.e. OMAP_EHCI_PORT_MODE_PHY
> 
> Any reason for not calling this "phys", given it's a list?
>

No good reason. "phys" seems more appropriate. Thanks.

cheers,
-roger
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v5 2/2] usb: phy: samsung: Add PHY support for USB 3.0 controller

2013-02-05 Thread Vivek Gautam
Adding PHY driver support for USB 3.0 controller for Samsung's
SoCs.

Signed-off-by: Vivek Gautam 
---
 drivers/usb/phy/Kconfig   |8 +
 drivers/usb/phy/Makefile  |1 +
 drivers/usb/phy/samsung-usb3phy.c |  349 +
 drivers/usb/phy/samsung-usbphy.h  |   81 +
 4 files changed, 439 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/phy/samsung-usb3phy.c

diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index b28878d..723d7b1 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -74,6 +74,14 @@ config SAMSUNG_USB2PHY
  Enable this to support Samsung USB 2.0 (High Speed) PHY controller
  driver for Samsung SoCs.
 
+config SAMSUNG_USB3PHY
+   bool "Samsung USB 3.0 PHY controller Driver"
+   select SAMSUNG_USBPHY
+   select USB_OTG_UTILS
+   help
+ Enable this to support Samsung USB 3.0 (Super Speed) phy controller
+ for samsung SoCs.
+
 config SAMSUNG_USBPHY
bool "Samsung USB PHY Driver"
help
diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile
index 1efa174..77f0b2e 100644
--- a/drivers/usb/phy/Makefile
+++ b/drivers/usb/phy/Makefile
@@ -13,3 +13,4 @@ obj-$(CONFIG_USB_EHCI_TEGRA)  += tegra_usb_phy.o
 obj-$(CONFIG_USB_RCAR_PHY) += rcar-phy.o
 obj-$(CONFIG_SAMSUNG_USBPHY)   += samsung-usbphy.o
 obj-$(CONFIG_SAMSUNG_USB2PHY)  += samsung-usb2phy.o
+obj-$(CONFIG_SAMSUNG_USB3PHY)  += samsung-usb3phy.o
diff --git a/drivers/usb/phy/samsung-usb3phy.c 
b/drivers/usb/phy/samsung-usb3phy.c
new file mode 100644
index 000..70e2c7b
--- /dev/null
+++ b/drivers/usb/phy/samsung-usb3phy.c
@@ -0,0 +1,349 @@
+/* linux/drivers/usb/phy/samsung-usb3phy.c
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *  http://www.samsung.com
+ *
+ * Author: Vivek Gautam 
+ *
+ * Samsung USB 3.0 PHY transceiver; talks to DWC3 controller.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "samsung-usbphy.h"
+
+/*
+ * Sets the phy clk as EXTREFCLK (XXTI) which is internal clock from clock 
core.
+ */
+static u32 samsung_usb3phy_set_refclk(struct samsung_usbphy *sphy)
+{
+   u32 reg;
+   u32 refclk;
+
+   refclk = sphy->ref_clk_freq;
+
+   reg = PHYCLKRST_REFCLKSEL_EXT_REFCLK |
+   PHYCLKRST_FSEL(refclk);
+
+   switch (refclk) {
+   case FSEL_CLKSEL_50M:
+   reg |= (PHYCLKRST_MPLL_MULTIPLIER_50M_REF |
+   PHYCLKRST_SSC_REFCLKSEL(0x00));
+   break;
+   case FSEL_CLKSEL_20M:
+   reg |= (PHYCLKRST_MPLL_MULTIPLIER_20MHZ_REF |
+   PHYCLKRST_SSC_REFCLKSEL(0x00));
+   break;
+   case FSEL_CLKSEL_19200K:
+   reg |= (PHYCLKRST_MPLL_MULTIPLIER_19200KHZ_REF |
+   PHYCLKRST_SSC_REFCLKSEL(0x88));
+   break;
+   case FSEL_CLKSEL_24M:
+   default:
+   reg |= (PHYCLKRST_MPLL_MULTIPLIER_24MHZ_REF |
+   PHYCLKRST_SSC_REFCLKSEL(0x88));
+   break;
+   }
+
+   return reg;
+}
+
+static int samsung_exynos5_usb3phy_enable(struct samsung_usbphy *sphy)
+{
+   void __iomem *regs = sphy->regs;
+   u32 phyparam0;
+   u32 phyparam1;
+   u32 linksystem;
+   u32 phybatchg;
+   u32 phytest;
+   u32 phyclkrst;
+
+   /* Reset USB 3.0 PHY */
+   writel(0x0, regs + EXYNOS5_DRD_PHYREG0);
+
+   phyparam0 = readl(regs + EXYNOS5_DRD_PHYPARAM0);
+   /* Select PHY CLK source */
+   phyparam0 &= ~PHYPARAM0_REF_USE_PAD;
+   /* Set Loss-of-Signal Detector sensitivity */
+   phyparam0 &= ~PHYPARAM0_REF_LOSLEVEL_MASK;
+   phyparam0 |= PHYPARAM0_REF_LOSLEVEL;
+   writel(phyparam0, regs + EXYNOS5_DRD_PHYPARAM0);
+
+   writel(0x0, regs + EXYNOS5_DRD_PHYRESUME);
+
+   /*
+* Setting the Frame length Adj value[6:1] to default 0x20
+* See xHCI 1.0 spec, 5.2.4
+*/
+   linksystem = LINKSYSTEM_XHCI_VERSION_CONTROL |
+   LINKSYSTEM_FLADJ(0x20);
+   writel(linksystem, regs + EXYNOS5_DRD_LINKSYSTEM);
+
+   phyparam1 = readl(regs + EXYNOS5_DRD_PHYPARAM1);
+   /* Set Tx De-Emphasis level */
+   phyparam1 &= ~PHYPARAM1_PCS_TXDEEMPH_MASK;
+   phyparam1 |= PHYPARAM1_PCS_TXDEEMPH;
+   writel(phyparam1, regs + EXYNOS5_DRD_PHYPARAM1);
+
+   phybatchg = readl(regs + EXYNOS5_DRD_PHYBATCHG);
+   ph

[PATCH v5 1/2] usb: phy: samsung: Common out the generic stuff

2013-02-05 Thread Vivek Gautam
Moving register and structure definitions to header file,
and keeping the generic functions to be used across
multiple PHYs in common phy helper driver under SAMSUNG_USBPHY,
and moving USB 2.0 PHY driver under SAMSUNG_USB2PHY.

Signed-off-by: Vivek Gautam 
---
 drivers/usb/phy/Kconfig   |   17 +-
 drivers/usb/phy/Makefile  |1 +
 drivers/usb/phy/samsung-usb2phy.c |  511 ++
 drivers/usb/phy/samsung-usbphy.c  |  717 +
 drivers/usb/phy/samsung-usbphy.h  |  247 +
 5 files changed, 780 insertions(+), 713 deletions(-)
 create mode 100644 drivers/usb/phy/samsung-usb2phy.c
 create mode 100644 drivers/usb/phy/samsung-usbphy.h

diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index 65217a5..b28878d 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -66,10 +66,17 @@ config USB_RCAR_PHY
  To compile this driver as a module, choose M here: the
  module will be called rcar-phy.
 
-config SAMSUNG_USBPHY
-   bool "Samsung USB PHY controller Driver"
-   depends on USB_S3C_HSOTG || USB_EHCI_S5P || USB_OHCI_EXYNOS
+config SAMSUNG_USB2PHY
+   bool "Samsung USB 2.0 PHY controller Driver"
+   select SAMSUNG_USBPHY
select USB_OTG_UTILS
help
- Enable this to support Samsung USB phy controller for samsung
- SoCs.
+ Enable this to support Samsung USB 2.0 (High Speed) PHY controller
+ driver for Samsung SoCs.
+
+config SAMSUNG_USBPHY
+   bool "Samsung USB PHY Driver"
+   help
+ Enable this to support Samsung USB phy helper driver for Samsung SoCs.
+ This driver provides common interface to interact, for Samsung USB 
2.0 PHY
+ driver and later for Samsung USB 3.0 PHY driver.
diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile
index b13faa1..1efa174 100644
--- a/drivers/usb/phy/Makefile
+++ b/drivers/usb/phy/Makefile
@@ -12,3 +12,4 @@ obj-$(CONFIG_MV_U3D_PHY)  += mv_u3d_phy.o
 obj-$(CONFIG_USB_EHCI_TEGRA)   += tegra_usb_phy.o
 obj-$(CONFIG_USB_RCAR_PHY) += rcar-phy.o
 obj-$(CONFIG_SAMSUNG_USBPHY)   += samsung-usbphy.o
+obj-$(CONFIG_SAMSUNG_USB2PHY)  += samsung-usb2phy.o
diff --git a/drivers/usb/phy/samsung-usb2phy.c 
b/drivers/usb/phy/samsung-usb2phy.c
new file mode 100644
index 000..55ac3a8
--- /dev/null
+++ b/drivers/usb/phy/samsung-usb2phy.c
@@ -0,0 +1,511 @@
+/* linux/drivers/usb/phy/samsung-usb2phy.c
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *  http://www.samsung.com
+ *
+ * Author: Praveen Paneri 
+ *
+ * Samsung USB2.0 PHY transceiver; talks to S3C HS OTG controller, EHCI-S5P and
+ * OHCI-EXYNOS controllers.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "samsung-usbphy.h"
+
+int samsung_usb2phy_set_host(struct usb_otg *otg, struct usb_bus *host)
+{
+   if (!otg)
+   return -ENODEV;
+
+   if (!otg->host)
+   otg->host = host;
+
+   return 0;
+}
+
+static bool exynos5_phyhost_is_on(void *regs)
+{
+   u32 reg;
+
+   reg = readl(regs + EXYNOS5_PHY_HOST_CTRL0);
+
+   return !(reg & HOST_CTRL0_SIDDQ);
+}
+
+static void samsung_exynos5_usb2phy_enable(struct samsung_usbphy *sphy)
+{
+   void __iomem *regs = sphy->regs;
+   u32 phyclk = sphy->ref_clk_freq;
+   u32 phyhost;
+   u32 phyotg;
+   u32 phyhsic;
+   u32 ehcictrl;
+   u32 ohcictrl;
+
+   /*
+* phy_usage helps in keeping usage count for phy
+* so that the first consumer enabling the phy is also
+* the last consumer to disable it.
+*/
+
+   atomic_inc(&sphy->phy_usage);
+
+   if (exynos5_phyhost_is_on(regs)) {
+   dev_info(sphy->dev, "Already power on PHY\n");
+   return;
+   }
+
+   /* Host configuration */
+   phyhost = readl(regs + EXYNOS5_PHY_HOST_CTRL0);
+
+   /* phy reference clock configuration */
+   phyhost &= ~HOST_CTRL0_FSEL_MASK;
+   phyhost |= HOST_CTRL0_FSEL(phyclk);
+
+   /* host phy reset */
+   phyhost &= ~(HOST_CTRL0_PHYSWRST |
+   HOST_CTRL0_PHYSWRSTALL |
+   HOST_CTRL0_SIDDQ |
+   /* Enable normal mode of operation */
+   HOST_CTRL0_FORCESUSPEND |
+   HOST_CTRL0_FORCESLEEP);
+
+   /* Link reset */
+   phyhost |= (HOST_CTRL0_LINKSWRST 

[PATCH v5 0/2] Adding USB 3.0 DRD-phy support for exynos5250

2013-02-05 Thread Vivek Gautam
Based on 'usb-next'

Changes from v4:
 - Modifying function names and driver names to follow a common
   naming convention.
"usb2phy" for samsung-usb2phy driver
"usb3phy" for samsung-usb3phy driver
 - Changing file names "samsung-usb2.c" to "samsung-usb2phy.c" and,
   "samsung-usb3.c" to "samsung-usb3phy.c"
 - Removing dependencies for SAMSUNG_USB2PHY and SAMSUNG_USB3PHY.
 - Arranging SAMSUNG_USB2PHY and SAMSUNG_USB3PHY to select SAMSUNG_USBPHY,
   which is the usb-phy helper driver.

Vivek Gautam (2):
  usb: phy: samsung: Common out the generic stuff
  usb: phy: samsung: Add PHY support for USB 3.0 controller

 drivers/usb/phy/Kconfig   |   25 +-
 drivers/usb/phy/Makefile  |2 +
 drivers/usb/phy/samsung-usb2phy.c |  511 ++
 drivers/usb/phy/samsung-usb3phy.c |  349 ++
 drivers/usb/phy/samsung-usbphy.c  |  717 +
 drivers/usb/phy/samsung-usbphy.h  |  328 +
 6 files changed, 1219 insertions(+), 713 deletions(-)
 create mode 100644 drivers/usb/phy/samsung-usb2phy.c
 create mode 100644 drivers/usb/phy/samsung-usb3phy.c
 create mode 100644 drivers/usb/phy/samsung-usbphy.h

-- 
1.7.6.5

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


Re: [PATCH 08/13] USB: ehci-omap: Add device tree support and binding information

2013-02-05 Thread Mark Rutland
On Mon, Feb 04, 2013 at 03:58:55PM +, Roger Quadros wrote:
> Allows the OMAP EHCI controller to be specified via device tree.
> 
> Signed-off-by: Roger Quadros 
> ---
>  .../devicetree/bindings/usb/omap-ehci.txt  |   34 ++
>  drivers/usb/host/ehci-omap.c   |   36 
> +++-
>  2 files changed, 69 insertions(+), 1 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/usb/omap-ehci.txt
> 
> diff --git a/Documentation/devicetree/bindings/usb/omap-ehci.txt 
> b/Documentation/devicetree/bindings/usb/omap-ehci.txt
> new file mode 100644
> index 000..90e6e3a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/omap-ehci.txt
> @@ -0,0 +1,34 @@
> +OMAP HS USB EHCI controller
> +
> +This device is usually the child of the omap-usb-host
> +Documentation/devicetree/bindings/mfd/omap-usb-host.txt
> +
> +Required properties:
> +
> +- compatible: should be "ti,omap-ehci"
> +- reg: should contain one register range i.e. start and length
> +- interrupt-parent: phandle to the interrupt controller
> +- interrupts: description of the interrupt line
> +
> +Optional properties:
> +
> +- phy: list of phandles to PHY nodes.
> +  This property is required if at least one of the ports are in
> +  PHY mode i.e. OMAP_EHCI_PORT_MODE_PHY

Any reason for not calling this "phys", given it's a list?

[...]

Thanks,
Mark.

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


Re: [PATCH 09/13] mfd: omap-usb-host: Add device tree support and binding information

2013-02-05 Thread Roger Quadros
On 02/05/2013 02:11 PM, kishon wrote:
> Hi,
> 
> On Tuesday 05 February 2013 04:28 PM, Roger Quadros wrote:
>> On 02/05/2013 08:16 AM, kishon wrote:
>>> On Monday 04 February 2013 09:28 PM, Roger Quadros wrote:
 Allows the OMAP HS USB host controller to be specified
 via device tree.

 CC: Samuel Ortiz 
 Signed-off-by: Roger Quadros 
 ---
.../devicetree/bindings/mfd/omap-usb-host.txt  |   68 
 
drivers/mfd/omap-usb-host.c|   83 
 ++--
2 files changed, 145 insertions(+), 6 deletions(-)
create mode 100644 
 Documentation/devicetree/bindings/mfd/omap-usb-host.txt

 diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-host.txt 
 b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
 new file mode 100644
 index 000..2196893
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
 @@ -0,0 +1,68 @@
 +OMAP HS USB Host
 +
 +Required properties:
 +
 +- compatible: should be "ti,usbhs-host"
 +- reg: should contain one register range i.e. start and length
 +- ti,hwmods: must contain "usb_host_hs"
 +
 +Optional properties:
 +
 +- nports: number of USB ports. Usually this is automatically detected
 +  from the IP's revision register but can be overridden by specifying
 +  this property.
 +
 +- portN_mode: Integer specifying the port mode for port N, where N can be
 +  from 1 to nports. The port mode must be as per enum usbhs_omap_port_mode
 +  in include/linux/platform_data/usb-omap.h
 +  If the port mode is not specified, that port is treated as unused.
 +
 +- single_ulpi_bypass: Must be present if the controller contains a single
 +  ULPI bypass control bit. e.g. OMAP3 silicon <= ES2.1
 +
 +Required properties if child node exists:
 +
 +- #address-cells: Must be 1
 +- #size-cells: Must be 1
 +- ranges: must be present
 +
 +Properties for children:
 +
 +The OMAP HS USB Host subsystem contains EHCI and OHCI controllers.
 +See Documentation/devicetree/bindings/usb/omap-ehci.txt and
 +omap3-ohci.txt
 +
 +Example for OMAP4:
 +
 +usbhshost: usbhshost@0x4a064000 {
 +compatible = "ti,usbhs-host";
 +reg = <0x4a064000 0x800>;
 +ti,hwmods = "usb_host_hs";
 +#address-cells = <1>;
 +#size-cells = <1>;
 +ranges;
 +
 +usbhsohci: ohci@0x4a064800 {
 +compatible = "ti,omap3-ohci", "usb-ohci";
 +reg = <0x4a064800 0x400>;
 +interrupt-parent = <&gic>;
 +interrupts = <0 76 0x4>;
 +};
 +
 +usbhsehci: ehci@0x4a064c00 {
 +compatible = "ti,omap-ehci", "usb-ehci";
 +reg = <0x4a064c00 0x400>;
 +interrupt-parent = <&gic>;
 +interrupts = <0 77 0x4>;
 +};
 +};
 +
 +&usbhshost {
 +port1_mode = <1>; /* OMAP_EHCI_PORT_MODE_PHY */
 +port2_mode = <2>; /* OMAP_EHCI_PORT_MODE_TLL */
 +port3_mode = <1>; /* OMAP_EHCI_PORT_MODE_PHY */
 +};
 +
 +&usbhsehci {
 +phy = <&hsusb1_phy 0 &hsusb3_phy>;
 +};
 diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
 index f8ed08e..0f67856 100644
 --- a/drivers/mfd/omap-usb-host.c
 +++ b/drivers/mfd/omap-usb-host.c
 @@ -1,8 +1,9 @@
/**
 * omap-usb-host.c - The USBHS core driver for OMAP EHCI & OHCI
 *
 - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
 + * Copyright (C) 2011-2013 Texas Instruments Incorporated - 
 http://www.ti.com
 * Author: Keshava Munegowda 
 + * Author: Roger Quadros 
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2  of
 @@ -27,6 +28,8 @@
#include 
#include 
#include 
 +#include 
 +#include 

#include "omap-usb.h"

 @@ -464,6 +467,37 @@ static void omap_usbhs_init(struct device *dev)
pm_runtime_put_sync(dev);
}

 +static int usbhs_omap_get_dt_pdata(struct device_node *node,
 +struct usbhs_omap_platform_data *pdata)
 +{
 +int ret, i;
 +
 +ret = of_property_read_u32(node, "nports", &pdata->nports);
 +if (ret)
 +pdata->nports = 0;
 +
 +/* get port modes */
 +for (i = 0; i < OMAP3_HS_USB_PORTS; i++) {
 +char prop[11];
 +
 +snprintf(prop, sizeof(prop), "port%d_mode", i + 1);
 +ret = of_property_read_u32(node, prop, &pdata->port_mode[i]);
 +if (ret)
 +pdata->port_mode[i] = OMAP_USBHS_PORT_MODE_UNUSED;
 +}
 +
 +/* get flags */
 +pdata->single_ulpi

Re: [PATCH 09/13] mfd: omap-usb-host: Add device tree support and binding information

2013-02-05 Thread kishon

Hi,

On Tuesday 05 February 2013 04:28 PM, Roger Quadros wrote:

On 02/05/2013 08:16 AM, kishon wrote:

On Monday 04 February 2013 09:28 PM, Roger Quadros wrote:

Allows the OMAP HS USB host controller to be specified
via device tree.

CC: Samuel Ortiz 
Signed-off-by: Roger Quadros 
---
   .../devicetree/bindings/mfd/omap-usb-host.txt  |   68 
   drivers/mfd/omap-usb-host.c|   83 
++--
   2 files changed, 145 insertions(+), 6 deletions(-)
   create mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-host.txt

diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-host.txt 
b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
new file mode 100644
index 000..2196893
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
@@ -0,0 +1,68 @@
+OMAP HS USB Host
+
+Required properties:
+
+- compatible: should be "ti,usbhs-host"
+- reg: should contain one register range i.e. start and length
+- ti,hwmods: must contain "usb_host_hs"
+
+Optional properties:
+
+- nports: number of USB ports. Usually this is automatically detected
+  from the IP's revision register but can be overridden by specifying
+  this property.
+
+- portN_mode: Integer specifying the port mode for port N, where N can be
+  from 1 to nports. The port mode must be as per enum usbhs_omap_port_mode
+  in include/linux/platform_data/usb-omap.h
+  If the port mode is not specified, that port is treated as unused.
+
+- single_ulpi_bypass: Must be present if the controller contains a single
+  ULPI bypass control bit. e.g. OMAP3 silicon <= ES2.1
+
+Required properties if child node exists:
+
+- #address-cells: Must be 1
+- #size-cells: Must be 1
+- ranges: must be present
+
+Properties for children:
+
+The OMAP HS USB Host subsystem contains EHCI and OHCI controllers.
+See Documentation/devicetree/bindings/usb/omap-ehci.txt and
+omap3-ohci.txt
+
+Example for OMAP4:
+
+usbhshost: usbhshost@0x4a064000 {
+compatible = "ti,usbhs-host";
+reg = <0x4a064000 0x800>;
+ti,hwmods = "usb_host_hs";
+#address-cells = <1>;
+#size-cells = <1>;
+ranges;
+
+usbhsohci: ohci@0x4a064800 {
+compatible = "ti,omap3-ohci", "usb-ohci";
+reg = <0x4a064800 0x400>;
+interrupt-parent = <&gic>;
+interrupts = <0 76 0x4>;
+};
+
+usbhsehci: ehci@0x4a064c00 {
+compatible = "ti,omap-ehci", "usb-ehci";
+reg = <0x4a064c00 0x400>;
+interrupt-parent = <&gic>;
+interrupts = <0 77 0x4>;
+};
+};
+
+&usbhshost {
+port1_mode = <1>; /* OMAP_EHCI_PORT_MODE_PHY */
+port2_mode = <2>; /* OMAP_EHCI_PORT_MODE_TLL */
+port3_mode = <1>; /* OMAP_EHCI_PORT_MODE_PHY */
+};
+
+&usbhsehci {
+phy = <&hsusb1_phy 0 &hsusb3_phy>;
+};
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index f8ed08e..0f67856 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -1,8 +1,9 @@
   /**
* omap-usb-host.c - The USBHS core driver for OMAP EHCI & OHCI
*
- * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
+ * Copyright (C) 2011-2013 Texas Instruments Incorporated - http://www.ti.com
* Author: Keshava Munegowda 
+ * Author: Roger Quadros 
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2  of
@@ -27,6 +28,8 @@
   #include 
   #include 
   #include 
+#include 
+#include 

   #include "omap-usb.h"

@@ -464,6 +467,37 @@ static void omap_usbhs_init(struct device *dev)
   pm_runtime_put_sync(dev);
   }

+static int usbhs_omap_get_dt_pdata(struct device_node *node,
+struct usbhs_omap_platform_data *pdata)
+{
+int ret, i;
+
+ret = of_property_read_u32(node, "nports", &pdata->nports);
+if (ret)
+pdata->nports = 0;
+
+/* get port modes */
+for (i = 0; i < OMAP3_HS_USB_PORTS; i++) {
+char prop[11];
+
+snprintf(prop, sizeof(prop), "port%d_mode", i + 1);
+ret = of_property_read_u32(node, prop, &pdata->port_mode[i]);
+if (ret)
+pdata->port_mode[i] = OMAP_USBHS_PORT_MODE_UNUSED;
+}
+
+/* get flags */
+pdata->single_ulpi_bypass = of_property_read_bool(node,
+"single_ulpi_bypass");
+return 0;
+}
+
+static struct of_device_id usbhs_child_match_table[] __initdata = {
+{ .compatible = "ti,omap-ehci", },
+{ .compatible = "ti,omap-ohci", },
+{ }
+};
+
   /**
* usbhs_omap_probe - initialize TI-based HCDs
*
@@ -479,6 +513,21 @@ static int usbhs_omap_probe(struct platform_device *pdev)
   inti;
   boolneed_logic_fck;

+if (dev->of_node) {
+/* For DT boot we populate platform data from OF node */
+pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+if (!pdata)
+return -ENOMEM;
+
+if (usbhs_omap_get_dt_pdata(dev->of_nod

Re: [PATCH 9/9] USB chipidea i.MX: use devm_usb_get_phy_by_phandle to get phy

2013-02-05 Thread Sascha Hauer
On Tue, Feb 05, 2013 at 03:45:12PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 04-02-2013 17:24, Sascha Hauer wrote:
> 
> >Signed-off-by: Sascha Hauer 
> >---
> >  drivers/usb/chipidea/ci13xxx_imx.c |   39 
> > +---
> >  1 file changed, 18 insertions(+), 21 deletions(-)
> 
> >diff --git a/drivers/usb/chipidea/ci13xxx_imx.c 
> >b/drivers/usb/chipidea/ci13xxx_imx.c
> >index b598bb8f..136869b 100644
> >--- a/drivers/usb/chipidea/ci13xxx_imx.c
> >+++ b/drivers/usb/chipidea/ci13xxx_imx.c
> [...]
> >@@ -147,19 +146,21 @@ static int ci13xxx_imx_probe(struct platform_device 
> >*pdev)
> > return ret;
> > }
> >
> >+phy = devm_usb_get_phy_by_phandle(&pdev->dev, "fsl,usbphy", 0);
> >+
> 
>No need for emoty line here. Keep the style as it was please.
> 
> >+if (PTR_ERR(phy) == -EPROBE_DEFER) {
> 
>Is it valid to call PTR_ERR() on non-error pointer?

Why shouldn't it?

> Isn't it
> better to do this check under *else* clause below the next *if*.

For better readability, yes.

Sascha

> 
> >+ret = -EPROBE_DEFER;
> >+goto err_clk;
> >+}
> >+
> 
>This empty line is also not needed, I think.
> 
> >+if (!IS_ERR(phy)) {
> >+ret = usb_phy_init(phy);
> >+if (ret) {
> >+dev_err(&pdev->dev, "unable to init phy: %d\n", ret);
> >+goto err_clk;
> > }
> >+
> >+data->phy = phy;
> > }
> >
> > /* we only support host now, so enable vbus here */
> 
> WBR, Sergei
> 
> 

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 9/9] USB chipidea i.MX: use devm_usb_get_phy_by_phandle to get phy

2013-02-05 Thread Sergei Shtylyov

Hello.

On 04-02-2013 17:24, Sascha Hauer wrote:


Signed-off-by: Sascha Hauer 
---
  drivers/usb/chipidea/ci13xxx_imx.c |   39 +---
  1 file changed, 18 insertions(+), 21 deletions(-)



diff --git a/drivers/usb/chipidea/ci13xxx_imx.c 
b/drivers/usb/chipidea/ci13xxx_imx.c
index b598bb8f..136869b 100644
--- a/drivers/usb/chipidea/ci13xxx_imx.c
+++ b/drivers/usb/chipidea/ci13xxx_imx.c

[...]

@@ -147,19 +146,21 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
return ret;
}

+   phy = devm_usb_get_phy_by_phandle(&pdev->dev, "fsl,usbphy", 0);
+


   No need for emoty line here. Keep the style as it was please.


+   if (PTR_ERR(phy) == -EPROBE_DEFER) {


   Is it valid to call PTR_ERR() on non-error pointer? Isn't it better to do 
this check under *else* clause below the next *if*.



+   ret = -EPROBE_DEFER;
+   goto err_clk;
+   }
+


   This empty line is also not needed, I think.


+   if (!IS_ERR(phy)) {
+   ret = usb_phy_init(phy);
+   if (ret) {
+   dev_err(&pdev->dev, "unable to init phy: %d\n", ret);
+   goto err_clk;
}
+
+   data->phy = phy;
}

/* we only support host now, so enable vbus here */


WBR, Sergei

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


Re: [PATCH 00/13] Device tree support for OMAP HS USB Host

2013-02-05 Thread Roger Quadros
On 02/05/2013 01:25 PM, Rajendra Nayak wrote:
> On Monday 04 February 2013 09:28 PM, Roger Quadros wrote:
>> This patchset adds device tree support for OMAP's High Speed USB Host
>> subsystem. Board adaptation for Panda and Beagleboard is also provided.
>>
>> Tested on Beagleboard.
>>
>> Will only work with Panda if we provide a reference to the PHY clock
> 
> But there is no reference provided even for Beagle. Does it work because
> the default clk speed is 192Mhz?

On beagle board the PHY is connected differently, i.e. as the clock receptor.
The PHY clock comes directly from the USB_CLK pin.

On Panda the PHY is the clock provider to the USB_CLK pin. For that it needs
a reference clock at the REFCLK pin which comes from FREF_CLK3.

> 
>> generator in the device tree in PATCH 11. I do not know how to do that
>> as there is no way to provide a phandle to any of the OMAP generated clocks
>> in the device tree. Suggestions welcome:).
> 

cheers,
-roger
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver

2013-02-05 Thread Roger Quadros
Hi Tony & Greg,

What's the best way to get these patches in?

All patches have been acked by respective maintainers.

If Tony can Ack the arch/arm/mach-omap2 stuff then should I send a
pull request directly to Greg? or the other way round?

Tony, 
fyi, these patches should not interfere with the dw3c/musb stuff
sent by Felipe & Kishon.

cheers,
-roger

On 01/28/2013 01:30 PM, Roger Quadros wrote:
> Hi,
> 
> The OMAP's High Speed Host controller can interface to ULPI/UTMI
> PHYs transparently i.e. whithout requiring the device drivers to
> access the PHY. However, the OS must ensure that the PHY has the necessary
> resources (power/clock/reset) enabled before it is used.
> 
> Till now, the omap-ehci driver was managing the power and reset of the PHY
> whereas, clock enabling was left to the bootloader or board files.
> 
> In this patchset we make the NOP PHY driver (nop-usb-xceiv.c) handle
> all the PHY resources that are available so that it can be used by
> platforms like OMAP.
> 
> The board files add the PHY as a platform device and use usb_bind_phy()
> (API introduced in [2]) to bind the PHY device to the controller's port.
> The ehci-omap driver then uses usb_get_phy_dev() to get the PHY device
> associated to the controller's port.
> 
> All this results in a much cleaner code and makes USB PHY resource management
> work properly on OMAP.
> 
> NOTE: Tested on 4460ES-B1 Panda and BeagleBoard C4 only. Other boards are only
> build tested.
> 
> Patches are based on Linux-3.8-rc5 and depend on
> 
> [1] [PATCH v9 00/20] OMAP USB Host cleanup
> https://lkml.org/lkml/2013/1/23/155
> 
> [2] [PATCH v2 0/6] USB: Add support for multiple PHYs of same type
> https://lkml.org/lkml/2013/1/24/876
> 
> v2:
> - Added Alan's patch to split ehci-omap into separate driver
> - Addressed Russell King's comments on usage of clk/regulator framework.
> - Adapted all board using ehci-omap to using the PHY mechanism.
> 
> The following changes since commit e18d48b7f7e563664a41d4658b8cc15679ee4745:
> 
>   usb: otg: utils: add facilities in phy lib to support multiple PHYs of same 
> type (2013-01-28 12:20:54 +0200)
> 
>   git://github.com/rogerq/linux.git linux-usbhost15
> 
> ---
> Alan Stern (1):
>   USB: EHCI: split ehci-omap out to a separate driver
> 
> Roger Quadros (29):
>   usb: phy: nop: use devm_kzalloc()
>   usb: phy: nop: Manage PHY clock
>   usb: phy: nop: Handle power supply regulator for the PHY
>   usb: phy: nop: Handle RESET for the PHY
>   usb: phy: nop: use new PHY API to register PHY
>   mfd: omap-usb-host: update nports in platform_data
>   mfd: omap-usb-host: Remove PHY reset handling code
>   USB: ehci-omap: Use devm_request_and_ioremap()
>   USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of
> suspend
>   usb: ehci-omap: Remove PHY reset handling code
>   usb: ehci-omap: Remove PHY regulator handling code
>   ARM: OMAP2+: omap4panda: Provide USB Host's PHY platform data
>   ARM: OMAP2+: omap4panda: Adapt to ehci-omap changes
>   ARM: OMAP3: Beagle: Adapt to ehci-omap changes
>   ARM: OMAP3: 3430SDP: Adapt to ehci-omap changes
>   ARM: OMAP3: 3630SDP: Adapt to ehci-omap changes
>   ARM: OMAP: AM3517crane: Adapt to ehci-omap changes
>   ARM: OMAP: AM3517evm: Adapt to ehci-omap changes
>   ARM: OMAP3: cm-t35: Adapt to ehci-omap changes
>   ARM: OMAP3: cm-t3517: Adapt to ehci-omap changes
>   ARM: OMAP: devkit8000: Adapt to ehci-omap changes
>   ARM: OMAP3: igep0020: Adapt to ehci-omap changes
>   ARM: OMAP3: omap3evm: Adapt to ehci-omap changes
>   ARM: OMAP3: omap3pandora: Adapt to ehci-omap changes
>   ARM: OMAP3: omap3stalker: Adapt to ehci-omap changes
>   ARM: OMAP3: omap3touchbook: Adapt to ehci-omap changes
>   ARM: OMAP3: overo: Adapt to ehci-omap changes
>   ARM: OMAP: zoom: Adapt to ehci-omap changes
>   ARM: OMAP: USB: Remove unused fields from struct
> usbhs_omap_platform_data
> 
>  arch/arm/mach-omap2/board-3430sdp.c|   99 +++-
>  arch/arm/mach-omap2/board-3630sdp.c|  100 +++-
>  arch/arm/mach-omap2/board-am3517crane.c|   95 ++--
>  arch/arm/mach-omap2/board-am3517evm.c  |   66 +++-
>  arch/arm/mach-omap2/board-cm-t35.c |   95 ++-
>  arch/arm/mach-omap2/board-cm-t3517.c   |   97 +++-
>  arch/arm/mach-omap2/board-devkit8000.c |   20 ++-
>  arch/arm/mach-omap2/board-igep0020.c   |  112 +++--
>  arch/arm/mach-omap2/board-omap3beagle.c|   93 ++-
>  arch/arm/mach-omap2/board-omap3evm.c   |   63 ++--
>  arch/arm/mach-omap2/board-omap3pandora.c   |   54 +-
>  arch/arm/mach-omap2/board-omap3stalker.c   |   52 +-
>  arch/arm/mach-omap2/board-omap3touchbook.c |   62 ++-
>  arch/arm/mach-omap2/board-omap4panda.c |  123 ++
>  arch/arm/mach-omap2/board-overo.c  |   55 ++-
>  arch/arm/mach-omap2/board-zoom.c   |   56 ++-
>  drivers/mfd/omap-usb-host.c|   48 +--
>  drivers/usb/host/Kconfig   

Re: [PATCH 00/13] Device tree support for OMAP HS USB Host

2013-02-05 Thread Rajendra Nayak

On Monday 04 February 2013 09:28 PM, Roger Quadros wrote:

This patchset adds device tree support for OMAP's High Speed USB Host
subsystem. Board adaptation for Panda and Beagleboard is also provided.

Tested on Beagleboard.

Will only work with Panda if we provide a reference to the PHY clock


But there is no reference provided even for Beagle. Does it work because
the default clk speed is 192Mhz?


generator in the device tree in PATCH 11. I do not know how to do that
as there is no way to provide a phandle to any of the OMAP generated clocks
in the device tree. Suggestions welcome:).


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


Re: [PATCH v8 19/22] ARM: OMAP3: clock data: get rid of unused USB host clock aliases and dummies

2013-02-05 Thread Roger Quadros
Hi Paul,

On 01/21/2013 05:03 PM, Paul Walmsley wrote:
> Hi
> 
> On Mon, 21 Jan 2013, Roger Quadros wrote:
> 
>> On 01/18/2013 10:27 PM, Paul Walmsley wrote:
>>> On Fri, 18 Jan 2013, Roger Quadros wrote:
>>>
 We don't need multiple aliases for the OMAP USB host clocks and neither
 the dummy clocks so remove them.

 CC: Paul Walmsley 
 CC: Rajendra Nayak 
 CC: Benoit Cousson 
 CC: Mike Turquette 

 Signed-off-by: Roger Quadros 
 Reviewed-by: Felipe Balbi 
 Acked-by: Paul Walmsley 
>>>
>>> Per Tony's earlier request, you can drop this patch and patch 20 from your 
>>> series now.  I've got them queued for 3.10 or late 3.9 merge window.
>>>
>>
>> Should have mentioned it earlier, but just this patch without the rest
>> of the cleanup patches will break USB Host on OMAP3, as the old driver
>> bails out if optional clock nodes are missing.
>>
>> Including patch 20 doesn't seem to cause a problem with OMAP4 though.
> 
> I've got these two patches queued for merging after your other patches go 
> upstream -- e.g., probably 3.10.  Do you foresee any problems with that?
> 

FYI, the usbhost patches are already in linux-next.

cheers,
-roger

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


Re: how to specify an OMAP clock in device tree?

2013-02-05 Thread Rajendra Nayak

On Tuesday 05 February 2013 03:04 PM, Roger Quadros wrote:

Hi Rajendra,

On 02/04/2013 05:58 PM, Roger Quadros wrote:

Provide the RESET and Power regulators for the USB PHY,
the USB Host port mode and the PHY device.

Also provide pin multiplexer information for the USB host
pins.

Signed-off-by: Roger Quadros 
---
  arch/arm/boot/dts/omap4-panda.dts |   55 +
  1 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap4-panda.dts 
b/arch/arm/boot/dts/omap4-panda.dts
index 4122efe..fe2d3d4 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -57,6 +57,35 @@
"AFML", "Line In",
"AFMR", "Line In";
};
+
+   /* HS USB Port 1 RESET */
+   hsusb1_reset: hsusb1_reset_reg {
+   compatible = "regulator-fixed";
+   regulator-name = "hsusb1_reset";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   gpio = <&gpio2 30 0>; /* gpio_62 */
+   startup-delay-us = <7>;
+   enable-active-high;
+   };
+
+   /* HS USB Port 1 Power */
+   hsusb1_power: hsusb1_power_reg {
+   compatible = "regulator-fixed";
+   regulator-name = "hsusb1_vbus";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   gpio = <&gpio1 1 0>;  /* gpio_1 */
+   startup-delay-us = <7>;
+   enable-active-high;
+   };
+
+   /* HS USB Host PHY on PORT 1 */
+   hsusb1_phy: hsusb1_phy {
+   compatible = "usb-nop-xceiv";
+   reset-supply = <&hsusb1_reset>;
+   vcc-supply = <&hsusb1_power>;
+   };


This is the patch I was discussing with you about before.

Let me explain the problem again.

The Pandaboard has a USB PHY whose reference clock is provided by
FREF_CLK3 pin which is a clock generated by the OMAP.
The PHY driver expects a reference to this clock in the PHY device node.


Well, the driver just does a clk_get(dev, "main_clk"); and clk_get() is
then able to either pick the reference from the PHY dt node or from a
clkdev entry.

The problem here seems to be that you are not able to add a clkdev entry
because the device name wouldn't be fixed, since you have a node in
the form of 'node: node {'. All other onchip OMAP devices don't have
this issue because they have an entry in the form of 'node: node@addr'
and hence have a fixed device name and hence can add a clkdev entry for
the clocks they want to control.

I don't know if there is any good way to define the DT node for the
on board PHY in such a way that the device name is always fixed, in
which case you can then add a clkdev entry for 'dev, main_clk' mapping
to the onchip clock that provides the clock, but if there is one, then
that should fix your problem.


See the above node hsusb1_phy. we would need something like
hsusb1_phy {
...
clocks = <&fref_clk3>;
clock-names = "main_clk";
...
};

Currently on OMAP, there is no way to provide a phandle to this clock.

Is it practical to provide device tree based implementation of at least
the externally accessible OMAP clocks?

cheers,
-roger


  };

  &omap4_pmx_core {
@@ -67,6 +96,7 @@
&mcbsp1_pins
&dss_hdmi_pins
&tpd12s015_pins
+   &hsusbb1_pins
>;

twl6040_pins: pinmux_twl6040_pins {
@@ -110,6 +140,23 @@
0x58 0x10b  /* hdmi_hpd.gpio_63 INPUT PULLDOWN | 
MODE3 */
>;
};





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


Re: [PATCH 09/13] mfd: omap-usb-host: Add device tree support and binding information

2013-02-05 Thread Roger Quadros
On 02/05/2013 08:16 AM, kishon wrote:
> On Monday 04 February 2013 09:28 PM, Roger Quadros wrote:
>> Allows the OMAP HS USB host controller to be specified
>> via device tree.
>>
>> CC: Samuel Ortiz 
>> Signed-off-by: Roger Quadros 
>> ---
>>   .../devicetree/bindings/mfd/omap-usb-host.txt  |   68 
>>   drivers/mfd/omap-usb-host.c|   83 
>> ++--
>>   2 files changed, 145 insertions(+), 6 deletions(-)
>>   create mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-host.txt
>>
>> diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-host.txt 
>> b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
>> new file mode 100644
>> index 000..2196893
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
>> @@ -0,0 +1,68 @@
>> +OMAP HS USB Host
>> +
>> +Required properties:
>> +
>> +- compatible: should be "ti,usbhs-host"
>> +- reg: should contain one register range i.e. start and length
>> +- ti,hwmods: must contain "usb_host_hs"
>> +
>> +Optional properties:
>> +
>> +- nports: number of USB ports. Usually this is automatically detected
>> +  from the IP's revision register but can be overridden by specifying
>> +  this property.
>> +
>> +- portN_mode: Integer specifying the port mode for port N, where N can be
>> +  from 1 to nports. The port mode must be as per enum usbhs_omap_port_mode
>> +  in include/linux/platform_data/usb-omap.h
>> +  If the port mode is not specified, that port is treated as unused.
>> +
>> +- single_ulpi_bypass: Must be present if the controller contains a single
>> +  ULPI bypass control bit. e.g. OMAP3 silicon <= ES2.1
>> +
>> +Required properties if child node exists:
>> +
>> +- #address-cells: Must be 1
>> +- #size-cells: Must be 1
>> +- ranges: must be present
>> +
>> +Properties for children:
>> +
>> +The OMAP HS USB Host subsystem contains EHCI and OHCI controllers.
>> +See Documentation/devicetree/bindings/usb/omap-ehci.txt and
>> +omap3-ohci.txt
>> +
>> +Example for OMAP4:
>> +
>> +usbhshost: usbhshost@0x4a064000 {
>> +compatible = "ti,usbhs-host";
>> +reg = <0x4a064000 0x800>;
>> +ti,hwmods = "usb_host_hs";
>> +#address-cells = <1>;
>> +#size-cells = <1>;
>> +ranges;
>> +
>> +usbhsohci: ohci@0x4a064800 {
>> +compatible = "ti,omap3-ohci", "usb-ohci";
>> +reg = <0x4a064800 0x400>;
>> +interrupt-parent = <&gic>;
>> +interrupts = <0 76 0x4>;
>> +};
>> +
>> +usbhsehci: ehci@0x4a064c00 {
>> +compatible = "ti,omap-ehci", "usb-ehci";
>> +reg = <0x4a064c00 0x400>;
>> +interrupt-parent = <&gic>;
>> +interrupts = <0 77 0x4>;
>> +};
>> +};
>> +
>> +&usbhshost {
>> +port1_mode = <1>; /* OMAP_EHCI_PORT_MODE_PHY */
>> +port2_mode = <2>; /* OMAP_EHCI_PORT_MODE_TLL */
>> +port3_mode = <1>; /* OMAP_EHCI_PORT_MODE_PHY */
>> +};
>> +
>> +&usbhsehci {
>> +phy = <&hsusb1_phy 0 &hsusb3_phy>;
>> +};
>> diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
>> index f8ed08e..0f67856 100644
>> --- a/drivers/mfd/omap-usb-host.c
>> +++ b/drivers/mfd/omap-usb-host.c
>> @@ -1,8 +1,9 @@
>>   /**
>>* omap-usb-host.c - The USBHS core driver for OMAP EHCI & OHCI
>>*
>> - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
>> + * Copyright (C) 2011-2013 Texas Instruments Incorporated - 
>> http://www.ti.com
>>* Author: Keshava Munegowda 
>> + * Author: Roger Quadros 
>>*
>>* This program is free software: you can redistribute it and/or modify
>>* it under the terms of the GNU General Public License version 2  of
>> @@ -27,6 +28,8 @@
>>   #include 
>>   #include 
>>   #include 
>> +#include 
>> +#include 
>>
>>   #include "omap-usb.h"
>>
>> @@ -464,6 +467,37 @@ static void omap_usbhs_init(struct device *dev)
>>   pm_runtime_put_sync(dev);
>>   }
>>
>> +static int usbhs_omap_get_dt_pdata(struct device_node *node,
>> +struct usbhs_omap_platform_data *pdata)
>> +{
>> +int ret, i;
>> +
>> +ret = of_property_read_u32(node, "nports", &pdata->nports);
>> +if (ret)
>> +pdata->nports = 0;
>> +
>> +/* get port modes */
>> +for (i = 0; i < OMAP3_HS_USB_PORTS; i++) {
>> +char prop[11];
>> +
>> +snprintf(prop, sizeof(prop), "port%d_mode", i + 1);
>> +ret = of_property_read_u32(node, prop, &pdata->port_mode[i]);
>> +if (ret)
>> +pdata->port_mode[i] = OMAP_USBHS_PORT_MODE_UNUSED;
>> +}
>> +
>> +/* get flags */
>> +pdata->single_ulpi_bypass = of_property_read_bool(node,
>> +"single_ulpi_bypass");
>> +return 0;
>> +}
>> +
>> +static struct of_device_id usbhs_child_match_table[] __initdata = {
>> +{ .compatible = "ti,omap-ehci", },
>> +{ .compatible = "ti,omap-ohci", },
>> +{ }
>> +};
>> +
>>   /**
>>* usbhs_omap_probe - initialize TI-based HCDs
>>*
>> @@ -479,6 +513,21 @@ static int usbhs_omap_p

Re: [PATCH 02/13] USB: phy: nop: Defer probe if device needs VCC/RESET

2013-02-05 Thread Roger Quadros
On 02/05/2013 11:09 AM, Felipe Balbi wrote:
> On Tue, Feb 05, 2013 at 10:44:05AM +0200, Roger Quadros wrote:
 diff --git a/include/linux/usb/nop-usb-xceiv.h 
 b/include/linux/usb/nop-usb-xceiv.h
 index 3265b61..148d351 100644
 --- a/include/linux/usb/nop-usb-xceiv.h
 +++ b/include/linux/usb/nop-usb-xceiv.h
 @@ -6,6 +6,10 @@
   struct nop_usb_xceiv_platform_data {
   enum usb_phy_type type;
   unsigned long clk_rate;
 +
 +/* if set fails with -EPROBE_DEFER if can't get regulator */
 +unsigned int needs_vcc:1;
 +unsigned int needs_reset:1;
>>>
>>> how about u8 here?
>>
>> Not sure. Bitfields are usually defined as unsigned int.
> 
> IIRC the benefit is that compiler can try to optimize those flags. I
> mean, if you have 32 1-bit flags, compiler will combine those in a
> single u32. Someone correct me if I'm wrong.
> 

Yes you are right. Kishon was asking me to use u8 instead of unsigned int, which
I don't think is necessary. AFAIK, it is a norm to use unsigned int when 
defining
a bitfield. Compilers are known to behave funny with bitfields. I don't mind
using bool for each.

cheers,
-roger
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 28/30] ARM: OMAP3: overo: Adapt to ehci-omap changes

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 01:30:29PM +0200, Roger Quadros wrote:
> Add platform device for 'nop-usb-xceiv'. This will be used as a
> PHY for HS USB Port 2, so provide binding information for it.
> 
> Model RESET for HS USB Port 2 as GPIO fixed regulator and link
> it to the 'nop-usb-xceiv' PHY.
> 
> Signed-off-by: Roger Quadros 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 31/31] USB: ehci-omap: Select NOP USB transceiver driver

2013-02-05 Thread Felipe Balbi
On Mon, Feb 04, 2013 at 04:03:10PM -0500, Alan Stern wrote:
> On Mon, 4 Feb 2013, Roger Quadros wrote:
> 
> > In PHY mode we need to have the nop-usb-xceiv transceiver
> > driver to operate, so select it in Kconfig.
> > 
> > CC: Alan Stern 
> > Signed-off-by: Roger Quadros 
> > ---
> >  drivers/usb/host/Kconfig |1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> > index 11e102e..2d2975d 100644
> > --- a/drivers/usb/host/Kconfig
> > +++ b/drivers/usb/host/Kconfig
> > @@ -157,6 +157,7 @@ config USB_EHCI_MXC
> >  config USB_EHCI_HCD_OMAP
> > tristate "EHCI support for OMAP3 and later chips"
> > depends on USB_EHCI_HCD && ARCH_OMAP
> > +   select NOP_USB_XCEIV
> > default y
> > ---help---
> >   Enables support for the on-chip EHCI controller on
> 
> Acked-by: Alan Stern 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 30/30] ARM: OMAP: USB: Remove unused fields from struct usbhs_omap_platform_data

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 01:30:31PM +0200, Roger Quadros wrote:
> All users have been adapted to the changes in ehci-omap. We can now
> get rid of the unused fields from usbhs_omap_platform_data.
> 
> Signed-off-by: Roger Quadros 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 29/30] ARM: OMAP: zoom: Adapt to ehci-omap changes

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 01:30:30PM +0200, Roger Quadros wrote:
> Add platform device for 'nop-usb-xceiv'. This will be used as a
> PHY for HS USB Port 2, so provide binding information for it.
> 
> Model RESET for HS USB Port 2 as GPIO fixed regulator and link
> it to the 'nop-usb-xceiv' PHY.
> 
> Signed-off-by: Roger Quadros 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 18/30] ARM: OMAP: AM3517crane: Adapt to ehci-omap changes

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 01:30:19PM +0200, Roger Quadros wrote:
> Add platform device for 'nop-usb-xceiv'. This will be used as a
> PHY for HS USB Port 1, so provide binding information for it.
> 
> Model RESET and Power for HS USB Port 1 as GPIO fixed regulators
> and link them to the 'nop-usb-xceiv' PHY.
> 
> Signed-off-by: Roger Quadros 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 16/30] ARM: OMAP3: 3430SDP: Adapt to ehci-omap changes

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 01:30:17PM +0200, Roger Quadros wrote:
> Add 2 platform devices for 'nop-usb-xceiv'. These will be used
> as PHYs for HS USB ports 1 and 2 so provide binding information
> for them.
> 
> Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and
> link them to the 2 PHYs we just created.
> 
> Signed-off-by: Roger Quadros 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 27/30] ARM: OMAP3: omap3touchbook: Adapt to ehci-omap changes

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 01:30:28PM +0200, Roger Quadros wrote:
> Add 2 platform devices for 'nop-usb-xceiv'. These will be used as a
> PHY for HS USB Ports 1 and 2, so provide binding information for them.
> 
> Model RESET for HS USB Port 2 as GPIO fixed regulator and link it
> to the respective 'nop-usb-xceiv' PHY.
> 
> Signed-off-by: Roger Quadros 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


how to specify an OMAP clock in device tree?

2013-02-05 Thread Roger Quadros
Hi Rajendra,

On 02/04/2013 05:58 PM, Roger Quadros wrote:
> Provide the RESET and Power regulators for the USB PHY,
> the USB Host port mode and the PHY device.
> 
> Also provide pin multiplexer information for the USB host
> pins.
> 
> Signed-off-by: Roger Quadros 
> ---
>  arch/arm/boot/dts/omap4-panda.dts |   55 
> +
>  1 files changed, 55 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/omap4-panda.dts 
> b/arch/arm/boot/dts/omap4-panda.dts
> index 4122efe..fe2d3d4 100644
> --- a/arch/arm/boot/dts/omap4-panda.dts
> +++ b/arch/arm/boot/dts/omap4-panda.dts
> @@ -57,6 +57,35 @@
>   "AFML", "Line In",
>   "AFMR", "Line In";
>   };
> +
> + /* HS USB Port 1 RESET */
> + hsusb1_reset: hsusb1_reset_reg {
> + compatible = "regulator-fixed";
> + regulator-name = "hsusb1_reset";
> + regulator-min-microvolt = <330>;
> + regulator-max-microvolt = <330>;
> + gpio = <&gpio2 30 0>;   /* gpio_62 */
> + startup-delay-us = <7>;
> + enable-active-high;
> + };
> +
> + /* HS USB Port 1 Power */
> + hsusb1_power: hsusb1_power_reg {
> + compatible = "regulator-fixed";
> + regulator-name = "hsusb1_vbus";
> + regulator-min-microvolt = <330>;
> + regulator-max-microvolt = <330>;
> + gpio = <&gpio1 1 0>;/* gpio_1 */
> + startup-delay-us = <7>;
> + enable-active-high;
> + };
> +
> + /* HS USB Host PHY on PORT 1 */
> + hsusb1_phy: hsusb1_phy {
> + compatible = "usb-nop-xceiv";
> + reset-supply = <&hsusb1_reset>;
> + vcc-supply = <&hsusb1_power>;
> + };

This is the patch I was discussing with you about before.

Let me explain the problem again.

The Pandaboard has a USB PHY whose reference clock is provided by
FREF_CLK3 pin which is a clock generated by the OMAP.
The PHY driver expects a reference to this clock in the PHY device node.
See the above node hsusb1_phy. we would need something like
hsusb1_phy {
...
clocks = <&fref_clk3>;
clock-names = "main_clk";
...
};

Currently on OMAP, there is no way to provide a phandle to this clock.

Is it practical to provide device tree based implementation of at least
the externally accessible OMAP clocks?

cheers,
-roger

>  };
>  
>  &omap4_pmx_core {
> @@ -67,6 +96,7 @@
>   &mcbsp1_pins
>   &dss_hdmi_pins
>   &tpd12s015_pins
> + &hsusbb1_pins
>   >;
>  
>   twl6040_pins: pinmux_twl6040_pins {
> @@ -110,6 +140,23 @@
>   0x58 0x10b  /* hdmi_hpd.gpio_63 INPUT PULLDOWN | 
> MODE3 */
>   >;
>   };


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


Re: [PATCH 26/30] ARM: OMAP3: omap3stalker: Adapt to ehci-omap changes

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 01:30:27PM +0200, Roger Quadros wrote:
> Add platform device for 'nop-usb-xceiv'. This will be used as a
> PHY for HS USB Port 2, so provide binding information for it.
> 
> Model RESET for HS USB Port 2 as GPIO fixed regulator and link
> it to the 'nop-usb-xceiv' PHY.
> 
> Signed-off-by: Roger Quadros 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 25/30] ARM: OMAP3: omap3pandora: Adapt to ehci-omap changes

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 01:30:26PM +0200, Roger Quadros wrote:
> Add platform device for 'nop-usb-xceiv'. This will be used as a
> PHY for HS USB Port 2, so provide binding information for it.
> 
> Model RESET for HS USB Port 2 as GPIO fixed regulator and link
> it to the 'nop-usb-xceiv' PHY.
> 
> Signed-off-by: Roger Quadros 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 24/30] ARM: OMAP3: omap3evm: Adapt to ehci-omap changes

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 01:30:25PM +0200, Roger Quadros wrote:
> Add platform device for 'nop-usb-xceiv'. This will be used as a
> PHY for HS USB Port 2, so provide binding information for it.
> 
> Model RESET for HS USB Port 2 as GPIO fixed regulator and link
> it to the 'nop-usb-xceiv' PHY.
> 
> Signed-off-by: Roger Quadros 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 23/30] ARM: OMAP3: igep0020: Adapt to ehci-omap changes

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 01:30:24PM +0200, Roger Quadros wrote:
> Add 2 platform devices for 'nop-usb-xceiv'. These will be used
> as PHYs for HS USB ports 1 and 2 so provide binding information
> for them.
> 
> Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and
> link them to the 2 PHYs we just created.
> 
> Signed-off-by: Roger Quadros 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 22/30] ARM: OMAP: devkit8000: Adapt to ehci-omap changes

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 01:30:23PM +0200, Roger Quadros wrote:
> Add platform device for 'nop-usb-xceiv'. This will be used as a
> PHY for HS USB Port 1, so provide binding information for it.
> 
> Signed-off-by: Roger Quadros 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 20/30] ARM: OMAP3: cm-t35: Adapt to ehci-omap changes

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 01:30:21PM +0200, Roger Quadros wrote:
> Add 2 platform devices for 'nop-usb-xceiv'. These will be used
> as PHYs for HS USB ports 1 and 2 so provide binding information
> for them.
> 
> Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and
> link them to the 2 PHYs we just created.
> 
> Signed-off-by: Roger Quadros 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 21/30] ARM: OMAP3: cm-t3517: Adapt to ehci-omap changes

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 01:30:22PM +0200, Roger Quadros wrote:
> Add 2 platform devices for 'nop-usb-xceiv'. These will be used
> as PHYs for HS USB ports 1 and 2 so provide binding information
> for them.
> 
> Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and
> link them to the 2 PHYs we just created.
> 
> Signed-off-by: Roger Quadros 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 19/30] ARM: OMAP: AM3517evm: Adapt to ehci-omap changes

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 01:30:20PM +0200, Roger Quadros wrote:
> Add 2 platform devices for 'nop-usb-xceiv'. These will be used as a
> PHY for HS USB Port 1 and 2, so provide binding information for them.
> 
> Model RESET for HS USB Port 1 as GPIO fixed regulator and link it
> to the 'nop-usb-xceiv' PHY on port 1.
> 
> Signed-off-by: Roger Quadros 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 15/30] ARM: OMAP3: Beagle: Adapt to ehci-omap changes

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 01:30:16PM +0200, Roger Quadros wrote:
> Add platform device for 'nop-usb-xceiv'. This will be used as a
> PHY for HS USB Port 2, so provide binding information for it.
> 
> Model RESET and Power for HS USB Port 2 as GPIO fixed regulators
> and link them to the 'nop-usb-xceiv' PHY.
> 
> Signed-off-by: Roger Quadros 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 17/30] ARM: OMAP3: 3630SDP: Adapt to ehci-omap changes

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 01:30:18PM +0200, Roger Quadros wrote:
> Add 2 platform devices for 'nop-usb-xceiv'. These will be used
> as PHYs for HS USB ports 1 and 2 so provide binding information
> for them.
> 
> Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and
> link them to the 2 PHYs we just created.
> 
> Signed-off-by: Roger Quadros 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH v2 14/30] ARM: OMAP2+: omap4panda: Adapt to ehci-omap changes

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 01:30:15PM +0200, Roger Quadros wrote:
> Model RESET and Power for HS USB Port 1 as GPIO fixed regulators
> and link them to the 'nop-usb-xceiv' PHY by making them as "reset"
> and "vcc" supplies.
> 
> The RESET and Power will then be managed by the PHY driver.
> 
> Signed-off-by: Roger Quadros 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH v2 13/30] ARM: OMAP2+: omap4panda: Provide USB Host's PHY platform data

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 01:30:14PM +0200, Roger Quadros wrote:
> Add platform device and data for 'nop-usb-xceiv'. This will be used
> as PHY for HS USB port 1, so provide binding information for it.
> 
> Get rid of managing the PHY clock as it will be done by the PHY driver.
> For that to work we create a clock alias that links the PHY clock name
> to the PHY device name.
> 
> Signed-off-by: Roger Quadros 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH v2 12/30] usb: ehci-omap: Remove PHY regulator handling code

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 12:35:25PM -0500, Alan Stern wrote:
> On Mon, 28 Jan 2013, Roger Quadros wrote:
> 
> > PHY regulator handling must be done in the PHY driver
> > 
> > Signed-off-by: Roger Quadros 
> 
> Acked-by: Alan Stern 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH v2 11/30] usb: ehci-omap: Remove PHY reset handling code

2013-02-05 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 12:34:16PM -0500, Alan Stern wrote:
> On Mon, 28 Jan 2013, Roger Quadros wrote:
> 
> > Reset GPIO handling for the PHY must be done in the PHY
> > driver. We use the PHY helpers instead to reset the PHY.
> > 
> > Signed-off-by: Roger Quadros 
> 
> Acked-by: Alan Stern 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: Digital signature


  1   2   >